import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
-import android.content.res.Configuration
import android.net.Uri
import android.os.Bundle
import android.text.Editable
// Use an alert dialog builder to create the alert dialog.
val dialogBuilder: AlertDialog.Builder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog)
- // Get the current theme status.
- val currentThemeStatus = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
-
// Set the icon according to the theme.
- if (currentThemeStatus == Configuration.UI_MODE_NIGHT_YES) {
- // Set the dark icon.
- dialogBuilder.setIcon(R.drawable.domains_night)
- } else {
- // Set the light icon.
- dialogBuilder.setIcon(R.drawable.domains_light)
- }
+ dialogBuilder.setIconAttribute(R.attr.domainsIcon)
// Set the title.
dialogBuilder.setTitle(R.string.add_domain)