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


Java XRecyclerView.setLayoutManager方法代码示例

本文整理汇总了Java中com.jcodecraeer.xrecyclerview.XRecyclerView.setLayoutManager方法的典型用法代码示例。如果您正苦于以下问题:Java XRecyclerView.setLayoutManager方法的具体用法?Java XRecyclerView.setLayoutManager怎么用?Java XRecyclerView.setLayoutManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jcodecraeer.xrecyclerview.XRecyclerView的用法示例。


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

示例1: initView

import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
private void initView() {
    mDatas = new ArrayList<>();
    mRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.srl_refresh);
    mRecyclerView = (XRecyclerView) findViewById(R.id.base_recycler_view);
    mSearchBtn = (FloatingActionButton) findViewById(R.id.fanju_new_btn_search);
    LinearLayoutManager layoutManager = new LinearLayoutManager(this);
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    mRecyclerView.setLayoutManager(layoutManager);
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mRecyclerView.setPullRefreshEnabled(false);
    mRecyclerView.setLoadingMoreEnabled(false);

    mSearchBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            showSearchDialog();
        }
    });

}
 
开发者ID:henryblue,项目名称:TeaCup,代码行数:21,代码来源:FanjuNewsActivity.java

示例2: setLinearLayout

import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
public void setLinearLayout(Context context, XRecyclerView mRecy) {
        LinearLayoutManager layoutManager = new LinearLayoutManager(context);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);

        mRecy.setLayoutManager(layoutManager);
        //设置分隔线
//        mRecy.addItemDecoration(new SpacesItemDecoration(1));
        mRecy.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
        mRecy.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
        mRecy.setArrowImageView(R.drawable.abc_icon_down_arrow);
    }
 
开发者ID:Alex-Jerry,项目名称:LLApp,代码行数:12,代码来源:XRecyclerViewHelper.java

示例3: onCreate

import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_route);
        setStatusBar();
        routeRecyclerView = (XRecyclerView) findViewById(R.id.recyclerview_route);
        no_route = (TextView) findViewById(R.id.no_route);
        routeRecyclerView.setLayoutManager(new LinearLayoutManager(this));

//        routeList = getAllPoints();
        routeList = new ArrayList<RouteRecord>();

        RouteDBHelper helper = new RouteDBHelper(this);
        db = helper.getWritableDatabase();
        itemCount = getItemCount();
        routeList = loadPage();
        if (routeList != null) {
            routeAdapter = new MyRouteAdapter(this, routeList);
            routeRecyclerView.setAdapter(routeAdapter);
            routeRecyclerView.addItemDecoration(new MyRouteDividerDecoration(10));
            routeAdapter.setOnClickListener(this);
        }else{
            no_route.setVisibility(View.VISIBLE);
        }

        routeRecyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
        routeRecyclerView.setLoadingMoreProgressStyle(ProgressStyle.BallScale);
        routeRecyclerView.setArrowImageView(R.drawable.iconfont_downgrey);
        routeRecyclerView.setPullRefreshEnabled(false);
//        View header = LayoutInflater.from(this).inflate(R.layout.recyclerview_header, (ViewGroup)findViewById(android.R.id.content),false);
//        routeRecyclerView.addHeaderView(header);

        routeRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
            @Override
            public void onRefresh() {
//                Toast.makeText(MyRouteActivity.this, "onRefresh", Toast.LENGTH_SHORT).show();
                routeRecyclerView.refreshComplete();
            }

            @Override
            public void onLoadMore() {
//                Toast.makeText(MyRouteActivity.this, "onLoadMore", Toast.LENGTH_SHORT).show();
                loadPage();
                routeRecyclerView.loadMoreComplete();
                routeAdapter.notifyDataSetChanged();
            }
        });
    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:48,代码来源:MyRouteActivity.java

示例4: setupRecycleView

import com.jcodecraeer.xrecyclerview.XRecyclerView; //导入方法依赖的package包/类
private void setupRecycleView() {
    recyclerView = (XRecyclerView) findViewById(R.id.base_recycler_view);
    if (recyclerView != null) {
        recyclerView.setHasFixedSize(true);
    }
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(FindBookActivity.this);
    mLayoutManager.setOrientation(OrientationHelper.VERTICAL);
    recyclerView.setLayoutManager(mLayoutManager);
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setLoadingMoreEnabled(false);
    recyclerView.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
    recyclerView.setLoadingListener(new XRecyclerView.LoadingListener() {
        @Override
        public void onRefresh() {
            sendParseDataMessage(REFRESH_START);
        }

        @Override
        public void onLoadMore() {

        }
    });

    mAdapter = new FindRecycleAdapter(this, mDatas);
    mAdapter.setOnItemClickListener(new FindRecycleAdapter.OnItemClickListener() {
        @Override
        public void onItemClick(View view, int position) {
            Intent intent = new Intent(FindBookActivity.this, BookDetailActivity.class);
            intent.putExtra("book", mDatas.get(position));

            ActivityOptionsCompat options =
                    ActivityOptionsCompat.makeSceneTransitionAnimation(FindBookActivity.this,
                            view.findViewById(R.id.iv_book_img),
                            getString(R.string.transition_book_img));

            ActivityCompat.startActivity(FindBookActivity.this, intent, options.toBundle());
        }
    });

    recyclerView.setAdapter(mAdapter);
}
 
开发者ID:henryblue,项目名称:TeaCup,代码行数:42,代码来源:FindBookActivity.java


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