From e0caaf39b2e4236f2d1179cd5cf128a87913242d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ptit=20l=C3=A9gume?=
<67562086+PtitLegume@users.noreply.github.com>
Date: Sun, 9 Aug 2026 01:21:51 +0200
Subject: [PATCH] feat(mobile): add random 4x2 flex window widget
---
.../android/app/src/main/AndroidManifest.xml | 15 +++++++++++++
.../immich/widget/FlexWindowReceivers.kt | 2 ++
.../app/src/main/res/values/strings.xml | 1 +
.../main/res/xml/random_widget_flex_4x2.xml | 21 +++++++++++++++++++
mobile/lib/constants/constants.dart | 1 +
5 files changed, 40 insertions(+)
create mode 100644 mobile/android/app/src/main/res/xml/random_widget_flex_4x2.xml
diff --git a/mobile/android/app/src/main/AndroidManifest.xml b/mobile/android/app/src/main/AndroidManifest.xml
index 99a1a6e6b6..c6f0232bb6 100644
--- a/mobile/android/app/src/main/AndroidManifest.xml
+++ b/mobile/android/app/src/main/AndroidManifest.xml
@@ -224,6 +224,21 @@
android:resource="@xml/samsung_appwidget_sub_screen" />
+
+
+
+
+
+
+
+
diff --git a/mobile/android/app/src/main/kotlin/app/alextran/immich/widget/FlexWindowReceivers.kt b/mobile/android/app/src/main/kotlin/app/alextran/immich/widget/FlexWindowReceivers.kt
index aae500270c..fd43f71fcf 100644
--- a/mobile/android/app/src/main/kotlin/app/alextran/immich/widget/FlexWindowReceivers.kt
+++ b/mobile/android/app/src/main/kotlin/app/alextran/immich/widget/FlexWindowReceivers.kt
@@ -7,3 +7,5 @@ class MemoryReceiverFlex2x2 : MemoryReceiver()
class MemoryReceiverFlex4x2 : MemoryReceiver()
class RandomReceiverFlex2x2 : RandomReceiver()
+
+class RandomReceiverFlex4x2 : RandomReceiver()
diff --git a/mobile/android/app/src/main/res/values/strings.xml b/mobile/android/app/src/main/res/values/strings.xml
index 4897b5bd1e..89b6384ae4 100644
--- a/mobile/android/app/src/main/res/values/strings.xml
+++ b/mobile/android/app/src/main/res/values/strings.xml
@@ -6,6 +6,7 @@
Memories (2x2)
Memories (4x2)
Random (2x2)
+ Random (4x2)
See memories from Immich.
View a random image from your library or a specific album.
diff --git a/mobile/android/app/src/main/res/xml/random_widget_flex_4x2.xml b/mobile/android/app/src/main/res/xml/random_widget_flex_4x2.xml
new file mode 100644
index 0000000000..5baa4e01c0
--- /dev/null
+++ b/mobile/android/app/src/main/res/xml/random_widget_flex_4x2.xml
@@ -0,0 +1,21 @@
+
+
+
diff --git a/mobile/lib/constants/constants.dart b/mobile/lib/constants/constants.dart
index 3ccab26408..cadb896c42 100644
--- a/mobile/lib/constants/constants.dart
+++ b/mobile/lib/constants/constants.dart
@@ -44,6 +44,7 @@ const List<(String, String)> kWidgetNames = [
('com.immich.widget.memory', 'app.alextran.immich.widget.MemoryReceiverFlex2x2'),
('com.immich.widget.memory', 'app.alextran.immich.widget.MemoryReceiverFlex4x2'),
('com.immich.widget.random', 'app.alextran.immich.widget.RandomReceiverFlex2x2'),
+ ('com.immich.widget.random', 'app.alextran.immich.widget.RandomReceiverFlex4x2'),
];
const int kMinMonthsToEnableScrubberSnap = 12;