I am migrating my app to Theme.Material3.*
and found that the MaterialToolbar
is now being highlighted in some accent color as soon as some content scrolls underneath it. See the animation that I'm referring to below:
However, I don't want this effect to be present within my application. But while reading through the MaterialToolbar documentation, it seems like there is no way to disable or modify it, which irritates me. What am I missing here?
The minimal XML layout to reproduce the behaviour (as well as using a Material3 theme):
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:titleCentered="true"
app:title="Welcome"
app:layout_scrollFlags="noScroll" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Lorem ipsum dolor sit amet..." />
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Thanks for your help.