question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BottomAppBar] BottomAppBar casts a shadow

See original GitHub issue

https://github.com/material-components/material-components-android/issues/2698

Description: BottomAppBar (https://m3.material.io/components/bottom-app-bar/overview):

  • Elevation: No shadow
  • M3: Bottom app bar has new colors, a taller container, no elevation or shadow, and contains the FAB.

unnamed9 But, the BottomAppBar casts a shadow (https://github.com/material-components/material-components-android/issues/2852). 180359724-25751a28-3757-45b5-8b06-88ac6bb92b48 The MaterialToolbar casts no drop shadow (https://github.com/material-components/material-components-android/issues/2698#issuecomment-1233742799). https://m3.material.io/components/top-app-bar/overview https://github.com/material-components/material-components/issues/108

Expected behavior: The BottomAppBar casts no shadow. Or revise the documentation.

Source code:

<androidx.coordinatorlayout.widget.CoordinatorLayout
    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">
    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        android:layout_gravity="bottom" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

Minimal sample app repro: Test1.zip (https://github.com/material-components/material-components-android/issues/2852)

Android API version: 33

Material Library version: 1.7.0-rc01

Device: Emulator 31.3.10

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
imhappicommented, Sep 19, 2022

Hi! Sorry, I was out last week

Yes, the designer has confirmed that although there is elevation, there should be no shadow. Changes for this will go out soon

0reactions
manabu-nakamuracommented, Sep 16, 2022

Thank you, @patzly. This method can also be used for the navigation bar (BottomNavigationView). https://m3.material.io/components/navigation-bar/overview

My method can not be used for the navigation bar:

((MaterialShapeDrawable)binding.appBar.getBackground()).setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_NEVER);

https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/bottomappbar/BottomAppBar.java#L355:

materialShapeDrawable.setShadowCompatibilityMode(SHADOW_COMPAT_MODE_ALWAYS);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Shadow at the top of Bottom App Bar - android - Stack Overflow
I am trying to give shadow at the top of the Bottom App Bar like the one in Google Tasks app as shown...
Read more >
BottomAppBar Has a high shadow in my application view #241
This is my BottomAppBar This is Material Components's BottomAppBar My App's BottomAppBar shadow is obviously higher!
Read more >
Transparent AppbarLayout casts uneven shadow - which isn't there ...
Transparent AppbarLayout casts uneven shadow - which isn't there when the appbar has color. 5. Hotlists (1) Mark as Duplicate.
Read more >
AppBar Class (Windows.UI.Xaml.Controls) - Microsoft Learn
Gets or sets the Vector3Transition that animates changes to the Scale property. (Inherited from UIElement). Shadow. Gets or sets the shadow effect cast...
Read more >
Mastering Shadows in Android - Medium
Screen (Surface layer — 0 depth); Cardviews; Appbar Layout ... or computed by a Drawable, to drive the shape of shadows cast by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found