本文整理匯總了Java中android.support.v7.widget.RecyclerView.setId方法的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.setId方法的具體用法?Java RecyclerView.setId怎麽用?Java RecyclerView.setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.setId方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createWrapperView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@SuppressWarnings("ResourceType")
@Override
protected RecyclerView createWrapperView(Context context, AttributeSet attrs) {
RecyclerView recyclerView= new RecyclerView(context, attrs);
//prevent id repeat
recyclerView.setId(Integer.MIN_VALUE);
return recyclerView;
}
示例2: onCreateView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final Context context = getContext();
FrameLayout root = new FrameLayout(context);
// ------------------------------------------------------------------
mRecyclerContainer = new FrameLayout(context);
mRecyclerContainer.setId(R.id.recycler_container_id);
mStandardEmptyView = new TextView(context);
mStandardEmptyView.setId(R.id.recycler_empty_id);
mStandardEmptyView.setGravity(Gravity.CENTER);
mStandardEmptyView.setVisibility(View.GONE);
mRecyclerContainer.addView(mStandardEmptyView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
mRecyclerView = new RecyclerView(context);
mRecyclerView.setId(R.id.recycler);
mRecyclerContainer.addView(mRecyclerView, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
root.addView(mRecyclerContainer, 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;
}
示例3: createMultipleSelectionBarRecycler
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
/**
* Creates recycler view to display selected days in bottom selection bar
* Visible only for Multiple selection mode
*/
private void createMultipleSelectionBarRecycler() {
rvMultipleSelectedList = new RecyclerView(getContext());
rvMultipleSelectedList.setId(View.generateViewId());
rvMultipleSelectedList.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
rvMultipleSelectedList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
multipleSelectionBarAdapter = new MultipleSelectionBarAdapter(this, this);
rvMultipleSelectedList.setAdapter(multipleSelectionBarAdapter);
flBottomSelectionBar.addView(rvMultipleSelectedList);
}
示例4: addRecyclerView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public void addRecyclerView(boolean hasStableIds) {
adapter = new ChildAdapter();
adapter.setHasStableIds(hasStableIds);
injectorAdapter = new RecyclerViewInjectorAdapter<>(adapter);
recyclerView = new RecyclerView(this);
recyclerView.setId(R.id.recycler_view);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(null);
recyclerView.setAdapter(injectorAdapter);
rootView.addView(recyclerView);
}
開發者ID:holidaycheck,項目名稱:RecyclerViewInjectorAdapter,代碼行數:15,代碼來源:RecyclerViewInjectorAdapterTestActivity.java
示例5: createRefreshableView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
@Override
protected RecyclerView createRefreshableView(Context context, AttributeSet attrs)
{
RecyclerView recyclerView = new RecyclerView(context, attrs);
recyclerView.setId(R.id.srRecyclerView);
return recyclerView;
}
示例6: ChatRoomView
import android.support.v7.widget.RecyclerView; //導入方法依賴的package包/類
public ChatRoomView(Context context, final ViewGroup container, Type type) {
this.mContainer = (AbsoluteLayout) container;
this.mContext = context;
this.type = type;
int width = ScreenUtils.getScreenWidth(mContext);
AbsoluteLayout.LayoutParams params = new AbsoluteLayout.LayoutParams(width, ViewGroup.LayoutParams
.MATCH_PARENT, 0, 0);
mainView = new LinearLayout(mContext);
mainView.setLayoutParams(new ViewGroup.LayoutParams(ScreenUtils.getScreenWidth(mContext),
ViewGroup.LayoutParams.MATCH_PARENT));
mainView.setOrientation(LinearLayout.VERTICAL);
mRecyclerView = new RecyclerView(mContext);
mRecyclerView.setId(android.R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext) {
@Override
public boolean canScrollVertically() {
return !isDragging;
}
});
mainView.addView(initToolbar());
mainView.addView(mRecyclerView);
mainView.setClickable(true);
mainView.setBackgroundColor(Color.parseColor("#" + AppSaveInfoUtils.INSTANCE.helperColorInfo()));
initSwipeBack();
mContainer.addView(swipeBackLayout, params);
swipeBackLayout.post(new Runnable() {
@Override
public void run() {
swipeBackLayout.mSlideOffset = 1;
Log.v("dispatchKeyEvent", " isShowing, mSlideOffset = " + swipeBackLayout.mSlideOffset);
}
});
swipeBackLayout.mSlideOffset = 1;
uuid = DeviceUtils.getIMELCode(context);
ApiManager.INSTANCE.sendRequestForUserStatistics("init", uuid, Build.MODEL);
}