@NonNull private DividerItemDecoration getDivider() { Drawable dividerBackground = ContextCompat.getDrawable(getActivity(), R.drawable.dark_blue_divider); Collection<Layer> layers = LayersBuilder.with( new Layer(DividerBuilder.from(dividerBackground).erase(Direction.getVertical()).build()), new Layer(new HeaderSelector(), DividerBuilder.fromEmpty().with(dividerBackground, Direction.SOUTH).build())).build(); return new DividerItemDecoration(layers); }
/** * Adds the drawable to all the sides of the divider. */ public DividerBuilder with(Drawable drawable) { for (Direction direction : Direction.values()) { sublayers.put(direction, new Sublayer(drawable)); } return this; }
EnumSet<Direction> directions = Direction.getSouthEastCorner();
@NonNull private DividerItemDecoration getDivider() { Drawable dividerBackground = ContextCompat.getDrawable(getActivity(), R.drawable.dark_blue_divider); Collection<Layer> layers = LayersBuilder.with( new Layer(DividerBuilder.from(dividerBackground).erase(Direction.getVertical()).build()), new Layer(new HeaderSelector(), DividerBuilder.fromEmpty().with(dividerBackground, Direction.SOUTH).build())).build(); return new DividerItemDecoration(layers); }