In my layout, I am using falling for predefined values for android:textAppearence
. But, there are, as I found, at least 2 ways to define them, which yields a very different result (like, different font size and alpha
and weight
value):
android:textAppearance:="@style/TextAppearance.MaterialComponents.Caption"
. This@style/...
values are defined in (in my case) in a file~/.gradle/caches/transforms-2/files-2.1/11ab83d2971a1126be493aa33fdd0f6e/material-1.1.0/res/values
. This, for example, is defined as:<style name="TextAppearance.MaterialComponents.Caption" parent="TextAppearance.AppCompat.Caption"> <item name="fontFamily">sans-serif</item> <item name="android:fontFamily">sans-serif</item> <item name="android:textStyle">normal</item> <item name="android:textAllCaps">false</item> <item name="android:textSize">12sp</item> <item name="android:letterSpacing">0.0333333333</item> </style>
android:textAppearance="@android:style/TextAppearance.Material.Menu"
. This is defined in/home/rudra/.Android/Sdk/platforms/android-29/data/res/values/styles_material.xml
. This is defined as:<style name="TextAppearance.Material.Menu"> <item name="textSize">@dimen/text_size_menu_material</item> <item name="fontFamily">@string/font_family_menu_material</item> </style>
The main problem to me is, I am not sure which one to use for more consistent user experience. I am sure, the file for case 2
will not be shipped with my app, but maybe the user will have styles_material
for his android-xx. But by realizing how values have changed with material-1.0.0
and 1.1.0
, I am a bit sKeptic to depend on these values, but I am not sure.
On the other hand, this is a considerable work to redefine textAppearance
for all possible scenarios.
So, I am looking for suggestions on how to define the textAppearence
, and among case 1
and case 2
, which should I use for more consistent result across devices