This is not an easy task: text and other Android widgets can have their own personal style (it also depends on the version for Android).
Therefore, to get around this, you will have to create your own style.
When creating your own style, always refer to the Android source code on this topic:
https://github.com/android/platform_frameworks_base/tree/master/core/res/res/values
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/themes.xml
https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
There are several ways to create your own style.
One way is to indicate your activity in your manifest. First you need the styles.xml file in the / values ββ/ folder. Here you declare your new style:
<style name="Theme.MyTheme.Dark" parent="@android:style/Theme.NoTitleBar"> <item name="android:textViewStyle">@style/Widget.TextView.Black</item> </style> <style name="Theme.MyTheme.Light" parent="@android:style/Theme.NoTitleBar"> <item name="android:textViewStyle">@style/Widget.TextView.White</item> </style>
The style above it, inherited from the Android style, which hides the title bar, you can inherit from something else. In this thread, we override textViewStyle, this allows us to set custom values ββfor our TextView
and override some of the internal values.
<style name="Widget.TextView.White" parent="@android:style/Widget.TextView"> <item name="android:textColor">#FFFFFF</item> </style> <style name="Widget.TextView.Black" parent="@android:style/Widget.TextView"> <item name="android:textColor">#000000</item> </style>
Finally, you are the subject of your activities in AndroidManifest.xml:
<activity android:name=".ui.phone.FirstActivity" android:theme="@style/Theme.MyTheme.Dark" /> <activity android:name=".ui.phone.SecondActivity" android:theme="@style/Theme.MyTheme.Light" />
Now when you use a TextView in FirstActivity, the text will be black by default and white in the second.
For your specific question:
You will need to look in the source files I linked to above and see if there are any padding or minWidth or size attributes that affect your widgets and your layout.