| 7 | import android.view.View; |
| 8 | |
| 9 | public class Shimmer { |
| 10 | |
| 11 | public static final int ANIMATION_DIRECTION_LTR = 0; |
| 12 | public static final int ANIMATION_DIRECTION_RTL = 1; |
| 13 | |
| 14 | private static final int DEFAULT_REPEAT_COUNT = ValueAnimator.INFINITE; |
| 15 | private static final long DEFAULT_DURATION = 1000; |
| 16 | private static final long DEFAULT_START_DELAY = 0; |
| 17 | private static final int DEFAULT_DIRECTION = ANIMATION_DIRECTION_LTR; |
| 18 | |
| 19 | private int repeatCount; |
| 20 | private long duration; |
| 21 | private long startDelay; |
| 22 | private int direction; |
| 23 | private Animator.AnimatorListener animatorListener; |
| 24 | |
| 25 | private ObjectAnimator animator; |
| 26 | |
| 27 | public Shimmer() { |
| 28 | repeatCount = DEFAULT_REPEAT_COUNT; |
| 29 | duration = DEFAULT_DURATION; |
| 30 | startDelay = DEFAULT_START_DELAY; |
| 31 | direction = DEFAULT_DIRECTION; |
| 32 | } |
| 33 | |
| 34 | public int getRepeatCount() { |
| 35 | return repeatCount; |
| 36 | } |
| 37 | |
| 38 | public Shimmer setRepeatCount(int repeatCount) { |
| 39 | this.repeatCount = repeatCount; |
| 40 | return this; |
| 41 | } |
| 42 | |
| 43 | public long getDuration() { |
| 44 | return duration; |
| 45 | } |
| 46 | |
| 47 | public Shimmer setDuration(long duration) { |
| 48 | this.duration = duration; |
| 49 | return this; |
| 50 | } |
| 51 | |
| 52 | public long getStartDelay() { |
| 53 | return startDelay; |
| 54 | } |
| 55 | |
| 56 | public Shimmer setStartDelay(long startDelay) { |
| 57 | this.startDelay = startDelay; |
| 58 | return this; |
| 59 | } |
| 60 | |
| 61 | public int getDirection() { |
| 62 | return direction; |
| 63 | } |
| 64 | |
| 65 | public Shimmer setDirection(int direction) { |
| 66 |
nothing calls this directly
no outgoing calls
no test coverage detected