Merge "Store the themed icon enabled state in SharedPreferences" into sc-dev
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index fe3779a..ab1c2d0 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -17,7 +17,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="1647136562008520313">"Fons de pantalla i estil"</string>
+    <string name="app_name" msgid="1647136562008520313">"Estil i fons de pantalla"</string>
     <string name="theme_title" msgid="2144932106319405101">"Estil"</string>
     <string name="clock_title" msgid="2126046720254613991">"Rellotge"</string>
     <string name="grid_title" msgid="1688173478777254123">"Quadrícula d\'apps"</string>
diff --git a/src/com/android/customization/model/mode/DarkModeSectionController.java b/src/com/android/customization/model/mode/DarkModeSectionController.java
index de63983..382162e 100644
--- a/src/com/android/customization/model/mode/DarkModeSectionController.java
+++ b/src/com/android/customization/model/mode/DarkModeSectionController.java
@@ -25,6 +25,8 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.os.Handler;
+import android.os.Looper;
 import android.os.PowerManager;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
@@ -124,7 +126,10 @@
             return;
         }
         UiModeManager uiModeManager = context.getSystemService(UiModeManager.class);
-        uiModeManager.setNightModeActivated(viewActivated);
+        int shortDelay = context.getResources().getInteger(android.R.integer.config_shortAnimTime);
+        new Handler(Looper.getMainLooper()).postDelayed(
+                () -> uiModeManager.setNightModeActivated(viewActivated),
+                /* delayMillis= */ shortDelay);
     }
 
     private class BatterySaverStateReceiver extends BroadcastReceiver {
diff --git a/src/com/android/customization/picker/mode/DarkModeSectionView.java b/src/com/android/customization/picker/mode/DarkModeSectionView.java
index 64b4622..6fc0a57 100644
--- a/src/com/android/customization/picker/mode/DarkModeSectionView.java
+++ b/src/com/android/customization/picker/mode/DarkModeSectionView.java
@@ -45,8 +45,7 @@
         switchView.setOnCheckedChangeListener((buttonView, isChecked) ->
                 switchView.setChecked(mIsDarkModeActivated)
         );
-        setOnClickListener(
-                view -> switchView.postDelayed(() -> modeToggleClicked(), /* delayMillis= */ 100));
+        setOnClickListener(view -> modeToggleClicked());
     }
 
     private void modeToggleClicked() {