Update TextInputLayout icon for spec update
Test: manual
BUG: 32691181
Change-Id: I7b32b034eb7cb7f0bd44504362c2313c80ee8d89
diff --git a/design/res/color-v23/design_tint_password_toggle.xml b/design/res/color-v23/design_tint_password_toggle.xml
index 3a09d32a..b728ccf 100644
--- a/design/res/color-v23/design_tint_password_toggle.xml
+++ b/design/res/color-v23/design_tint_password_toggle.xml
@@ -15,6 +15,5 @@
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checked="true" android:color="?android:attr/colorForeground" android:alpha="0.54"/>
- <item android:color="?android:attr/colorForeground" android:alpha="0.38"/>
+ <item android:color="?android:attr/colorForeground" android:alpha="0.54"/>
</selector>
\ No newline at end of file
diff --git a/design/res/color/design_tint_password_toggle.xml b/design/res/color/design_tint_password_toggle.xml
index 15016e4..13beffd 100644
--- a/design/res/color/design_tint_password_toggle.xml
+++ b/design/res/color/design_tint_password_toggle.xml
@@ -16,6 +16,5 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
- <item android:state_checked="true" android:color="?android:attr/colorForeground" app:alpha="0.54"/>
- <item android:color="?android:attr/colorForeground" app:alpha="0.38"/>
+ <item android:color="?android:attr/colorForeground" app:alpha="0.54"/>
</selector>
\ No newline at end of file
diff --git a/design/res/drawable/design_ic_visibility.xml b/design/res/drawable-anydpi-v21/design_ic_visibility.xml
similarity index 74%
rename from design/res/drawable/design_ic_visibility.xml
rename to design/res/drawable-anydpi-v21/design_ic_visibility.xml
index 91d46ff..123acd2 100644
--- a/design/res/drawable/design_ic_visibility.xml
+++ b/design/res/drawable-anydpi-v21/design_ic_visibility.xml
@@ -20,7 +20,9 @@
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
+
<path
- android:fillColor="@android:color/black"
- android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
+ android:fillColor="@android:color/white"
+ android:pathData="@string/path_password_eye"/>
+
</vector>
\ No newline at end of file
diff --git a/design/res/drawable-anydpi-v21/design_ic_visibility_off.xml b/design/res/drawable-anydpi-v21/design_ic_visibility_off.xml
new file mode 100644
index 0000000..a8b47f0
--- /dev/null
+++ b/design/res/drawable-anydpi-v21/design_ic_visibility_off.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="24"
+ android:viewportWidth="24">
+
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/>
+
+</vector>
\ No newline at end of file
diff --git a/design/res/drawable-hdpi/design_ic_visibility.png b/design/res/drawable-hdpi/design_ic_visibility.png
new file mode 100644
index 0000000..329e617
--- /dev/null
+++ b/design/res/drawable-hdpi/design_ic_visibility.png
Binary files differ
diff --git a/design/res/drawable-hdpi/design_ic_visibility_off.png b/design/res/drawable-hdpi/design_ic_visibility_off.png
new file mode 100644
index 0000000..b21a686
--- /dev/null
+++ b/design/res/drawable-hdpi/design_ic_visibility_off.png
Binary files differ
diff --git a/design/res/drawable-mdpi/design_ic_visibility.png b/design/res/drawable-mdpi/design_ic_visibility.png
new file mode 100644
index 0000000..58597e9
--- /dev/null
+++ b/design/res/drawable-mdpi/design_ic_visibility.png
Binary files differ
diff --git a/design/res/drawable-mdpi/design_ic_visibility_off.png b/design/res/drawable-mdpi/design_ic_visibility_off.png
new file mode 100644
index 0000000..3efdf49
--- /dev/null
+++ b/design/res/drawable-mdpi/design_ic_visibility_off.png
Binary files differ
diff --git a/design/res/drawable-v21/avd_hide_password.xml b/design/res/drawable-v21/avd_hide_password.xml
new file mode 100644
index 0000000..8c6ed1c
--- /dev/null
+++ b/design/res/drawable-v21/avd_hide_password.xml
@@ -0,0 +1,86 @@
+<?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-vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt">
+
+ <aapt:attr name="android:drawable">
+
+ <vector
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="24"
+ android:viewportWidth="24">
+
+ <path
+ android:name="strike_through"
+ android:pathData="@string/path_password_strike_through"
+ android:strokeColor="@android:color/white"
+ android:strokeLineCap="square"
+ android:strokeWidth="1.8"
+ android:trimPathEnd="0"/>
+
+ <group>
+
+ <clip-path
+ android:name="eye_mask"
+ android:pathData="@string/path_password_eye_mask_visible"/>
+
+ <path
+ android:name="eye"
+ android:fillColor="@android:color/white"
+ android:pathData="@string/path_password_eye"/>
+
+ </group>
+
+ </vector>
+
+ </aapt:attr>
+
+ <target android:name="eye_mask">
+
+ <aapt:attr name="android:animation">
+
+ <objectAnimator
+ android:duration="@integer/hide_password_duration"
+ android:interpolator="@android:interpolator/fast_out_slow_in"
+ android:propertyName="pathData"
+ android:valueFrom="@string/path_password_eye_mask_visible"
+ android:valueTo="@string/path_password_eye_mask_strike_through"
+ android:valueType="pathType"/>
+
+ </aapt:attr>
+
+ </target>
+
+ <target android:name="strike_through">
+
+ <aapt:attr name="android:animation">
+
+ <objectAnimator
+ android:duration="@integer/hide_password_duration"
+ android:interpolator="@android:interpolator/fast_out_slow_in"
+ android:propertyName="trimPathEnd"
+ android:valueFrom="0"
+ android:valueTo="1"/>
+
+ </aapt:attr>
+
+ </target>
+
+</animated-vector>
diff --git a/design/res/drawable-v21/avd_show_password.xml b/design/res/drawable-v21/avd_show_password.xml
new file mode 100644
index 0000000..5b205d7
--- /dev/null
+++ b/design/res/drawable-v21/avd_show_password.xml
@@ -0,0 +1,85 @@
+<?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-vector
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt">
+
+ <aapt:attr name="android:drawable">
+
+ <vector
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="24"
+ android:viewportWidth="24">
+
+ <path
+ android:name="strike_through"
+ android:pathData="@string/path_password_strike_through"
+ android:strokeColor="@android:color/white"
+ android:strokeLineCap="square"
+ android:strokeWidth="1.8"/>
+
+ <group>
+
+ <clip-path
+ android:name="eye_mask"
+ android:pathData="@string/path_password_eye_mask_strike_through"/>
+
+ <path
+ android:name="eye"
+ android:fillColor="@android:color/white"
+ android:pathData="@string/path_password_eye"/>
+
+ </group>
+
+ </vector>
+
+ </aapt:attr>
+
+ <target android:name="eye_mask">
+
+ <aapt:attr name="android:animation">
+
+ <objectAnimator
+ android:duration="@integer/show_password_duration"
+ android:interpolator="@android:interpolator/fast_out_linear_in"
+ android:propertyName="pathData"
+ android:valueFrom="@string/path_password_eye_mask_strike_through"
+ android:valueTo="@string/path_password_eye_mask_visible"
+ android:valueType="pathType"/>
+
+ </aapt:attr>
+
+ </target>
+
+ <target android:name="strike_through">
+
+ <aapt:attr name="android:animation">
+
+ <objectAnimator
+ android:duration="@integer/show_password_duration"
+ android:interpolator="@android:interpolator/fast_out_linear_in"
+ android:propertyName="trimPathEnd"
+ android:valueFrom="1"
+ android:valueTo="0"/>
+
+ </aapt:attr>
+
+ </target>
+
+</animated-vector>
diff --git a/design/res/drawable-v21/design_password_eye.xml b/design/res/drawable-v21/design_password_eye.xml
new file mode 100644
index 0000000..1bffaf4
--- /dev/null
+++ b/design/res/drawable-v21/design_password_eye.xml
@@ -0,0 +1,39 @@
+<?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>
\ No newline at end of file
diff --git a/design/res/drawable-xhdpi/design_ic_visibility.png b/design/res/drawable-xhdpi/design_ic_visibility.png
new file mode 100644
index 0000000..1f7b4cc
--- /dev/null
+++ b/design/res/drawable-xhdpi/design_ic_visibility.png
Binary files differ
diff --git a/design/res/drawable-xhdpi/design_ic_visibility_off.png b/design/res/drawable-xhdpi/design_ic_visibility_off.png
new file mode 100644
index 0000000..46bf0c93
--- /dev/null
+++ b/design/res/drawable-xhdpi/design_ic_visibility_off.png
Binary files differ
diff --git a/design/res/drawable-xxhdpi/design_ic_visibility.png b/design/res/drawable-xxhdpi/design_ic_visibility.png
new file mode 100644
index 0000000..c816ab49
--- /dev/null
+++ b/design/res/drawable-xxhdpi/design_ic_visibility.png
Binary files differ
diff --git a/design/res/drawable-xxhdpi/design_ic_visibility_off.png b/design/res/drawable-xxhdpi/design_ic_visibility_off.png
new file mode 100644
index 0000000..13eb65d
--- /dev/null
+++ b/design/res/drawable-xxhdpi/design_ic_visibility_off.png
Binary files differ
diff --git a/design/res/drawable-xxxhdpi/design_ic_visibility.png b/design/res/drawable-xxxhdpi/design_ic_visibility.png
new file mode 100644
index 0000000..e005b97
--- /dev/null
+++ b/design/res/drawable-xxxhdpi/design_ic_visibility.png
Binary files differ
diff --git a/design/res/drawable-xxxhdpi/design_ic_visibility_off.png b/design/res/drawable-xxxhdpi/design_ic_visibility_off.png
new file mode 100644
index 0000000..ce3c9d8
--- /dev/null
+++ b/design/res/drawable-xxxhdpi/design_ic_visibility_off.png
Binary files differ
diff --git a/design/res/drawable/design_password_eye.xml b/design/res/drawable/design_password_eye.xml
new file mode 100644
index 0000000..b5185f1
--- /dev/null
+++ b/design/res/drawable/design_password_eye.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:drawable="@drawable/design_ic_visibility"
+ android:state_checked="true"/>
+
+ <item
+ android:drawable="@drawable/design_ic_visibility_off"/>
+
+</selector>
\ No newline at end of file
diff --git a/design/res/values/password_visibility.xml b/design/res/values/password_visibility.xml
new file mode 100644
index 0000000..23faec3
--- /dev/null
+++ b/design/res/values/password_visibility.xml
@@ -0,0 +1,28 @@
+<?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.
+ -->
+
+<resources>
+
+ <!-- Resources used in the password visibility anim, see @drawable/design_password_eye -->
+ <string name="path_password_eye_mask_visible">M2,4.27 L2,4.27 L4.54,1.73 L4.54,1.73 L4.54,1 L23,1 L23,23 L1,23 L1,4.27 Z</string>
+ <string name="path_password_eye_mask_strike_through">M2,4.27 L19.73,22 L22.27,19.46 L4.54,1.73 L4.54,1 L23,1 L23,23 L1,23 L1,4.27 Z</string>
+ <string name="path_password_eye">M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z</string>
+ <string name="path_password_strike_through">M3.27,4.27 L19.74,20.74</string>
+ <integer name="show_password_duration">200</integer>
+ <integer name="hide_password_duration">320</integer>
+
+</resources>
diff --git a/design/res/values/styles.xml b/design/res/values/styles.xml
index 820742f..1e13d47 100644
--- a/design/res/values/styles.xml
+++ b/design/res/values/styles.xml
@@ -69,7 +69,7 @@
<item name="errorTextAppearance">@style/TextAppearance.Design.Error</item>
<item name="counterTextAppearance">@style/TextAppearance.Design.Counter</item>
<item name="counterOverflowTextAppearance">@style/TextAppearance.Design.Counter.Overflow</item>
- <item name="passwordToggleDrawable">@drawable/design_ic_visibility</item>
+ <item name="passwordToggleDrawable">@drawable/design_password_eye</item>
<item name="passwordToggleTint">@color/design_tint_password_toggle</item>
</style>