Skip to content

Commit 6c942c2

Browse files
Piotr Zawadzkizawadz88
authored andcommitted
- Resolves issue #152 i.e. updates Support Library dependency to 25.4.0 & removes fallback animated vector drawables below Lollipop
- Adds a missing test for showing bottom navigation bar
1 parent af9578e commit 6c942c2

File tree

13 files changed

+42
-194
lines changed

13 files changed

+42
-194
lines changed

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ allprojects {
1919
repositories {
2020
jcenter()
2121
mavenCentral()
22+
maven {
23+
url "https://maven.google.com"
24+
}
2225
}
2326
}
2427

@@ -29,7 +32,7 @@ configure(allprojects) {
2932
androidTargetSdkVersion = 25
3033
androidCompileSdkVersion = 25
3134
androidBuildToolsVersion = '25.0.2'
32-
androidSupportLibraryVersion = '25.3.1'
35+
androidSupportLibraryVersion = '25.4.0'
3336

3437
junitVersion = '4.12'
3538
mockitoVersion = '2.7.21'

config/quality/quality.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ task findbugs(type: FindBugs,
5757
xml {
5858
destination "$reportsDir/findbugs/findbugs.xml"
5959
}
60-
html {
61-
destination "$reportsDir/findbugs/findbugs.html"
62-
}
6360
}
6461

6562
classpath = files()

material-stepper/src/main/java/com/stepstone/stepper/internal/widget/StepTab.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import android.graphics.Typeface;
2121
import android.graphics.drawable.Animatable;
2222
import android.graphics.drawable.Drawable;
23-
import android.os.Build;
2423
import android.support.annotation.CallSuper;
2524
import android.support.annotation.ColorInt;
2625
import android.support.annotation.DrawableRes;
@@ -196,20 +195,13 @@ private Drawable createWarningToCircleDrawable() {
196195
}
197196

198197
/**
199-
* Inflates an animated vector drawable. On Lollipop+ this uses the native {@link android.graphics.drawable.AnimatedVectorDrawable}
200-
* and below it inflates the drawable as a {@link AnimatedVectorDrawableCompat}.
198+
* Inflates an animated vector drawable.
201199
*
202200
* @param animatedVectorDrawableResId resource ID for the animated vector
203201
* @return animated vector drawable
204202
*/
205203
public Drawable createAnimatedVectorDrawable(@DrawableRes int animatedVectorDrawableResId) {
206-
Context context = getContext();
207-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
208-
Drawable drawable = context.getDrawable(animatedVectorDrawableResId);
209-
return drawable.getConstantState().newDrawable(context.getResources());
210-
} else {
211-
return AnimatedVectorDrawableCompat.create(context, animatedVectorDrawableResId);
212-
}
204+
return AnimatedVectorDrawableCompat.create(getContext(), animatedVectorDrawableResId);
213205
}
214206

