use of com.funstill.kelefun.adapter.StatusAdapter in project keleFanfou by kelefun.
the class FavouriteStatusListFragment method initView.
protected void initView(View view) {
SwipeRefreshLayout mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.line_swipe_refresh);
// 禁用下拉刷新
mRefreshLayout.setEnabled(false);
mRecyclerView = (RecyclerView) view.findViewById(R.id.line_recycler);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new StatusAdapter(getActivity(), data);
mRecyclerView.setAdapter(mAdapter);
Map<String, String> map = new ArrayMap<>();
map.put("id", tuserId);
map.put("page", "1");
getUserTimeLineStatus(map);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE && (mLayoutManager.findLastVisibleItemPosition() + 1 == mLayoutManager.getItemCount()) && !isLoadingMore) {
isLoadingMore = true;
if (data.size() > 0) {
Map<String, String> loadMoreParam = new ArrayMap<>();
loadMoreParam.put("max_id", data.get(data.size() - 1).getId());
loadMoreParam.put("count", "20");
loadMoreParam.put("id", tuserId);
loadMoreHomeLineStatus(loadMoreParam);
}
}
}
});
}
use of com.funstill.kelefun.adapter.StatusAdapter in project keleFanfou by kelefun.
the class MentionsPagerFragment method initView.
private void initView(View view) {
mRecyclerView = (RecyclerView) view.findViewById(R.id.line_recycler);
mLayoutManager = new LinearLayoutManager(_mActivity);
mRecyclerView.setLayoutManager(mLayoutManager);
mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.no_toolbar_swipe_refresh);
mRefreshLayout.setColorSchemeResources(R.color.colorPrimary, R.color.colorOrange, R.color.colorRed);
mRefreshLayout.setOnRefreshListener(this);
mRefreshLayout.post(() -> mRefreshLayout.setRefreshing(true));
mAdapter = new StatusAdapter(getActivity(), data);
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
mScrollTotal += dy;
mInAtTop = mScrollTotal <= 0;
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE && (mLayoutManager.findLastVisibleItemPosition() + 1 == mLayoutManager.getItemCount()) && !isLoadingMore) {
if (data.size() > 0) {
Map<String, String> loadMoreParam = new ArrayMap<>();
loadMoreParam.put("max_id", data.get(data.size() - 1).getId());
loadMoreParam.put("count", "20");
loadMoreMentions(loadMoreParam);
}
}
}
});
}
use of com.funstill.kelefun.adapter.StatusAdapter in project keleFanfou by kelefun.
the class StatusListFragment method initView.
protected void initView(View view) {
mRecyclerView = (RecyclerView) view.findViewById(R.id.line_recycler);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new StatusAdapter(getActivity(), data);
mRecyclerView.setAdapter(mAdapter);
if (getArguments() != null) {
tuserId = getArguments().getString(KelefunConst.USER_ID);
}
Map<String, String> map = new ArrayMap<>();
map.put("id", tuserId);
map.put("page", "1");
getUserTimeLineStatus(map);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE && (mLayoutManager.findLastVisibleItemPosition() + 1 == mLayoutManager.getItemCount()) && !isLoadingMore) {
isLoadingMore = true;
if (data.size() > 0) {
Map<String, String> loadMoreParam = new ArrayMap<>();
loadMoreParam.put("max_id", data.get(data.size() - 1).getId());
loadMoreParam.put("count", "20");
loadMoreParam.put("id", tuserId);
loadMoreHomeLineStatus(loadMoreParam);
}
}
}
});
}
use of com.funstill.kelefun.adapter.StatusAdapter in project keleFanfou by kelefun.
the class FavouriteStatusListFragment method initView.
protected void initView(View view) {
mRecyclerView = (RecyclerView) view.findViewById(R.id.line_recycler);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mAdapter = new StatusAdapter(getActivity(), data);
mRecyclerView.setAdapter(mAdapter);
if (getArguments() != null) {
tuserId = getArguments().getString(KelefunConst.USER_ID);
}
Map<String, String> map = new ArrayMap<>();
map.put("id", tuserId);
map.put("page", "1");
getFavourites(map);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE && (mLayoutManager.findLastVisibleItemPosition() + 1 == mLayoutManager.getItemCount()) && !isLoadingMore) {
isLoadingMore = true;
if (data.size() > 0) {
Map<String, String> loadMoreParam = new ArrayMap<>();
loadMoreParam.put("max_id", data.get(data.size() - 1).getId());
loadMoreParam.put("count", "20");
loadMoreParam.put("id", tuserId);
loadMoreFavouriteStatus(loadMoreParam);
}
}
}
});
}
use of com.funstill.kelefun.adapter.StatusAdapter in project keleFanfou by kelefun.
the class ExploreFragmentChild method initView.
private void initView(View view) {
mToolbar = (Toolbar) view.findViewById(R.id.toolbar);
mToolbar.setTitle("随便看看");
mRecyclerView = (RecyclerView) view.findViewById(R.id.line_recycler);
mLayoutManager = new LinearLayoutManager(_mActivity);
mRecyclerView.setLayoutManager(mLayoutManager);
mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.swipe_refresh);
mRefreshLayout.setColorSchemeResources(R.color.colorPrimary, R.color.colorOrange, R.color.colorRed);
mRefreshLayout.setOnRefreshListener(this);
mRefreshLayout.post(() -> mRefreshLayout.setRefreshing(true));
mAdapter = new StatusAdapter(getActivity(), data);
mRecyclerView.setAdapter(mAdapter);
// 初始化数据
Map<String, String> map = new ArrayMap<>();
map.put("count", "20");
getPublicTimeLineStatus(map);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
mScrollTotal += dy;
mInAtTop = mScrollTotal <= 0;
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
if (newState == RecyclerView.SCROLL_STATE_IDLE && (mLayoutManager.findLastVisibleItemPosition() + 1 == mLayoutManager.getItemCount()) && !isLoadingMore) {
isLoadingMore = true;
// 处理逻辑
if (data.size() > 0) {
Map<String, String> loadMoreParam = new ArrayMap<>();
loadMoreParam.put("max_id", data.get(data.size() - 1).getId());
loadMoreParam.put("count", "20");
loadMore(loadMoreParam);
}
}
}
});
}
Aggregations