Search in sources :

Example 41 with BaseQuickAdapter

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

the class AuthorActivity method init.

private void init() {
    swipeLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

        @Override
        public void onRefresh() {
            presenter.authorVideos(uid, true);
        }
    });
    swipeLayout.setEnabled(false);
    List<UnLimit91PornItem> mUnLimit91PornItemList = new ArrayList<>();
    mUnLimit91Adapter = new UnLimit91Adapter(R.layout.item_unlimit_91porn, mUnLimit91PornItemList);
    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);
            Intent intent = new Intent();
            intent.putExtra(Keys.KEY_INTENT_UNLIMIT91PORNITEM, unLimit91PornItems);
            setResult(AUTHORACTIVITY_RESULT_CODE, intent);
            onBackPressed();
        }
    });
    mUnLimit91Adapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            presenter.authorVideos(uid, false);
        }
    }, recyclerView);
    helper = new LoadViewHelper(recyclerView);
    helper.setListener(new OnLoadViewListener() {

        @Override
        public void onRetryClick() {
            swipeLayout.setEnabled(false);
            presenter.authorVideos(uid, true);
        }
    });
    presenter.authorVideos(uid, false);
}
Also used : ArrayList(java.util.ArrayList) UnLimit91Adapter(com.dante.adapter.UnLimit91Adapter) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) 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 42 with BaseQuickAdapter

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

the class IndexFragment 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 = mUnLimit91PornItemList.get(position);
            goToPlayVideo(unLimit91PornItems);
        }
    });
    helper = new LoadViewHelper(recyclerView);
    helper.setListener(new OnLoadViewListener() {

        @Override
        public void onRetryClick() {
            loadData(false, true);
        }
    });
    AppUtils.setColorSchemeColors(context, contentView);
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) OnLoadViewListener(com.helper.loadviewhelper.help.OnLoadViewListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) LoadViewHelper(com.helper.loadviewhelper.load.LoadViewHelper) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) UnLimit91PornItem(com.dante.data.model.UnLimit91PornItem)

Example 43 with BaseQuickAdapter

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

the class PigAvFragment 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);
    piaAvAdapter.setWidth(QMUIDisplayHelper.getScreenWidth(context));
    recyclerView.setLayoutManager(new LinearLayoutManager(context));
    recyclerView.setAdapter(piaAvAdapter);
    piaAvAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            PigAv pigAv = (PigAv) adapter.getItem(position);
            if (pigAv == null) {
                return;
            }
            Intent intent = new Intent(context, PlayPigAvActivity.class);
            intent.putExtra(Keys.KEY_INTENT_PIG_AV_ITEM, pigAv);
            startActivityWithAnimotion(intent);
        }
    });
    piaAvAdapter.setOnLoadMoreListener(new BaseQuickAdapter.RequestLoadMoreListener() {

        @Override
        public void onLoadMoreRequested() {
            presenter.moreVideoList(category.getCategoryValue(), false);
        }
    });
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Intent(android.content.Intent) PigAv(com.dante.data.model.PigAv) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) PlayPigAvActivity(com.dante.ui.pigav.playpigav.PlayPigAvActivity)

Example 44 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project Atom_Android by Rogrand-Dev.

the class ToolTabFragment method initAdapter.

private void initAdapter() {
    BaseQuickAdapter toolAdapter = new ToolAdapter(R.layout.item_grid_tool, mDataList);
    toolAdapter.openLoadAnimation();
    View top = mActivity.getLayoutInflater().inflate(R.layout.view_tool_top, (ViewGroup) mRecyclerView.getParent(), false);
    toolAdapter.addHeaderView(top);
    toolAdapter.setOnItemClickListener((adapter, view, position) -> {
        Intent intent = new Intent(mContext, ACTIVITY[position]);
        startActivity(intent);
    });
    mRecyclerView.setAdapter(toolAdapter);
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Intent(android.content.Intent) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 45 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project BaseRecyclerViewAdapterHelper by CymChad.

the class DataBindingUseActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_universal_recycler);
    setTitle("DataBinding Use");
    setBackBtn();
    final RecyclerView mRecyclerView = findViewById(R.id.rv);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
    mRecyclerView.setAdapter(adapter);
    // demo 添加的 Header
    // Header 是自行添加进去的 View,所以 Adapter 不管理 Header 的 DataBinding。
    // 请在外部自行完成数据的绑定
    View view = getLayoutInflater().inflate(R.layout.head_view, null, false);
    view.findViewById(R.id.iv).setVisibility(View.GONE);
    adapter.addHeaderView(view);
    // item 点击事件
    adapter.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
            Tips.show("onItemClick: " + position);
        }
    });
    // 设置数据
    adapter.setList(genData());
}
Also used : OnItemClickListener(com.chad.library.adapter.base.listener.OnItemClickListener) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView)

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