Update design and behaviour on widget permission bottom sheet
This commit is contained in:
Benoit Marty 2022-06-22 15:04:02 +02:00 committed by GitHub
parent c4e578a653
commit 29d4916a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 6 deletions

1
changelog.d/6326.bugfix Normal file
View File

@ -0,0 +1 @@
Update design and behaviour on widget permission bottom sheet

View File

@ -4,10 +4,13 @@
<!-- BottomSheet theming -->
<style name="Theme.Vector.BottomSheetDialog.Light" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
<item name="colorPrimary">@color/element_accent_light</item>
<item name="colorOnPrimary">@color/palette_white</item>
<item name="colorSecondary">@color/palette_element_green</item>
<item name="colorOnSecondary">@color/palette_white</item>
<item name="colorSurface">@color/element_background_light</item>
<item name="colorOnSurface">@color/element_content_primary_light</item>
<item name="colorError">@color/element_alert_light</item>
<item name="colorOnError">@color/palette_white</item>
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/element_content_primary_light</item>
<item name="android:textColorLink">@color/element_link_light</item>
@ -15,10 +18,13 @@
<style name="Theme.Vector.BottomSheetDialog.Dark" parent="Theme.MaterialComponents.BottomSheetDialog">
<item name="colorPrimary">@color/element_accent_dark</item>
<item name="colorOnPrimary">@color/palette_white</item>
<item name="colorSecondary">@color/palette_element_green</item>
<item name="colorOnSecondary">@color/palette_white</item>
<item name="colorSurface">@color/element_background_dark</item>
<item name="colorOnSurface">@color/element_content_primary_dark</item>
<item name="colorError">@color/element_alert_dark</item>
<item name="colorOnError">@color/palette_white</item>
<!-- Default color for text View -->
<item name="android:textColorTertiary">@color/element_content_primary_dark</item>
<item name="android:textColorLink">@color/element_link_dark</item>

View File

@ -21,5 +21,4 @@ import im.vector.app.core.platform.VectorViewModelAction
sealed class RoomWidgetPermissionActions : VectorViewModelAction {
object AllowWidget : RoomWidgetPermissionActions()
object BlockWidget : RoomWidgetPermissionActions()
object DoClose : RoomWidgetPermissionActions()
}

View File

@ -102,8 +102,9 @@ class RoomWidgetPermissionBottomSheet :
}
override fun onCancel(dialog: DialogInterface) {
viewModel.handle(RoomWidgetPermissionActions.BlockWidget)
directListener?.invoke(false)
super.onCancel(dialog)
viewModel.handle(RoomWidgetPermissionActions.DoClose)
}
companion object {

View File

@ -95,7 +95,6 @@ class RoomWidgetPermissionViewModel @AssistedInject constructor(
when (action) {
RoomWidgetPermissionActions.AllowWidget -> handleAllowWidget()
RoomWidgetPermissionActions.BlockWidget -> handleRevokeWidget()
RoomWidgetPermissionActions.DoClose -> Unit
}
}

View File

@ -92,7 +92,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/layout_vertical_margin_big"
android:layout_marginTop="@dimen/layout_vertical_margin"
android:gravity="end"
android:orientation="horizontal">