*Summary:*
The ActionBar on Android won't resize when the device rotates.
[As seen in Material Design guidelines](
https://material.io/guidelines/layout/structure.html#structure-app-bar), when a mobile is on landscape, ActionBar's height is 48dp, while on portrait it's 56dp.
Attached is a video demonstrating the issue.
*Steps to reproduce:*
Position an Android device in portrait.
Build and run a default Classic app project on that Android device.
Note the height of the top titlebar.
Rotate the device to landscape.
Notice the titlebar 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 titlebar height is smaller upon launch.
Rotate the device to portrait.
Notice that the titlebar height has not increased. _(This is the bug.)_
By the way, I've noticed this also happens if you use a Toolbar.
[~gfigueras] This is happening because of the way Titanium is dealing with applications' configuration changes after switching orientation. I have some concerns that addressing this may introduce major problems. I will be back at it with update/information once I discuss the matter with the team.
A fix for this is needed to calculate the
safeAreaPadding
(see [TIMOB-26427]). Especially for Android P notch support (see [TIMOB-26246]). The reason is because Google's AppCompat support library incorrectly hardcodes the *inset* height of the topActionBar
to what is defined in their XML instead of reading the actualActionBar
pixel height. This can cause issues with any native Android views which calls the Java [View.setFitsSystemWindows(boolean)](https://developer.android.com/reference/android/view/View.html#setFitsSystemWindows(boolean)) set tofalse
because such views will be positioned wrong. This can happen with Titanium's DrawerLayouts which use aToolbar
with "extendBackground" set totrue
.PR (master): https://github.com/appcelerator/titanium_mobile/pull/10383
*FR Passed* Waiting on Jenkins to merge
Verified the fix on SDK 7.5.0.v20181025085349. Actionbar works as expected. Closing