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*
http://schemas.android.com/apk/res/android">
Hello [~horozco], Thanks for sharing with us. Please provide a full sample test project that regenerates the issue. We will test the issue in our environment. Also, provide the SDK and CLI version you are testing on. Thanks. Best
Hi Mostafizur! I've updated the description to include the full sample code that regenerates the issue. Thanks! Kind regards.
The issue is resolved in SDK 7.0.1.GA.
When using a Toolbar as an Actionbar, how do I add the left icon which used to show the left drawer menu? I mean, the icon that's in the blue rectangle: http://belencruz.com/wp-content/uploads/2015/04/android_actionbar_default-1024x253.png I have this on my alloy file:
And I have this on my controller:
Hey Guillermo, Check this out: Add a custom toolbar and use the navigationIcon property - http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Toolbar Sample: https://github.com/appcelerator/titanium_mobile/pull/9646 Hope that helps :)
@Henry Orozco thank you!
Well, now I'm not sure on how to show the drawer menu when clicking on the navigationIcon. How do I add the click listener to it?
@Guillermo
I'm getting this error when using your code:
@Guillermo, replace $.drawerLayout.window for the id of the window that is wrapping your DrawerLayout. e.g var activity = $.myWindow.getActivity();
I tried that but nothing happens. I also tried this but it doesn't work: