FileDocCategorySizeDatePackage
ScrollingMovementMethod.javaAPI DocAndroid 5.1 API3623Thu Mar 12 22:22:10 GMT 2015android.text.method

ScrollingMovementMethod

public class ScrollingMovementMethod extends BaseMovementMethod implements MovementMethod
A movement method that interprets movement keys by scrolling the text buffer.

Fields Summary
private static ScrollingMovementMethod
sInstance
Constructors Summary
Methods Summary
protected booleanbottom(android.widget.TextView widget, Spannable buffer)

        return scrollBottom(widget, buffer);
    
protected booleandown(android.widget.TextView widget, Spannable buffer)

        return scrollDown(widget, buffer, 1);
    
protected booleanend(android.widget.TextView widget, Spannable buffer)

        return bottom(widget, buffer);
    
public static MovementMethodgetInstance()

        if (sInstance == null)
            sInstance = new ScrollingMovementMethod();

        return sInstance;
    
protected booleanhome(android.widget.TextView widget, Spannable buffer)

        return top(widget, buffer);
    
protected booleanleft(android.widget.TextView widget, Spannable buffer)

        return scrollLeft(widget, buffer, 1);
    
protected booleanlineEnd(android.widget.TextView widget, Spannable buffer)

        return scrollLineEnd(widget, buffer);
    
protected booleanlineStart(android.widget.TextView widget, Spannable buffer)

        return scrollLineStart(widget, buffer);
    
public voidonTakeFocus(android.widget.TextView widget, Spannable text, int dir)

        Layout layout = widget.getLayout();

        if (layout != null && (dir & View.FOCUS_FORWARD) != 0) {
            widget.scrollTo(widget.getScrollX(),
                            layout.getLineTop(0));
        }
        if (layout != null && (dir & View.FOCUS_BACKWARD) != 0) {
            int padding = widget.getTotalPaddingTop() +
                          widget.getTotalPaddingBottom();
            int line = layout.getLineCount() - 1;

            widget.scrollTo(widget.getScrollX(),
                            layout.getLineTop(line+1) -
                            (widget.getHeight() - padding));
        }
    
public booleanonTouchEvent(android.widget.TextView widget, Spannable buffer, android.view.MotionEvent event)

        return Touch.onTouchEvent(widget, buffer, event);
    
protected booleanpageDown(android.widget.TextView widget, Spannable buffer)

        return scrollPageDown(widget, buffer);
    
protected booleanpageUp(android.widget.TextView widget, Spannable buffer)

        return scrollPageUp(widget, buffer);
    
protected booleanright(android.widget.TextView widget, Spannable buffer)

        return scrollRight(widget, buffer, 1);
    
protected booleantop(android.widget.TextView widget, Spannable buffer)

        return scrollTop(widget, buffer);
    
protected booleanup(android.widget.TextView widget, Spannable buffer)

        return scrollUp(widget, buffer, 1);