Prevent crash, cleanup

This commit is contained in:
M66B 2019-04-29 12:04:45 +02:00
parent b4092d5c5e
commit ab038ce8a2
2 changed files with 2 additions and 4 deletions

View File

@ -148,8 +148,7 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int pos = parent.getChildAdapterPosition(view);
NavMenuItem menu = adapter.get(pos);
Log.i("pos=" + pos + " separated=" + menu.isSeparated());
outRect.set(0, 0, 0, menu.isSeparated() ? d.getIntrinsicHeight() : 0);
outRect.set(0, 0, 0, menu != null && menu.isSeparated() ? d.getIntrinsicHeight() : 0);
}
};
itemDecorator.setDrawable(d);

View File

@ -211,8 +211,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
int pos = parent.getChildAdapterPosition(view);
NavMenuItem menu = eadapter.get(pos);
Log.i("pos=" + pos + " separated=" + menu.isSeparated());
outRect.set(0, 0, 0, menu.isSeparated() ? d.getIntrinsicHeight() : 0);
outRect.set(0, 0, 0, menu != null && menu.isSeparated() ? d.getIntrinsicHeight() : 0);
}
};
itemDecorator.setDrawable(d);