Search in sources :

Example 36 with ExpandableListView

use of android.widget.ExpandableListView in project packages_apps_Contacts by AOKP.

the class ExpandableListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Context context = getActivity();
    FrameLayout listContainer = new FrameLayout(context);
    listContainer.setId(INTERNAL_LIST_CONTAINER_ID);
    ExpandableListView lv = new ExpandableListView(getActivity());
    lv.setId(android.R.id.list);
    lv.setDrawSelectorOnTop(false);
    listContainer.addView(lv, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    return listContainer;
}
Also used : Context(android.content.Context) FrameLayout(android.widget.FrameLayout) ExpandableListView(android.widget.ExpandableListView)

Example 37 with ExpandableListView

use of android.widget.ExpandableListView in project packages_apps_Contacts by AOKP.

the class ExpandableListFragment method ensureList.

private void ensureList() {
    if (mExpandableList != null) {
        return;
    }
    View root = getView();
    if (root == null) {
        throw new IllegalStateException("Content view not yet created");
    }
    if (root instanceof ExpandableListView) {
        mExpandableList = (ExpandableListView) root;
    } else {
        mEmptyView = root.findViewById(android.R.id.empty);
        mExpandableListContainer = root.findViewById(INTERNAL_LIST_CONTAINER_ID);
        View rawExpandableListView = root.findViewById(android.R.id.list);
        if (!(rawExpandableListView instanceof ExpandableListView)) {
            if (rawExpandableListView == null) {
                throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
            }
            throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
        }
        mExpandableList = (ExpandableListView) rawExpandableListView;
        if (mEmptyView != null) {
            mExpandableList.setEmptyView(mEmptyView);
        }
    }
    if (mAdapter != null) {
        setListAdapter(mAdapter);
    }
    mHandler.post(mRequestFocus);
}
Also used : View(android.view.View) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView)

Example 38 with ExpandableListView

use of android.widget.ExpandableListView in project FlycoDialog_Master by H07000223.

the class DialogHomeActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ac_dialog_home);
    ButterKnife.bind(this);
    mMenuItems.add(new DialogMenuItem("收藏", R.mipmap.ic_winstyle_favor));
    mMenuItems.add(new DialogMenuItem("下载", R.mipmap.ic_winstyle_download));
    mMenuItems.add(new DialogMenuItem("分享", R.mipmap.ic_winstyle_share));
    mMenuItems.add(new DialogMenuItem("删除", R.mipmap.ic_winstyle_delete));
    mMenuItems.add(new DialogMenuItem("歌手", R.mipmap.ic_winstyle_artist));
    mMenuItems.add(new DialogMenuItem("专辑", R.mipmap.ic_winstyle_album));
    mBasIn = new BounceTopEnter();
    mBasOut = new SlideBottomExit();
    View decorView = getWindow().getDecorView();
    HomeAdapter adapter = new HomeAdapter(mContext);
    mElv.setAdapter(adapter);
    // extend all group
    for (int i = 0; i < mGroups.length; i++) {
        mElv.expandGroup(i);
    }
    mElv.setOnChildClickListener(this);
    mElv.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {

        @Override
        public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
            return true;
        }
    });
}
Also used : DialogMenuItem(com.flyco.dialog.entity.DialogMenuItem) BounceTopEnter(com.flyco.animation.BounceEnter.BounceTopEnter) SlideBottomExit(com.flyco.animation.SlideExit.SlideBottomExit) HomeAdapter(com.flyco.dialogsamples.adapter.HomeAdapter) View(android.view.View) AdapterView(android.widget.AdapterView) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView)

Example 39 with ExpandableListView

use of android.widget.ExpandableListView in project RecyclerViewAnimator by dkmeteor.

the class PullToRefreshExpandableListView method createRefreshableView.

@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
    final ExpandableListView lv;
    if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
        lv = new InternalExpandableListViewSDK9(context, attrs);
    } else {
        lv = new InternalExpandableListView(context, attrs);
    }
    // Set it to this so it can be used in ListActivity/ListFragment
    lv.setId(android.R.id.list);
    return lv;
}
Also used : ExpandableListView(android.widget.ExpandableListView)

Example 40 with ExpandableListView

use of android.widget.ExpandableListView in project Android-PullToRefresh by chrisbanes.

the class PullToRefreshExpandableListView method createRefreshableView.

@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
    final ExpandableListView lv;
    if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
        lv = new InternalExpandableListViewSDK9(context, attrs);
    } else {
        lv = new InternalExpandableListView(context, attrs);
    }
    // Set it to this so it can be used in ListActivity/ListFragment
    lv.setId(android.R.id.list);
    return lv;
}
Also used : ExpandableListView(android.widget.ExpandableListView)

Aggregations

ExpandableListView (android.widget.ExpandableListView)86 View (android.view.View)59 TextView (android.widget.TextView)30 AdapterView (android.widget.AdapterView)18 Intent (android.content.Intent)16 ListView (android.widget.ListView)16 ArrayList (java.util.ArrayList)16 AbsListView (android.widget.AbsListView)14 DialogInterface (android.content.DialogInterface)11 ImageView (android.widget.ImageView)11 List (java.util.List)11 Builder (android.app.AlertDialog.Builder)9 ViewGroup (android.view.ViewGroup)9 ExpandableListAdapter (android.widget.ExpandableListAdapter)7 AbsSpinner (android.widget.AbsSpinner)6 QuickContactBadge (android.widget.QuickContactBadge)6 TabHost (android.widget.TabHost)6 AdapterBinding (com.android.ide.common.rendering.api.AdapterBinding)6 ResourceReference (com.android.ide.common.rendering.api.ResourceReference)6 SessionParams (com.android.ide.common.rendering.api.SessionParams)6