I have a confusing situation relate to context.
I was implement crowdin, this sdk make a "wrap" over the context for override the string.xml
in runtime.
Crowdin.wrap(context) //ContextWrapper()
and works fine when dont wrapping the context, but when try to use MaterialAlertDialogBuilder
with the context wrapped for crowdin the app crashed with the next exception.
android.view.InflateException: Binary XML file line #25 in com.example.app_user.user:layout/mtrl_alert_dialog: Binary XML file line #27: You must supply a layout_width attribute.
Caused by: java.lang.UnsupportedOperationException: Binary XML file line #27: You must supply a layout_width attribute.
The file where not found the layout_width
attribute is from Material Components
.
I think that error is maybe cause because material first apply a ContextThemeWrapper
and after crowdin apply a over the Context wrapped(ContextThemeWrapper)
- Appcompat: 1.2.0
- Material: 1.1.0
Post
- https://ataulm.com/2019/11/20/using-context-theme-wrapper.html
- https://medium.com/androiddevelopers/android-styling-themes-overlay-1ffd57745207
- https://medium.com/@ali.muzaffar/which-context-should-i-use-in-android-e3133d00772c
from ContextWrapper override ContextThemeWrapper?
No comments:
Post a Comment