|
4 | 4 | import android.content.res.TypedArray; |
5 | 5 | import android.graphics.drawable.Drawable; |
6 | 6 | import android.graphics.drawable.GradientDrawable; |
7 | | -import android.transition.ChangeBounds; |
8 | | -import android.transition.Fade; |
9 | | -import android.transition.Transition; |
10 | | -import android.transition.TransitionManager; |
11 | | -import android.transition.TransitionSet; |
12 | 7 | import android.util.AttributeSet; |
13 | 8 | import android.util.DisplayMetrics; |
14 | 9 | import android.util.TypedValue; |
15 | 10 | import android.view.View; |
16 | 11 | import android.widget.LinearLayout; |
17 | 12 |
|
| 13 | +import com.transitionseverywhere.ChangeBounds; |
| 14 | +import com.transitionseverywhere.Fade; |
| 15 | +import com.transitionseverywhere.Transition; |
| 16 | +import com.transitionseverywhere.TransitionManager; |
| 17 | +import com.transitionseverywhere.TransitionSet; |
| 18 | + |
18 | 19 | import java.util.Arrays; |
19 | 20 |
|
20 | 21 | import androidx.annotation.Nullable; |
|
33 | 34 | * created 07.06.2017. |
34 | 35 | */ |
35 | 36 | public class OverflowPagerIndicator extends LinearLayout { |
36 | | - private static final int MAX_INDICATORS = 9; |
37 | | - private static final int INDICATOR_SIZE_DIP = 12; |
| 37 | + private static final int MAX_INDICATORS = 9; |
| 38 | + private static final int INDICATOR_SIZE_DIP = 12; |
38 | 39 | private static final int INDICATOR_MARGIN_DIP = 2; |
39 | 40 |
|
40 | 41 | // State also represents indicator scale factor |
41 | | - private static final float STATE_GONE = 0; |
| 42 | + private static final float STATE_GONE = 0; |
42 | 43 | private static final float STATE_SMALLEST = 0.2f; |
43 | | - private static final float STATE_SMALL = 0.4f; |
44 | | - private static final float STATE_NORMAL = 0.6f; |
| 44 | + private static final float STATE_SMALL = 0.4f; |
| 45 | + private static final float STATE_NORMAL = 0.6f; |
45 | 46 | private static final float STATE_SELECTED = 1.0f; |
46 | 47 |
|
47 | 48 | private int mIndicatorCount; |
48 | 49 | private int mLastSelected; |
49 | 50 | private int mIndicatorSize; |
50 | 51 | private int mIndicatorMargin; |
51 | 52 |
|
52 | | - private RecyclerView mRecyclerView; |
| 53 | + private RecyclerView mRecyclerView; |
53 | 54 | private OverflowDataObserver mDataObserver; |
54 | 55 |
|
55 | 56 | private int dotStrokeColor; |
@@ -163,7 +164,7 @@ private void updateOverflowState(int position) { |
163 | 164 | float[] positionStates = new float[mIndicatorCount + 1]; |
164 | 165 | Arrays.fill(positionStates, STATE_GONE); |
165 | 166 |
|
166 | | - int start = position - MAX_INDICATORS + 4; |
| 167 | + int start = position - MAX_INDICATORS + 4; |
167 | 168 | int realStart = Math.max(0, start); |
168 | 169 |
|
169 | 170 | if (realStart + MAX_INDICATORS > mIndicatorCount) { |
@@ -199,7 +200,7 @@ private void updateOverflowState(int position) { |
199 | 200 |
|
200 | 201 | private void updateIndicators(float[] positionStates) { |
201 | 202 | for (int i = 0; i < mIndicatorCount; i++) { |
202 | | - View v = getChildAt(i); |
| 203 | + View v = getChildAt(i); |
203 | 204 | float state = positionStates[i]; |
204 | 205 |
|
205 | 206 | if (state == STATE_GONE) { |
|
0 commit comments