0

I have tried many ways to make action bar place in bottom of status bar but still not working, I am using API 17,I have added android:fitsSystemWindows="true" in CoordinatorLayout but still not working Here is my code:

the main_activity:

<net.aparteman.apartemanapp.viewHolder.SlidingMenuLayout 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.support.design.widget.NavigationView
            android:id="@+id/nvView"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end"
            android:background="@color/dark_purple"
            android:fitsSystemWindows="true"
            android:layoutDirection="rtl"
            android:textDirection="rtl"
            app:elevation="0dp"
            app:headerLayout="@layout/dashboard_nav_header"
            app:itemTextColor="@color/white"
            app:menu="@menu/dashboard_drawer_view"
            app:theme="@style/ApartemanStyle" />

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">


    <include
        android:id="@+id/actionbar"
        layout="@layout/dashboard_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <FrameLayout
        android:id="@+id/dashboard_fragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>

the dashboard_bar.xml :

<?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark"
        app:popupTheme="@style/AppTheme" />

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

style.xml:

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="actionMenuTextColor">@color/white</item>
    <item name="android:actionMenuTextColor">@color/white</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="ApartemanStyle" parent="Theme.AppCompat.Light">
    <item name="android:textSize">16sp</item>
    <item name="actionMenuTextColor">@color/white</item>
    <item name="android:actionMenuTextColor">@color/white</item>
    <item name="contentInsetStart">0dp</item>
    <item name="contentInsetEnd">0dp</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="ApartemanStyle.NoActionBar">
    <item name="actionMenuTextColor">@color/white</item>
    <item name="android:actionMenuTextColor">@color/white</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="ApartemanStyle.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="ApartemanStyle.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

It looks like this: action bar under status bar Can anyone help me on this?

Nazila
  • 1,353
  • 4
  • 15
  • 28

0 Answers0