当前位置: 首页>>代码示例>>Java>>正文


Java StaggeredGridLayoutManager.HORIZONTAL属性代码示例

本文整理汇总了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;
}
 
开发者ID:dkzwm,项目名称:SmoothRefreshLayout,代码行数:26,代码来源:BoundaryUtil.java

示例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;

    }

}
 
开发者ID:liusmallpig,项目名称:LowRecyclerView,代码行数:25,代码来源:RecyclerViewUtils.java

示例4: initStaggerAdapterH

private void initStaggerAdapterH(){
    StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL);
    mRv.setLayoutManager(layoutManager);
    mRv.setAdapter(mStaggerAdapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:RecyclerViewActivity1.java


注:本文中的android.support.v7.widget.StaggeredGridLayoutManager.HORIZONTAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。