Using Custom Colors

Use custom colors to change the look of Workflow messages and the Hybrid Web Container.

These examples modify the colors of the Workflow messages. You can also use custom colors for the Hybrid Web Container using similar steps. The related comment tag for customizing colors is ANDROID_CUSTOMIZATION_POINT_COLORS.

  1. Open the colors.xml file, which is located in ...\HybridWebContainer\res\values, for editing.
  2. Find the ANDROID_CUSTOMIZATION_POINT_COLORS comment tag and add these tags inside the resources tag:
       <color name="hybridapp_message_title_color">#F23431</color>
       <color name="hybridapp_message_from_color">#FF1111</color>
       <color name="hybridapp_message_date_color">#3234F1</color>
    
  3. Open the workflowmessages.xml file, which is located in ...\HybridWebContainer\res\layout, for editing.
  4. In the msg_datetime TextView tag, modify the android:textColor attribute to:
    android:textColor="@color/hybridapp_message_date_color"
  5. Make similar changes to the msg_from and the msg_title tags, using the color resource defined in step 2.
    If you build the Hybrid Web Container without making any more changes, notice that the custom colors are used for msg_datetime and msg_title, but not for msg_from. This is because the color for msg_from is overridden by the Java code. To stop a custom attribute from being overridden:
    1. Select Search > File from the menu.
    2. For Containing text, enter msg_from and click Search.
      The search result shows two files: workflowmessages.xml and UiHybridAppMessagesScreen.java.
    3. Open the UiHybridAppMessagesScreen.java file for editing.
    4. Search the file for "msg_from."
      You will find this line: TextView tf = (TextView) v.findViewById(R.id.msg_from);
      The TextView object tf represents msg_from.
    5. You are changing the color, so search for “tf.setTextColor.”
      The search results return two occurrences because the color is set depending on whether the message has been read or not.
    6. Comment out both lines to ensure that msg_from is always the color you set in the workflowmessages.xml file. Save the file.