Open Deepscorn opened 9 years ago
Try adding an item decoration at the bottom.
implement decoration.
class BottomSpaceDecoration extends ItemDecoration {
private final LayoutManager mLayoutManager;
private final int mHeightSize;
public BottomSpaceDecoration(LayoutManager layoutManager, int heightSize) {
mLayoutManager = layoutManager;
mHeightSize = heightSize;
}
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView recyclerView, RecyclerView.State state) {
super.getItemOffsets(outRect, view, recyclerView, state);
int itemPosition = recyclerView.getChildAdapterPosition(view);
if (itemPosition == mLayoutManager.getItemCount() - 1) {
outRect.bottom = mHeightSize;
}
}
}
and apply decoration like this.
int heightSize = mContext.getResources().getDimension(R.dimen.bottom_padding_size);
mTwoWayView.addItemDecoration(new BottomSpaceDecoration(mTwoWayView.getLayoutManager(), heightSize));
Having this layout:
When scrolling content up items appear too late from below. I think this is due to padding. The main idea of bottom padding with clipToPadding="false" is to show bottom block (with TextView) when finished scrolling down with fade in. Another bug is the thing, that having these tiles:
In onBindViewHolder(holder, position) in adapter:
Tiles positioned correctly, but I see a gap on the right side of the screen in both landscape and portrait orientation, that's my styles.xml for them both: