locked
toolbar and snackbar RRS feed

  • Question

  • User181132 posted

    I just discovered the snackbar. I would like to use it in my app. But I am also using a toolbar. My toolbar requires a custom theme. The snackbar requires a AppCompat theme. So it seems like I can't use both? Is that correct? If not, how can I use both in the same app.

    Thursday, May 31, 2018 2:32 PM

Answers

  • User346469 posted

    Did you try to inherit your custom theme from AppCompat theme?

    <style name="CustomTheme" parent="Theme.AppCompat">

    Anyway, declaring properties which are required by a SnackBar in your custom theme, explicitly, should also work.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 1, 2018 2:19 PM

All replies

  • User346469 posted

    Did you try to inherit your custom theme from AppCompat theme?

    <style name="CustomTheme" parent="Theme.AppCompat">

    Anyway, declaring properties which are required by a SnackBar in your custom theme, explicitly, should also work.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 1, 2018 2:19 PM
  • User181132 posted

    Thanks Dmitry, that did the trick.

    Friday, June 1, 2018 6:11 PM