Search code examples
androidnavigationfragment

How to translucent only one fragment


I use single activity architecture and navigation component. I want to translucent only my splash fragment by changing style all fragment are changed Setting fitSystemWindows true in splash fragment not work :(

Like this sample

please help me


Solution

  • You must follow these steps:

    1- Add lines below inner your style theme

    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    

    2- Add this property android:fitsSystemWindows="true" to root element of fragments that you don't want to make them translucent