FileDocCategorySizeDatePackage
ListItemISVAndButton.javaAPI DocAndroid 1.5 API2497Wed May 06 22:42:02 BST 2009com.android.frameworktest.listview

ListItemISVAndButton

public class ListItemISVAndButton extends com.android.frameworktest.util.ListScenario
Each item is an internal selection view, a button, and some filler

Fields Summary
Constructors Summary
Methods Summary
protected android.view.ViewcreateView(int position, android.view.ViewGroup parent, int desiredHeight)

        Context context = parent.getContext();

        final LinearLayout ll = new LinearLayout(context);
        ll.setOrientation(LinearLayout.VERTICAL);

        final InternalSelectionView isv = new InternalSelectionView(context, 8, "ISV postion " + position);
        isv.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                desiredHeight - 240));
        ll.addView(isv);

        final LinearLayout.LayoutParams buttonLp =
                new LinearLayout.LayoutParams(
                        ViewGroup.LayoutParams.FILL_PARENT,
                        40);
        final Button topButton = new Button(context);
        topButton.setLayoutParams(
                buttonLp);
        topButton.setText("button " + position + ")");
        ll.addView(topButton);

        final TextView filler = new TextView(context);
        filler.setLayoutParams(new LinearLayout.LayoutParams(
                ViewGroup.LayoutParams.FILL_PARENT,
                200));
        filler.setText("filler");
        ll.addView(filler);


        return ll;
    
protected voidinit(Params params)

        params.setItemScreenSizeFactor(2.0)
                .setNumItems(3)
                .setItemsFocusable(true);