# Print output for @column tags ?> Touch - Android SDK | Android Developers

Most visited


Recently visited


Touch

public class Touch
extends Object

java.lang.Object
   ↳ android.text.method.Touch


Summary


Public methods

static int getInitialScrollX(TextView widget, Spannable buffer)
static int getInitialScrollY(TextView widget, Spannable buffer)
static boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event)

Handles touch events for dragging.

static void scrollTo(TextView widget, Layout layout, int x, int y)

Scrolls the specified widget to the specified coordinates, except constrains the X scrolling position to the horizontal regions of the text that will be visible after scrolling to the specified Y position.

Inherited methods

Public methods


getInitialScrollX

public static int getInitialScrollX (TextView widget, 
                Spannable buffer)

Parameters
widget TextView: The text view.

buffer Spannable: The text buffer.

Returns
int

getInitialScrollY

public static int getInitialScrollY (TextView widget, 
                Spannable buffer)

Parameters
widget TextView: The text view.

buffer Spannable: The text buffer.

Returns
int

onTouchEvent

public static boolean onTouchEvent (TextView widget, 
                Spannable buffer, 
                MotionEvent event)

Handles touch events for dragging. You may want to do other actions like moving the cursor on touch as well.

Parameters
widget TextView

buffer Spannable

event MotionEvent

Returns
boolean

scrollTo

public static void scrollTo (TextView widget, 
                Layout layout, 
                int x, 
                int y)

Scrolls the specified widget to the specified coordinates, except constrains the X scrolling position to the horizontal regions of the text that will be visible after scrolling to the specified Y position.

Parameters
widget TextView

layout Layout

x int

y int

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.