1. 将dp转化为像素值;
int padding = getResources().getDimensionPixelSize(R.dimen.tab_padding);
2.判断recycleview 是否滑动到底部;
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy);// if (mIsLoading)// return; int visibleItemCount = mLayoutManager.getChildCount(); int totalItemCount = mLayoutManager.getItemCount(); int pastVisibleItems = mLayoutManager.findFirstVisibleItemPosition(); if (pastVisibleItems + visibleItemCount >= totalItemCount) { //End of list if (!isLoading) { presenter.loadVideosFrom(videos.get(videos.size()-1).id); isLoading = true; } } } });
3.将id转化成Drawable
Drawable dhome = ContextCompat.getDrawable(this, R.mipmap.ic_tab_home);