本文整理汇总了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