Android ExpandableListView - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ExpandableListView class.

This code example shows how to use the following methods:setVisibility, startAnimation
            return; 
        } 
        mListShown = shown;
        if (shown) {
            if (animate) {
                mList.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), android.R.anim.fade_in));
            } 
            mList.setVisibility(View.VISIBLE);
        } else { 
            if (animate) {
                mList.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), android.R.anim.fade_out));
            } 
            mList.setVisibility(View.GONE);
        } 
    } 
 
    /** 
     * Get the ListAdapter associated with this activity's ListView. 
8
CodeRank
This code example shows how to use the following methods:setId
		} 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;
	} 
 
	class InternalExpandableListView extends ExpandableListView implements EmptyViewMethodAccessor {
 
		public InternalExpandableListView(Context context, AttributeSet attrs) {
			super(context, attrs);
		} 
 
		@Override 
		public void setEmptyView(View emptyView) {
			PullToRefreshExpandableListView.this.setEmptyView(emptyView);
		} 
 
7
CodeRank
This code example shows how to use the following methods:getSelectedId, setAdapter, setOnItemClickListener, setEmptyView, setOnItemLongClickListener
		return mList.getSelectedPosition();
	} 
 
	public long getSelectedId() { 
		ensureList(); 
		return mList.getSelectedId();
	} 
 
	public ExpandableListView getExpandableListView() {
		ensureList(); 
		return mList;
	} 
 
	/** 
	 * The default content for a ListFragment has a TextView that can 
	 * be shown when the list is empty. If you would like to have it 
	 * shown, call this method to supply the text it should use. 
	 */ 
	public void setEmptyText(CharSequence text) {
		ensureList(); 
6
CodeRank
This code example shows how to use the following methods:setAdapter, setOnItemClickListener, setEmptyView
     */ 
    public void setListAdapter(ExpandableListAdapter adapter) {
        boolean hadAdapter = mAdapter != null;
        mAdapter = adapter;
        if (mList != null) {
            mList.setAdapter(adapter);
            if (!mListShown && !hadAdapter) {
                // The list was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setListShown(true, getView().getWindowToken() != null);
            } 
        } 
    } 
 
    /** 
     * Set the currently selected list item to the specified 
     * position with the adapter's data 
     * 
     * @param position 
     */ 

6
CodeRank
This code example shows how to use the following methods:setAdapter, setOnChildClickListener, setOnGroupClickListener, setOnGroupCollapseListener, setOnGroupExpandListener
	 */ 
	public void setListAdapter(ExpandableListAdapter adapter) {
		boolean hadAdapter = mAdapter != null;
		mAdapter = adapter;
		if (mList != null) {
			mList.setAdapter(adapter);
			if (!mListShown && !hadAdapter) {
				// The list was hidden, and previously didn't have an 
				// adapter. It is now time to show it. 
				setListShown(true, getView().getWindowToken() != null); 
			} 
		} 
	} 
 
	/** 
	 * Set the currently selected list item to the specified position with the adapter's data 
	 *  
	 * @param position 
	 */ 
	public void setSelection(int position) {

6
CodeRank
This code example shows how to use the following methods:expandGroup, setAdapter
 
		android.view.ViewGroup.LayoutParams params = getLayoutParams();
		params.height = getMeasuredHeight();
	    } 
	}; 
	elv.setAdapter(new ToggleTextExpandableListAdapter(ctx, toggleText));
	if (! toggleText.isCollapsed()) {
	    elv.expandGroup(0);
	} 
    } 
 
    @Override 
    public View getView() {
	return elv;
    } 
 
    @Override 
    public boolean validate() { 
	return true; 
    } 
6
CodeRank
This code example shows how to use the following methods:setAdapter, setOnChildClickListener, setOnGroupCollapseListener, setOnGroupExpandListener, setEmptyView
     */ 
    public void setListAdapter(ExpandableListAdapter adapter) {
        boolean hadAdapter = mAdapter != null;
        mAdapter = adapter;
        if (mExpandableList != null) {
            mExpandableList.setAdapter(adapter);
            if (!mExpandableListShown && !hadAdapter) {
                // The list was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setListShown(true, getView().getWindowToken() != null);
            } 
        } 
    } 
 
    /** 
     * Set the currently selected list item to the specified 
     * position with the adapter's data 
     * 
     * @param position 
     */ 

6
CodeRank
This code example shows how to use the following methods:getExpandableListAdapter
This code example shows how to use the following methods:setOnChildClickListener, setOnGroupClickListener, setOnGroupCollapseListener, setOnGroupExpandListener
This code example shows how to use the following methods:setAdapter, setOnChildClickListener, setOnGroupCollapseListener, setOnGroupExpandListener, setEmptyView
    /** Provide the cursor for the list view. */ 
    public void setListAdapter(ExpandableListAdapter adapter) {
        boolean hadAdapter = mAdapter != null;
        mAdapter = adapter;
        if (mList != null) {
            mList.setAdapter(adapter);
            if (!mListShown && !hadAdapter) {
                // The list was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setListShown(true, getView().getWindowToken() != null);
            } 
        } 
    } 
 
    /** 
     * Set the currently selected list item to the specified 
     * position with the adapter's data 
     */ 
    public void setSelection(int position) {
        ensureList(); 

5
CodeRank

Related Android ExpandableListView Questions & Answers:

Other Android ExpandableListView Examples

2:	
3:				@Override
4:				public boolean onChildClick(ExpandableListView parent, View v,
5:						int groupPosition, int childPosition, long id) {
6:					Toast.makeText(

Read More

16:	
17:		ExpandableListAdapter listAdapter;
18:		ExpandableListView expListView;
19:		List<String> listDataHeader;
20:		HashMap<String, List<String>> listDataChild;
-
26:	
27:			// get the listview
28:			expListView = (ExpandableListView) findViewById(R.id.lvExp);
29:	
30:			// preparing list data
-
40:	
41:				@Override
42:				public boolean onGroupClick(ExpandableListView parent, View v,
43:						int groupPosition, long id) {
44:					// Toast.makeText(getApplicationContext(),
-
76:	
77:				@Override
78:				public boolean onChildClick(ExpandableListView parent, View v,
79:						int groupPosition, int childPosition, long id) {
80:					// TODO Auto-generated method stub

Read More

16:	
17:		ExpandableListAdapter listAdapter;
18:		ExpandableListView expListView;
19:		List<String> listDataHeader;
20:		HashMap<String, List<String>> listDataChild;
-
26:	
27:			// get the listview
28:			expListView = (ExpandableListView) findViewById(R.id.lvExp);
29:	
30:			// preparing list data

Read More

See Code Examples for Android ExpandableListView Methods: