@Test public void getItemOffsets_test() { when(recyclerView.getChildAdapterPosition(child)).thenReturn(1); testAdapter.getItemDecoration().getItemOffsets(outRect, child, recyclerView, state); verify(testAdapter).getDecorationOffset(outRect, child, recyclerView, state, 1); }
@Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int adapterPosition = parent.getChildAdapterPosition(view); if (adapterPosition < 0) { return; } adapter.getDecorationOffset(outRect, view, parent, state, adapterPosition); }
DecorationDelegate extends RecyclerView.ItemDecoration { @Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int adapterPosition = parent.getChildAdapterPosition(view); if (adapterPosition < 0) { return; } adapter.getDecorationOffset(outRect, view, parent, state, adapterPosition); } }
DecorationDelegate extends RecyclerView.ItemDecoration { @Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int adapterPosition = parent.getChildAdapterPosition(view); if (adapterPosition < 0) { return; } adapter.getDecorationOffset(outRect, view, parent, state, adapterPosition); } DecorationDelegate(MultiViewAdapter adapter); }
DecorationDelegate extends RecyclerView.ItemDecoration { @Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int adapterPosition = parent.getChildAdapterPosition(view); if (adapterPosition < 0) { return; } adapter.getDecorationOffset(outRect, view, parent, state, adapterPosition); } DecorationDelegate(MultiViewAdapter adapter); @Override void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state); @Override void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state); @Override void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
      @NonNull RecyclerView parent, @NonNull RecyclerView.State state); }
DecorationDelegate extends RecyclerView.ItemDecoration { @Override public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { int adapterPosition = parent.getChildAdapterPosition(view); if (adapterPosition < 0) { return; } adapter.getDecorationOffset(outRect, view, parent, state, adapterPosition); } DecorationDelegate(MultiViewAdapter adapter); @Override void onDraw(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state); @Override void onDrawOver(@NonNull Canvas canvas, @NonNull RecyclerView parent,
      @NonNull RecyclerView.State state); @Override void getItemOffsets(@NonNull Rect outRect, @NonNull View view,
      @NonNull RecyclerView parent, @NonNull RecyclerView.State state);  }