jruesga / rview

A Gerrit client application for Android
Apache License 2.0
66 stars 21 forks source link

styles: Switch AppTheme to MaterialComponents #114

Closed ix5 closed 4 years ago

ix5 commented 4 years ago

Fixes a crash when opening the "About" page.

The dependency "AboutLibraries" contains a layout named listheader_opensource.xml, which contains references to com.google.android.material.button.MaterialButton. That one in turn requires the base app theme to be a descendant of Theme.MaterialComponents:

android.view.InflateException: Binary XML file line #48 in \
  com.ruesga.rview.debug:layout/listheader_opensource: \
  Binary XML file line #48 in com.ruesga.rview.debug:layout/listheader_opensource: \
  Error inflating class com.google.android.material.button.MaterialButton
Caused by: java.lang.IllegalArgumentException: \
  The style on this component requires your app theme to be \
  Theme.MaterialComponents (or a descendant).

@jruesga This is quite ugly, do you think only styling the AboutLibraries fragment could work instead? They suggest using something akin to defining a CustomAboutLibrariesStyle with `parent="Theme.MaterialComponents.Light.NoActionBar", see the README


Btw, still haven't forgotten about the F-Droid submission, got a lot on my plate though ;)

jruesga commented 4 years ago

@ix5 it's ok to me. I will merge this one. Thanks for the patch.