use of com.helper.loadviewhelper.load.LoadViewHelper 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.helper.loadviewhelper.load.LoadViewHelper 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);
}
use of com.helper.loadviewhelper.load.LoadViewHelper in project 91Pop by DanteAndroid.
the class BasePlayVideo method initLoadHelper.
private void initLoadHelper() {
helper = new LoadViewHelper(flLoadHolder);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
if (isVideoError) {
presenter.loadVideoUrl(unLimit91PornItem);
} else {
// 加载评论
if (unLimit91PornItem.getVideoResultId() == 0) {
return;
}
presenter.loadVideoComment(unLimit91PornItem.getVideoResult().getVideoId(), unLimit91PornItem.getViewKey(), true);
}
}
});
}
use of com.helper.loadviewhelper.load.LoadViewHelper in project 91Pop by DanteAndroid.
the class FavoriteActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_favorite);
ButterKnife.bind(this);
deleteAlertDialog = DialogUtils.initLodingDialog(this, "删除中,请稍后...");
initToolBar(toolbar);
toolbar.setContentInsetStartWithNavigation(0);
// Setup contentView == SwipeRefreshView
contentView.setOnRefreshListener(this);
List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
mUnLimit91Adapter = new FavoriteAdapter(R.layout.item_right_menu_delete, 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.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
SwipeItemLayout swipeItemLayout = (SwipeItemLayout) view.getParent();
swipeItemLayout.close();
if (view.getId() == R.id.right_menu_delete) {
UnLimit91PornItem unLimit91PornItem = (UnLimit91PornItem) adapter.getItem(position);
if (unLimit91PornItem == null || unLimit91PornItem.getVideoResult() == null) {
showMessage("信息错误,无法删除", TastyToast.WARNING);
return;
}
presenter.deleteFavorite(unLimit91PornItem.getVideoResult().getVideoId());
}
}
});
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.loadRemoteFavoriteData(false);
}
}, recyclerView);
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
presenter.loadRemoteFavoriteData(false);
}
});
boolean needRefresh = dataManager.isFavoriteNeedRefresh();
presenter.loadRemoteFavoriteData(needRefresh);
}
use of com.helper.loadviewhelper.load.LoadViewHelper in project 91Pop by DanteAndroid.
the class SearchActivity method init.
private void init() {
initToolBar(toolbar);
searchView.setQueryHint("搜索视频");
searchView.onActionViewExpanded();
List<String> datasetSortBy = new LinkedList<>(Arrays.asList(getResources().getStringArray(R.array.sort_by)));
niceSpinnerSortBy.attachDataSource(datasetSortBy);
List<String> datasetSearch = new LinkedList<>(Arrays.asList(getResources().getStringArray(R.array.search)));
niceSpinnerSearch.attachDataSource(datasetSearch);
List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
mUnLimit91Adapter = new UnLimit91Adapter(R.layout.item_unlimit_91porn, mUnLimit91PornItemList);
mUnLimit91Adapter.openLoadAnimation();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(mUnLimit91Adapter);
mUnLimit91Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
UnLimit91PornItem unLimit91PornItems = (UnLimit91PornItem) adapter.getData().get(position);
goToPlayVideo(unLimit91PornItems);
}
});
mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {
@Override
public void onLoadMoreRequested() {
presenter.searchVideos(searchId, sort, false);
}
}, recyclerView);
helper = new LoadViewHelper(recyclerView);
helper.setListener(new OnLoadViewListener() {
@Override
public void onRetryClick() {
presenter.searchVideos(searchId, sort, false);
}
});
}
Aggregations