Create customized textual content fashion
Instance to create customized textual content fashion:
Modify /res/values/types.xml to create our customized textual content fashion “LargeRedText”, “InverseMediumBlueText”, “GreenText”, “ItalicGrayText” and “Daring50BlackText”.
1 | <assets xmlns:android="http://schemas.android.com/apk/res/android"><br /><br /> <!--<br /> Base utility theme, depending on API stage. This theme is changed<br /> by AppBaseTheme from res/values-vXX/types.xml on newer units.<br /> --><br /> <fashion identify="AppBaseTheme" guardian="Theme.AppCompat.Mild"><br /> <!--<br /> Theme customizations accessible in newer API ranges can go in<br /> res/values-vXX/types.xml, whereas customizations associated to<br /> backward-compatibility can go right here.<br /> --><br /> </fashion><br /><br /> <!-- Utility theme. --><br /> <fashion identify="AppTheme" guardian="AppBaseTheme"><br /> <!-- All customizations which might be NOT particular to a specific API-level can go right here. --><br /> </fashion><br /> <br /> <fashion identify="LargeRedText" guardian="@android:fashion/TextAppearance.Giant"><br /> <merchandise identify="android:textColor">#FF0000</merchandise><br /> </fashion><br /> <fashion identify="InverseMediumBlueText" guardian="@android:fashion/TextAppearance.Medium.Inverse"><br /> <merchandise identify="android:background">#0000FF</merchandise><br /> </fashion><br /> <fashion identify="GreenText" guardian="@android:fashion/TextAppearance"><br /> <merchandise identify="android:textColor">#00FF00</merchandise><br /> </fashion><br /> <fashion identify="ItalicGrayText" guardian="@android:fashion/TextAppearance"><br /> <merchandise identify="android:textColor">#A0A0A0</merchandise><br /> <merchandise identify="android:textStyle">italic</merchandise><br /> </fashion><br /> <fashion identify="Daring50BlackText"><br /> <merchandise identify="android:textColor">#000000</merchandise><br /> <merchandise identify="android:textStyle">daring</merchandise><br /> <merchandise identify="android:textSize">50dp</merchandise><br /> </fashion><br /><br /></assets><br /><br /> |
Instance to make use of our customized textual content fashion in format xml.
1 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"<br /> xmlns:instruments="http://schemas.android.com/instruments"<br /> android:layout_width="match_parent"<br /> android:layout_height="match_parent"<br /> android:orientation="vertical"<br /> instruments:context="com.instance.androidtextappearance.MainActivity" ><br /><br /> <TextView<br /> android:layout_width="wrap_content"<br /> android:layout_height="wrap_content"<br /> android:textual content="android-coding.blogspot.com"<br /> android:textSize="24dp"<br /> android:textStyle="daring" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="textAppearance"<br /> android:textAppearance="?android:textAppearance" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="textAppearanceLarge"<br /> android:textAppearance="?android:textAppearanceLarge" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="textAppearanceMedium"<br /> android:textAppearance="?android:textAppearanceMedium" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="textAppearanceSmall"<br /> android:textAppearance="?android:textAppearanceSmall" /><br /> <br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="customized fashion LargeRedText"<br /> fashion="@fashion/LargeRedText" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="customized fashion InverseMediumBlueText"<br /> fashion="@fashion/InverseMediumBlueText" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="customized fashion GreenText"<br /> fashion="@fashion/GreenText" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="customized fashion ItalicGrayText"<br /> fashion="@fashion/ItalicGrayText" /><br /> <TextView<br /> android:layout_width="match_parent"<br /> android:layout_height="wrap_content"<br /> android:textual content="customized fashion Daring50BlackText"<br /> fashion="@fashion/Daring50BlackText" /><br /> <br /></LinearLayout><br /><br /> |