-
Notifications
You must be signed in to change notification settings - Fork 3
Styled Text View
Styled Text View is a stylized Text View. There are 13 prepackaged styles that can be easily applied to a Styled Text View, all of which conform to RealWear’s design principles. If no style is specifically set, Styled Text View will default to the Android TextView style. Developers can also apply their own style to the Command Button and change fields to better suit their own application.
Styled Text View extends from the Android AppCompatTextView and functions in the same basic way. Developers can choose to insert the view in an XML layout file to to create the view programmatically.
<com.realwear.ux.view.StyledTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
There are 13 prepackaged UX Library styles that can be set for a Styled Text View. Each style is adapted to suit different needs while conforming to RealWear design guidelines.
- H1 Style
- H2 Style
- H3 Style
- H4 Style
- H5 Style
- H6 Style
- Subtitle 1 Style
- Subtitle 2 Style
- Body 1 Style
- Body 2 Style
- Caption Style
- Overline Style
- Overlay Style
<com.realwear.ux.view.StyledTextView
...
style="@style/H1_TextView" />
Developers can create their own custom style that extends from a RealWear style and update the fields to adapt their component to suit their app better. For example, a developer could extend from the H1 Text View style and change the text color:
<style name="RedH1TextViewStyle" parent="H1_TextView">
<item name="android:textColor">@android:color/holo_red_light</item>
</style>
Regardless of which style is set on the Styled Text View, fields set in the XML layout file or programmatically will take precedence, allowing the user to control the appearance of each individual Styled Text View:
<com.realwear.ux.view.StyledTextView
...
style="@style/H1_TextView"
android:textColor="@android:color/holo_blue_bright" />
Styled Text View styles come with default text color, but the developer has the ability to override this parameters with their app theme, which will be automatically implemented on all Styled Text Views (unless specifically set for the component in XML or programmatically, as shown above.)
<style name="MyAppTheme">
<item name="android:textColor">@android:color/holo_red_light</item>
</style>