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


Java StaggeredGridLayoutManager.VERTICAL属性代码示例

本文整理汇总了Java中android.support.v7.widget.StaggeredGridLayoutManager.VERTICAL属性的典型用法代码示例。如果您正苦于以下问题:Java StaggeredGridLayoutManager.VERTICAL属性的具体用法?Java StaggeredGridLayoutManager.VERTICAL怎么用?Java StaggeredGridLayoutManager.VERTICAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v7.widget.StaggeredGridLayoutManager的用法示例。


在下文中一共展示了StaggeredGridLayoutManager.VERTICAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateView

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View views = inflater.inflate(R.layout.fragment_base_view, container, false);
    unbinder = ButterKnife.bind(this,views);
    progressLayout.showLoading();
    swipeRefreshLayout.setOnRefreshListener(this);
    recyclerView.setHasFixedSize(true); //originally set to fixed size true
    mLayoutManager = new StaggeredGridLayoutManager(getResources().getInteger(R.integer.card_col_size_home), StaggeredGridLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(mLayoutManager);
    if(savedInstanceState != null) {
        model_user = savedInstanceState.getString(MODEL_USER);
        model_type = savedInstanceState.getString(MODEL_TYPE);
    }
    return views;
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:16,代码来源:UserStatusFragment.java

示例2: onInit

private void onInit() {
    mCurrentUser = mPresenter.getCurrentUser();
    loaderManager = getLoaderManager();
    swipeRefreshLayout.setOnRefreshListener(this);
    recyclerView.setHasFixedSize(true); //originally set to fixed size true
    recyclerView.setNestedScrollingEnabled(false); //set to false if somethings fail to work properly
    mLayoutManager = new StaggeredGridLayoutManager(getResources().getInteger(R.integer.card_col_size_home), StaggeredGridLayoutManager.VERTICAL);
    recyclerView.setLayoutManager(mLayoutManager);
    mActivityOrigin.setHasFixedSize(true);
    mActivityOrigin.setNestedScrollingEnabled(false);

    View bottomSheet = new BottomSheetBuilder(this, coordinatorLayout)
            .setMode(BottomSheetBuilder.MODE_GRID)
            .setBackgroundColorResource(R.color.colorDarkKnight)
            .setItemTextColorResource(R.color.white)
            .setMenu(R.menu.menu_attachments)
            .setItemClickListener(this).createView();

    mBehavior = BottomSheetBehavior.from(bottomSheet);
    mBehavior.setBottomSheetCallback(null);
    updateUI();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:22,代码来源:UserReplyActivity.java

示例3: isLastRow

private boolean isLastRow(RecyclerView parent, int pos, int rowCount, int childCount) {
    RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager) {
        childCount = childCount - childCount % rowCount;
        if (pos >= childCount) { // 如果是最后一行,则不需要绘制底部分割线
            return true;
        }
    } else if (layoutManager instanceof StaggeredGridLayoutManager) {
        int orientation = ((StaggeredGridLayoutManager) layoutManager).getOrientation();
        if (orientation == StaggeredGridLayoutManager.VERTICAL) {
            childCount = childCount - childCount % rowCount;
            if (pos >= childCount) { // 如果是最后一行,则不需要绘制底部分割线
                return true;
            }
        } else {
            if ((pos + 1) % rowCount == 0) { // 如果是最后一行,则不需要绘制底部分割线
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:ymqq,项目名称:CommonFramework,代码行数:22,代码来源:DividerGridItemDecoration.java

示例4: initView

@Override
public void initView(Bundle savedInstanceState) {
    getBinding().setFrag(this);
    getBinding().swipeRefreshGirl.setColorSchemeColors(Color.parseColor("#515151"));
    mAdapter = new GirlRecyclerAdapter(getActivity());
    getBinding().recyclerGirl.setAdapter(mAdapter);
    StaggeredGridLayoutManager staggeredGridLayoutManager
            = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
    getBinding().recyclerGirl.setLayoutManager(staggeredGridLayoutManager);
    getBinding().recyclerGirl.setOnScrollListener(new LoadMoreRecyclerOnScrollListener(staggeredGridLayoutManager) {
        @Override
        public void onLoadMore(int current_page) {
            mCurrentPage = current_page;
            loadMore(current_page);
        }
    });
    getBinding().swipeRefreshGirl.setOnRefreshListener(this);
    getBinding().swipeRefreshGirl.setRefreshing(true);
    onRefresh();

}
 
开发者ID:wheat7,项目名称:Cashew,代码行数:21,代码来源:GirlFragment.java

示例5: isLastColum

private boolean isLastColum(RecyclerView parent, int pos, int spanCount,
                            int childCount) {
    LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager) {
        if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
        {
            return true;
        }
    } else if (layoutManager instanceof StaggeredGridLayoutManager) {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        if (orientation == StaggeredGridLayoutManager.VERTICAL) {
            if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
            {
                return true;
            }
        } else {
            childCount = childCount - childCount % spanCount;
            if (pos >= childCount)// 如果是最后一列,则不需要绘制右边
                return true;
        }
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:24,代码来源:DividerGridItemDecoration.java

示例6: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount, int childCount) {
    LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager) {
        childCount = childCount - childCount % spanCount;
        if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
            return true;
    } else if (layoutManager instanceof StaggeredGridLayoutManager) {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        // StaggeredGridLayoutManager 且纵向滚动
        if (orientation == StaggeredGridLayoutManager.VERTICAL) {
            childCount = childCount - childCount % spanCount;
            // 如果是最后一行,则不需要绘制底部
            if (pos >= childCount)
                return true;
        } else
        // StaggeredGridLayoutManager 且横向滚动
        {
            // 如果是最后一行,则不需要绘制底部
            if ((pos + 1) % spanCount == 0) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:OCNYang,项目名称:RecyclerViewEvent,代码行数:26,代码来源:DividerGridItemDecoration.java

示例7: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
                          int childCount)
{
    RecyclerView.LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager)
    {
        childCount = childCount - childCount % spanCount;
        if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
            return true;
    } else if (layoutManager instanceof StaggeredGridLayoutManager)
    {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        // StaggeredGridLayoutManager 且纵向滚动
        if (orientation == StaggeredGridLayoutManager.VERTICAL)
        {
            childCount = childCount - childCount % spanCount;
            // 如果是最后一行,则不需要绘制底部
            if (pos >= childCount)
                return true;
        } else
        // StaggeredGridLayoutManager 且横向滚动
        {
            // 如果是最后一行,则不需要绘制底部
            if ((pos + 1) % spanCount == 0)
            {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:DividerGridItemDecoration.java

示例8: initView

@Override
protected void initView() {
    setToolbar(false);
    StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
    mAdapter = new GirlsListAdapter(this);
    mRecyclerView.setLayoutManager(layoutManager);
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.addOnScrollListener(getOnBottomListener(layoutManager));
    mRefreshLayout.setOnRefreshListener(() -> {
        mPage = 1;
        loadFromNet(true);
    });
}
 
开发者ID:weixianshishen,项目名称:BeautifulGirls,代码行数:13,代码来源:MainActivity.java

示例9: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
                          int childCount) {
    LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager) {
        childCount = childCount - childCount % spanCount;
        if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
            return true;
    } else if (layoutManager instanceof StaggeredGridLayoutManager) {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        // StaggeredGridLayoutManager 且纵向滚动
        if (orientation == StaggeredGridLayoutManager.VERTICAL) {
            childCount = childCount - childCount % spanCount;
            // 如果是最后一行,则不需要绘制底部
            if (pos >= childCount)
                return true;
        } else
        // StaggeredGridLayoutManager 且横向滚动
        {
            // 如果是最后一行,则不需要绘制底部
            if ((pos + 1) % spanCount == 0) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:DividerGridItemDecoration.java

示例10: isLastColum

private boolean isLastColum(RecyclerView parent, int pos, int spanCount, int childCount)
{
	LayoutManager layoutManager = parent.getLayoutManager();
	if (layoutManager instanceof GridLayoutManager)
	{
		if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
		{
			return true;
		}
	}
	else if (layoutManager instanceof StaggeredGridLayoutManager)
	{
		int orientation = ((StaggeredGridLayoutManager) layoutManager).getOrientation();
		if (orientation == StaggeredGridLayoutManager.VERTICAL)
		{
			if ((pos + 1) % spanCount == 0)// 如果是最后一列,则不需要绘制右边
			{
				return true;
			}
		}
		else
		{
			childCount = childCount - childCount % spanCount;
			if (pos >= childCount)// 如果是最后一列,则不需要绘制右边
				return true;
		}
	}
	
	return false;
}
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:30,代码来源:DividerGridItemDecoration.java

示例11: onCreateView

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_videos, container, false);
    RecyclerView recyclerView = root.findViewById(R.id.recycler_view);

    mSwipeRefreshLayout = root.findViewById(R.id.refresh);
    mSwipeRefreshLayout.setOnRefreshListener(() -> getPresenter().fireRefresh());

    ViewUtils.setupSwipeRefreshLayoutWithCurrentTheme(getActivity(), mSwipeRefreshLayout);

    mEmpty = root.findViewById(R.id.empty);

    int columns = getContext().getResources().getInteger(R.integer.videos_column_count);
    StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(columns, StaggeredGridLayoutManager.VERTICAL);

    recyclerView.setLayoutManager(manager);
    recyclerView.addOnScrollListener(new PicassoPauseOnScrollListener(VideoAlbumsNewAdapter.PICASSO_TAG));
    recyclerView.addOnScrollListener(new EndlessRecyclerOnScrollListener() {
        @Override
        public void onScrollToLastElement() {
            getPresenter().fireScrollToLast();
        }
    });

    mAdapter = new VideoAlbumsNewAdapter(getActivity(), Collections.emptyList());
    mAdapter.setListener(this);
    recyclerView.setAdapter(mAdapter);

    resolveEmptyTextVisibility();
    return root;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:31,代码来源:VideoAlbumsFragment.java

示例12: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
                          int childCount) {
    LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager) {
        childCount = childCount - childCount % spanCount;
        if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
            return true;
    } else if (layoutManager instanceof StaggeredGridLayoutManager) {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        // StaggeredGridLayoutManager 且纵向滚动
        if (orientation == StaggeredGridLayoutManager.VERTICAL) {
            childCount = childCount - childCount % spanCount + 1;
            // 如果是最后一行,则不需要绘制底部
            if (pos >= childCount)
                return true;
        } else
        // StaggeredGridLayoutManager 且横向滚动
        {
            // 如果是最后一行,则不需要绘制底部
            if ((pos + 1) % spanCount == 0) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:27,代码来源:DividerGridItemDecoration.java

示例13: setLayoutManager

private void setLayoutManager(RecyclerView recyclerView) {
        final StaggeredGridLayoutManager layoutManager = new StaggeredGridLayoutManager(SPAN_COUNT, StaggeredGridLayoutManager.VERTICAL);
        GridLayoutManager.SpanSizeLookup spanSizeLookup = new GridLayoutManager.SpanSizeLookup() {
            @Override
            public int getSpanSize(int position) {
                Object item = items.get(position);
                if (item instanceof Bean01) {
                    return 1;
                }
                if (item instanceof Bean02) {
                    return 1;
                }
                if (item instanceof Bean03) {
                    return SPAN_COUNT;
                }
                if (item instanceof Bean04) {
                    return SPAN_COUNT;
                }
                if (item instanceof String) {
                    return SPAN_COUNT;
                }
                return 1;
            }
        };
//        layoutManager.setSpanSizeLookup(spanSizeLookup);
//        layoutManager.setSpanCount(2);
        recyclerView.setLayoutManager(layoutManager);
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:WaterFallActivity.java

示例14: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
		int childCount)
{
	LayoutManager layoutManager = parent.getLayoutManager();
	if (layoutManager instanceof GridLayoutManager)
	{
		childCount = childCount - childCount % spanCount;
		if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
			return true;
	} else if (layoutManager instanceof StaggeredGridLayoutManager)
	{
		int orientation = ((StaggeredGridLayoutManager) layoutManager)
				.getOrientation();
		// StaggeredGridLayoutManager 且纵向滚动
		if (orientation == StaggeredGridLayoutManager.VERTICAL)
		{
			childCount = childCount - childCount % spanCount;
			// 如果是最后一行,则不需要绘制底部
			if (pos >= childCount)
				return true;
		} else
		// StaggeredGridLayoutManager 且横向滚动
		{
			// 如果是最后一行,则不需要绘制底部
			if ((pos + 1) % spanCount == 0)
			{
				return true;
			}
		}
	}
	return false;
}
 
开发者ID:henrymorgen,项目名称:android-advanced-light,代码行数:32,代码来源:DividerGridItemDecoration.java

示例15: isLastRaw

private boolean isLastRaw(RecyclerView parent, int pos, int spanCount,
                          int childCount)
{
    LayoutManager layoutManager = parent.getLayoutManager();
    if (layoutManager instanceof GridLayoutManager)
    {
        childCount = childCount - childCount % spanCount;
        if (pos >= childCount)// 如果是最后一行,则不需要绘制底部
            return true;
    } else if (layoutManager instanceof StaggeredGridLayoutManager)
    {
        int orientation = ((StaggeredGridLayoutManager) layoutManager)
                .getOrientation();
        // StaggeredGridLayoutManager 且纵向滚动
        if (orientation == StaggeredGridLayoutManager.VERTICAL)
        {
            childCount = childCount - childCount % spanCount;
            // 如果是最后一行,则不需要绘制底部
            if (pos >= childCount)
                return true;
        } else
        // StaggeredGridLayoutManager 且横向滚动
        {
            // 如果是最后一行,则不需要绘制底部
            if ((pos + 1) % spanCount == 0)
            {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:HStanN,项目名称:TakeRest,代码行数:32,代码来源:DividerGridItemDecoration.java


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