#StackBounty: #android #styles #navbar #bottomnavigationview BottomNavigationBar underneath NavBar

Bounty: 250

The Goal:

1) Make the status bar transparent – Done

2) Make the BottomNavigationView and the Navbar the same color. – Almost Done

The Problem

By adding the following code in my Activity, the status bar becomes transparent. BUT, BottomNavigationView falls underneath the NavBar. If I remove this line of code, the StatusBar no longer is transparent. You feel my pain here? Furthermore… How would I make the TOP of the layout go underneath the statusbar?

The Code in the Activity:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    Window w = getWindow();
    w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, 
    WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}

The Activity XML:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false">

<com.custom.app.view.ClickableViewPager
    android:id="@+id/view_pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@id/tab_layout" />

<android.support.design.widget.BottomNavigationView
    android:id="@+id/tab_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="@color/custom_black"
    app:itemIconTint="@color/white"
    app:itemTextColor="@color/white"
    app:menu="@menu/bottom_navigation_main" />

</android.support.design.widget.CoordinatorLayout>

The Style.xml

<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="android:textColorPrimary">@color/md_white_1000</item>
    <item name="android:actionMenuTextColor">@color/custom_black</item>
    <item name="actionMenuTextColor">@color/custom_black</item>
    <item name="android:alertDialogStyle">@style/AppTheme.AlertDialog</item>
    <item name="colorControlNormal">@color/md_white_1000</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:statusBarColor">@android:color/transparent</item>
    <item name="android:windowTranslucentNavigation">false</item>
    <item name="android:navigationBarColor">@color/custom_black</item>
</style>


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.