Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
| import android.content.Context; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.Drawable; | |
| import android.support.v7.widget.LinearLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.util.AttributeSet; | |
| import android.view.View; |
| <?xml version="1.0" encoding="utf-8"?> | |
| <!-- https://gist.github.com/kalehv/bae765c756e94455ed88 --> | |
| <resources> | |
| <color name="red_50">#ffebee</color> | |
| <color name="red_100">#ffcdd2</color> | |
| <color name="red_200">#ef9a9a</color> | |
| <color name="red_300">#e57373</color> | |
| <color name="red_400">#ef5350</color> | |
| <color name="red_500">#f44336</color> |
| public class CircularProgressDrawable extends Drawable | |
| implements Animatable { | |
| private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
| private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
| private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
| private static final int SWEEP_ANIMATOR_DURATION = 600; | |
| private static final int MIN_SWEEP_ANGLE = 30; | |
| private final RectF fBounds = new RectF(); |