Files
loongoffice/android/source/res/layout/activity_document_browser.xml
Michael Weghorn c82a594da3 tdf#124480 android: Avoid using color attr requiring API 23
Using "colorBackgroundFloating" requires API level 23 [1],
but our current minimum API level is 16 (when building with
NDK 23).

Therefore, define an own color `background_floating` instead
and use the correspodning color values from the material theme
(`background_floating_material_{dark,light}` depending on whether
dark/night mode is enabled or not.

This makes the app work again in a quick test with an x86 AVD
with API level 16 instead of crashing on startup.

Change-Id: I7b8378b42e9fc7430ec4ed263d4cb8b42027a930
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160077
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-30 12:17:14 +01:00

248 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 -->
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:elevation="3dp"
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">
</com.google.android.material.appbar.MaterialToolbar>
<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" />
<Button
android:id="@+id/open_file_button"
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_48dp" />
<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:contentDescription="@string/create_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
app:backgroundTint="@color/background_floating"
app:fabSize="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:srcCompat="@drawable/ic_add_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_floating"
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_floating"
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_floating"
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_floating"
app:fabSize="mini"
app:srcCompat="@drawable/draw"
app:useCompatPadding="true" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>