FileDocCategorySizeDatePackage
RequestRectangleVisibleWithInternalScroll.javaAPI DocAndroid 1.5 API2097Wed May 06 22:42:02 BST 2009com.android.frameworktest.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);
            }
        });