Skip to content

Commit fbcfd9f

Browse files
committed
Use transitioneverywhere (support 16+)
1 parent 47d6ad3 commit fbcfd9f

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

library/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
compileSdkVersion 28
1313

1414
defaultConfig {
15-
minSdkVersion 19
15+
minSdkVersion 16
1616
targetSdkVersion 28
1717
versionCode 1
1818
versionName "1.0"

library/src/main/java/cz/intik/overflowindicator/OverflowPagerIndicator.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
import android.content.res.TypedArray;
55
import android.graphics.drawable.Drawable;
66
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;
127
import android.util.AttributeSet;
138
import android.util.DisplayMetrics;
149
import android.util.TypedValue;
1510
import android.view.View;
1611
import android.widget.LinearLayout;
1712

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+
1819
import java.util.Arrays;
1920

2021
import androidx.annotation.Nullable;
@@ -33,23 +34,23 @@
3334
* created 07.06.2017.
3435
*/
3536
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;
3839
private static final int INDICATOR_MARGIN_DIP = 2;
3940

4041
// State also represents indicator scale factor
41-
private static final float STATE_GONE = 0;
42+
private static final float STATE_GONE = 0;
4243
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;
4546
private static final float STATE_SELECTED = 1.0f;
4647

4748
private int mIndicatorCount;
4849
private int mLastSelected;
4950
private int mIndicatorSize;
5051
private int mIndicatorMargin;
5152

52-
private RecyclerView mRecyclerView;
53+
private RecyclerView mRecyclerView;
5354
private OverflowDataObserver mDataObserver;
5455

5556
private int dotStrokeColor;
@@ -163,7 +164,7 @@ private void updateOverflowState(int position) {
163164
float[] positionStates = new float[mIndicatorCount + 1];
164165
Arrays.fill(positionStates, STATE_GONE);
165166

166-
int start = position - MAX_INDICATORS + 4;
167+
int start = position - MAX_INDICATORS + 4;
167168
int realStart = Math.max(0, start);
168169

169170
if (realStart + MAX_INDICATORS > mIndicatorCount) {
@@ -199,7 +200,7 @@ private void updateOverflowState(int position) {
199200

200201
private void updateIndicators(float[] positionStates) {
201202
for (int i = 0; i < mIndicatorCount; i++) {
202-
View v = getChildAt(i);
203+
View v = getChildAt(i);
203204
float state = positionStates[i];
204205

205206
if (state == STATE_GONE) {

0 commit comments

Comments
 (0)