/** * Zamyka zagnieżdżoną grupę kontrolek. Pobiera odpowiednie wysokości oraz odpowiedni adapter. * * @param groupPos Pozycja grupy do zamknięcia. * @return Czy zamknięto grupę. */ @Override public boolean collapseGroup(int groupPos) { BaseExpandableListAdapter listAdapter = (BaseExpandableListAdapter) this.getExpandableListAdapter(); this.getLayoutParams().height = UnitConverter.toDpi(50) * listAdapter.getGroupCount() + UnitConverter.toDpi(1); return super.collapseGroup(groupPos); }
/** * Otwiera zagnieżdżoną grupę kontrolek. Pobiera odpowiednie wysokości oraz odpowiedni adapter. * * @param groupPos Pozycja grupy do otwarcia. * @param animate Czy wywołać animację otwarcia. * @return Czy otwarto grupę. */ @Override public boolean expandGroup(int groupPos, boolean animate) { BaseExpandableListAdapter listAdapter = (BaseExpandableListAdapter) this.getExpandableListAdapter(); this.getLayoutParams().height = UnitConverter.toDpi(50) * (listAdapter.getGroupCount() + listAdapter.getChildrenCount(groupPos)) + UnitConverter.toDpi(1); return super.expandGroup(groupPos, animate); }
private void checkScanFinish() { mAdapter.notifyDataSetChanged(); if (mIsProcessScanFinish && mIsSysCacheScanFinish && mIsOverallScanFinish) { mIsScanning = false; JunkGroup cacheGroup = mJunkGroups.get(JunkGroup.GROUP_CACHE); ArrayList<JunkInfo> children = cacheGroup.mChildren; cacheGroup.mChildren = new ArrayList<>(); for (JunkInfo info : children) { cacheGroup.mChildren.add(info); if (info.mChildren != null) { cacheGroup.mChildren.addAll(info.mChildren); } } children = null; long size = getTotalSize(); String totalSize = CleanUtil.formatShortFileSize(this, size); mHeaderView.mSize.setText(totalSize); mHeaderView.mProgress.setText("共发现:" + totalSize); mHeaderView.mProgress.setGravity(Gravity.CENTER); mCleanButton.setEnabled(true); } }
public void onGroupExpanded(int groupPosition) { // collapse the old expanded group, if not the same // as new group to expand if (groupPosition != lastExpandedGroupPosition) { this.expandableListView.collapseGroup(lastExpandedGroupPosition); } super.onGroupExpanded(groupPosition); lastExpandedGroupPosition = groupPosition; }
private void dealWithHttpReturned(String result) { Gson gson = new Gson(); AcademyResult r = gson.fromJson(result, AcademyResult.class); String resultCode = r.getResult().getErrorcode(); if (HttpResult.SUCCESS.equals(resultCode)) { List<AcademyClass> academyClasses = r.getAcademys(); mItems.addAll(academyClasses); mAdapter.notifyDataSetChanged(); } else if (HttpResult.FAIL.equals(resultCode)) { } else { Toaster.showShort(AcademyActivity.this, "请求出错,请重试"); } }
private void checkCleanFinish() { if (mIsProcessCleanFinish && mIsSysCacheCleanFinish && mIsOverallCleanFinish) { mHeaderView.mProgress.setText("清理完成"); mHeaderView.mSize.setText(CleanUtil.formatShortFileSize(this, 0L)); for (JunkGroup group : mJunkGroups.values()) { group.mSize = 0L; group.mChildren = null; } mAdapter.notifyDataSetChanged(); } }
@Override public void onGroupExpanded(int groupPosition) { // collapse the old expanded group, if not the same // as new group to expand Activity mActivity = (Activity) context; ExpandableListView listView = (ExpandableListView) mActivity.findViewById(R.id.exlvHomeListView); if (groupPosition != lastExpandedGroupPosition) { listView.collapseGroup(lastExpandedGroupPosition); } super.onGroupExpanded(groupPosition); lastExpandedGroupPosition = groupPosition; }
@Override public void onGroupExpanded(int groupPosition) { super.onGroupExpanded(groupPosition); if (groupItem.get(groupPosition).isRead() == false) { // Mark the item read if (Constants.LOGD) Log.e(groupItem.get(groupPosition).getGuid(), "check"); groupItem.get(groupPosition).setRead(true); mCallBack = (OnGroupClickListener) ((Activity) context); mCallBack.OnGroupClick(groupPosition, groupItem.get(groupPosition).getGuid(), "read"); // Only one groupview is expanded at one time. If another groupview was expanded, the current // one needs to be collapsed /* ExpandableListView mExpandableListVew=((ExpandableListActivity)context).getExpandableListView(); if (expandedArticle>0&&mExpandableListVew.isGroupExpanded(expandedArticle)){ mExpandableListVew.collapseGroup(expandedArticle); } expandedArticle=groupPosition; */ } }
@Override public void onGroupExpanded(int groupPosition) { super.onGroupExpanded(groupPosition); }
@Override public void onGroupCollapsed(int groupPosition) { super.onGroupCollapsed(groupPosition); }
@Override public void notifyDataSetChanged() { // Refresh List rows super.notifyDataSetChanged(); }
@Override protected void finalize() throws Throwable { super.finalize(); }
@Override public void notifyDataSetChanged() { super.notifyDataSetChanged(); }
@Override public void notifyDataSetInvalidated() { super.notifyDataSetInvalidated(); }
@Override public void unregisterDataSetObserver(DataSetObserver observer) { super.unregisterDataSetObserver(observer); }