Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 - improvment after PR review.

Signed-off-by: Ahmed Radhouane Belkilani <arbelkilani@gmail.com>
  • Loading branch information
ahmed-radhouane committed Mar 3, 2022
1 parent 400a7e9 commit 2b74884
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 36 deletions.
4 changes: 0 additions & 4 deletions library/ui-styles/src/main/res/values/styles_bottom_sheet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@
<item name="android:textSize">12sp</item>
</style>

<style name="BottomSheetButtonTextColor">
<item name="android:textColor">@android:color/white</item>
</style>

</resources>
6 changes: 4 additions & 2 deletions library/ui-styles/src/main/res/values/styles_buttons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@
<item name="android:textColor">@android:color/white</item>
</style>

<style name="Widget.Vector.Button.Destructive" parent="BottomSheetButtonTextColor">
<style name="Widget.Vector.Button.Destructive">
<item name="android:minWidth">94dp</item>
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayDestructive</item>
</style>

<style name="VectorMaterialThemeOverlayDestructive">
<item name="colorPrimary">?colorError</item>
<item name="colorOnPrimary">@color/palette_white</item>
</style>

<style name="Widget.Vector.Button.Positive" parent="BottomSheetButtonTextColor">
<style name="Widget.Vector.Button.Positive">
<item name="android:minWidth">94dp</item>
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayPositive</item>
</style>

<style name="VectorMaterialThemeOverlayPositive">
<!-- Keep default colors from the theme -->
<item name="colorOnPrimary">@color/palette_white</item>
</style>

<style name="Widget.Vector.Button.Unelevated" parent="Widget.MaterialComponents.Button.UnelevatedButton">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import timber.log.Timber
/**
* Add Mavericks capabilities, handle DI and bindings.
*/
abstract class VectorBaseBottomSheetDialogFragment<VB : ViewBinding> : BottomSheetDialogFragment(), MavericksView, VectorBaseBottomSheetListener {
abstract class VectorBaseBottomSheetDialogFragment<VB : ViewBinding> : BottomSheetDialogFragment(), MavericksView {
/* ==========================================================================================
* Analytics
* ========================================================================================== */
Expand Down Expand Up @@ -126,9 +126,8 @@ abstract class VectorBaseBottomSheetDialogFragment<VB : ViewBinding> : BottomShe
super.onDestroy()
}

override fun doCancel(dialog: DialogInterface) {}
@CallSuper
override fun onCancel(dialog: DialogInterface) {
doCancel(dialog)
super.onCancel(dialog)
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ class RoomWidgetPermissionBottomSheet :
views.widgetPermissionContinue.debouncedClicks { doAccept() }
}

override fun doCancel(dialog: DialogInterface) {
doDecline()
}

override fun invalidate() = withState(viewModel) { state ->
super.invalidate()
val permissionData = state.permissionData() ?: return@withState
Expand Down Expand Up @@ -107,6 +103,7 @@ class RoomWidgetPermissionBottomSheet :

override fun onCancel(dialog: DialogInterface) {
super.onCancel(dialog)
doDecline()
viewModel.handle(RoomWidgetPermissionActions.DoClose)
}

Expand Down

0 comments on commit 2b74884

Please sign in to comment.