Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19081

Android: Add Theme.AppCompat.NoTitleBar to default themes

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 4.0.0
    • Fix Version/s: Release 5.0.0
    • Component/s: Android
    • Labels:
    • Environment:

      SDK 4.0.0.GA/master

    • Story Points:
      3
    • Sprint:
      2015 Sprint 14 SDK

      Description

      Every android app we build includes a few built-in themes:

      • Theme.AppCompat.Fullscreen
      • Theme.AppCompat.Translucent
      • Theme.AppCompat.Translucent.NoTitleBar
      • Theme.AppCompat.Translucent.NoTitleBar.Fullscreen
      • Theme.Titanium, which extends either Theme.AppCompat directly or Theme.AppCompat.Fullscreen depending on the <fullscreen> setting in tiapp.xml.

      Strangely enough, it does not include a theme that would cover one of the most common use cases: hiding the Action Bar. Our guide explains how to do this using a custom theme, while it could be much simpeler if only we would include one by default.

      via tiapp.xml

       <android xmlns:android="http://schemas.android.com/apk/res/android">
          <manifest>
              <application android:theme="@style/Theme.AppCompat.NoTitleBar"/>
          </manifest>
      </android>
      

      or per window:

      Ti.UI.createWindow({
        theme: "Theme.AppCompat.NoTitleBar"
      }).open();
      

      Ideally, the new themes would follow the same naming convention as the Translucent ones:

      	<style name="Theme.AppCompat.NoTitleBar">
      		<item name="android:windowNoTitle">true</item>
      		<item name="android:windowContentOverlay">@null</item>
      		<item name="android:windowActionBar">false</item>
      		<!-- AppCompat Compatibility -->
      		<item name="windowActionBar">false</item>
      	</style>
      	
      	<style name="Theme.AppCompat.NoTitleBar.Fullscreen">
      		<item name="android:windowFullscreen">true</item>
      	</style>
       
      	<!-- Legacy Compatibility -->
      	<style name="Theme.AppCompat.Fullscreen" parent="@style/Theme.AppCompat.NoTitleBar.Fullscreen" />
      

      As you can see the existing Theme.AppCompat.Fullscreen theme can inherit the new Theme.AppCompat.NoTitleBar so that it is still available under the existing name.

      With these new themes in place we could also restore the <navbar-hidden> and <fullscreen> elements in tiapp.xml. This would select the Theme.AppCompat.NoTitleBar for <application> or Theme.AppCompat.NoTitleBar.FullScreen theme if <fullscreen> is also true.

      The attached test app shows how these new themes would work, by adding them via a custom theme.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                fokkezb Fokke Zandbergen
                Reviewer:
                Ashraf Abu (Inactive)
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration