Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-5413

Ti.UI.Android.createDrawerLayout there is no way to set the color of the title on AppBar via theme

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Done
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Labels:
      None

      Description

      Ti.UI.Android.createDrawerLayout SDK 6.3.0.GA

      There is no way to set the color of the title on AppBar via theme XML file.
      Defaults to black, in this case I want the title on white.

      The only way (not ideal because editing the SDK file) I've found so far is editing the file https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/res/layout/titanium_ui_drawer_layout.xml
      and add android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" to android.support.v7.widget.Toolbar

      Sample Alloy project:

      inde.js
      var win = Ti.UI.createWindow(

      { theme: "Theme.AudioVerse.NoActionBar" }

      );

      var leftView = Ti.UI.createView(

      { backgroundColor:'white' }

      );
      var centerView = Ti.UI.createView(

      { backgroundColor:'white' }

      );

      var drawer = Ti.UI.Android.createDrawerLayout(

      { leftView: leftView, centerView: centerView }

      );

      win.add(drawer);
      win.open();

      themes.xml on app/platform/android/res/values
      <?xml version="1.0" encoding="utf-8"?>

      <resources xmlns:android="http://schemas.android.com/apk/res/android">

      <style name="Theme.AudioVerse" parent="@style/Theme.AppCompat.Light.DarkActionBar">
      <item name="colorPrimary">#E53935</item>
      <item name="colorPrimaryDark">#D32F2F</item>
      </style>

      <style name="Theme.AudioVerse.NoActionBar" parent="@style/Theme.AppCompat.Light.NoActionBar">
      <item name="colorPrimary">#E53935</item>
      <item name="colorPrimaryDark">#D32F2F</item>
      </style>

      </resources>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shossain Shak Hossain
                Reporter:
                horozco Henry Orozco
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code