make status bar above the collapsed toolbar imageview










0















https://github.com/antoniolg/MaterializeYourApp



I basically followed the code in the link above but I still couldn't make the status bar above the collapsed toolbar imageview.



One thing I found would work is to put <item name="android:windowTranslucentStatus">true</item> in the style. But that would make the toolbar and status bar overlap.



CollapsedToolbarImage ExpandedToolbarImage



Basically I want the status bar in the first image to be like the second. And I guess the statusbar is already translucent. This is partially what I put in the style.



<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>



Another problem is that I set the collapsed title text programmatically but it is also not showing up.



I also have tried putting around some fitSystemWindow="true" but it still doesn't work. Below is the xml file.



<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ScrollingActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/up_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/up_ctoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
app:collapsedTitleGravity="center"
app:contentScrim="@android:color/transparent"
app:expandedTitleGravity="center"
app:layout_behavior="@string/title_activity_scrolling"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true"
app:toolbarId="@+id/up_toolbar">

<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:background="@drawable/nav_background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />

<android.support.v7.widget.Toolbar
android:id="@+id/up_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageButton
android:id="@+id/up_back"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_white" />

<ImageButton
android:id="@+id/up_search"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_search_white" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>

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

<include layout="@layout/user_profile_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>











share|improve this question
























  • try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

    – Karan Mer
    Nov 15 '18 at 5:58











  • @KaranMer sadly doesn't work.

    – Seaky Luo
    Nov 15 '18 at 6:06











  • do you want to set only status bar transparent or both toolbar and statusbar?

    – Karan Mer
    Nov 15 '18 at 6:07











  • I think the status is already transparent but it's just not above the imageview.

    – Seaky Luo
    Nov 15 '18 at 6:11











  • can you set fitsSystemWindows="false" in your parent coordinator layout and try.

    – Karan Mer
    Nov 15 '18 at 6:15















0















https://github.com/antoniolg/MaterializeYourApp



I basically followed the code in the link above but I still couldn't make the status bar above the collapsed toolbar imageview.



One thing I found would work is to put <item name="android:windowTranslucentStatus">true</item> in the style. But that would make the toolbar and status bar overlap.



CollapsedToolbarImage ExpandedToolbarImage



Basically I want the status bar in the first image to be like the second. And I guess the statusbar is already translucent. This is partially what I put in the style.



<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>



Another problem is that I set the collapsed title text programmatically but it is also not showing up.



I also have tried putting around some fitSystemWindow="true" but it still doesn't work. Below is the xml file.



<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ScrollingActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/up_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/up_ctoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
app:collapsedTitleGravity="center"
app:contentScrim="@android:color/transparent"
app:expandedTitleGravity="center"
app:layout_behavior="@string/title_activity_scrolling"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true"
app:toolbarId="@+id/up_toolbar">

<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:background="@drawable/nav_background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />

<android.support.v7.widget.Toolbar
android:id="@+id/up_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageButton
android:id="@+id/up_back"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_white" />

<ImageButton
android:id="@+id/up_search"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_search_white" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>

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

<include layout="@layout/user_profile_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>











share|improve this question
























  • try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

    – Karan Mer
    Nov 15 '18 at 5:58











  • @KaranMer sadly doesn't work.

    – Seaky Luo
    Nov 15 '18 at 6:06











  • do you want to set only status bar transparent or both toolbar and statusbar?

    – Karan Mer
    Nov 15 '18 at 6:07











  • I think the status is already transparent but it's just not above the imageview.

    – Seaky Luo
    Nov 15 '18 at 6:11











  • can you set fitsSystemWindows="false" in your parent coordinator layout and try.

    – Karan Mer
    Nov 15 '18 at 6:15













0












0








0








https://github.com/antoniolg/MaterializeYourApp



I basically followed the code in the link above but I still couldn't make the status bar above the collapsed toolbar imageview.



One thing I found would work is to put <item name="android:windowTranslucentStatus">true</item> in the style. But that would make the toolbar and status bar overlap.



CollapsedToolbarImage ExpandedToolbarImage



Basically I want the status bar in the first image to be like the second. And I guess the statusbar is already translucent. This is partially what I put in the style.



<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>



Another problem is that I set the collapsed title text programmatically but it is also not showing up.



I also have tried putting around some fitSystemWindow="true" but it still doesn't work. Below is the xml file.



<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ScrollingActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/up_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/up_ctoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
app:collapsedTitleGravity="center"
app:contentScrim="@android:color/transparent"
app:expandedTitleGravity="center"
app:layout_behavior="@string/title_activity_scrolling"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true"
app:toolbarId="@+id/up_toolbar">

<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:background="@drawable/nav_background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />

<android.support.v7.widget.Toolbar
android:id="@+id/up_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageButton
android:id="@+id/up_back"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_white" />

<ImageButton
android:id="@+id/up_search"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_search_white" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>

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

<include layout="@layout/user_profile_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>











share|improve this question
















https://github.com/antoniolg/MaterializeYourApp



I basically followed the code in the link above but I still couldn't make the status bar above the collapsed toolbar imageview.



One thing I found would work is to put <item name="android:windowTranslucentStatus">true</item> in the style. But that would make the toolbar and status bar overlap.



CollapsedToolbarImage ExpandedToolbarImage



Basically I want the status bar in the first image to be like the second. And I guess the statusbar is already translucent. This is partially what I put in the style.



<item name="android:windowIsTranslucent">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>



