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

Commit 09be4b3c authored by Alan Viverette's avatar Alan Viverette
Browse files

Stop using framework-private switch asset

BUG: 16467249
Change-Id: I0829c3dea522cf59e0f92046ea7c6092d416ad4c
parent 6d839875
Loading
Loading
Loading
Loading

res/drawable/switch_inner.xml

deleted100644 → 0
+0 −37
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:state_checked="true">
        <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000"
                    android:tint="?android:attr/colorControlNormal"
                    android:alpha="?android:attr/disabledAlpha" />
    </item>
    <item android:state_enabled="false">
        <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000"
                    android:tint="?android:attr/colorControlNormal"
                    android:alpha="?android:attr/disabledAlpha" />
    </item>
    <item android:state_checked="true">
        <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000"
                    android:tint="@color/switch_accent_color" />
    </item>
    <item>
        <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000"
                    android:tint="?android:attr/colorControlNormal" />
    </item>
</selector>

res/drawable/switch_track.xml

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true">
        <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha"
                    android:tint="@color/switch_accent_color" />
    </item>
    <item>
        <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha"
                    android:tint="?android:attr/colorControlNormal" />
    </item>
</selector>
+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:background="@null" />
            android:background="@null"
            android:theme="@style/ThemeOverlay.SwitchBar" />

</merge>
+6 −0
Original line number Diff line number Diff line
@@ -204,4 +204,10 @@
        <item name="@android:numbersBackgroundColor">@android:color/white</item>
    </style>

    <!-- Used to color the switch bar controls -->
    <style name="ThemeOverlay.SwitchBar" parent="@android:style/ThemeOverlay">
        <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. -->
        <item name="android:colorAccent">@color/switch_accent_color</item>
    </style>

</resources>
+0 −3
Original line number Diff line number Diff line
@@ -97,9 +97,6 @@ public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedC
            }
        });

        mSwitch.setTrackResource(R.drawable.switch_track);
        mSwitch.setThumbResource(R.drawable.switch_inner);

        setOnClickListener(this);

        // Default is hide