I wanna make the Navigation Bar totally transparent and the status bar either transparent or translucent !
so I added these line inside v21/styles
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:windowTranslucentNavigation">false</item>
and this inside the onCreate
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
and this in the root layout
android:fitsSystemWindows="true"
The navigation bar shows transparent successfully, but the status bar overlapped..! I tried to move the last line in every Layout in the xml but no luck.. sometimes it stopped overlapping but the nav bar no longer stays transparent..! Any help?
The full XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:autofit="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#2d2b30">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorToolbar"
app:titleTextColor="@color/white"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/decoratoin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:alpha="0.017"
android:elevation="5dp"
android:scaleType="center"
android:src="@drawable/decoration0"/>
<!-- The Linearlayout with id="rootView" is the one that contains the major views -->
<LinearLayout
android:id="@+id/rootView"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="5dp"
app:cardBackgroundColor="#da2e2c30"
app:cardCornerRadius="2dp"
app:cardElevation="5dp">
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<me.grantland.widget.AutofitTextView
android:id="@+id/txt"
android:layout_width="match_parent"
android:layout_height="95dp"
android:layout_margin="2dp"
android:padding="5dp"
android:maxLines="4"
android:text="ooooooooooo"
android:textColor="#ffff"
android:textSize="20sp"
autofit:minTextSize="12sp"/>
<ImageView
android:id="@+id/swipe_arrow"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical|end"
android:alpha="0.1"
android:src="@drawable/swipe_icon"/>
</FrameLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/reset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_horizontal|center_vertical"
android:padding="2dp"
android:clickable="true"
android:hapticFeedbackEnabled="true"
android:src="@mipmap/reset"/>
<TextView
android:id="@+id/btn_edit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_horizontal|center_vertical"
android:padding="2dp"
android:background="@mipmap/nums_max"
android:clickable="true"
android:elevation="10dp"
android:hapticFeedbackEnabled="true"/>
<TextView
android:id="@+id/btn_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_gravity="center_horizontal|center_vertical"
android:padding="1dp"
android:background="@mipmap/azkar_list"
android:clickable="true"
android:elevation="10dp"
android:hapticFeedbackEnabled="true"/>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.github.lzyzsd.circleprogress.ArcProgress
android:id="@+id/arc_progress"
android:layout_width="220dp"
android:layout_height="220dp"
android:layout_marginTop="30dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="50dp"
android:layout_gravity="center_horizontal"
android:background="#2d2b30"
custom:arc_bottom_text=" "
custom:arc_bottom_text_size="35dp"
custom:arc_finished_color="@color/colorAccent"
custom:arc_progress="55"
custom:arc_stroke_width="20dp"
custom:arc_suffix_text=" "
custom:arc_text_color="#84e43b"
custom:arc_text_size="45dp"
custom:arc_unfinished_color="#2cf2f2f1"/>
<TextView
android:id="@+id/check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:background="@drawable/check"
android:visibility="gone"/>
</FrameLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>