Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] Android Collapsing Toolbar does not collapse

Posted on November 14, 2022

Solution 1 :

I think you are missing an actual toolbar inside the collapsing toolbar.
try adding a toolbar after the linear layout’s closing tag.
example:

<androidx.appcompat.widget.Toolbar
    android_id="@+id/toolbar"
    android_layout_width="match_parent"
    android_layout_height="?attr/actionBarSize"
    android_background="@color/colorPrimaryLight"
    android_theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
    app_layout_collapseMode="pin"
    app_title="Toolbar title" />

and another thing I noticed, you AppBarLayout has android:fitsSystemWindows="true" so check that as well.

Problem :

I have the following layout that has a collapsing toolbar with a LinearLayout inside –

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

<layout 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">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android_layout_width="match_parent"
        android_layout_height="match_parent"
        android_orientation="vertical"
        tools_context=".application_flow.group.GroupOverviewFragment">

        <com.google.android.material.appbar.AppBarLayout
            android_layout_width="match_parent"
            android_layout_height="200dp"
            android_elevation="10dp"
            android_fitsSystemWindows="true"
            android_stateListAnimator="@animator/show_toolbar">

            <com.google.android.material.appbar.CollapsingToolbarLayout
                android_layout_width="match_parent"
                android_layout_height="match_parent"
                app_collapsedTitleGravity="center"
                app_contentScrim="@color/colorPrimary"
                app_expandedTitleGravity="top"
                app_layout_scrollFlags="scroll|exitUntilCollapsed"
                app_title="Lohamei Galipoly 38"
                app_titleEnabled="false"
                app_toolbarId="@id/group_tasks_toolbar">

                <LinearLayout
                    android_layout_width="match_parent"
                    android_layout_height="match_parent"
                    android_layout_marginStart="14dp"
                    android_layout_marginEnd="14dp"
                    android_orientation="vertical"
                    app_layout_collapseMode="parallax"
                    app_layout_collapseParallaxMultiplier="0.6">

                    <androidx.appcompat.widget.Toolbar
                        android_id="@+id/group_tasks_toolbar"
                        android_layout_width="match_parent"
                        android_layout_height="?attr/actionBarSize"
                        app_contentInsetStartWithNavigation="0dp"
                        app_layout_collapseMode="pin"
                        app_navigationIcon="@drawable/left_arrow_white"
                        app_titleTextColor="@color/white" />

                    <Space
                        android_layout_width="match_parent"
                        android_layout_height="0dp"
                        android_layout_weight="1" />

                    <TextView
                        android_layout_width="wrap_content"
                        android_layout_height="wrap_content"
                        android_layout_gravity="center"
                        android_layout_marginBottom="30dp"
                        android_textColor="@color/white"
                        android_textSize="18sp"
                        tools_text="Total group tasks: 8" />

                    <com.google.android.material.tabs.TabLayout
                        android_id="@+id/group_tasks_tab_layout"
                        android_layout_width="match_parent"
                        android_layout_height="wrap_content"
                        app_tabIndicatorColor="@color/white"
                        app_tabMode="fixed"
                        app_tabSelectedTextColor="@color/white" />

                </LinearLayout>

            </com.google.android.material.appbar.CollapsingToolbarLayout>


        </com.google.android.material.appbar.AppBarLayout>

        <androidx.viewpager2.widget.ViewPager2
            android_id="@+id/group_tasks_viewpager"
            android_layout_width="match_parent"
            android_layout_height="wrap_content"
            app_layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" />


    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</layout>

For some reason it does not collapse the entire content of the LinearLayout like it should and it is being left fixed in place.

This error seemed to start happening after I switched to work with the LinearLayout inside my CollapsingToolbarLayout

What is it that I am missing?

Comments

Comment posted by ʍѳђઽ૯ท

It’s already have a

READ  [ANSWERED] android - How to callback different clicks from DialogFragment to Activity?
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress