mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Merge pull request #2039 from nextcloud/feature/2035/roundCornersBottomSheet
Make bottom_sheets initial state collapsed for the rounded top corners
This commit is contained in:
commit
462aff0e73
@ -90,6 +90,6 @@ class AttachmentDialog(val activity: Activity, var chatController: ChatControlle
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class AudioOutputDialog(val callActivity: CallActivity) : BottomSheetDialog(call
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -40,7 +40,7 @@ import com.nextcloud.talk.databinding.DialogBottomContactsBinding
|
|||||||
class ContactsBottomDialog(
|
class ContactsBottomDialog(
|
||||||
val activity: Activity,
|
val activity: Activity,
|
||||||
val bundle: Bundle
|
val bundle: Bundle
|
||||||
) : BottomSheetDialog(activity, R.style.BottomSheetDialogThemeNoFloating) {
|
) : BottomSheetDialog(activity) {
|
||||||
|
|
||||||
private var dialogRouter: Router? = null
|
private var dialogRouter: Router? = null
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ class ContactsBottomDialog(
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -72,7 +72,7 @@ class ConversationsListBottomDialog(
|
|||||||
val controller: ConversationsListController,
|
val controller: ConversationsListController,
|
||||||
val currentUser: UserEntity,
|
val currentUser: UserEntity,
|
||||||
val conversation: Conversation
|
val conversation: Conversation
|
||||||
) : BottomSheetDialog(activity, R.style.BottomSheetDialogThemeNoFloating) {
|
) : BottomSheetDialog(activity) {
|
||||||
|
|
||||||
private var dialogRouter: Router? = null
|
private var dialogRouter: Router? = null
|
||||||
|
|
||||||
@ -309,7 +309,7 @@ class ConversationsListBottomDialog(
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -60,7 +60,7 @@ class MessageActionsDialog(
|
|||||||
private val showMessageDeletionButton: Boolean,
|
private val showMessageDeletionButton: Boolean,
|
||||||
private val hasChatPermission: Boolean,
|
private val hasChatPermission: Boolean,
|
||||||
private val ncApi: NcApi
|
private val ncApi: NcApi
|
||||||
) : BottomSheetDialog(chatController.activity!!, R.style.BottomSheetDialogThemeNoFloating) {
|
) : BottomSheetDialog(chatController.activity!!) {
|
||||||
|
|
||||||
private lateinit var dialogMessageActionsBinding: DialogMessageActionsBinding
|
private lateinit var dialogMessageActionsBinding: DialogMessageActionsBinding
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ class MessageActionsDialog(
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun hasUserId(user: UserEntity?): Boolean {
|
private fun hasUserId(user: UserEntity?): Boolean {
|
||||||
|
@ -38,8 +38,7 @@ class ScopeDialog(
|
|||||||
private val userInfoAdapter: ProfileController.UserInfoAdapter,
|
private val userInfoAdapter: ProfileController.UserInfoAdapter,
|
||||||
private val field: ProfileController.Field,
|
private val field: ProfileController.Field,
|
||||||
private val position: Int
|
private val position: Int
|
||||||
) :
|
) : BottomSheetDialog(con) {
|
||||||
BottomSheetDialog(con) {
|
|
||||||
|
|
||||||
private lateinit var dialogScopeBinding: DialogScopeBinding
|
private lateinit var dialogScopeBinding: DialogScopeBinding
|
||||||
|
|
||||||
@ -79,6 +78,6 @@ class ScopeDialog(
|
|||||||
super.onStart()
|
super.onStart()
|
||||||
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,10 +29,12 @@ package com.nextcloud.talk.ui.dialog
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.annotation.NonNull
|
import androidx.annotation.NonNull
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import autodagger.AutoInjector
|
import autodagger.AutoInjector
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
|
import com.google.android.material.tabs.TabLayout.OnTabSelectedListener
|
||||||
@ -84,6 +86,13 @@ class ShowReactionsDialog(
|
|||||||
initEmojiReactions()
|
initEmojiReactions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
val bottomSheet = findViewById<View>(R.id.design_bottom_sheet)
|
||||||
|
val behavior = BottomSheetBehavior.from(bottomSheet as View)
|
||||||
|
behavior.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||||
|
}
|
||||||
|
|
||||||
private fun initEmojiReactions() {
|
private fun initEmojiReactions() {
|
||||||
adapter?.list?.clear()
|
adapter?.list?.clear()
|
||||||
if (chatMessage.reactions != null && chatMessage.reactions.isNotEmpty()) {
|
if (chatMessage.reactions != null && chatMessage.reactions.isNotEmpty()) {
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
<style name="Talk.BottomSheetDialog" parent="Widget.MaterialComponents.BottomSheet.Modal">
|
<style name="Talk.BottomSheetDialog" parent="Widget.MaterialComponents.BottomSheet.Modal">
|
||||||
<item name="backgroundTint">@color/bg_bottom_sheet</item>
|
<item name="backgroundTint">@color/bg_bottom_sheet</item>
|
||||||
|
<item name="shapeAppearanceOverlay">@style/CustomShapeAppearanceBottomSheetDialog</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TransparentTheme" parent="Theme.MaterialComponents.NoActionBar.Bridge">
|
<style name="TransparentTheme" parent="Theme.MaterialComponents.NoActionBar.Bridge">
|
||||||
@ -244,9 +245,12 @@
|
|||||||
<item name="android:colorControlNormal">#ffffff</item>
|
<item name="android:colorControlNormal">#ffffff</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="BottomSheetDialogThemeNoFloating" parent="ThemeOverlay.MaterialComponents.DayNight.BottomSheetDialog">
|
<style name="CustomShapeAppearanceBottomSheetDialog" parent="">
|
||||||
<item name="android:windowIsFloating">false</item>
|
<item name="cornerFamily">rounded</item>
|
||||||
<item name="android:windowSoftInputMode">adjustResize</item>
|
<item name="cornerSizeTopRight">16dp</item>
|
||||||
|
<item name="cornerSizeTopLeft">16dp</item>
|
||||||
|
<item name="cornerSizeBottomRight">0dp</item>
|
||||||
|
<item name="cornerSizeBottomLeft">0dp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="OutlinedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
<style name="OutlinedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||||
@ -262,5 +266,4 @@
|
|||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user