use of com.chad.library.adapter.base.BaseQuickAdapter in project BaseRecyclerViewAdapterHelper by CymChad.
the class ItemClickActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setBackBtn();
setTitle("ItemClickActivity Activity");
setContentView(R.layout.activity_item_click);
mRecyclerView = (RecyclerView) findViewById(R.id.list);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
initAdapter();
mRecyclerView.addOnItemTouchListener(new OnItemClickListener() {
/**
* Callback method to be invoked when an item in this AdapterView has
* been clicked.
*
* @param view The view within the AdapterView that was clicked (this
* will be a view provided by the adapter)
* @param position The position of the view in the adapter.
*/
@Override
public void onSimpleItemClick(final BaseQuickAdapter adapter, final View view, final int position) {
Log.d(TAG, "SimpleOnItemClick: ");
Toast.makeText(ItemClickActivity.this, "onSimpleItemClick" + position, Toast.LENGTH_SHORT).show();
}
/**
* callback method to be invoked when an chidview in this view has been
* click and held
*
* @param view The view whihin the AbsListView that was clicked
* @param position The position of the view int the adapter
* @return true if the callback consumed the long click ,false otherwise
*/
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
Logger.d("onItemChildClick " + position + " be click");
Toast.makeText(ItemClickActivity.this, "onItemChildClick" + position, Toast.LENGTH_SHORT).show();
}
/**
* Callback method to be invoked when an item in this view has been clicked and held.
* @param adapter
* @param view
* @param position
*/
@Override
public void onItemLongClick(final BaseQuickAdapter adapter, final View view, final int position) {
Toast.makeText(ItemClickActivity.this, "onItemLongClick" + position, Toast.LENGTH_SHORT).show();
}
/**
* Callback method to be invoked when an itemchild in this view has been clicked and held.
* @param adapter
* @param view
* @param position
*/
@Override
public void onItemChildLongClick(final BaseQuickAdapter adapter, final View view, final int position) {
Toast.makeText(ItemClickActivity.this, "onItemChildLongClick" + position, Toast.LENGTH_SHORT).show();
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project PracticeFilmApplication by FOnlyJack.
the class VideoPlayActivity method initListener.
private void initListener() {
filmVideoAdapter.setOnLoadMoreListener(this, rvVideoList);
rvVideoList.addOnItemTouchListener(new OnItemClickListener() {
@Override
public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
FilmVideoBean.VideoListBean msBean = (FilmVideoBean.VideoListBean) adapter.getData().get(position);
String hightUrl = msBean.getHightUrl();
String title = msBean.getTitle();
String image = msBean.getImage();
if (jcVideo.currentState == JCVideoPlayer.CURRENT_STATE_PLAYING) {
JCVideoPlayer.releaseAllVideos();
}
presenter.unSubscribe();
jcVideo.setUp(hightUrl, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, title);
Glide.with(VideoPlayActivity.this).load(image).into(jcVideo.thumbImageView);
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project Ency by xiarunhao123.
the class WeiXinFragment method initialize.
@Override
protected void initialize() {
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
swipeRefreshLayout.setRefreshing(true);
swipeRefreshLayout.setOnRefreshListener(this);
mPresenter.getWeiXinData(PAGE_SIZE, page);
mPresenter.getPTP();
weiXinAdapter = new WeiXinAdapter();
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(weiXinAdapter);
weiXinAdapter.setPTP(sharePrefManager.getProvincialTrafficPattern());
weiXinAdapter.setOnLoadMoreListener(this, recyclerView);
weiXinAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
WeiXinBean.NewslistBean bean = (WeiXinBean.NewslistBean) adapter.getData().get(position);
WebActivity.open(new WebActivity.Builder().setGuid(// 微信Item没有id,使用url作为guid
bean.getUrl()).setImgUrl(bean.getPicUrl()).setType(Constants.TYPE_WEIXIN).setUrl(bean.getUrl()).setTitle(bean.getTitle()).setShowLikeIcon(true).setContext(mContext));
}
});
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class VideoListFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
unbinder = ButterKnife.bind(this, view);
// Setup contentView == SwipeRefreshView
contentView.setOnRefreshListener(this);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(mUnLimit91Adapter);
mUnLimit91Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
UnLimit91PornItem unLimit91PornItems = (UnLimit91PornItem) adapter.getItem(position);
goToPlayVideo(unLimit91PornItems);
}
});
// 使用缓存的FragmentPagerAdapter之后会导致新方法的加载更多失效,暂时切换回过时api,可正常运行
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.loadVideoListData(false, false, category.getCategoryValue(), 0);
}
});
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
loadData(false, true, 0);
}
});
// loadData(false);
AppUtils.setColorSchemeColors(context, contentView);
handlerSkipPage();
}
use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.
the class ProxySettingActivity method init.
private void init() {
testAlertDialog = DialogUtils.initLodingDialog(this, "测试中,请稍候...");
String proxyHost = dataManager.getProxyIpAddress();
int port = dataManager.getProxyPort();
etDialogProxySettingIpAddress.setIpAddressStr(proxyHost);
etDialogProxySettingPort.setText(port == 0 ? "" : String.valueOf(port));
List<ProxyModel> data = new ArrayList<>();
proxyAdapter = new ProxyAdapter(R.layout.item_proxy, data);
recyclerViewProxySetting.setLayoutManager(new LinearLayoutManager(this));
recyclerViewProxySetting.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
View view = getLayoutInflater().inflate(R.layout.item_proxy, recyclerViewProxySetting, false);
proxyAdapter.setHeaderView(view);
proxyAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.parseXiCiDaiLi(false);
}
}, recyclerViewProxySetting);
proxyAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
ProxyModel proxyModel = (ProxyModel) adapter.getItem(position);
if (proxyModel == null) {
showMessage("数据出错了", TastyToast.WARNING);
return;
}
proxyAdapter.setClickPosition(position);
if (proxyModel.getType() != ProxyModel.TYPE_SOCKS) {
etDialogProxySettingIpAddress.setIpAddressStr(proxyModel.getProxyIp());
etDialogProxySettingPort.setText(proxyModel.getProxyPort());
} else {
showMessage("暂不支持socket代理", TastyToast.INFO);
}
}
});
recyclerViewProxySetting.setAdapter(proxyAdapter);
helper = new LoadViewHelper(recyclerViewProxySetting);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
presenter.parseXiCiDaiLi(false);
}
});
presenter.parseXiCiDaiLi(false);
}
Aggregations