Search in sources :

Example 31 with BaseQuickAdapter

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;
            }
        }
    });
}
Also used : CalendarAdapter(com.muzi.library.adapter.CalendarAdapter) MLinearLayoutManager(com.muzi.library.manager.MLinearLayoutManager) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) OnItemChildClickListener(com.chad.library.adapter.base.listener.OnItemChildClickListener) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) View(android.view.View)

Example 32 with BaseQuickAdapter

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);
        }
    });
}
Also used : BlogDetailActivity(com.qyh.myblog_android.ui.activity.blog.BlogDetailActivity) RecyclerViewDecoration(com.qyh.myblog_android.widget.RecyclerViewDecoration) BlogContentAdapter(com.qyh.myblog_android.ui.adapter.BlogContentAdapter) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Intent(android.content.Intent) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 33 with BaseQuickAdapter

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);
        }
    });
}
Also used : OnItemClickListener(com.chad.library.adapter.base.listener.OnItemClickListener) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 34 with BaseQuickAdapter

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();
}
Also used : DialogInterface(android.content.DialogInterface) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) UnLimit91PornItem(com.dante.data.model.UnLimit91PornItem) DownloadVideoAdapter(com.dante.adapter.DownloadVideoAdapter) File(java.io.File)

Example 35 with BaseQuickAdapter

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);
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) HistoryAdapter(com.dante.adapter.HistoryAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) BindView(butterknife.BindView) SwipeMenuRecyclerView(com.aitsuki.swipe.SwipeMenuRecyclerView) View(android.view.View) UnLimit91PornItem(com.dante.data.model.UnLimit91PornItem)

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