From 4b22f5939d68af24c0c84f6681f25a84aed1c709 Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Wed, 27 Mar 2019 16:20:44 +0100 Subject: [PATCH] Prepare for buffer join/create UI --- .idea/copyright/Quasseldroid.xml | 2 +- .idea/copyright/profiles_settings.xml | 3 -- app/build.gradle.kts | 1 + .../chat/buffers/BufferViewConfigFragment.kt | 40 ++++++++++++++++ app/src/main/res/drawable/ic_add.xml | 2 +- app/src/main/res/layout/chat_chatlist.xml | 48 ++++++++++++++----- app/src/main/res/values/ids.xml | 4 ++ app/src/main/res/values/strings.xml | 2 + gradle.properties | 4 +- 9 files changed, 87 insertions(+), 19 deletions(-) diff --git a/.idea/copyright/Quasseldroid.xml b/.idea/copyright/Quasseldroid.xml index 9b44d9579..a2c0b251a 100644 --- a/.idea/copyright/Quasseldroid.xml +++ b/.idea/copyright/Quasseldroid.xml @@ -1,7 +1,7 @@ <component name="CopyrightManager"> <copyright> <option name="allowReplaceRegexp" value="Quasseldroid" /> - <option name="notice" value="Quasseldroid - Quassel client for Android Copyright (c) &#36;today.year Janne Koschinski Copyright (c) &#36;today.year The Quassel Project This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>." /> <option name="myName" value="Quasseldroid" /> + <option name="notice" value="Quasseldroid - Quassel client for Android Copyright (c) &#36;today.year Janne Koschinski Copyright (c) &#36;today.year Ken Børge Viktil Copyright (c) &#36;today.year Magnus Fjell Copyright (c) &#36;today.year Martin Sandsmark Copyright (c) &#36;today.year The Quassel Project This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>." /> </copyright> </component> \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml index ce1572560..f46dd7bca 100644 --- a/.idea/copyright/profiles_settings.xml +++ b/.idea/copyright/profiles_settings.xml @@ -1,8 +1,5 @@ <component name="CopyrightManager"> <settings> - <module2copyright> - <element module="Project Source Files" copyright="Quasseldroid" /> - </module2copyright> <LanguageOptions name="HTML"> <option name="fileTypeOverride" value="3" /> <option name="prefixLines" value="false" /> diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ba0d5aec4..2b1e91e03 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -152,6 +152,7 @@ dependencies { } // UI + implementation("com.leinardi.android", "speed-dial", "2.0.1") implementation("me.zhanghai.android.materialprogressbar", "library", "1.6.1") withVersion("0.9.6.0") { implementation("com.afollestad.material-dialogs", "core", version) diff --git a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/buffers/BufferViewConfigFragment.kt b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/buffers/BufferViewConfigFragment.kt index 2acc5cbca..916cdbf17 100644 --- a/app/src/main/java/de/kuschku/quasseldroid/ui/chat/buffers/BufferViewConfigFragment.kt +++ b/app/src/main/java/de/kuschku/quasseldroid/ui/chat/buffers/BufferViewConfigFragment.kt @@ -91,6 +91,10 @@ class BufferViewConfigFragment : ServiceBoundFragment() { @BindView(R.id.buffer_search_container) lateinit var bufferSearchContainer: ViewGroup +/* + @BindView(R.id.fab) + lateinit var fab: SpeedDialView + */ @Inject lateinit var appearanceSettings: AppearanceSettings @@ -531,6 +535,42 @@ class BufferViewConfigFragment : ServiceBoundFragment() { bufferSearch.setText("") } + /* + @ColorInt var colorLabel = 0 + @ColorInt var colorLabelBackground = 0 + view.context.theme.styledAttributes(R.attr.colorTextPrimary, R.attr.colorBackgroundCard) { + colorLabel = getColor(0, 0) + colorLabelBackground = getColor(1, 0) + } + + fab.addActionItem( + SpeedDialActionItem.Builder(R.id.fab_create, R.drawable.ic_add) + .setFabImageTintColor(0xffffffffu.toInt()) + .setLabel(R.string.label_create_channel) + .setLabelBackgroundColor(colorLabelBackground) + .setLabelColor(colorLabel) + .create() + ) + + fab.addActionItem( + SpeedDialActionItem.Builder(R.id.fab_join, R.drawable.ic_channel) + .setFabImageTintColor(0xffffffffu.toInt()) + .setLabel(R.string.label_join_long) + .setLabelBackgroundColor(colorLabelBackground) + .setLabelColor(colorLabel) + .create() + ) + + fab.addActionItem( + SpeedDialActionItem.Builder(R.id.fab_query, R.drawable.ic_account) + .setFabImageTintColor(0xffffffffu.toInt()) + .setLabel(R.string.label_query_medium) + .setLabelBackgroundColor(colorLabelBackground) + .setLabelColor(colorLabel) + .create() + ) + */ + return view } diff --git a/app/src/main/res/drawable/ic_add.xml b/app/src/main/res/drawable/ic_add.xml index 5788cb987..f9fac1dfb 100644 --- a/app/src/main/res/drawable/ic_add.xml +++ b/app/src/main/res/drawable/ic_add.xml @@ -23,6 +23,6 @@ android:viewportWidth="24" android:viewportHeight="24"> <path - android:fillColor="#000" + android:fillColor="#fff" android:pathData="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /> </vector> diff --git a/app/src/main/res/layout/chat_chatlist.xml b/app/src/main/res/layout/chat_chatlist.xml index 75ebdd6ad..b5136c4f4 100644 --- a/app/src/main/res/layout/chat_chatlist.xml +++ b/app/src/main/res/layout/chat_chatlist.xml @@ -17,12 +17,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. --> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.coordinatorlayout.widget.CoordinatorLayout 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"> + android:layout_height="match_parent"> <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" @@ -48,21 +47,46 @@ </androidx.appcompat.widget.Toolbar> - </com.google.android.material.appbar.AppBarLayout> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> - <include layout="@layout/widget_search" /> + <include layout="@layout/widget_search" /> - <de.kuschku.quasseldroid.util.ui.view.WarningBarView - android:id="@+id/feature_context_bufferactivitysync" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:icon="@drawable/ic_alert" - app:text="@string/label_feature_context_bufferactivitysync" /> + <de.kuschku.quasseldroid.util.ui.view.WarningBarView + android:id="@+id/feature_context_bufferactivitysync" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:icon="@drawable/ic_alert" + app:text="@string/label_feature_context_bufferactivitysync" /> + </LinearLayout> + + </com.google.android.material.appbar.AppBarLayout> <de.kuschku.quasseldroid.util.ui.fastscroll.views.FastScrollRecyclerView android:id="@+id/chatList" style="@style/Widget.FastScroller" android:layout_width="match_parent" android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:listitem="@layout/widget_buffer" /> -</LinearLayout> + + <!-- + <com.leinardi.android.speeddial.SpeedDialOverlayLayout + android:id="@+id/overlay" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior" /> + + <com.leinardi.android.speeddial.SpeedDialView + android:id="@+id/fab" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + app:layout_behavior="@string/speeddial_scrolling_view_snackbar_behavior" + app:sdMainFabClosedSrc="@drawable/ic_add" + app:sdOverlayLayout="@id/overlay" /> + --> +</androidx.coordinatorlayout.widget.CoordinatorLayout> diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml index e41089e46..e64019beb 100644 --- a/app/src/main/res/values/ids.xml +++ b/app/src/main/res/values/ids.xml @@ -23,4 +23,8 @@ <item name="tag_daychange_content" type="id" /> <item name="tag_markerline" type="id" /> + + <item name="fab_query" type="id" /> + <item name="fab_join" type="id" /> + <item name="fab_create" type="id" /> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 714217941..437744ba3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -46,6 +46,7 @@ <string name="label_copy">Copy</string> <string name="label_crashes">Crashes</string> <string name="label_crashes_empty">No crash reports found</string> + <string name="label_create_channel">Create Channel</string> <string name="label_delete">Delete</string> <string name="label_delete_all">Delete All</string> <string name="label_descending">Descending</string> @@ -102,6 +103,7 @@ <string name="label_privacy_policy">Privacy Policy</string> <string name="label_query">Query</string> <string name="label_query_long">Open private chat with user</string> + <string name="label_query_medium">Open private chat</string> <string name="label_rename">Rename</string> <string name="label_reply">Reply</string> <string name="label_reset">Reset</string> diff --git a/gradle.properties b/gradle.properties index 9450fb27e..9b93d673b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,9 +33,9 @@ android.enableD8=true # Enable new Android R8 Optimizer android.enableR8=true # Enable gradle build cache -org.gradle.caching=true +org.gradle.caching=false # Enable android build cache -android.enableBuildCache=true +android.enableBuildCache=false # Enable AndroidX android.useAndroidX=true android.enableJetifier=true -- GitLab