Skip to content

Commit

Permalink
Use custom tintMode attribute instead of API 21's.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghai committed Oct 3, 2015
1 parent 91e6a55 commit 7db62ac
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -60,7 +60,7 @@ Available custom attributes:
- `app:mpb_useIntrinsicPadding`: Whether progress drawable should use its intrinsic padding. Defaults to `true`.
- `app:mpb_showTrack`: Whether progress drawable should show a track. Defaults to `true` for horizontal progress drawable, `false` otherwise.

`android:tint` and `android:tintMode` are also backported so that they can control the tinting of progress drawables. The default tint color is `?colorControlActivated`, and the default tint mode is `src_in`.
`android:tint` and `app:mpb_tintMode` are also backported so that they can control the tinting of progress drawables. The default tint color is `?colorControlActivated`, and the default tint mode is `src_in`.

### Using Drawable

Expand Down
Empty file modified art/app_icon_base.sh 100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions library/library.iml
Expand Up @@ -89,6 +89,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
Expand Down
Expand Up @@ -76,9 +76,9 @@ private void init(Context context, AttributeSet attrs, int defStyleAttr, int def
R.styleable.MaterialProgressBar_android_tint);
mProgressTint.mHasTintList = true;
}
if (a.hasValue(R.styleable.MaterialProgressBar_android_tintMode)) {
if (a.hasValue(R.styleable.MaterialProgressBar_mpb_tintMode)) {
mProgressTint.mTintMode = DrawableCompat.parseTintMode(a.getInt(
R.styleable.MaterialProgressBar_android_tintMode, -1), null);
R.styleable.MaterialProgressBar_mpb_tintMode, -1), null);
mProgressTint.mHasTintMode = true;
}
a.recycle();
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/values/attrs.xml
Expand Up @@ -25,6 +25,6 @@
-->
<attr name="mpb_showTrack" format="boolean" />
<attr name="android:tint" />
<attr name="android:tintMode" />
<attr name="mpb_tintMode" />
</declare-styleable>
</resources>
3 changes: 3 additions & 0 deletions sample/sample.iml
Expand Up @@ -84,6 +84,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down

0 comments on commit 7db62ac

Please sign in to comment.