Fixed
Status Update
Comments
ki...@google.com <ki...@google.com> #2
1.4.0-alpha03
still missing tint compound drawable ...
ki...@google.com <ki...@google.com> #3
Marking as low-hanging bug. This seems like it should be straightfoward fix.
he...@ataulm.com <he...@ataulm.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 5184652d714e2f13390a9ff6884d8e4bd41d0f8e
Author: Alan Viverette <alanv@google.com>
Date: Tue Feb 08 16:13:05 2022
Implement TintableCompoundDrawablesView in TextView-derived widgets
Adds AppCompatMultiAutoCompleteViewTest, which is a direct copy of
AppCompatAutoCompleteViewTest. Everything else is copied from
AppCompatTextView and refactored to match the class names. There's no
new logic in this CL.
Relnote: Backports compound drawable tinting to TextView-derived widgets
Fixes: 165822337
Test: AppCompatCheckBoxTest, etc.
Change-Id: Idf98ced324a724a5cb5b9d5a2f397a3b82fad900
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatAutoCompleteTextViewTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_togglebutton_activity.xml
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_autocompletetextview_activity.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java
A appcompat/appcompat/src/androidTest/res/layout/appcompat_multiautocompletetextview_activity.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatToggleButton.java
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextViewTest.java
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatToggleButtonTest.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckedTextView.java
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextViewActivity.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_checkedtextview_activity.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckedTextViewTest.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_checkbox_activity.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_activity.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_radiobutton_activity.xml
https://android-review.googlesource.com/1978467
Branch: androidx-main
commit 5184652d714e2f13390a9ff6884d8e4bd41d0f8e
Author: Alan Viverette <alanv@google.com>
Date: Tue Feb 08 16:13:05 2022
Implement TintableCompoundDrawablesView in TextView-derived widgets
Adds AppCompatMultiAutoCompleteViewTest, which is a direct copy of
AppCompatAutoCompleteViewTest. Everything else is copied from
AppCompatTextView and refactored to match the class names. There's no
new logic in this CL.
Relnote: Backports compound drawable tinting to TextView-derived widgets
Fixes: 165822337
Test: AppCompatCheckBoxTest, etc.
Change-Id: Idf98ced324a724a5cb5b9d5a2f397a3b82fad900
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextView.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckBox.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatAutoCompleteTextViewTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_togglebutton_activity.xml
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckBoxTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_autocompletetextview_activity.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatRadioButton.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatAutoCompleteTextView.java
A appcompat/appcompat/src/androidTest/res/layout/appcompat_multiautocompletetextview_activity.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatToggleButton.java
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextViewTest.java
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatToggleButtonTest.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatCheckedTextView.java
A appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatMultiAutoCompleteTextViewActivity.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_checkedtextview_activity.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatCheckedTextViewTest.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatRadioButtonTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_checkbox_activity.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_activity.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_radiobutton_activity.xml
ki...@google.com <ki...@google.com> #5
This is one of those cases where I am so glad that we have good tests. It's surprising how much can go wrong in a straightforward* copy/paste set of changes.
Anyway, this won't be in the next release -- just missed build cut deadline -- but it'll be out in a 1.5.0
alpha some time in the next ~month.
*actually not straightforward
he...@ataulm.com <he...@ataulm.com> #6
Perfect thanks!
For us, there's no urgency as we're wrapping usages of `TextViewCompat.setTextAppearance` with our own function and applying this workaround on Lollipop, but would be great to ditch it at some point because no doubt this sort of thing is the source of subtle bugs/divergences in intended behaviour.
For us, there's no urgency as we're wrapping usages of `TextViewCompat.setTextAppearance` with our own function and applying this workaround on Lollipop, but would be great to ditch it at some point because no doubt this sort of thing is the source of subtle bugs/divergences in intended behaviour.
ki...@google.com <ki...@google.com>
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 7869860590c185a90287c9b94e1de151b0c75504
Author: Kirill Grouchnikov <kirillg@google.com>
Date: Tue May 05 12:55:01 2020
Consistent resolution of text hint and link colors
Same as for changing set appearance and resolving the main
text color - do the same for text link and text hint colors.
Test: ./gradlew appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextTest
Test: ./gradlew appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatTextViewTest
Bug: 154702995
Change-Id: Iddb7f1e7f17b9bceb14c20ca0b3468b10092b8f9
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java
A appcompat/appcompat/src/androidTest/res/color/color_state_list_hint.xml
A appcompat/appcompat/src/androidTest/res/color/color_state_list_refs12.xml
A appcompat/appcompat/src/androidTest/res/color/color_state_list_refs34.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_activity.xml
A appcompat/appcompat/src/androidTest/res/values/attrs.xml
M appcompat/appcompat/src/androidTest/res/values/strings.xml
M appcompat/appcompat/src/androidTest/res/values/styles.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java
https://android-review.googlesource.com/1302103
Branch: androidx-master-dev
commit 7869860590c185a90287c9b94e1de151b0c75504
Author: Kirill Grouchnikov <kirillg@google.com>
Date: Tue May 05 12:55:01 2020
Consistent resolution of text hint and link colors
Same as for changing set appearance and resolving the main
text color - do the same for text link and text hint colors.
Test: ./gradlew appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextTest
Test: ./gradlew appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatTextViewTest
Bug: 154702995
Change-Id: Iddb7f1e7f17b9bceb14c20ca0b3468b10092b8f9
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextTest.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatTextViewTest.java
A appcompat/appcompat/src/androidTest/res/color/color_state_list_hint.xml
A appcompat/appcompat/src/androidTest/res/color/color_state_list_refs12.xml
A appcompat/appcompat/src/androidTest/res/color/color_state_list_refs34.xml
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_activity.xml
A appcompat/appcompat/src/androidTest/res/values/attrs.xml
M appcompat/appcompat/src/androidTest/res/values/strings.xml
M appcompat/appcompat/src/androidTest/res/values/styles.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatTextHelper.java
Description
androidx.appcompat:appcompat
1.2.0-beta01
Theme.MaterialComponents.Light.NoActionBar
Issue
Setting the text appearance programmatically with
TextViewCompat.setTextAppearance(TextView, Int)
on anAppCompatEditText
does not take into account theme attrs being used inColorStateList
asandroid:textColorHint
(orandroid:textColorLink
).So on Lollipop, such a hint color is rendered as red (see screenshot).
Cause
Internally, it delegates to
AppCompatTextHelper.onSetTextAppearance
, which doesn't handle these two attributes - it only considersandroid:textColor
:However, it does consider them in
loadFromAttributes()
so it seems like it's an oversight.Feature request/bug fix
Update
AppCompatTextHelper
to handle theme attributes in CSLs forandroid:textColorHint
andandroid:textColorLink
inonSetTextAppearance()
as it's done inloadFromAttributes()
.Workaround
For folks in the meantime - call this too, after calling
TextViewCompat.setTextAppearance()
.