[android] Fixes after review.

This commit is contained in:
velichkomarija 2020-10-09 18:43:53 +03:00 committed by Alexey
parent 787190261e
commit b268398331
3 changed files with 8 additions and 7 deletions

View file

@ -2,4 +2,4 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@drawable/divider_shape" />
</layer-list>
</layer-list>

View file

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?attr/dividerHorizontal" />
<size android:height="1dp" />
</shape>
<size android:height="@dimen/divider_height" />
</shape>

View file

@ -23,15 +23,16 @@ public class DividerItemDecorationWithPadding extends RecyclerView.ItemDecoratio
}
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state)
public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent,
@NonNull RecyclerView.State state)
{
if (state.isMeasuring())
return;
int right = parent.getWidth();
int dividerHeight = mDivider.getIntrinsicHeight();
final int right = parent.getWidth();
final int dividerHeight = mDivider.getIntrinsicHeight();
int childCount = parent.getChildCount();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++)
{
View child = parent.getChildAt(i);