JeffProd
JeffProd

Reputation: 3148

How to remove the bottom navigation bar in a TWA?

I have build a TWA as described at https://developers.google.com/web/updates/2019/02/using-twa

I want to remove the bottom navigation bar. I have read that it can only be done programmatically with IMMERSIVE mode : https://developer.android.com/training/system-ui/immersive.html

So i need to add a Class associated to the activity "android.support.customtabs.trusted.LauncherActivity" and to add the hideSystemUI() code in onCreate() i guess.

How to do that ?

Here is the manifest :

....
<activity
    android:name="android.support.customtabs.trusted.LauncherActivity"
    android:theme="@style/Theme.LauncherActivity"
    android:label="@string/app_name">
....

How to code the immersive mode for this activity ?

Upvotes: 3

Views: 771

Answers (1)

andreban
andreban

Reputation: 4976

Using Bubblewrap

When using Bubblewrap (recommended), you will be asked which display mode the application should use as part of the init command.

If you have already initialized the application, modify twa-manifest.json, set display to fullscreen.

In AndroidManifest.xml

When building the application yourself and using the default LauncherActivity, you can get set the following meta-tag as part of the Activity definition in AndroidManifest.xml:

 <meta-data android:name="android.support.customtabs.trusted.DISPLAY_MODE"
                android:value="immersive" />

Upvotes: 1

Related Questions