3

I have searched everywhere but didn't get any help. I want to use a background image as full screen which will cover status bar and the footer navigation also which having a back button with home button and a task switcher button.

Like below image:

Nexus 5 Home Screen

Pankaj
  • 7,908
  • 6
  • 42
  • 65

1 Answers1

5

Transparent navigation bar work for Android 4.4+ (API 19) (just like status bar).

values/styles.xml

<style name="FullScreenEffectTheme" parent="Theme.AppCompat.NoActionBar">
    <!-- ... -->
</style>

values-v19/styles.xml

<style name="FullScreenEffectTheme">
    <!-- StatusBar -->
    <item name="android:statusBarColor">@android:color/transparent</item>
    <!-- NavigationBar -->
    <item name="android:navigationBarColor">@android:color/transparent</item>
</style>

In code set flags:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    getWindow().getDecorView().setSystemUiVisibility(
         View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
         View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
}

Don't forget to set this style to activity :)

Then you need to add padding or Space to your layout.

Important: If you want to have landscape orientation for phones translucent navigation bar cause ugly issue and in this case you should off this feature. I solved it like Tanner Perrien explained here.

Community
  • 1
  • 1
paulina_glab
  • 2,467
  • 2
  • 16
  • 25
  • I have got the background image in navigation bar by your method but the problem is there is a transparent black bar at footer how can i remove that also which you can't see in the image i have posted – Pankaj Dec 20 '15 at 16:45
  • Check now. Note that I removed two of style's item. – paulina_glab Dec 20 '15 at 17:01