@Test public void testShouldDecorate() { final ItemDividerDecoration decoration = new ItemDividerDecoration(); decoration.setDivider(mock(Drawable.class)); decoration.setDividerThickness(2); assertThat(decoration.shouldDecorate(mockRecyclerView, mockRecyclerViewState), is(true)); }
@Override protected boolean shouldDecorate(@NonNull final RecyclerView parent, @NonNull final RecyclerView.State state) { return super.shouldDecorate(parent, state) && divider != null && dividerThickness > 0; }
ItemDividerDecoration extends RecyclerViewItemDecoration { @Override protected boolean shouldDecorate(@NonNull final RecyclerView parent, @NonNull final RecyclerView.State state) { return super.shouldDecorate(parent, state) && divider != null && dividerThickness > 0; } }
ItemDividerDecoration extends RecyclerViewItemDecoration { @Override protected boolean shouldDecorate(@NonNull final RecyclerView parent, @NonNull final RecyclerView.State state) { return super.shouldDecorate(parent, state) && divider != null && dividerThickness > 0; } ItemDividerDecoration();  ItemDividerDecoration(@Orientation final int orientation, @NonNull final Drawable divider);  ItemDividerDecoration(@Nullable final Context context);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("ResourceType")  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); }
ItemDividerDecoration extends RecyclerViewItemDecoration { @Override protected boolean shouldDecorate(@NonNull final RecyclerView parent, @NonNull final RecyclerView.State state) { return super.shouldDecorate(parent, state) && divider != null && dividerThickness > 0; } ItemDividerDecoration();  ItemDividerDecoration(@Orientation final int orientation, @NonNull final Drawable divider);  ItemDividerDecoration(@Nullable final Context context);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("ResourceType")  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); void setOrientation(@Orientation final int orientation); @Orientation int getOrientation(); void setDivider(@Nullable final Drawable divider); @Nullable Drawable getDivider(); void setDividerThickness(@IntRange(from = 0) final int thickness); @IntRange(from = 0) int getDividerThickness(); void setDividerOffset(@IntRange(from = 0) final int start, @IntRange(from = 0) final int end); int getDividerOffsetStart(); int getDividerOffsetEnd(); @Override void getItemOffsets(@NonNull final Rect rect, @NonNull final View view, @NonNull final RecyclerView parent, @NonNull final RecyclerView.State state); @Override void onDraw(@NonNull final Canvas canvas, @NonNull final RecyclerView parent, @NonNull final RecyclerView.State state); }
ItemDividerDecoration extends RecyclerViewItemDecoration { @Override protected boolean shouldDecorate(@NonNull final RecyclerView parent, @NonNull final RecyclerView.State state) { return super.shouldDecorate(parent, state) && divider != null && dividerThickness > 0; } ItemDividerDecoration();  ItemDividerDecoration(@Orientation final int orientation, @NonNull final Drawable divider);  ItemDividerDecoration(@Nullable final Context context);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs);  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("ResourceType")  ItemDividerDecoration(@Nullable final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); void setOrientation(@Orientation final int orientation); @Orientation int getOrientation(); void setDivider(@Nullable final Drawable divider); @Nullable Drawable getDivider(); void setDividerThickness(@IntRange(from = 0) final int thickness); @IntRange(from = 0) int getDividerThickness(); void setDividerOffset(@IntRange(from = 0) final int start, @IntRange(from = 0) final int end); int getDividerOffsetStart(); int getDividerOffsetEnd(); @Override void getItemOffsets(@NonNull final Rect rect, @NonNull final View view, @NonNull final RecyclerView parent, @NonNull final RecyclerView.State state); @Override void onDraw(@NonNull final Canvas canvas, @NonNull final RecyclerView parent, @NonNull final RecyclerView.State state); static final int HORIZONTAL; static final int VERTICAL; }