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