From cb306151b1d0522452b9df59ceebb8c82a943f7b Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 13 Dec 2023 09:27:52 +0100 Subject: [PATCH 1/5] Material3: Add drag handle Signed-off-by: Andy Scherzinger --- .../layout/dialog_conversation_operations.xml | 400 +++++++++--------- 1 file changed, 207 insertions(+), 193 deletions(-) diff --git a/app/src/main/res/layout/dialog_conversation_operations.xml b/app/src/main/res/layout/dialog_conversation_operations.xml index 65df06d17..62658acb2 100644 --- a/app/src/main/res/layout/dialog_conversation_operations.xml +++ b/app/src/main/res/layout/dialog_conversation_operations.xml @@ -20,242 +20,256 @@ ~ You should have received a copy of the GNU General Public License ~ along with this program. If not, see . --> - + android:layout_gravity="bottom" + app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> + android:paddingBottom="@dimen/standard_half_padding"> - + - + android:layout_height="@dimen/bottom_sheet_item_height" + android:gravity="start|center_vertical" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + android:textColor="@color/medium_emphasis_text" + android:textSize="@dimen/bottom_sheet_text_size" + tools:text="conversation name" /> - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> - + - + + - + android:layout_height="@dimen/bottom_sheet_item_height" + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="horizontal" + android:paddingStart="@dimen/standard_padding" + android:paddingEnd="@dimen/standard_padding" + tools:ignore="UseCompoundDrawables"> + + + + + + - + From c68f733ea0a679e67c24aa39873aaf36928d4f52 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Wed, 13 Dec 2023 16:55:43 +0100 Subject: [PATCH 2/5] Material3: Add drag handle to sscope dialog Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/dialog_scope.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/dialog_scope.xml b/app/src/main/res/layout/dialog_scope.xml index a3e8bfe15..ca87c36d7 100644 --- a/app/src/main/res/layout/dialog_scope.xml +++ b/app/src/main/res/layout/dialog_scope.xml @@ -1,10 +1,11 @@ - + + Date: Wed, 13 Dec 2023 16:57:40 +0100 Subject: [PATCH 3/5] theme background for dialog-based BottomSheet Signed-off-by: Andy Scherzinger --- app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt | 2 +- .../com/nextcloud/talk/ui/bottom/sheet/ProfileBottomSheet.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 9d203e9a0..556a59e9f 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -948,7 +948,7 @@ class ChatActivity : private fun initMessageHolders(): MessageHolders { val messageHolders = MessageHolders() - val profileBottomSheet = ProfileBottomSheet(ncApi, conversationUser!!) + val profileBottomSheet = ProfileBottomSheet(ncApi, conversationUser!!, viewThemeUtils) val payload = MessagePayload( roomToken, diff --git a/app/src/main/java/com/nextcloud/talk/ui/bottom/sheet/ProfileBottomSheet.kt b/app/src/main/java/com/nextcloud/talk/ui/bottom/sheet/ProfileBottomSheet.kt index 305c6b168..605e65b11 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/bottom/sheet/ProfileBottomSheet.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/bottom/sheet/ProfileBottomSheet.kt @@ -40,6 +40,7 @@ import com.nextcloud.talk.models.json.hovercard.HoverCardOverall import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet.AllowedAppIds.EMAIL import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet.AllowedAppIds.PROFILE import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet.AllowedAppIds.SPREED +import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.bundle.BundleKeys import io.reactivex.Observer @@ -49,7 +50,7 @@ import io.reactivex.schedulers.Schedulers private const val TAG = "ProfileBottomSheet" -class ProfileBottomSheet(val ncApi: NcApi, val userModel: User) { +class ProfileBottomSheet(val ncApi: NcApi, val userModel: User, val viewThemeUtils: ViewThemeUtils) { private val allowedAppIds = listOf(SPREED.stringValue, PROFILE.stringValue, EMAIL.stringValue) @@ -89,6 +90,7 @@ class ProfileBottomSheet(val ncApi: NcApi, val userModel: User) { MaterialDialog(context, BottomSheet(LayoutMode.WRAP_CONTENT)).show { cornerRadius(res = R.dimen.corner_radius) + viewThemeUtils.platform.themeDialog(this.view) title(text = displayName) listItemsWithImage(items = items) { _, index, _ -> From e0c6bfdd46289ef290d508422ebc6c7b64ca237b Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 14 Dec 2023 17:30:59 +0100 Subject: [PATCH 4/5] add drag handles to call/chat bottom sheets Signed-off-by: Andy Scherzinger --- app/src/main/res/layout/dialog_message_actions.xml | 4 ++++ app/src/main/res/layout/dialog_message_reactions.xml | 4 ++++ app/src/main/res/layout/dialog_more_call_actions.xml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/app/src/main/res/layout/dialog_message_actions.xml b/app/src/main/res/layout/dialog_message_actions.xml index cfa283a41..6f0c082e1 100644 --- a/app/src/main/res/layout/dialog_message_actions.xml +++ b/app/src/main/res/layout/dialog_message_actions.xml @@ -26,6 +26,10 @@ android:orientation="vertical" android:paddingBottom="@dimen/standard_half_padding"> + + + + diff --git a/app/src/main/res/layout/dialog_more_call_actions.xml b/app/src/main/res/layout/dialog_more_call_actions.xml index 9a3ffe617..67a278b75 100644 --- a/app/src/main/res/layout/dialog_more_call_actions.xml +++ b/app/src/main/res/layout/dialog_more_call_actions.xml @@ -27,6 +27,10 @@ android:orientation="vertical" android:paddingBottom="@dimen/standard_half_padding"> + + Date: Fri, 15 Dec 2023 09:02:02 +0000 Subject: [PATCH 5/5] Analysis: update lint results to reflect reduced error/warning count Signed-off-by: github-actions --- scripts/analysis/lint-results.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/analysis/lint-results.txt b/scripts/analysis/lint-results.txt index dae4ca273..7cc7b2ee3 100644 --- a/scripts/analysis/lint-results.txt +++ b/scripts/analysis/lint-results.txt @@ -1,2 +1,2 @@ DO NOT TOUCH; GENERATED BY DRONE - Lint Report: 8 errors and 84 warnings + Lint Report: 8 errors and 83 warnings