use of com.chad.library.adapter.base.BaseQuickAdapter in project VerticalCalendar by mzyq.
the class CalendarView method initRecyclerView.
/**
* 初始化RecyclerView
*/
private void initRecyclerView() {
recyclerView.setLayoutManager(new MLinearLayoutManager(getContext()));
calendarAdapter = new CalendarAdapter(getContext(), R.layout.item_month, monthList);
recyclerView.setAdapter(calendarAdapter);
recyclerView.addOnItemTouchListener(new OnItemChildClickListener() {
@Override
public void onSimpleItemChildClick(BaseQuickAdapter adapter, View view, int position) {
if (view.getId() == R.id.rvMonth) {
rvPosition = position;
}
}
});
calendarAdapter.setListener(new CalendarAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
if (rvPosition > -1) {
handleClick(rvPosition, position);
// 刷新adapter
calendarAdapter.notifyDataSetChanged();
rvPosition = -1;
}
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project Qblog_Android by qiaoyhh.
the class BlogContentFragment method initView.
@Override
protected void initView() {
if (getArguments() != null) {
blogType = getArguments().getInt(Constants.BLOG_TYPE);
}
mAdapter = new BlogContentAdapter(R.layout.item_blogcontent_view, null);
mLayoutManger = new LinearLayoutManager(mContext);
viewMain.setLayoutManager(mLayoutManger);
viewMain.setHasFixedSize(true);
viewMain.addItemDecoration(new RecyclerViewDecoration(mContext, LinearLayoutManager.HORIZONTAL, R.drawable.divider_mileage));
viewMain.setAdapter(mAdapter);
refreshLayout.setColorSchemeColors(getResources().getColor(R.color.blue_light), getResources().getColor(R.color.green_light), getResources().getColor(R.color.orange_light), getResources().getColor(R.color.red_light));
refreshLayout.setOnRefreshListener(this);
mAdapter.setEnableLoadMore(false);
mAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
page++;
getBlogListData(page, Constants.TYPE_LOADMORE);
}
});
mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
Intent intent = new Intent(mContext, BlogDetailActivity.class);
intent.putExtra(Constants.BLOGCONTENT_TYPE, mData.get(position));
startActivity(intent);
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project UIWidget by AriesHoo.
the class BaseRecycleActivity method initRecyclerView.
protected void initRecyclerView() {
mRecyclerView.setOverScrollMode(View.OVER_SCROLL_NEVER);
mRecyclerView.setLayoutManager(initLayoutManager());
mRecyclerView.setAdapter(initAdapter());
if (!setItemClickable()) {
return;
}
mRecyclerView.addOnItemTouchListener(new OnItemClickListener() {
@Override
public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
onItemClicked(adapter, view, position);
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class FinishedFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
unbinder = ButterKnife.bind(this, view);
List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
mDownloadAdapter = new DownloadVideoAdapter(R.layout.item_unlimit_91porn_download, mUnLimit91PornItemList);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(mDownloadAdapter);
mDownloadAdapter.setEmptyView(R.layout.empty_view, recyclerView);
mDownloadAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
UnLimit91PornItem unLimit91PornItem = (UnLimit91PornItem) adapter.getItem(position);
openMp4File(unLimit91PornItem);
}
});
mDownloadAdapter.setOnItemLongClickListener(new BaseQuickAdapter.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) {
final UnLimit91PornItem unLimit91PornItem = (UnLimit91PornItem) adapter.getItem(position);
if (unLimit91PornItem == null)
return false;
new AlertDialog.Builder(context).setMessage("刪除此任务?").setPositiveButton("好的", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
File file = new File(unLimit91PornItem.getDownLoadPath(dataManager));
if (file.exists()) {
showDeleteFileDialog(unLimit91PornItem);
} else {
presenter.deleteDownloadedTask(unLimit91PornItem, false);
presenter.loadFinishedData();
}
}
}).show();
return true;
}
});
presenter.loadFinishedData();
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class HistoryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_history);
ButterKnife.bind(this);
initToolBar(toolbar);
mUnLimit91PornItemList = new ArrayList<>();
mUnLimit91Adapter = new HistoryAdapter(R.layout.item_unlimit_91porn, mUnLimit91PornItemList);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mUnLimit91Adapter);
mUnLimit91Adapter.setEmptyView(R.layout.empty_view, recyclerView);
mUnLimit91Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
goToPlayVideo((UnLimit91PornItem) adapter.getItem(position));
}
});
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.loadHistoryData(false);
}
}, recyclerView);
presenter.loadHistoryData(false);
}
Aggregations