Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08b643dd authored by Jun Mukai's avatar Jun Mukai Committed by Android Git Automerger
Browse files

am cc45eeff: am 46f087c4: Merge "Apply thumbTint and trackTint styles to...

am cc45eeff: am 46f087c4: Merge "Apply thumbTint and trackTint styles to Switch from xml." into mnc-dev

* commit 'cc45eeff':
  Apply thumbTint and trackTint styles to Switch from xml.
parents fed11552 cc45eeff
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -242,6 +242,38 @@ public class Switch extends CompoundButton {
                com.android.internal.R.styleable.Switch_switchPadding, 0);
        mSplitTrack = a.getBoolean(com.android.internal.R.styleable.Switch_splitTrack, false);

        ColorStateList thumbTintList = a.getColorStateList(
                com.android.internal.R.styleable.Switch_thumbTint);
        if (thumbTintList != null) {
            mThumbTintList = thumbTintList;
            mHasThumbTint = true;
        }
        PorterDuff.Mode thumbTintMode = Drawable.parseTintMode(
                a.getInt(com.android.internal.R.styleable.Switch_thumbTintMode, -1), null);
        if (mThumbTintMode != thumbTintMode) {
            mThumbTintMode = thumbTintMode;
            mHasThumbTintMode = true;
        }
        if (mHasThumbTint || mHasThumbTintMode) {
            applyThumbTint();
        }

        ColorStateList trackTintList = a.getColorStateList(
                com.android.internal.R.styleable.Switch_trackTint);
        if (trackTintList != null) {
            mTrackTintList = trackTintList;
            mHasTrackTint = true;
        }
        PorterDuff.Mode trackTintMode = Drawable.parseTintMode(
                a.getInt(com.android.internal.R.styleable.Switch_trackTintMode, -1), null);
        if (mTrackTintMode != trackTintMode) {
            mTrackTintMode = trackTintMode;
            mHasTrackTintMode = true;
        }
        if (mHasTrackTint || mHasTrackTintMode) {
            applyTrackTint();
        }

        final int appearance = a.getResourceId(
                com.android.internal.R.styleable.Switch_switchTextAppearance, 0);
        if (appearance != 0) {