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

AdjacentListsWithAdjacentISVsInside

public class AdjacentListsWithAdjacentISVsInside extends android.app.Activity
Most bodacious scenario yet!

Fields Summary
private android.widget.ListView
mLeftListView
private android.widget.ListView
mRightListView
Constructors Summary
Methods Summary
private static android.view.ViewcombineAdjacent(android.view.View views)

        if (views.length < 2) {
            throw new IllegalArgumentException("you should pass at least 2 views in");
        }

        final LinearLayout ll = new LinearLayout(views[0].getContext());
        ll.setOrientation(LinearLayout.HORIZONTAL);
        final LinearLayout.LayoutParams lp =
                new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1.0f);

        for (View view : views) {
            ll.addView(view, lp);
        }
        return ll;
    
public com.android.frameworktest.util.InternalSelectionViewgetLeftIsv()

        return (InternalSelectionView)
                ((ViewGroup) mLeftListView.getChildAt(0)).getChildAt(0);
    
public android.widget.ListViewgetLeftListView()

        return mLeftListView;
    
public com.android.frameworktest.util.InternalSelectionViewgetLeftMiddleIsv()

        return (InternalSelectionView)
                ((ViewGroup) mLeftListView.getChildAt(0)).getChildAt(1);
    
public com.android.frameworktest.util.InternalSelectionViewgetRightIsv()

        return (InternalSelectionView)
                ((ViewGroup) mRightListView.getChildAt(0)).getChildAt(1);
    
public android.widget.ListViewgetRightListView()

        return mRightListView;
    
public com.android.frameworktest.util.InternalSelectionViewgetRightMiddleIsv()

        return (InternalSelectionView)
                ((ViewGroup) mRightListView.getChildAt(0)).getChildAt(0);
    
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        final int desiredHeight = (int) (0.8 * getWindowManager().getDefaultDisplay().getHeight());

        mLeftListView = new ListView(this);
        mLeftListView.setAdapter(new AdjacentISVAdapter(desiredHeight));
        mLeftListView.setItemsCanFocus(true);


        mRightListView = new ListView(this);
        mRightListView.setAdapter(new AdjacentISVAdapter(desiredHeight));
        mRightListView.setItemsCanFocus(true);



        setContentView(combineAdjacent(mLeftListView, mRightListView));