FileDocCategorySizeDatePackage
HorizontalFocusSearch.javaAPI DocAndroid 5.1 API3855Thu Mar 12 22:22:12 GMT 2015android.widget.focus

HorizontalFocusSearch

public class HorizontalFocusSearch extends android.app.Activity

Fields Summary
private android.widget.LinearLayout
mLayout
private android.widget.Button
mLeftTall
private android.widget.Button
mMidShort1Top
private android.widget.Button
mMidShort2Bottom
private android.widget.Button
mRightTall
Constructors Summary
Methods Summary
private android.widget.ButtonaddShort(android.widget.LinearLayout root, java.lang.String label, boolean atBottom)

        Button button = new MyButton(this);
        button.setText(label);
        button.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                0, // height
                490));

        TextView filler = new TextView(this);
        filler.setText("filler");
        filler.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                0, // height
                510));

        LinearLayout ll = new LinearLayout(this);
        ll.setOrientation(LinearLayout.VERTICAL);
        ll.setLayoutParams(new LinearLayout.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.MATCH_PARENT));

        if (atBottom) {
            ll.addView(filler);
            ll.addView(button);
            root.addView(ll);
        } else {
            ll.addView(button);
            ll.addView(filler);
            root.addView(ll);
        }
        return button;
    
public android.widget.LinearLayoutgetLayout()

        return mLayout;
    
public android.widget.ButtongetLeftTall()

        return mLeftTall;
    
public android.widget.ButtongetMidShort1Top()

        return mMidShort1Top;
    
public android.widget.ButtongetMidShort2Bottom()

        return mMidShort2Bottom;
    
public android.widget.ButtongetRightTall()

        return mRightTall;
    
private android.widget.ButtonmakeTall(java.lang.String label)

        Button button = new MyButton(this);
        button.setText(label);
        button.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        return button;
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

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

        mLeftTall = makeTall("left tall");
        mLayout.addView(mLeftTall);

        mMidShort1Top = addShort(mLayout, "mid(1) top", false);
        mMidShort2Bottom = addShort(mLayout, "mid(2) bottom", true);

        mRightTall = makeTall("right tall");
        mLayout.addView(mRightTall);

        setContentView(mLayout);