215207
/**

material-stepper/src/main/res/drawable-v21/ms_animated_vector_circle_to_warning_24dp.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

material-stepper/src/main/res/drawable-v21/ms_animated_vector_warning_to_circle_24dp.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

material-stepper/src/main/res/drawable-v21/ms_vector_circle_24dp.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

material-stepper/src/main/res/drawable-v21/ms_vector_warning_24dp.xml

Lines changed: 0 additions & 18 deletions
This file was deleted.

material-stepper/src/main/res/drawable/ms_animated_vector_circle_to_warning_24dp.xml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,27 @@
44
android:drawable="@drawable/ms_vector_circle_24dp"
55
tools:targetApi="lollipop">
66

7-
<target android:name="circle_group">
7+
<target android:name="icon">
88
<aapt:attr name="android:animation">
9-
<set>
10-
11-
<objectAnimator
12-
android:propertyName="scaleX"
13-
android:valueFrom="1"
14-
android:interpolator="@android:anim/decelerate_interpolator"
15-
android:valueTo="@integer/ms_circle_start_scale"
16-
android:duration="@integer/ms_default_error_tab_animation_duration" />
17-
18-
<objectAnimator
19-
android:propertyName="scaleY"
20-
android:valueFrom="1"
21-
android:valueTo="@integer/ms_circle_start_scale"
22-
android:interpolator="@android:anim/decelerate_interpolator"
23-
android:duration="@integer/ms_default_error_tab_animation_duration" />
24-
</set>
9+
<objectAnimator
10+
android:duration="@integer/ms_default_error_tab_animation_duration"
11+
android:interpolator="@android:anim/decelerate_interpolator"
12+
android:propertyName="pathData"
13+
android:valueFrom="@string/ms_circle_path"
14+
android:valueTo="@string/ms_warning_path"
15+
android:valueType="pathType" />
2516
</aapt:attr>
2617
</target>
2718

2819
<target android:name="icon_container">
2920
<aapt:attr name="android:animation">
3021
<objectAnimator
3122
android:duration="@integer/ms_default_error_tab_animation_duration"
23+
android:interpolator="@android:anim/decelerate_interpolator"
3224
android:propertyName="translateY"
3325
android:valueFrom="0"
3426
android:valueTo="@integer/ms_warning_end_translate_y" />
3527
</aapt:attr>
3628
</target>
3729

38-
<target android:name="circle">
39-
<aapt:attr name="android:animation">
40-
<!-- This hack is needed since setting duration to 0 and startOffset to 300 does not trigger the animation... -->
41-
<objectAnimator
42-
android:duration="1"
43-
android:startOffset="299"
44-
android:propertyName="fillAlpha"
45-
android:valueFrom="1"
46-
android:valueTo="0" />
47-
</aapt:attr>
48-
</target>
49-
5030
</animated-vector>

material-stepper/src/main/res/drawable/ms_animated_vector_warning_to_circle_24dp.xml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,23 @@
44
android:drawable="@drawable/ms_vector_warning_24dp"
55
tools:targetApi="lollipop">
66

7-
<target android:name="circle">
7+
<target android:name="icon">
88
<aapt:attr name="android:animation">
99
<objectAnimator
10-
android:duration="0"
11-
android:propertyName="fillAlpha"
12-
android:valueFrom="0"
13-
android:valueTo="1" />
14-
</aapt:attr>
15-
</target>
16-
17-
<target android:name="circle_group">
18-
<aapt:attr name="android:animation">
19-
<set>
20-
21-
<objectAnimator
22-
android:duration="@integer/ms_default_error_tab_animation_duration"
23-
android:interpolator="@android:anim/decelerate_interpolator"
24-
android:propertyName="scaleX"
25-
android:valueFrom="@integer/ms_circle_start_scale"
26-
android:valueTo="1" />
27-
28-
<objectAnimator
29-
android:duration="@integer/ms_default_error_tab_animation_duration"
30-
android:interpolator="@android:anim/decelerate_interpolator"
31-
android:propertyName="scaleY"
32-
android:valueFrom="@integer/ms_circle_start_scale"
33-
android:valueTo="1" />
34-
</set>
10+
android:duration="@integer/ms_default_error_tab_animation_duration"
11+
android:interpolator="@android:anim/decelerate_interpolator"
12+
android:propertyName="pathData"
13+
android:valueFrom="@string/ms_warning_path"
14+
android:valueTo="@string/ms_circle_path"
15+
android:valueType="pathType" />
3516
</aapt:attr>
3617
</target>
3718

3819
<target android:name="icon_container">
3920
<aapt:attr name="android:animation">
4021
<objectAnimator
4122
android:duration="@integer/ms_default_error_tab_animation_duration"
23+
android:interpolator="@android:anim/decelerate_interpolator"
4224
android:propertyName="translateY"
4325
android:valueFrom="@integer/ms_warning_end_translate_y"
4426
android:valueTo="0" />

material-stepper/src/main/res/drawable/ms_vector_circle_24dp.xml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,10 @@
88
android:name="icon_container"
99
android:translateY="0">
1010

11-
<group
12-
android:name="circle_group"
13-
android:pivotX="12"
14-
android:pivotY="12"
15-
android:scaleX="1"
16-
android:scaleY="1">
17-
18-
<path
19-
android:name="circle"
20-
android:fillAlpha="1"
21-
android:fillColor="@android:color/black"
22-
android:pathData="@string/ms_circle_path" />
23-
24-
</group>
25-
2611
<path
12+
android:name="icon"
2713
android:fillColor="@android:color/black"
28-
android:pathData="@string/ms_warning_path" />
14+
android:pathData="@string/ms_circle_path" />
2915

3016
</group>
3117

0 commit comments

Comments
 (0)