android/source/res/layout/activity_document_browser.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 730add0ca619985b99e133dd586e063f0f12538b Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Thu Apr 21 13:48:53 2022 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Thu Apr 21 20:57:21 2022 +0200 android: Use drawable tag already supported with API level 16 Use the `app:drawableLeftCompat` tag instead of `android:drawableLeft` to set the icon to show in the TextView. With the latter, trying to start Android Viewer in an x86 AVD with API level 16 resulted in this crash: > E/AndroidRuntime( 2510): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.libreoffice/org.libreoffice.ui.LibreOfficeUIActivity}: android.view.InflateException: Binary XML file line #80: Error inflating class TextView > E/AndroidRuntime( 2510): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059) > E/AndroidRuntime( 2510): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) > E/AndroidRuntime( 2510): at android.app.ActivityThread.access$600(ActivityThread.java:130) > E/AndroidRuntime( 2510): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) > E/AndroidRuntime( 2510): at android.os.Handler.dispatchMessage(Handler.java:99) > E/AndroidRuntime( 2510): at android.os.Looper.loop(Looper.java:137) > E/AndroidRuntime( 2510): at android.app.ActivityThread.main(ActivityThread.java:4745) > E/AndroidRuntime( 2510): at java.lang.reflect.Method.invokeNative(Native Method) > E/AndroidRuntime( 2510): at java.lang.reflect.Method.invoke(Method.java:511) > E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) > E/AndroidRuntime( 2510): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) > E/AndroidRuntime( 2510): at dalvik.system.NativeStart.main(Native Method) > E/AndroidRuntime( 2510): Caused by: android.view.InflateException: Binary XML file line #80: Error inflating class TextView > E/AndroidRuntime( 2510): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170) > E/AndroidRuntime( 2510): at org.libreoffice.ui.LibreOfficeUIActivity.createUI(LibreOfficeUIActivity.java:169) > E/AndroidRuntime( 2510): at org.libreoffice.ui.LibreOfficeUIActivity.onCreate(LibreOfficeUIActivity.java:147) > E/AndroidRuntime( 2510): at android.app.Activity.performCreate(Activity.java:5008) > E/AndroidRuntime( 2510): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) > E/AndroidRuntime( 2510): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) > E/AndroidRuntime( 2510): ... 11 more > E/AndroidRuntime( 2510): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi-v4/ic_folder_grey_48dp.xml from drawable resource ID #0x7f080083 > E/AndroidRuntime( 2510): at android.content.res.Resources.loadDrawable(Resources.java:1923) > E/AndroidRuntime( 2510): at android.content.res.TypedArray.getDrawable(TypedArray.java:601) > E/AndroidRuntime( 2510): at android.widget.TextView.<init>(TextView.java:614) > E/AndroidRuntime( 2510): at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100) > E/AndroidRuntime( 2510): at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:194) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551) > E/AndroidRuntime( 2510): at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602) > E/AndroidRuntime( 2510): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675) > E/AndroidRuntime( 2510): ... 26 more > E/AndroidRuntime( 2510): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector > E/AndroidRuntime( 2510): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:877) > E/AndroidRuntime( 2510): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:818) > E/AndroidRuntime( 2510): at android.content.res.Resources.loadDrawable(Resources.java:1920) > E/AndroidRuntime( 2510): ... 35 more > W/ActivityManager( 1421): Force finishing activity org.libreoffice/.ui.LibreOfficeUIActivity Change-Id: I4253a68f90d6c507805c7bf72aaf81011fb19339 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133256 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/android/source/res/layout/activity_document_browser.xml b/android/source/res/layout/activity_document_browser.xml index 1632770d97a8..23ef44f4e5dc 100644 --- a/android/source/res/layout/activity_document_browser.xml +++ b/android/source/res/layout/activity_document_browser.xml @@ -82,10 +82,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:drawableLeft="@drawable/ic_folder_grey_48dp" android:gravity="center_vertical" android:text="@string/select_file_to_open" - android:textSize="14dp" /> + android:textSize="14dp" + app:drawableLeftCompat="@drawable/ic_folder_grey_48dp" /> </LinearLayout> <TextView