GridRvActivity.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:SwipeMenuRecyclerView-master 作者:
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_list);
    mContext = this;
    users = getUsers();
    swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipeRefreshLayout);
    swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            Toast.makeText(mContext, "Refresh success", Toast.LENGTH_LONG).show();
            swipeRefreshLayout.setRefreshing(false);
        }
    });
    mRecyclerView = (SwipeMenuRecyclerView) findViewById(R.id.listView);
    mRecyclerView.addItemDecoration(new GridSpaceItemDecoration(3, 3));
    mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
    mRecyclerView.setOpenInterpolator(new BounceInterpolator());
    mRecyclerView.setCloseInterpolator(new BounceInterpolator());
    mAdapter = new AppAdapter(this, users);
    mRecyclerView.setAdapter(mAdapter);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号