ExpandableListView expandGroup - top ranked examples from Open Source projects

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

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:getChildAt, expandGroup, getFlatListPosition, setSelectedChild, smoothScrollToPosition
6
CodeRank
This code example shows how to use the following methods:expandGroup, setSelectedChild
        try { // Check if the parent activity is the IndicatorActivity. only need to track indicator selection here 
			 
			act = (IndicatorActivity) getActivity();
			mAdapter.setSelectedPosition(act.getGroupPosition(), act.getChildPosition());
			 
			menuList.setSelectedChild(act.getGroupPosition(), act.getChildPosition(), true);
			menuList.expandGroup(act.getGroupPosition());
			 
		} catch (ClassCastException actException) {// otherwise leave list collapsed
			//hAct = (HomeActivity) getActivity(); 
			mAdapter.setSelectedPosition(-1);
			 
		} 
         
 
    } 
     
    @Override 
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState){
5
CodeRank
This code example shows how to use the following methods:expandGroup, setSelectedGroup
	/** 点击了Group触发的事件,要根据根据当前点击 Group的状态来判断 */ 
	@Override 
	public boolean onGroupClick(ExpandableListView parent,View v,int groupPosition,long id) {
		if (mAdapter.getGroupClickStatus(groupPosition) == 0) {
			mAdapter.setGroupClickStatus(groupPosition, 1);
			parent.expandGroup(groupPosition);
			parent.setSelectedGroup(groupPosition);
		} else if (mAdapter.getGroupClickStatus(groupPosition) == 1) {
			mAdapter.setGroupClickStatus(groupPosition, 0);
			parent.collapseGroup(groupPosition);
		} 
		return true; 
	} 
	 
	@Override 
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		if (mHeaderView != null) {
			measureChild(mHeaderView, widthMeasureSpec, heightMeasureSpec);
			mHeaderViewWidth = mHeaderView.getMeasuredWidth();
4
CodeRank
This code example shows how to use the following methods:expandGroup, isGroupExpanded
    } 
     
    @Override 
    public boolean onGroupClick(ExpandableListView parent, View v,
            int groupPosition, long id) {
        if (!parent.isGroupExpanded(groupPosition)) {
            parent.expandGroup(groupPosition);
        } 
        else { 
            parent.collapseGroup(groupPosition);
        } 
        return true; 
    } 
     
    @Override 
    public void onGroupExpand(int groupPosition) {}
 
    @Override 
    public void onGroupCollapse(int groupPosition) {}
 
4
CodeRank
This code example shows how to use the following methods:expandGroup
		 
		@Override 
		public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
			View view = super.getGroupView(groupPosition, isExpanded, convertView, parent);
			ExpandableListView listView = (ExpandableListView) parent;
			listView.expandGroup(groupPosition);
			return view;
		} 
	} 
	 
	class MyHandler extends Handler {
 
		@Override 
		public void handleMessage(Message msg) {
 
			if (msg.what == 0x01) {
				if(dialog.isShowing()){
					dialog.dismiss();
				} 
				 
4
CodeRank
This code example shows how to use the following methods:expandGroup
This code example shows how to use the following methods:expandGroup
            return this;
        } 
 
        @Override 
        public void expandGroup(int groupPosition) {
            listView.expandGroup(groupPosition);
        } 
    } 
     
    private static class HoneycombActionBar extends GingerbreadExpandGroup { 
        @Override 
        public void expandGroup(int groupPosition) {
            listView.expandGroup(groupPosition, true);
        } 
    } 
     
} 
4
CodeRank
This code example shows how to use the following methods:expandGroup

Related ExpandableListView expandGroup Questions & Answers:

expandGroup Method Overview
Expand a group in the grouped list view
See Code Examples for other Android ExpandableListView Methods: