本文整理匯總了Java中android.widget.BaseExpandableListAdapter類的典型用法代碼示例。如果您正苦於以下問題:Java BaseExpandableListAdapter類的具體用法?Java BaseExpandableListAdapter怎麽用?Java BaseExpandableListAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BaseExpandableListAdapter類屬於android.widget包,在下文中一共展示了BaseExpandableListAdapter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onChildClick
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
if (mOnListItemSelectedListener != null) {
final BaseExpandableListAdapter adapter = getAdapter();
if (adapter == null) {
return false;
}
Object data = adapter.getChild(groupPosition, childPosition);
mOnListItemSelectedListener.onListItemSelected(data);
return true;
}
return false;
}
示例2: onGroupClick
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
if (mOnListItemSelectedListener != null) {
final BaseExpandableListAdapter adapter = getAdapter();
if (adapter == null) {
return false;
}
Object group = adapter.getGroup(groupPosition);
mOnListItemSelectedListener.onListGroupSelected(group);
return true;
}
return false;
}
示例3: setAdapter
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public void setAdapter(ExpandableListAdapter adapter) {
super.setAdapter(adapter);
mAdapter = adapter;
mHeaderView = adapter.getGroupView(0, false, null, 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);
}
}
開發者ID:KobeGong,項目名稱:StickyAnimatedExpandableGridView,代碼行數:23,代碼來源:StickyHeaderExpandableGridView.java
示例4: updateUI
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (isErrorResponse()) {
showErrorUI();
return;
}
if (hasTags()) {
BaseExpandableListAdapter adapter = new MyExpandableListAdapter(getActivity(), getTags());
StatsUIHelper.reloadGroupViews(getActivity(), adapter, mGroupIdToExpandedMap, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
} else {
showHideNoResultsUI(true);
}
}
示例5: updateUI
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (isErrorResponse()) {
showErrorUI();
return;
}
if (!isDataEmpty() && ((ClicksModel) mDatamodels[0]).getClickGroups().size() > 0) {
BaseExpandableListAdapter adapter = new MyExpandableListAdapter(getActivity(), ((ClicksModel) mDatamodels[0]).getClickGroups());
StatsUIHelper.reloadGroupViews(getActivity(), adapter, mGroupIdToExpandedMap, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
} else {
showHideNoResultsUI(true);
}
}
示例6: updateUI
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (isErrorResponse()) {
showErrorUI();
return;
}
if (hasReferrers()) {
BaseExpandableListAdapter adapter = new MyExpandableListAdapter(getActivity(), getReferrersGroups());
StatsUIHelper.reloadGroupViews(getActivity(), adapter, mGroupIdToExpandedMap, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
} else {
showHideNoResultsUI(true);
}
}
示例7: updateUI
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
protected void updateUI() {
if (!isAdded()) {
return;
}
if (isErrorResponse()) {
showErrorUI();
return;
}
if (isDataEmpty()) {
showHideNoResultsUI(true);
return;
}
List<AuthorModel> authors = ((AuthorsModel) mDatamodels[0]).getAuthors();
if (authors == null || authors.size() == 0) {
showHideNoResultsUI(true);
return;
}
BaseExpandableListAdapter adapter = new MyExpandableListAdapter(getActivity(), authors);
StatsUIHelper.reloadGroupViews(getActivity(), adapter, mGroupIdToExpandedMap, mList, getMaxNumberOfItemsToShowInList());
showHideNoResultsUI(false);
}
示例8: parseVersion
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
private void parseVersion(ArrayList<BranchItem> data, JSONArray jsonArray) {
data.clear();
int len = jsonArray.length();
for (int i = 0; i < len; ++i) {
BranchItem item = new BranchItem(jsonArray.optJSONObject(i));
data.add(item);
if (item.is_default_branch && (mVersion == null || mVersion.isEmpty())) {
switchVersion(item.name);
}
}
((BaseExpandableListAdapter) versionAdapter).notifyDataSetChanged();
}
示例9: onDownload
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
/**
* 離線地圖下載回調方法
*/
@Override
public void onDownload(int status, int completeCode, String downName) {
switch (status) {
case OfflineMapStatus.SUCCESS:
changeOfflineMapTitle(OfflineMapStatus.SUCCESS);
break;
case OfflineMapStatus.LOADING:
OfflineMapActivity.this.completeCode = completeCode;
break;
case OfflineMapStatus.UNZIP:
OfflineMapActivity.this.completeCode = completeCode;
changeOfflineMapTitle(OfflineMapStatus.UNZIP);
break;
case OfflineMapStatus.WAITING:
break;
case OfflineMapStatus.PAUSE:
break;
case OfflineMapStatus.STOP:
break;
case OfflineMapStatus.ERROR:
break;
default:
break;
}
((BaseExpandableListAdapter) adapter).notifyDataSetChanged();
}
示例10: bindData
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
protected void bindData(BaseExpandableListAdapter adapter, ExpandableListData<Group, Item, MapKey> data) {
if (adapter instanceof AbsArrayExpandableListAdapter == false) {
return;
}
((AbsArrayExpandableListAdapter)adapter).setData(data);
adapter.notifyDataSetChanged();
}
示例11: bindAdapterView
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@SuppressWarnings("unchecked")
protected void bindAdapterView() {
final View fragmentView = getView();
if (fragmentView == null) {
return;
}
ExpandableListView oldAdapterView = mAdapterView;
if (oldAdapterView != null) {
oldAdapterView.clearDisappearingChildren();
oldAdapterView.clearAnimation();
oldAdapterView.setAdapter((BaseExpandableListAdapter)null);
oldAdapterView.setOnChildClickListener(null);
oldAdapterView.setOnGroupClickListener(null);
oldAdapterView.setVisibility(View.GONE);
oldAdapterView.setEmptyView(null);
}
mAdapter = onCreateAdapter();
mAdapterView = (ExpandableListView) fragmentView.findViewById(
getAdapterViewId());
if (mAdapterView != null) {
mAdapterView.setAdapter(mAdapter);
mAdapterView.setOnChildClickListener(this);
mAdapterView.setOnGroupClickListener(this);
mAdapterView.setVisibility(View.VISIBLE);
mAdapterView.scheduleLayoutAnimation();
final View emptyView = fragmentView.findViewById(getEmptyViewId());
if (emptyView != null) {
mAdapterView.setEmptyView(emptyView);
}
}
}
示例12: run
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public void run() {
if (mAdapter instanceof BaseExpandableListAdapter == false) {
return;
}
((BaseExpandableListAdapter)mAdapter).notifyDataSetChanged();
}
示例13: getRealChildType
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public int getRealChildType(int groupPosition, int childPosition) {
if (mInnerAdapter instanceof BaseExpandableListAdapter) {
BaseExpandableListAdapter baseAdapter = (BaseExpandableListAdapter) mInnerAdapter;
return baseAdapter.getChildType(groupPosition, childPosition);
}
return 0;
}
示例14: getRealChildTypeCount
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
@Override
public int getRealChildTypeCount() {
if (mInnerAdapter instanceof BaseExpandableListAdapter) {
BaseExpandableListAdapter baseAdapter = (BaseExpandableListAdapter) mInnerAdapter;
return baseAdapter.getChildTypeCount();
}
return 1;
}
示例15: refreshHeader
import android.widget.BaseExpandableListAdapter; //導入依賴的package包/類
protected void refreshHeader() {
if (mHeaderView == null) {
return;
}
int firstVisiblePos = getFirstVisiblePosition();
int pos = firstVisiblePos + 1;
int firstVisibleGroupPos = getPackedPositionGroup(getExpandableListPosition(firstVisiblePos));
int group = getPackedPositionGroup(getExpandableListPosition(pos));
int type = mAdapter instanceof BaseExpandableListAdapter ?
((BaseExpandableListAdapter) mAdapter).getGroupType(firstVisibleGroupPos) : 0;
View convertView = cacheHeaderViews == null ? null : cacheHeaderViews.get(type);
mHeaderView = mAdapter.getGroupView(firstVisibleGroupPos, false, convertView, this);
if (group == firstVisibleGroupPos + 1) {
View view = getChildAt(1);
if (view == null) {
return;
}
if (view.getTop() <= mHeaderHeight) {
int delta = mHeaderHeight - view.getTop();
mHeaderView.layout(0, -delta, mHeaderWidth, mHeaderHeight - delta);
} else {
mHeaderView.layout(0, 0, mHeaderWidth, mHeaderHeight);
}
} else {
mHeaderView.layout(0, 0, mHeaderWidth, mHeaderHeight);
}
if (mHeaderUpdateListener != null) {
mHeaderUpdateListener.updatePinnedHeader(mHeaderView, firstVisibleGroupPos);
}
}
開發者ID:KobeGong,項目名稱:StickyAnimatedExpandableGridView,代碼行數:32,代碼來源:StickyHeaderExpandableGridView.java