當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。