微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android.widget.ExpandableListAdapter的实例源码

项目:yyox    文件ExpandedListUtils.java   
public static void setExpandedListViewHeightBasedOnChildren(ExpandableListView listView,int groupPosition) {
    expandablelistadapter listadapter = listView.getexpandablelistadapter();
    if (listadapter == null) {
        return;
    }
    View listItem = listadapter.getChildView(groupPosition,true,null,listView);
    listItem.measure(0,0);
    int appendHeight = 0;
    for (int i = 0; i < listadapter.getChildrenCount(groupPosition); i++) {
        appendHeight += listItem.getMeasuredHeight();
    }
    ViewGroup.LayoutParams params = listView.getLayoutParams();
    params.height += appendHeight;
    listView.setLayoutParams(params);
}
项目:yyox    文件ExpandedListUtils.java   
public static void setCollapseListViewHeightBasedOnChildren(ExpandableListView listView,0);
    int appendHeight = 0;
    for (int i = 0; i < listadapter.getChildrenCount(groupPosition); i++) {
        appendHeight += listItem.getMeasuredHeight();
    }
    ViewGroup.LayoutParams params = listView.getLayoutParams();
    params.height -= appendHeight;
    listView.setLayoutParams(params);
}
项目:easyfilemanager    文件RootsFragment.java   
private ArrayList<Long> getExpandedIds() {
    ExpandableListView list = mList;
    expandablelistadapter adapter = mAdapter;
    if (adapter != null) {
        int length = adapter.getGroupCount();
        ArrayList<Long> expandedIds = new ArrayList<Long>();
        for(int i=0; i < length; i++) {
            if(list.isGroupExpanded(i)) {
                expandedIds.add(adapter.getGroupId(i));
            }
        }
        return expandedIds;
    } else {
        return null;
    }
}
项目:exciting-app    文件ExpandableHListView.java   
/**
 * Sets the adapter that provides data to this view.
 *
 * @param adapter The adapter that provides data to this view.
 */
