color-chooser icon indicating copy to clipboard operation
color-chooser copied to clipboard

How to make rounded corner dialog in view based variant same as compose version and always want dark themed dialog

Open payal-iroid opened this issue 1 year ago • 3 comments

I want to change the tab title colors, rounded corner dialog and the dialog should be always in dark theme or I can set the dialog content colors. Can I get these customization without adding this library as a module? reference of compose sample : https://github.com/ohmae/color-chooser/blob/master/readme/1.png

payal-iroid avatar Apr 02 '25 05:04 payal-iroid

Since the entity is an AlertDialog, you can change the appearance by setting the theme. e.g.

    <style name="AppTheme" parent="Theme.Material3.DynamicColors.Dark">
        <item name="alertDialogTheme">@style/AppTheme.Dialog</item>
    </style>
    <style name="AppTheme.Dialog" parent="ThemeOverlay.Material3.Dialog.Alert">
        <item name="dialogCornerRadius">24dp</item>
    </style>

ohmae avatar Apr 02 '25 11:04 ohmae

<style name="Theme.mvvm_2_0" parent="Theme.Material3.Dark.NoActionBar">
     
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryVariant">@color/colorPrimaryVariant</item>
        <item name="colorOnPrimary">@color/white</item>
  
        <item name="colorSecondary">@color/colorSecondary</item>
        <item name="colorSecondaryVariant">@color/colorSecondaryVariant</item>
        <item name="colorOnSecondary">@color/black</item>
        <item name="android:statusBarColor">@color/colorSelago</item>
        <item name="android:forceDarkAllowed" tools:targetApi="q">false</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="searchViewStyle">@style/SearchViewStyle</item>
        <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>
        
        <item name="alertDialogTheme">@style/AppTheme.Dialog</item>
        
    </style>

    <style name="AppTheme.Dialog" parent="ThemeOverlay.Material3.Dialog.Alert">
        <item name="dialogCornerRadius">24dp</item>
    </style>

Above is my theme I am using in my app and I've applied your suggestion but it is not working.

payal-iroid avatar Apr 02 '25 12:04 payal-iroid

Right? It works fine in my environment. In any case, this is a general Android app implementation method, and is not a problem specific to this library, so I cannot provide any further support.

ohmae avatar Apr 03 '25 11:04 ohmae