Skip to content

Commit

Permalink
Merge pull request #3512 from nextcloud/chore/noid/dragHandle
Browse files Browse the repository at this point in the history
Material3: Add drag handle
  • Loading branch information
AndyScherzinger authored Dec 15, 2023
2 parents cfcf8df + cbe5f22 commit e7f5bf7
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 199 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down Expand Up @@ -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, _ ->
Expand Down
400 changes: 207 additions & 193 deletions app/src/main/res/layout/dialog_conversation_operations.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/src/main/res/layout/dialog_message_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
android:orientation="vertical"
android:paddingBottom="@dimen/standard_half_padding">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:id="@+id/emojiBar"
android:layout_width="match_parent"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/dialog_message_reactions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="288dp">
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/dialog_more_call_actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
android:orientation="vertical"
android:paddingBottom="@dimen/standard_half_padding">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:id="@+id/call_emoji_bar"
android:layout_width="match_parent"
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/res/layout/dialog_scope.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?><!--
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Nextcloud Talk application
~
~ @author Tobias Kaminsky
~ @author Andy Scherzinger
~ Copyright (C) 2021 Tobias Kaminsky <[email protected]>
~ Copyright (C) 2021-2022 Andy Scherzinger <[email protected]>
~ Copyright (C) 2021-2023 Andy Scherzinger <[email protected]>
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
Expand All @@ -21,12 +22,16 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/Widget.Material3.BottomSheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_half_padding">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<LinearLayout
android:id="@+id/scope_private"
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion scripts/analysis/lint-results.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 8 errors and 84 warnings</span>
<span class="mdl-layout-title">Lint Report: 8 errors and 83 warnings</span>

0 comments on commit e7f5bf7

Please sign in to comment.