public void setAdapter( expandablelistadapter adapter ) {
    // Set member variable
    mAdapter = adapter;

    if( adapter != null ) {
        // Create the connector
        mConnector = new ExpandableHListConnector( adapter );
    }
    else {
        mConnector = null;
    }

    // Link the ListView (superclass) to the expandable list data through the connector
    super.setAdapter( mConnector );
}
项目:FireFiles    文件RootsFragment.java   
private ArrayList<Long> getExpandedIds() {
    ExpandableListView list = mList;
    expandablelistadapter adapter = mAdapter;
    if (adapter != null) {
        int length = adapter.getGroupCount();
        ArrayList<Long> expandedIds = new ArrayList<Long>();
        for(int i=0; i < length; i++) {
            if(list.isGroupExpanded(i)) {
                expandedIds.add(adapter.getGroupId(i));
            }
        }
        return expandedIds;
    } else {
        return null;
    }
}
项目:simple-share-android    文件RootsFragment.java   
private ArrayList<Long> getExpandedIds() {
    ExpandableListView list = mList;
    expandablelistadapter adapter = mAdapter;
    if (adapter != null) {
        int length = adapter.getGroupCount();
        ArrayList<Long> expandedIds = new ArrayList<Long>();
        for(int i=0; i < length; i++) {
            if(list.isGroupExpanded(i)) {
                expandedIds.add(adapter.getGroupId(i));
            }
        }
        return expandedIds;
    } else {
        return null;
    }
}
项目:StickyAnimatedExpandableGridView    文件StickyHeaderExpandableGridView.java   
@Override
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);
    mAdapter = adapter;
    mHeaderView = adapter.getGroupView(0,false,this);
    boolean isBaseAdapter = adapter instanceof Baseexpandablelistadapter;
    if (cacheHeaderViews == null) {
        if (isBaseAdapter) {
            int typeCount = ((Baseexpandablelistadapter) adapter).getGroupTypeCount();
            cacheHeaderViews = new SparseArray<>(typeCount);
        }
        cacheHeaderViews = new SparseArray<>(1);
    }
    if (mHeaderView != null) {
        int groupType = 0;
        if (isBaseAdapter) {
            groupType = ((Baseexpandablelistadapter) adapter).getGroupType(0);
            cacheHeaderViews.put(groupType,mHeaderView);
        }
        cacheHeaderViews.put(groupType,mHeaderView);
    }
}
项目:connectedteam-android    文件ListOrExpandableListFragment.java   
public void setexpandablelistadapter(expandablelistadapter adapter){
    mAdapter=null;
    boolean hadAdapter = mexpandablelistadapter != null;
    mexpandablelistadapter = adapter;
    if (mList!=null && !(mList instanceof ExpandableListView)){
        changelistView(true);

    }
    if (mList instanceof ExpandableListView) {
        ((ExpandableListView)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);
        }
    }

}
项目:ActivityLauncher    文件AllTasksListFragment.java   
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.frament_all_list,null);

    this.list = (ExpandableListView) view.findViewById(R.id.expandableListView1);

    this.list.setonChildClickListener(new OnChildClickListener() {
        @Override
        public boolean onChildClick(ExpandableListView parent,View v,int groupPosition,int childPosition,long id) {
            expandablelistadapter adapter = parent.getexpandablelistadapter();
            MyActivityInfo info = (MyActivityInfo)adapter.getChild(groupPosition,childPosition);
            LauncherIconCreator.launchActivity(getActivity(),info.component_name);
            return false;
        }
    });

    AllTasksListAsyncProvider provider = new AllTasksListAsyncProvider(this.getActivity(),this);
    provider.execute();

    return view;
}
项目:IntentsLab    文件browseComponentsFragment.java   
private void clearDataAndShowLoadingIndicator() {
    if (mProgressIndicator != null) {
        mNonExpandableListView.setEmptyView(null);
        mNonExpandableListView.setVisibility(View.GONE);
        mNonExpandableListView.setonItemClickListener(null);
        mNonExpandableListView.setAdapter(null);

        mExpandableListView.setEmptyView(null);
        mExpandableListView.setVisibility(View.GONE);
        mExpandableListView.setonChildClickListener(null);
        mExpandableListView.setAdapter((expandablelistadapter) null);

        mEmptyMessage.setVisibility(View.GONE);
        mCustomErrorText.setVisibility(View.GONE);
        mProgressIndicator.setVisibility(View.VISIBLE);
    }

    mloadedData = null;
}
项目:MultiChoiceExpandableList    文件MultiChoiceExpandableListView.java   
@Override
public void setAdapter(final expandablelistadapter adapter){

    if (adapter == null)
        throw new NullPointerException("The adapter you passed was null");


    if (adapter instanceof MultiChoiceExpandableAdapter)
        this.mAdapterWrapper = (MultiChoiceExpandableAdapter) adapter;

    else if (mAdapterWrapper == null)
        mAdapterWrapper = new MultiChoiceExpandableAdapter( adapter,this);
    else
        mAdapterWrapper.setWrappedAdapter(adapter);

    super.setAdapter(mAdapterWrapper);

    mCheckStore = new CheckStateStore(this); // Must do this to ensure
                                                // hasstableIds stays
                                                // current
}
项目:opentasks    文件RetainExpandableListView.java   
public void expandGroups(long[] groupsToExpand)
{
    // this.expandedIds = expandedIds;
    if (groupsToExpand != null && groupsToExpand.length > 0)
    {
        expandablelistadapter adapter = getexpandablelistadapter();
        if (adapter != null)
        {
            for (int i = 0; i < adapter.getGroupCount(); i++)
            {
                long id = adapter.getGroupId(i);
                if (inArray(groupsToExpand,id))
                {
                    expandGroup(i);
                }
            }
        }
    }
}
项目:opentasks    文件TaskListFragment.java   
private void selectChildView(ExpandableListView expandLV,boolean force)
{
    if (groupPosition < mAdapter.getGroupCount() && childPosition < mAdapter.getChildrenCount(groupPosition))
    {
        // a task instance element has been clicked,get it's instance id and notify the activity
        expandablelistadapter listadapter = expandLV.getexpandablelistadapter();
        Cursor cursor = (Cursor) listadapter.getChild(groupPosition,childPosition);

        if (cursor == null)
        {
            return;
        }
        // Todo: for Now we get the id of the task,not the instance,once we support recurrence we'll have to change that
        Long selectTaskId = cursor.getLong(cursor.getColumnIndex(Instances.TASK_ID));

        if (selectTaskId != null)
        {
            // Notify the active callbacks interface (the activity,if the fragment is attached to one) that an item has been selected.

            // Todo: use the instance URI one we support recurrence
            Uri taskUri = ContentUris.withAppendedId(Tasks.getContentUri(mAuthority),selectTaskId);

            mCallbacks.onItemSelected(taskUri,force,mInstancePosition);
        }
    }
}
项目:easyfilemanager    文件RootsFragment.java   
private void restoreExpandedState(ArrayList<Long> expandedIds) {
    this.expandedIds = expandedIds;
    if (expandedIds != null) {
        ExpandableListView list = mList;
        expandablelistadapter adapter = mAdapter;
        if (adapter != null) {
            for (int i=0; i<adapter.getGroupCount(); i++) {
                long id = adapter.getGroupId(i);
                if (expandedIds.contains(id)) list.expandGroup(i);
            }
        }
    }
}
项目:Phial    文件keyvalueView.java   
public keyvalueView(Context context,KVSaver kvSaver) {
    super(context);
    this.kvSaver = kvSaver;

    inflate(context,R.layout.view_keyvalue,this);
    listView = findViewById(R.id.list_keyvalue);
    adapter = new keyvalueAdapter(LayoutInflater.from(context));
    listView.setAdapter((expandablelistadapter) adapter);

    updateData();
    kvSaver.addobserver(this);
}
项目:Android-DFU-App    文件ExpandableListActivity.java   
/**
 * Provide the adapter for the expandable list.
 */
