Enabling Dark Mode in the Default User Interface

When the device is in dark mode, the Default UI payment flow screens appear in darker contrasting colors than the colors used with the default screen settings (light mode). The Dark Mode feature might be used in low-light settings such as restaurants and bars.
The default dark mode background color is dark gray (#121212). To change the background color to pure black (#000000), add a new
Theme.PayButton2
theme in the
value-night
folder.
Follow this step to change dark mode behavior:
  1. If you want to enforce light or dark mode across your application and Default UI, regardless of the phone's dark mode setting, use this Android method. This example enforces night mode. For more information about this setting, see the Android documentation.
    AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)