Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-deck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-11-05 01:44:44 +0300
committerStefan Niedermann <info@niedermann.it>2020-11-05 01:44:44 +0300
commit92a96a57c36b69939dc860b74c9f9a84cdaa0372 (patch)
treef8a9d7cf7f9a8a69c7d35741039b0d52178c95f2 /app/src/main/res
parent57d0efd5d0c87d28d6ae000ba847a80b1fe7d85f (diff)
Use BottomNavigation for attachments tabs
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/res')
-rw-r--r--app/src/main/res/layout/fragment_card_edit_tab_attachments.xml53
-rw-r--r--app/src/main/res/menu/attachment_picker_menu.xml19
-rw-r--r--app/src/main/res/values/dimens.xml1
-rw-r--r--app/src/main/res/values/strings.xml2
4 files changed, 31 insertions, 44 deletions
diff --git a/app/src/main/res/layout/fragment_card_edit_tab_attachments.xml b/app/src/main/res/layout/fragment_card_edit_tab_attachments.xml
index a28c75aa3..2b77f3f12 100644
--- a/app/src/main/res/layout/fragment_card_edit_tab_attachments.xml
+++ b/app/src/main/res/layout/fragment_card_edit_tab_attachments.xml
@@ -74,59 +74,24 @@
android:paddingStart="@dimen/spacer_1x"
android:paddingTop="@dimen/spacer_1x"
android:paddingEnd="@dimen/spacer_1x"
- android:paddingBottom="88dp"
+ android:paddingBottom="@dimen/attachments_bottom_navigation_height"
tools:listitem="@layout/support_simple_spinner_dropdown_item"
tools:visibility="gone" />
</LinearLayout>
<LinearLayout
- android:id="@+id/pickerControlsWrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom">
- <com.google.android.flexbox.FlexboxLayout
- android:id="@+id/pickerControls"
+ <com.google.android.material.bottomnavigation.BottomNavigationView
+ android:id="@+id/bottomNavigation"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="?attr/colorSurface"
- android:clickable="true"
- android:paddingStart="@dimen/spacer_2x"
- android:paddingTop="@dimen/spacer_2x"
- android:paddingEnd="@dimen/spacer_2x"
- android:paddingBottom="@dimen/spacer_2x"
- app:justifyContent="space_around"
- tools:ignore="KeyboardInaccessibleWidget">
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/pickCamera"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:contentDescription="@string/simple_camera"
- android:tint="@android:color/white"
- android:visibility="gone"
- app:backgroundTint="@color/defaultBrand"
- app:srcCompat="@drawable/ic_baseline_photo_camera_24" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/pickContact"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:contentDescription="@string/simple_contact"
- android:tint="@android:color/white"
- android:visibility="gone"
- app:backgroundTint="@color/defaultBrand"
- app:srcCompat="@drawable/ic_person_grey600_24dp" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/pickFile"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:contentDescription="@string/simple_file"
- android:tint="@android:color/white"
- android:visibility="gone"
- app:backgroundTint="@color/defaultBrand"
- app:srcCompat="@drawable/ic_attach_file_grey600_24dp" />
- </com.google.android.flexbox.FlexboxLayout>
+ android:layout_height="@dimen/attachments_bottom_navigation_height"
+ android:translationY="@dimen/attachments_bottom_navigation_height"
+ app:backgroundTint="?attr/colorPrimary"
+ app:itemIconTint="?attr/colorAccent"
+ app:itemTextColor="?attr/colorAccent"
+ app:menu="@menu/attachment_picker_menu" />
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/menu/attachment_picker_menu.xml b/app/src/main/res/menu/attachment_picker_menu.xml
new file mode 100644
index 000000000..f280ac752
--- /dev/null
+++ b/app/src/main/res/menu/attachment_picker_menu.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+ <item
+ android:id="@+id/gallery"
+ android:icon="@drawable/ic_baseline_photo_camera_24"
+ android:title="@string/gallery"
+ app:showAsAction="ifRoom" />
+ <item
+ android:id="@+id/contacts"
+ android:icon="@drawable/ic_person_grey600_24dp"
+ android:title="@string/contacts"
+ app:showAsAction="ifRoom" />
+ <item
+ android:id="@+id/files"
+ android:icon="@drawable/ic_attach_file_grey600_24dp"
+ android:title="@string/files"
+ app:showAsAction="ifRoom" />
+</menu>
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 8aa82c1cf..cf02e320d 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -7,6 +7,7 @@
<dimen name="spacer_4x">32dp</dimen>
<dimen name="compact_label_height">6dp</dimen>
+ <dimen name="attachments_bottom_navigation_height">56dp</dimen>
<!-- Drawer header -->
<dimen name="drawer_header_height">100dp</dimen>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fa67b88d1..4d27bbae4 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -324,4 +324,6 @@
<string name="upload_a_new_attachment">Upload a new attachment</string>
<string name="contacts">Contacts</string>
<string name="downloads">Downloads</string>
+ <string name="files">Files</string>
+ <string name="gallery">Gallery</string>
</resources>