public void setlistadapter(expandablelistadapter adapter) {
    synchronized (this) {
        ensureList();
        mAdapter = adapter;
        mList.setAdapter(adapter);
    }
}
项目:MyFlightbookAndroid    文件FixedExpandableListActivity.java   
/**
 * Provide the adapter for the expandable list.
 */
void setlistadapter(expandablelistadapter adapter) {
    synchronized (this) {
        ensureList();
        mAdapter = adapter;
        mList.setAdapter(adapter);
    }
}
项目:MyFlightbookAndroid    文件ExpandableListFragment.java   
/**
* Provide the cursor for the list view.
*/
    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.
                View v = getView();
                if (v != null)
                    setListShown(true,getView().getwindowToken() != null);
            }
        }
    }
项目:Paper-Melody    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:FireFiles    文件RootsFragment.java   
private void restoreExpandedState(ArrayList<Long> expandedIds) {
    this.expandedIds = expandedIds;
    if (expandedIds != null) {
        ExpandableListView list = mList;
        expandablelistadapter adapter = mAdapter;
        if (adapter != null) {
            for (int i=0; i<adapter.getGroupCount(); i++) {
                long id = adapter.getGroupId(i);
                if (expandedIds.contains(id)) list.expandGroup(i);
            }
        }
    }
}
项目:simple-share-android    文件RootsFragment.java   
private void restoreExpandedState(ArrayList<Long> expandedIds) {
    this.expandedIds = expandedIds;
    if (expandedIds != null) {
        ExpandableListView list = mList;
        expandablelistadapter adapter = mAdapter;
        if (adapter != null) {
            for (int i=0; i<adapter.getGroupCount(); i++) {
                long id = adapter.getGroupId(i);
                if (expandedIds.contains(id)) list.expandGroup(i);
            }
        }
    }
}
项目:Veggietizer    文件Popup.java   
/**
 * Shows the popup that is opened when the user clicks on the info action button of a details page.
 * An {@link ExpandableListView} is used as a layout.
 *
 * @param context The context to show the popup in.
 * @param title The popup's title.
 * @param groups The expandable categories.
 * @param entries Each category in <code>groups</code> shows one entry when expanded.
 * @return The dialog.
 */
private static AlertDialog showDetailsInfo(Context context,String title,String[] groups,String[] entries,DialogInterface.OnClickListener onSubmitListener) {
    if (groups.length != entries.length) {
        throw new IllegalArgumentException();
    }

    // Custom title
    TextView customTitle = (TextView) LayoutInflater.from(context).inflate(R.layout.popup_title,null);
    customTitle.setText(title);

    View popupDetailsInfo = LayoutInflater.from(context)
            .inflate(R.layout.popup_details_info,null);
    ExpandableListView listViewDetailsInfo = (ExpandableListView)
            popupDetailsInfo.findViewById(R.id.expandablelistview_popup_details_info);
    expandablelistadapter adapter = createDetailsInfoAdapter(context,groups,entries);
    listViewDetailsInfo.setAdapter(adapter);

    AlertDialog.Builder popupBuilder = new AlertDialog.Builder(context);
    popupBuilder.setView(popupDetailsInfo)
            .setNeutralButton(R.string.ok,onSubmitListener)
            .setCustomTitle(customTitle);

    AlertDialog dialog = popupBuilder.create();
    dialog.show();

    Utility.setFont(FontManager.Font.ROBOTO_LIGHT,new TextView[]{
            customTitle
    });

    return dialog;
}
项目:Veggietizer    文件Popup.java   
private static expandablelistadapter createDetailsInfoAdapter(Context context,String[] entries) {
    // Creates the upper list level
    List<Map<String,String>> groupData = new LinkedList<>();
    String groupName = "GroupName";
    String[] groupFrom = new String[] {groupName};
    int[] groupTo = new int[] {R.id.component_details_info_group};

    for (String g : groups) {
        Map<String,String> group = new HashMap<>(1);
        group.put(groupName,g);
        groupData.add(group);
    }

    // Creates the lower list level
    List<List<Map<String,String>>> childData = new LinkedList<>();
    String groupContent = "Content";
    String[] childFrom = new String[] {groupContent};
    int[] childTo = new int[] {R.id.component_details_info_entry};

    for (String e : entries) {
        List<Map<String,String>> content = new LinkedList<>();
        Map<String,String> entry = new HashMap<>(1);

        entry.put(groupContent,e);
        content.add(entry);
        childData.add(content);
    }

    return new DetailsInfoAdapter(context,groupData,groupFrom,groupTo,childData,childFrom,childTo);
}
项目:ScribaNotesApp    文件ExpandableListActivity.java   
/**
 * Provide the adapter for the expandable list.
 */
