FileDocCategorySizeDatePackage
GoneParentFocusedChild.javaAPI DocAndroid 1.5 API2647Wed May 06 22:42:02 BST 2009com.android.frameworktest.focus

GoneParentFocusedChild

public class GoneParentFocusedChild extends android.app.Activity
An activity that helps test the scenario where a parent is GONE and one of its children has focus; the activity should get the key event. see bug 945150.

Fields Summary
private android.widget.LinearLayout
mGoneGroup
private android.widget.Button
mButton
private boolean
mUnhandledKeyEvent
private android.widget.LinearLayout
mLayout
Constructors Summary
Methods Summary
public android.widget.ButtongetButton()

        return mButton;
    
public android.widget.LinearLayoutgetGoneGroup()

        return mGoneGroup;
    
public android.widget.LinearLayoutgetLayout()

        return mLayout;
    
public booleanisUnhandledKeyEvent()


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

        super.onCreate(icicle);

        mLayout = new LinearLayout(this);
        mLayout.setOrientation(LinearLayout.HORIZONTAL);
        mLayout.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));


        mGoneGroup = new LinearLayout(this);
        mGoneGroup.setOrientation(LinearLayout.HORIZONTAL);
        mGoneGroup.setLayoutParams(new ViewGroup.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                ViewGroup.LayoutParams.FILL_PARENT));

        mButton = new Button(this);
        mButton.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT));


        mGoneGroup.addView(mButton);
        setContentView(mLayout);

        mGoneGroup.setVisibility(View.GONE);
        mButton.requestFocus();
    
public booleanonKeyUp(int keyCode, android.view.KeyEvent event)

        mUnhandledKeyEvent = true;
        return true;