@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);
}
GridRvActivity.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:SwipeMenuRecyclerView-master
作者:
评论列表
文章目录