本文整理匯總了Java中android.support.v7.widget.StaggeredGridLayoutManager.HORIZONTAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java StaggeredGridLayoutManager.HORIZONTAL屬性的具體用法?Java StaggeredGridLayoutManager.HORIZONTAL怎麽用?Java StaggeredGridLayoutManager.HORIZONTAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v7.widget.StaggeredGridLayoutManager
的用法示例。
在下文中一共展示了StaggeredGridLayoutManager.HORIZONTAL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isHorizontalView
private static boolean isHorizontalView(View view) {
if (view instanceof ViewPager || view instanceof HorizontalScrollView
|| view instanceof WebView) {
return true;
}
try {
if (view instanceof RecyclerView) {
RecyclerView recyclerView = (RecyclerView) view;
RecyclerView.LayoutManager manager = recyclerView.getLayoutManager();
if (manager != null) {
if (manager instanceof LinearLayoutManager) {
LinearLayoutManager linearManager = ((LinearLayoutManager) manager);
if (linearManager.getOrientation() == LinearLayoutManager.HORIZONTAL)
return true;
} else if (manager instanceof StaggeredGridLayoutManager) {
StaggeredGridLayoutManager gridLayoutManager = (StaggeredGridLayoutManager) manager;
if (gridLayoutManager.getOrientation() == StaggeredGridLayoutManager.HORIZONTAL)
return true;
}
}
}
} catch (NoClassDefFoundError e) {
e.printStackTrace();
}
return false;
}
示例2: onCreate
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler_view);
ButterKnife.bind(this);
toolbar.setTitle("Staggered Horizontal");
toolbar.setNavigationOnClickListener(new NavigationFinishClickListener(this));
new OptionViewHolder(this, recyclerView, OptionViewHolder.ORIENTATION_HORIZONTAL);
StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.HORIZONTAL);
recyclerView.setLayoutManager(layoutManager);
new HorizontalHeader(this, recyclerView);
new HorizontalHeader(this, recyclerView);
new HorizontalFooter(this, recyclerView);
new HorizontalFooter(this, recyclerView);
StaggeredHorizontalAdapter adapter = new StaggeredHorizontalAdapter(this);
adapter.getIllustList().addAll(ApiClient.buildIllustList());
recyclerView.setAdapter(adapter);
}
開發者ID:TakWolf,項目名稱:Android-HeaderAndFooterRecyclerView,代碼行數:23,代碼來源:StaggeredHorizontalActivity.java
示例3: setRecyclerStlty
private void setRecyclerStlty() {
switch (mAdapter.getmStyle()) {
case ListView:
case HorizontalListView:
setLView();
break;
case GridView:
case HorizontalGridView:
setGView();
break;
case WaterFall:
StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(mNunColumns, StaggeredGridLayoutManager.VERTICAL);
mRecyclerView.setLayoutManager(manager);
break;
case HorizontalWaterFall:
StaggeredGridLayoutManager manager1 = new StaggeredGridLayoutManager(mNunColumns, StaggeredGridLayoutManager.HORIZONTAL);
mRecyclerView.setLayoutManager(manager1);
break;
case MultiLayout:
//多布局暫未實現
break;
}
}
示例4: initStaggerAdapterH
private void initStaggerAdapterH(){
StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL);
mRv.setLayoutManager(layoutManager);
mRv.setAdapter(mStaggerAdapter);
}