FileDocCategorySizeDatePackage
RequestRectangleVisibleWithInternalScroll.javaAPI DocAndroid 5.1 API2093Thu Mar 12 22:22:12 GMT 2015android.widget.scroll

RequestRectangleVisibleWithInternalScroll

public class RequestRectangleVisibleWithInternalScroll extends android.app.Activity

Fields Summary
private int
scrollYofBlob
private android.widget.TextView
mTextBlob
private android.widget.Button
mScrollToBlob
Constructors Summary
Methods Summary
public android.widget.ButtongetScrollToBlob()

        return mScrollToBlob;
    
public intgetScrollYofBlob()



       
        return scrollYofBlob;
    
public android.widget.TextViewgetTextBlob()

        return mTextBlob;
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        setContentView(R.layout.scroll_to_rect_with_internal_scroll);

        mTextBlob = (TextView) findViewById(R.id.blob);
        mTextBlob.scrollBy(0, scrollYofBlob);


        mScrollToBlob = (Button) findViewById(R.id.scrollToBlob);
        mScrollToBlob.setOnClickListener(new View.OnClickListener() {

            public void onClick(View v) {

                // the rect we want to make visible is offset to match
                // the internal scroll
                Rect rect = new Rect();
                rect.set(0, 0, 0, mTextBlob.getHeight());
                rect.offset(0, mTextBlob.getScrollY());
                mTextBlob.requestRectangleOnScreen(rect);
            }
        });