ui_touch: optimize code.

Change-Id: I3091a8ae38cbbd309468cea8eb53c6658407ce69