public void setlistadapter(expandablelistadapter adapter) {
    synchronized (this) {
        ensureList();
        mAdapter = adapter;
        mList.setAdapter(adapter);
    }
}
项目:m-dan    文件Utils.java   
/**
 * Sets ExpandableListView height dynamically based on the height of the items.
 *
 * @param expandablelistView to be resized
 * @return true if the expandablelistView is successfully resized,false otherwise
 */
public static boolean setListViewHeightBasedOnItems(ExpandableListView expandablelistView) {

    expandablelistadapter expandablelistadapter = expandablelistView.getexpandablelistadapter();
    if (expandablelistadapter != null) {

        int numberOfGroups = expandablelistadapter.getGroupCount();
        int numberOfDividers = numberOfGroups;

        // Get total height of all items of all group expanded
        int totalItemsHeight = 0;

        for (int groupPos = 0; groupPos < numberOfGroups; groupPos++) {

            View item = expandablelistadapter.getGroupView(groupPos,expandablelistView.isGroupExpanded(groupPos),expandablelistView);
            item.measure(0,0);
            totalItemsHeight += item.getMeasuredHeight();

            if(expandablelistView.isGroupExpanded(groupPos)) {
                totalItemsHeight += calculateHeightOfOneGroup(groupPos,expandablelistadapter,expandablelistView);
                numberOfDividers += expandablelistadapter.getChildrenCount(groupPos);
            }
        }

        // Get total height of all item dividers.
        int totalDividersHeight = expandablelistView.getDividerHeight() * numberOfDividers;

        // Set list height.
        ViewGroup.LayoutParams params = expandablelistView.getLayoutParams();
        params.height = totalItemsHeight + totalDividersHeight + 5;
        expandablelistView.setLayoutParams(params);
        expandablelistView.requestLayout();

        return true;
    } else {
        return false;
    }
}
项目:m-dan    文件Utils.java   
/**
 * Calculate the height of an expanded group dynamically based on the height of the items.
 *
 * @param groupPos position of the current group
 * @param expandablelistadapter adapter of the expandableList
 * @param parent the parent that this view will eventually be attached to
 * @return true if the listView is successfully resized,false otherwise
 */