Another problem is that I set the collapsed title text programmatically but it is also not showing up.



I also have tried putting around some fitSystemWindow="true" but it still doesn't work. Below is the xml file.



<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ScrollingActivity">

<android.support.design.widget.AppBarLayout
android:id="@+id/up_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">

<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/up_ctoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false"
app:collapsedTitleGravity="center"
app:contentScrim="@android:color/transparent"
app:expandedTitleGravity="center"
app:layout_behavior="@string/title_activity_scrolling"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true"
app:toolbarId="@+id/up_toolbar">

<ImageView
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/header_height"
android:background="@drawable/nav_background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />

<android.support.v7.widget.Toolbar
android:id="@+id/up_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">

<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageButton
android:id="@+id/up_back"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back_white" />

<ImageButton
android:id="@+id/up_search"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="@android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_search_white" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>

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

<include layout="@layout/user_profile_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>








android android-toolbar android-coordinatorlayout android-collapsingtoolbarlayout android-statusbar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 6:15







Seaky Luo

















asked Nov 14 '18 at 23:59









Seaky LuoSeaky Luo

116




116












  • try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

    – Karan Mer
    Nov 15 '18 at 5:58











  • @KaranMer sadly doesn't work.

    – Seaky Luo
    Nov 15 '18 at 6:06











  • do you want to set only status bar transparent or both toolbar and statusbar?

    – Karan Mer
    Nov 15 '18 at 6:07











  • I think the status is already transparent but it's just not above the imageview.

    – Seaky Luo
    Nov 15 '18 at 6:11











  • can you set fitsSystemWindows="false" in your parent coordinator layout and try.

    – Karan Mer
    Nov 15 '18 at 6:15

















  • try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

    – Karan Mer
    Nov 15 '18 at 5:58











  • @KaranMer sadly doesn't work.

    – Seaky Luo
    Nov 15 '18 at 6:06











  • do you want to set only status bar transparent or both toolbar and statusbar?

    – Karan Mer
    Nov 15 '18 at 6:07











  • I think the status is already transparent but it's just not above the imageview.

    – Seaky Luo
    Nov 15 '18 at 6:11











  • can you set fitsSystemWindows="false" in your parent coordinator layout and try.

    – Karan Mer
    Nov 15 '18 at 6:15
















try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

– Karan Mer
Nov 15 '18 at 5:58





try and add <item name="android:windowTranslucentNavigation">true</item> to your app theme.

– Karan Mer
Nov 15 '18 at 5:58













@KaranMer sadly doesn't work.

– Seaky Luo
Nov 15 '18 at 6:06





@KaranMer sadly doesn't work.

– Seaky Luo
Nov 15 '18 at 6:06













do you want to set only status bar transparent or both toolbar and statusbar?

– Karan Mer
Nov 15 '18 at 6:07





do you want to set only status bar transparent or both toolbar and statusbar?

– Karan Mer
Nov 15 '18 at 6:07













I think the status is already transparent but it's just not above the imageview.

– Seaky Luo
Nov 15 '18 at 6:11





I think the status is already transparent but it's just not above the imageview.

– Seaky Luo
Nov 15 '18 at 6:11













can you set fitsSystemWindows="false" in your parent coordinator layout and try.

– Karan Mer
Nov 15 '18 at 6:15





can you set fitsSystemWindows="false" in your parent coordinator layout and try.

– Karan Mer
Nov 15 '18 at 6:15












1 Answer
1






active

oldest

votes


















0














You should add below code to your AppBarLayout block



 android:background="@android:color/transparent"
android:elevation="0dp"
android:shadowColor="@android:color/transparent"
android:stateListAnimator="@null"


It should help you fix the issue






share|improve this answer























  • Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

    – Seaky Luo
    Nov 15 '18 at 5:49










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310561%2fmake-status-bar-above-the-collapsed-toolbar-imageview%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You should add below code to your AppBarLayout block



 android:background="@android:color/transparent"
android:elevation="0dp"
android:shadowColor="@android:color/transparent"
android:stateListAnimator="@null"


It should help you fix the issue






share|improve this answer























  • Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

    – Seaky Luo
    Nov 15 '18 at 5:49















0














You should add below code to your AppBarLayout block



 android:background="@android:color/transparent"
android:elevation="0dp"
android:shadowColor="@android:color/transparent"
android:stateListAnimator="@null"


It should help you fix the issue






share|improve this answer























  • Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

    – Seaky Luo
    Nov 15 '18 at 5:49













0












0








0







You should add below code to your AppBarLayout block



 android:background="@android:color/transparent"
android:elevation="0dp"
android:shadowColor="@android:color/transparent"
android:stateListAnimator="@null"


It should help you fix the issue






share|improve this answer













You should add below code to your AppBarLayout block



 android:background="@android:color/transparent"
android:elevation="0dp"
android:shadowColor="@android:color/transparent"
android:stateListAnimator="@null"


It should help you fix the issue







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 4:08









Vikash BijarniyaVikash Bijarniya

1719




1719












  • Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

    – Seaky Luo
    Nov 15 '18 at 5:49

















  • Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

    – Seaky Luo
    Nov 15 '18 at 5:49
















Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

– Seaky Luo
Nov 15 '18 at 5:49





Sadly it doesn't. By the way I set the title but it also not showing up do you know why?

– Seaky Luo
Nov 15 '18 at 5:49



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53310561%2fmake-status-bar-above-the-collapsed-toolbar-imageview%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20