use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class RecyclerViewActivity method getRecyclerView.
public RecyclerView getRecyclerView() {
if (rv == null) {
rv = new RecyclerView(this);
rv.setHasFixedSize(true);
setContentView(rv);
}
return (rv);
}
use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class RecyclerViewActivity method getRecyclerView.
public RecyclerView getRecyclerView() {
if (rv == null) {
rv = new RecyclerView(this);
rv.setHasFixedSize(true);
setContentView(rv);
}
return (rv);
}
use of android.support.v7.widget.RecyclerView in project cw-omnibus by commonsguy.
the class RecyclerViewActivity method getRecyclerView.
public RecyclerView getRecyclerView() {
if (rv == null) {
rv = new RecyclerView(this);
rv.setHasFixedSize(true);
setContentView(rv);
}
return (rv);
}
use of android.support.v7.widget.RecyclerView in project UltimateAndroid by cymcsg.
the class SnackbarRecyclerViewSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.snack_bar_activity_recyclerview_sample);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mRecyclerView = (RecyclerView) findViewById(android.R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
List<String> data = new ArrayList<String>();
for (int i = 0; i < 25; i++) {
data.add(String.format("Item %d", (i + 1)));
}
SimpleDataAdapter adapter = new SimpleDataAdapter(android.R.layout.simple_list_item_1, data, this);
mRecyclerView.setAdapter(adapter);
}
use of android.support.v7.widget.RecyclerView in project GeekNews by codeestX.
the class WechatMainFragment method initEventAndData.
@Override
protected void initEventAndData() {
mList = new ArrayList<>();
mAdapter = new WechatAdapter(mContext, mList);
rvWechatList.setLayoutManager(new LinearLayoutManager(mContext));
rvWechatList.setAdapter(mAdapter);
rvWechatList.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
int lastVisibleItem = ((LinearLayoutManager) rvWechatList.getLayoutManager()).findLastVisibleItemPosition();
int totalItemCount = rvWechatList.getLayoutManager().getItemCount();
if (lastVisibleItem >= totalItemCount - 2 && dy > 0) {
//还剩2个Item时加载更多
if (!isLoadingMore) {
isLoadingMore = true;
mPresenter.getMoreWechatData();
}
}
}
});
swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
mPresenter.getWechatData();
}
});
ivProgress.start();
mPresenter.getWechatData();
}
Aggregations