forked from amazingfate/loongoffice
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.weghorn@posteo.de>
258 lines
10 KiB
XML
258 lines
10 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!--
|
|
This file is part of the LibreOffice project.
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
-->
|
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
xmlns:tools="http://schemas.android.com/tools"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
android:orientation="vertical">
|
|
|
|
<!-- The toolbar -->
|
|
<androidx.appcompat.widget.Toolbar
|
|
android:id="@+id/toolbar"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:elevation="3dp"
|
|
android:background="@color/toolbar_background"
|
|
app:theme="@style/LibreOfficeTheme.Toolbar"
|
|
tools:theme="@style/LibreOfficeTheme.Toolbar"
|
|
app:popupTheme="@style/LibreOfficeTheme"
|
|
tools:layout_constraintTop_creator="1"
|
|
tools:layout_constraintRight_creator="1"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
tools:layout_constraintLeft_creator="1"
|
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
</androidx.appcompat.widget.Toolbar>
|
|
|
|
|
|
<androidx.drawerlayout.widget.DrawerLayout
|
|
android:id="@+id/drawer_layout"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
tools:layout_constraintTop_creator="1"
|
|
tools:layout_constraintRight_creator="1"
|
|
tools:layout_constraintBottom_creator="1"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
app:layout_constraintTop_toBottomOf="@+id/toolbar"
|
|
tools:layout_constraintLeft_creator="1"
|
|
app:layout_constraintLeft_toLeftOf="parent">
|
|
|
|
<!-- The content -->
|
|
<androidx.core.widget.NestedScrollView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent">
|
|
|
|
<LinearLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="vertical"
|
|
android:divider="@color/doorhanger_divider_light"
|
|
android:showDividers="middle">
|
|
|
|
<TextView
|
|
android:id="@+id/header_browser"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:padding="16dp"
|
|
android:text="@string/title_browser"
|
|
android:textSize="14sp"
|
|
android:textStyle="bold" />
|
|
|
|
<!--Icon and text to open system file picker via Intent -->
|
|
<LinearLayout
|
|
android:id="@+id/system_file_picker_layout"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="?attr/colorButtonNormal"
|
|
android:orientation="horizontal"
|
|
app:layout_constraintTop_toBottomOf="@id/toolbar">
|
|
|
|
<TextView
|
|
android:id="@+id/open_file_view"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:gravity="center_vertical"
|
|
android:text="@string/select_file_to_open"
|
|
android:textSize="14dp"
|
|
app:drawableLeftCompat="@drawable/ic_folder_grey_48dp" />
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:id="@+id/header_recents"
|
|
android:text="@string/title_recents"
|
|
android:gravity="center_vertical"
|
|
android:textSize="14sp"
|
|
android:padding="16dp"
|
|
android:textStyle="bold" />
|
|
|
|
<!--Recent files-->
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
android:id="@+id/list_recent"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="8dp"
|
|
android:layout_marginBottom="8dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.core.widget.NestedScrollView>
|
|
|
|
<!-- The navigation drawer -->
|
|
|
|
</androidx.drawerlayout.widget.DrawerLayout>
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/editFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:clickable="true"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:fabSize="normal"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
app:srcCompat="@drawable/ic_add_black_24dp"
|
|
app:useCompatPadding="true" />
|
|
|
|
<LinearLayout
|
|
android:id="@+id/writerLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@id/editFAB"
|
|
app:layout_constraintRight_toRightOf="@id/editFAB"
|
|
tools:visibility="visible">
|
|
|
|
<TextView
|
|
android:id="@+id/newWriterTextView"
|
|
style="@style/NewDocumentTextView"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:text="@string/new_textdocument" />
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/newWriterFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:clickable="true"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:fabSize="mini"
|
|
app:srcCompat="@drawable/writer"
|
|
app:useCompatPadding="true" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/impressLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
app:layout_constraintBottom_toTopOf="@+id/writerLayout"
|
|
app:layout_constraintRight_toRightOf="@id/editFAB"
|
|
tools:visibility="visible">
|
|
|
|
<TextView
|
|
android:id="@+id/newImpressTextView"
|
|
style="@style/NewDocumentTextView"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:text="@string/new_presentation" />
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/newImpressFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:clickable="true"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:fabSize="mini"
|
|
app:srcCompat="@drawable/impress"
|
|
app:useCompatPadding="true" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/calcLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
tools:visibility="visible"
|
|
app:layout_constraintBottom_toTopOf="@+id/impressLayout"
|
|
app:layout_constraintRight_toRightOf="@id/editFAB">
|
|
|
|
<TextView
|
|
android:id="@+id/newCalcTextView"
|
|
style="@style/NewDocumentTextView"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:text="@string/new_spreadsheet" />
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/newCalcFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:clickable="true"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:fabSize="mini"
|
|
app:srcCompat="@drawable/calc"
|
|
app:useCompatPadding="true" />
|
|
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/drawLayout"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:visibility="invisible"
|
|
tools:visibility="visible"
|
|
app:layout_constraintBottom_toTopOf="@+id/calcLayout"
|
|
app:layout_constraintRight_toRightOf="@id/editFAB">
|
|
|
|
<TextView
|
|
android:id="@+id/newDrawTextView"
|
|
style="@style/NewDocumentTextView"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:text="@string/new_drawing" />
|
|
|
|
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
|
android:id="@+id/newDrawFAB"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginBottom="@dimen/new_doc_fab_tweak_bottom"
|
|
android:layout_marginTop="@dimen/new_doc_fab_tweak_top"
|
|
android:clickable="true"
|
|
app:backgroundTint="@color/background_normal"
|
|
app:fabSize="mini"
|
|
app:srcCompat="@drawable/draw"
|
|
app:useCompatPadding="true" />
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|