Simplify TextField drawable resources
https://github.com/material-components/material-components-android/issues/611 PiperOrigin-RevId: 273544807
@ -3591,7 +3591,7 @@ public class TextInputLayout extends LinearLayout {
|
||||
colorStateList.getColorForState(this.getDrawableState(), colorStateList.getDefaultColor());
|
||||
|
||||
icon = DrawableCompat.wrap(icon).mutate();
|
||||
DrawableCompat.setTint(icon, color);
|
||||
DrawableCompat.setTintList(icon, ColorStateList.valueOf(color));
|
||||
iconView.setImageDrawable(icon);
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 507 B |
|
Before Width: | Height: | Size: 309 B |
|
Before Width: | Height: | Size: 351 B |
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2016 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.
|
||||
-->
|
||||
|
||||
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/visible"
|
||||
android:drawable="@drawable/design_ic_visibility"
|
||||
android:state_checked="true"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/masked"
|
||||
android:drawable="@drawable/design_ic_visibility_off"/>
|
||||
|
||||
<transition
|
||||
android:drawable="@drawable/avd_show_password"
|
||||
android:fromId="@id/masked"
|
||||
android:toId="@id/visible"/>
|
||||
|
||||
<transition
|
||||
android:drawable="@drawable/avd_hide_password"
|
||||
android:fromId="@id/visible"
|
||||
android:toId="@id/masked"/>
|
||||
|
||||
</animated-selector>
|
||||
|
||||
|
Before Width: | Height: | Size: 593 B |
|
Before Width: | Height: | Size: 629 B |
|
Before Width: | Height: | Size: 868 B |
|
Before Width: | Height: | Size: 884 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@ -17,7 +17,9 @@
|
||||
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="NewApi">
|
||||
|
||||
<aapt:attr name="android:drawable">
|
||||
|
||||
@ -17,7 +17,9 @@
|
||||
|
||||
<animated-vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt">
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="NewApi">
|
||||
|
||||
<aapt:attr name="android:drawable">
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="NewApi"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0"
|
||||
@ -16,6 +16,8 @@
|
||||
-->
|
||||
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="NewApi"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24"
|
||||
@ -15,13 +15,28 @@
|
||||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<animated-selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:ignore="NewApi">
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/design_ic_visibility"
|
||||
android:state_checked="true"/>
|
||||
<item
|
||||
android:id="@+id/visible"
|
||||
android:drawable="@drawable/design_ic_visibility"
|
||||
android:state_checked="true"/>
|
||||
|
||||
<item
|
||||
android:drawable="@drawable/design_ic_visibility_off"/>
|
||||
<item
|
||||
android:id="@+id/masked"
|
||||
android:drawable="@drawable/design_ic_visibility_off"/>
|
||||
|
||||
<transition
|
||||
android:drawable="@drawable/avd_show_password"
|
||||
android:fromId="@id/masked"
|
||||
android:toId="@id/visible"/>
|
||||
|
||||
<transition
|
||||
android:drawable="@drawable/avd_hide_password"
|
||||
android:fromId="@id/visible"
|
||||
android:toId="@id/masked"/>
|
||||
|
||||
</animated-selector>
|
||||
|
||||
</selector>
|
||||
|
||||