This question is related to two other questions that I'll specifically name below. The difference being, that I specifically ask for a way to change the color without the use of the base AppTheme
.
In the first related question, the proposed solution includes setting
<item name="colorAccent">@color/Color Name</item>
in AppTheme
However, it also says to make a theme/style specifically for the TextInputLayout
, which looks like this:
<style name="TextLabel" parent="TextAppearance.AppCompat">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">@color/Color Name</item>
<item name="android:textSize">20sp</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">@color/Color Name</item>
<item name="colorControlNormal">@color/Color Name</item>
<item name="colorControlActivated">@color/Color Name</item>
</style>
So the colorAccent
is set twice. I tried this and came to the conclusion that the specific theme for the TextInputLayout
is unnecessary, as I got the same result, with and without it. Only setting the colorAccent
in the AppTheme
is sufficient. This works but isn't necessarily what I want/need.
In the second related question, people suggest to, again, modify the AppTheme
and setting colorAccent
(and other attributes).
However, I don't find this solution right/satisfying. There should be a way to specifically change that one color without changing the style of the whole app, which the person posing the second question also criticizes in one of his/her comments.
So, what I am specifically looking for here, is a solution, in XML or programmatically, to specifically change the color of the floating hint/label and cursor of the TextInputLabel
+TextInputEditText
Combo. Basically the same behavior I'd get when setting colorAccent
.
Is there a way to do this or did the SDK developers seriously make it only possible by setting colorAccent
?
PS I realize that this might work with making a new Theme, inheriting from AppTheme
and setting it to the activities that I want to have the specific color. However, as I said, thats not what I'm looking for.