Search in sources :

Example 36 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.

the class Mm99Fragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    unbinder = ButterKnife.bind(this, view);
    swipeLayout.setOnRefreshListener(this);
    AppUtils.setColorSchemeColors(context, swipeLayout);
    recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
    recyclerView.setAdapter(mm99Adapter);
    mm99Adapter.setWidth(QMUIDisplayHelper.getScreenWidth(context) / 2);
    mm99Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            loadData(false, false);
        }
    });
    mm99Adapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            Mm99 mm99 = (Mm99) adapter.getItem(position);
            if (mm99 == null) {
                return;
            }
            Intent intent = new Intent(context, PictureViewerActivity.class);
            intent.putExtra(Keys.KEY_INTENT_99_MM_ITEM, mm99);
            startActivityWithAnimotion(intent);
        }
    });
}
Also used : Mm99(com.dante.data.model.Mm99) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) Intent(android.content.Intent) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) PictureViewerActivity(com.dante.ui.images.viewimage.PictureViewerActivity)

Example 37 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.

the class BasePlayVideo method initVideoComments.

private void initVideoComments() {
    List<VideoComment> videoCommentList = new ArrayList<>();
    videoCommentAdapter = new VideoCommentAdapter(this, R.layout.item_video_comment, videoCommentList);
    recyclerViewVideoComment.setLayoutManager(new LinearLayoutManager(this));
    // recyclerViewVideoComment.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
    recyclerViewVideoComment.setAdapter(videoCommentAdapter);
    videoCommentAdapter.setLoadMoreView(new LoadMoreView() {

        @Override
        public int getLayoutId() {
            return R.layout.loading;
        }

        @Override
        protected int getLoadingViewId() {
            return R.id.loading;
        }

        @Override
        protected int getLoadFailViewId() {
            return R.id.loadFailed;
        }

        @Override
        protected int getLoadEndViewId() {
            return R.id.loadEnd;
        }
    });
    videoCommentAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            // 加载评论
            if (unLimit91PornItem.getVideoResultId() == 0) {
                videoCommentAdapter.loadMoreFail();
                return;
            }
            presenter.loadVideoComment(unLimit91PornItem.getVideoResult().getVideoId(), unLimit91PornItem.getViewKey(), false);
        }
    }, recyclerViewVideoComment);
    videoCommentAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            if (floatingToolbar.isShowing()) {
                floatingToolbar.hide();
            }
            if (commentLayoutShown) {
                if (videoCommentAdapter.getClickPosition() == position) {
                    hideCommentLayout();
                }
            } else {
                showCommentLayout();
            }
            isComment = false;
            videoComment = (VideoComment) adapter.getData().get(position);
            etVideoComment.setHint("回复:" + videoComment.getuName());
            videoCommentAdapter.setClickPosition(position);
        }
    });
    recyclerViewVideoComment.addOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            if (dy > 0)
                fab.hide();
            else if (dy < -5)
                fab.show();
        }
    });
}
Also used : VideoCommentAdapter(com.dante.adapter.VideoCommentAdapter) LoadMoreView(com.chad.library.adapter.base.loadmore.LoadMoreView) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) LoadMoreView(com.chad.library.adapter.base.loadmore.LoadMoreView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) VideoComment(com.dante.data.model.VideoComment) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) RecyclerView(android.support.v7.widget.RecyclerView)

Example 38 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter 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);
        }
    });
}
Also used : ArrayList(java.util.ArrayList) UnLimit91Adapter(com.dante.adapter.UnLimit91Adapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) LinkedList(java.util.LinkedList) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) OnLoadViewListener(com.helper.loadviewhelper.help.OnLoadViewListener) LoadViewHelper(com.helper.loadviewhelper.load.LoadViewHelper) UnLimit91PornItem(com.dante.data.model.UnLimit91PornItem)

Example 39 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.

the class VideoListFragment method handlerSkipPage.

private void handlerSkipPage() {
    if (dataManager.isOpenSkipPage()) {
        skipPageLayout.setVisibility(View.VISIBLE);
        skipPageRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
        skipPageRecyclerView.setAdapter(skipPageAdapter);
        skipPageAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                int page = (int) adapter.getItem(position);
                loadData(false, false, page);
            }
        });
    } else {
        skipPageLayout.setVisibility(View.GONE);
    }
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView)

Example 40 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project 91Pop by DanteAndroid.

the class ForumFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    unbinder = ButterKnife.bind(this, view);
    swipeLayout.setOnRefreshListener(this);
    AppUtils.setColorSchemeColors(context, swipeLayout);
    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));
    recyclerView.setAdapter(forun91PornAdapter);
    forun91PornAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            loadData(false);
        }
    }, recyclerView);
    if ("17".equals(category.getCategoryValue()) || "4".equals(category.getCategoryValue())) {
        tipTextView.setVisibility(View.VISIBLE);
        swipeLayout.setEnabled(false);
    }
    forun91PornAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            Forum91PronItem forum91PronItem = (Forum91PronItem) adapter.getItem(position);
            Intent intent = new Intent(context, Browse91PornActivity.class);
            intent.putExtra(Keys.KEY_INTENT_BROWSE_FORUM_91_PORN_ITEM, forum91PronItem);
            startActivityWithAnimotion(intent);
        }
    });
}
Also used : Browse91PornActivity(com.dante.ui.porn91forum.browse91porn.Browse91PornActivity) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Forum91PronItem(com.dante.data.model.Forum91PronItem) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) DividerItemDecoration(android.support.v7.widget.DividerItemDecoration) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView)

Aggregations

BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)49 View (android.view.View)47 RecyclerView (android.support.v7.widget.RecyclerView)38 BindView (butterknife.BindView)27 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)26 OnItemClickListener (com.chad.library.adapter.base.listener.OnItemClickListener)15 Intent (android.content.Intent)12 UnLimit91PornItem (com.dante.data.model.UnLimit91PornItem)8 RecyclerView (androidx.recyclerview.widget.RecyclerView)7 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)6 ImageView (android.widget.ImageView)6 OnItemChildClickListener (com.chad.library.adapter.base.listener.OnItemChildClickListener)6 OnLoadViewListener (com.helper.loadviewhelper.help.OnLoadViewListener)6 LoadViewHelper (com.helper.loadviewhelper.load.LoadViewHelper)6 ArrayList (java.util.ArrayList)6 TextView (android.widget.TextView)4 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)3 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)3 BaseViewHolder (com.chad.library.adapter.base.BaseViewHolder)3 DialogInterface (android.content.DialogInterface)2