public static int calculateHeightOfOneGroup(int groupPos,expandablelistadapter expandablelistadapter,ViewGroup parent) {

    int numberOfItems = expandablelistadapter.getChildrenCount(groupPos);

    // Get total height of all items in the group
    int totalItemsHeight = 0;

    for (int itemPos = 0; itemPos < numberOfItems; itemPos++) {

        boolean lastItem = false;
        if(itemPos == numberOfItems-1){
            lastItem = true;
        }

        // Supprimer le if si on veut garder un truc générique. Ici,le if sert à gérer la cutom expandable en plus des expandables classiques
        View item;
        if(expandablelistadapter instanceof com.orange.ease.idunnololz.widgets.AnimatedExpandableListView.Animatedexpandablelistadapter){
            item = ((AnimatedExpandableListView.Animatedexpandablelistadapter) expandablelistadapter).getRealChildView(groupPos,itemPos,lastItem,parent);
        }else{
            item = expandablelistadapter.getChildView(groupPos,parent);
        }


        item.measure(0,0);
        totalItemsHeight += item.getMeasuredHeight();
    }

    return totalItemsHeight;
}
项目:m-dan    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:lr_dialer    文件Common.java   
private void onScrollStateChanged(ExpandableListView elv,int scrollState)
{
    elv.setTag(AQuery.TAG_NUM,scrollState);
    if (scrollState == SCROLL_STATE_IDLE)
    {
        int first = elv.getFirstVisiblePosition();
        int last = elv.getLastVisiblePosition();
        int count = last - first;
        expandablelistadapter ela = elv.getexpandablelistadapter();
        for (int i = 0; i <= count; i++)
        {
            long packed = elv.getExpandableListPosition(i + first);
            int group = ExpandableListView.getPackedPositionGroup(packed);
            int child = ExpandableListView.getPackedPositionChild(packed);
            if (group >= 0)
            {
                View convertView = elv.getChildAt(i);
                Long targetPacked = (Long) convertView.getTag(AQuery.TAG_NUM);
                if (targetPacked != null && targetPacked.longValue() == packed)
                {
                    if (child == -1)
                    {
                        ela.getGroupView(group,elv.isGroupExpanded(group),convertView,elv);
                    }
                    else
                    {
                        ela.getChildView(group,child,child == ela.getChildrenCount(group) - 1,elv);
                    }
                    convertView.setTag(AQuery.TAG_NUM,null);
                }
                else
                {
                    //AQUtility.debug("skip!");
                }
            }
        }
    }
}
项目:newbee    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if (adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:StickyAnimatedExpandableGridView    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:AndroidAgent    文件OCSShowInventory.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.actvity_show_inventory);

    // Get the listview
    ExpandableListView maListView = (ExpandableListView) findViewById(R.id.myListView);

    // Set datas
    expandablelistadapter monlistadapter = new ExpandableSectionAdapter(this,Inventory.getInstance(this).getAllSections());

    // Set list adapter
    maListView.setAdapter(monlistadapter);
}
项目:AeonDroid    文件TriggersActivity.java   
@Override
protected void onPostExecute(Cursor cursor) {
    expandablelistadapter ela = getexpandablelistadapter();
    if (ela == null) {
        setlistadapter(new AlertTriggerCursorAdapter(cursor,context,mEditButtonListener));
    }
    else {
        AlertTriggerCursorAdapter atca = (AlertTriggerCursorAdapter)getexpandablelistadapter();
        atca.changeCursor(cursor);
    }
}
项目:Android-ExpandableListFragment    文件ExpandableListFragment.java   
/**
 * Provide the adapter for the expandable list.
 */
public void setlistadapter(final expandablelistadapter adapter){
    final boolean hadAdapter = this.adapter != null;
    this.adapter = adapter;
    if(list != null){
        list.setAdapter(adapter);
        if(!isListShown && !hadAdapter){
            // The list was hidden,getView().getwindowToken() != null);
        }
    }
}
项目:mobile-android-studio    文件GDExpandableListActivity.java   
/**
 * Provide the adapter for the expandable list.
 */
public void setlistadapter(expandablelistadapter adapter) {
    synchronized (this) {
        ensureLayout();
        mAdapter = adapter;
        mList.setAdapter(adapter);
    }
}
项目:Android-SlideSupport-ListLayouts    文件SlideSupportExpandableListView.java   
@Override
public void setAdapter(expandablelistadapter adapter) {
    if (adapter instanceof SlideAdapter) {
        SlideAdapter slideAdapter = (SlideAdapter) adapter;
        slideAdapter.setSlideSupporter(mActionHandler);
    }

    super.setAdapter(adapter);
}
项目:Subreddit_Reader    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:iGuide    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);

    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:XiaomiOrder    文件AnimatedExpandableListView.java   
/**
 * @see ExpandableListView#setAdapter(expandablelistadapter)
 */
public void setAdapter(expandablelistadapter adapter) {
    super.setAdapter(adapter);
    // Make sure that the adapter extends Animatedexpandablelistadapter
    if(adapter instanceof Animatedexpandablelistadapter) {
        this.adapter = (Animatedexpandablelistadapter) adapter;
        this.adapter.setParent(this);
    } else {
        throw new ClassCastException(adapter.toString() + " must implement Animatedexpandablelistadapter");
    }
}
项目:Android-nRF-ToolBox    文件ExpandableListActivity.java   
/**
 * Provide the adapter for the expandable list.
 */
public void setlistadapter(expandablelistadapter adapter) {
    synchronized (this) {
        ensureList();
        mAdapter = adapter;
        mList.setAdapter(adapter);
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。