Joe Blow Joe Blow - 8 days ago 5
Android Question

Android, no AppCompat, full screen - the most correct style?

I'm making an Android app that is for level 21 onwards only. I am not using AppCompat.

It's a simple full-screen app with absolutely no menu bar, tool bar, martini bar, action bar.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.client.client">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"

android:theme="@style/AppTheme">

<activity android:name=".Main"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>


I've noticed there are at least two possibilities:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"


versus...

android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"


What should I really be doing here, what is the best and most modern choice?

One says title bar, one says action bar; I want neither. (I don't fully understand the complete history of the difference between those in Android :/ )

Again, I am not using AppCompat, if that matters. And this is for Lollipop+ only.

(FWIW, at first I was using
Theme.Holo.Light.NoActionBar.Fullscreen
- probably a bad idea?)

Here's a screenshot of how I want the app to look on all devices:

enter image description here

Answer

what is the best and most modern choice?

With a minSdkVersion of 21+, you can use themes based off of Theme.Material, such as Theme.Material.Light.NoActionBar.Fullscreen.

Comments