Skip to content

styles: Switch AppTheme to MaterialComponents#114

Merged
jruesga merged 1 commit intojruesga:masterfrom
ix5:theme-material-aboutpage
May 17, 2020
Merged

styles: Switch AppTheme to MaterialComponents#114
jruesga merged 1 commit intojruesga:masterfrom
ix5:theme-material-aboutpage

Conversation

@ix5
Copy link
Contributor

@ix5 ix5 commented May 16, 2020

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 ;)

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
Copy link
Owner

jruesga commented May 16, 2020

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

@jruesga jruesga merged commit c441f1e into jruesga:master May 17, 2020
@ix5 ix5 deleted the theme-material-aboutpage branch May 17, 2020 13:33
@ix5 ix5 changed the title [WIP] styles: Switch AppTheme to MaterialComponents styles: Switch AppTheme to MaterialComponents May 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants