Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Merge PR #620: Wallpapers: opt-in sequential/shuffle playback order with restart reconciliation (#602)

Gathin2379da45d0419a
diff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 56777dbeb,6eec195ab..b55b5a100
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@@ -128,12 -114,12 +133,12 @@@ final class Config
String liveTvAction, Map<String, String> launchActions, Map<String, String> appLabels,
Map<String, String> appBanners, String sourcePanelService, String sourcePanelAction, String inputAction,
int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,
- boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, String vpnApp,
+ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean showNetworkPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, String vpnApp,
boolean showHomeSettingsShortcut, boolean showStats, boolean appLibrary, int backgroundColor, int skyIntensity,
int[] settingsKeycodes, boolean settingsKeyPanel, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,
- int wallpaperRotationMinutes, int wallpaperDim, boolean overlayApplied,
+ int wallpaperRotationMinutes, int wallpaperDim, String wallpaperOrder, boolean overlayApplied,
Festival festival, int[] inputKeycodes, List<String> appKeys,
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome) {
+ List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes) {
this.inputKeycodes = inputKeycodes;
this.appKeys = Collections.unmodifiableList(appKeys);
this.dockApps = Collections.unmodifiableList(dockApps);
@@@ -333,11 -298,10 +343,11 @@@
packageMap(appBanners), panelService,
panelAction, inputAction,
Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,
- shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, vpn, homeSettings, showStats, library, background,
+ shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, showNetworkPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, vpn, homeSettings, showStats, library, background,
Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, wallpaperEnabled, wallpaper,
- wallpapers, rotationMinutes, wallpaperDim, applied,
+ wallpapers, rotationMinutes, wallpaperDim, wallpaperOrder, applied,
- festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic);
+ festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
+ Math.max(0, idleClockMinutes));
}
/**
diff --cc launcher/app/src/main/java/com/gathin/tvhome/WallpaperPlayer.java
index 0d8a02327,7d94891cb..f51a14a25
--- a/launcher/app/src/main/java/com/gathin/tvhome/WallpaperPlayer.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/WallpaperPlayer.java
@@@ -40,8 -39,15 +41,16 @@@ final class WallpaperPlayer
this.root = root;
files = new ArrayList<>(config.wallpapers);
interval = config.wallpaperRotationMinutes * 60_000L;
+ bitmapConfig = config.wallpaperTrueColor ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565;
+ order = config.wallpaperOrder;
preferences = context.getSharedPreferences("wallpaper_rotation", Context.MODE_PRIVATE);
+ // Playback state belongs to one collection. Changing the collection starts from its first
+ // picture instead of resuming a filename that belonged to the previous one.
+ String collection = collectionKey(files);
+ if (!collection.equals(preferences.getString("collection", ""))) {
+ preferences.edit().putString("collection", collection)
+ .remove("image").remove("changed").apply();
+ }
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
width = metrics.widthPixels;
height = metrics.heightPixels;