本文整理汇总了Java中android.widget.ExpandableListView.setId方法的典型用法代码示例。如果您正苦于以下问题:Java ExpandableListView.setId方法的具体用法?Java ExpandableListView.setId怎么用?Java ExpandableListView.setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ExpandableListView
的用法示例。
在下文中一共展示了ExpandableListView.setId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRefreshableView
import android.widget.ExpandableListView; //导入方法依赖的package包/类
@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
final ExpandableListView lv;
if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
lv = new InternalExpandableListViewSDK9(context, attrs);
} else {
lv = new InternalExpandableListView(context, attrs);
}
// Set it to this so it can be used in ListActivity/ListFragment
lv.setId(android.R.id.list);
return lv;
}
示例2: createRefreshableView
import android.widget.ExpandableListView; //导入方法依赖的package包/类
protected final ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
ExpandableListView lv;
if (VERSION.SDK_INT >= 9) {
lv = new InternalExpandableListViewSDK9(this, context, attrs);
} else {
lv = new InternalExpandableListView(this, context, attrs);
}
lv.setLayoutParams(new LayoutParams(-1, -1));
int mode = getMode();
String pullLabel = context.getString(2131100695);
String refreshingLabel = context.getString(2131100699);
String releaseLabel = context.getString(2131100700);
if (mode == 1 || mode == 3) {
this.mLvHeaderLoadingFrame = new FrameLayout(context);
this.mHeaderLoadingView = new PullToRefreshHeaderView(context, 1, releaseLabel, pullLabel, refreshingLabel, new Object[0]);
this.mLvHeaderLoadingFrame.addView(this.mHeaderLoadingView, -1, (int) ((60.0f * getResources().getDisplayMetrics().density) + 0.5f));
this.mHeaderLoadingView.setVisibility(8);
lv.addHeaderView(this.mLvHeaderLoadingFrame, null, false);
}
if (mode == 2 || mode == 3) {
this.mLvFooterLoadingFrame = new FrameLayout(context);
this.mFooterLoadingView = new PullToRefreshHeaderView(context, 2, releaseLabel, pullLabel, refreshingLabel, new Object[0]);
this.mLvFooterLoadingFrame.addView(this.mFooterLoadingView, -1, -2);
this.mFooterLoadingView.setVisibility(8);
}
lv.setId(16908293);
return lv;
}
示例3: createRefreshableView
import android.widget.ExpandableListView; //导入方法依赖的package包/类
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
ExpandableListView lv;
if (VERSION.SDK_INT >= 9) {
lv = new InternalExpandableListViewSDK9(context, attrs);
} else {
lv = new InternalExpandableListView(context, attrs);
}
lv.setId(16908298);
return lv;
}
示例4: onCreateView
import android.widget.ExpandableListView; //导入方法依赖的package包/类
/**
* Provide default implementation to return a simple list view. Subclasses
* can override to replace with their own layout. If doing so, the
* returned view hierarchy <em>must</em> have a ListView whose id
* is {@link android.R.id#list android.R.id.list} and can optionally
* have a sibling view id {@link android.R.id#empty android.R.id.empty}
* that is to be shown when the list is empty.
*
* <p>If you are overriding this method with your own custom content,
* consider including the standard layout {@link android.R.layout#list_content}
* in your layout file, so that you continue to retain all of the standard
* behavior of ListFragment. In particular, this is currently the only
* way to have the built-in indeterminant progress state be shown.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final Context context = getActivity();
FrameLayout root = new FrameLayout(context);
// ------------------------------------------------------------------
LinearLayout pframe = new LinearLayout(context);
pframe.setId(INTERNAL_PROGRESS_CONTAINER_ID);
pframe.setOrientation(LinearLayout.VERTICAL);
pframe.setVisibility(View.GONE);
pframe.setGravity(Gravity.CENTER);
ProgressBar progress = new ProgressBar(context, null,
android.R.attr.progressBarStyleLarge);
pframe.addView(progress, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
root.addView(pframe, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
// ------------------------------------------------------------------
FrameLayout lframe = new FrameLayout(context);
lframe.setId(INTERNAL_LIST_CONTAINER_ID);
TextView tv = new TextView(getActivity());
tv.setId(INTERNAL_EMPTY_ID);
tv.setGravity(Gravity.CENTER);
lframe.addView(tv, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
ExpandableListView lv = new ExpandableListView(getActivity());
lv.setId(android.R.id.list);
lv.setDrawSelectorOnTop(false);
lframe.addView(lv, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
root.addView(lframe, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
// ------------------------------------------------------------------
root.setLayoutParams(new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
return root;
}