FileDocCategorySizeDatePackage
ListItemISVAndButton.javaAPI DocAndroid 5.1 API2453Thu Mar 12 22:22:12 GMT 2015android.widget.listview

ListItemISVAndButton

public class ListItemISVAndButton extends android.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.MATCH_PARENT,
                desiredHeight - 240));
        ll.addView(isv);

        final LinearLayout.LayoutParams buttonLp =
                new LinearLayout.LayoutParams(
                        ViewGroup.LayoutParams.MATCH_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.MATCH_PARENT,
                200));
        filler.setText("filler");
        ll.addView(filler);


        return ll;
    
protected voidinit(Params params)

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