Android Toolbars (and ActionBars) are supposed to use a height of 56dp for portrait orientation and 48dp for landscape. If a Toolbar's "height" is set to Ti.UI.SIZE (the default), then the height and its font size should automatically change when the orientation changes. It currently does not.
Steps to reproduce:
- Position an Android device in portrait.
- Build and run the below code on that Android device.
- Note the height of the top toolbar.
- Rotate the device to landscape.
- Notice that toolbar height does not shrink. (This is the bug.)
- Keep holding the device at landscape and back out of the app.
- Launch the app in landscape form.
- Notice that the toolbar height is smaller upon launch.
- Rotate the device to portrait.
- Notice that the toolbar height has not increased. (This is the bug.)
The height is not changing because Titanium override the activity's "configChanges" for orientation in the "AndroidManifest.xml". This is needed to prevent the UI from being torn down upon orientation change. Google designed it to reload UI from XML, but since Titanium's UI is generated dynamically via code, this is not an option. We have to resize the height ourselves.