Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
Merge PR #275: keep dock slots free when dock_apps is short (#162)
Gathin231267b003b3f9
diff --cc docs/specs/card.mdindex 3531d2271,f9ecdceb6..68b9800eb--- a/docs/specs/card.md+++ b/docs/specs/card.md@@@ -135,8 -135,9 +135,10 @@@ any violation drops that one card, witnext to it. A package in `hidden_apps` (`config.xml`) shows neither a tile nor a card. A package in`dock_apps` gets its card in that dock slot. Other cards sort right after the configured dock appsand before the alphabetical grid, by label. On the default configuration, four dock apps and four- columns, that is the first grid tile. With fewer `dock_apps` than columns, a shown card fills the- empty dock slot, since the dock is simply the first row. In the dock, the top shelf shows the label and the glow uses- columns, that is the first grid tile. With fewer `dock_apps` than columns, the free dock slots stay- empty and a shown card is the first grid tile; with `fill_dock` on, a shown card fills the free- dock slot, since the dock is then simply the first row. In the dock, the top shelf shows the label and the glow uses++ columns, that is the first grid tile. With fewer `dock_apps` than columns, the free dock slots take++ the first grid apps (`fill_dock`, on by default), so a shown card fills the free dock slot, since++ the dock is then simply the first row; with `fill_dock` false the free slots stay empty and a++ shown card is the first grid tile. In the dock, the top shelf shows the label and the glow usesthe accent; in the grid, the name line under the focused tile shows the label and the caption,as far as they fit on one line. A card uses the app's own banner (or icon) for its artwork.7. Hide. A hidden card leaves the app's ordinary tile exactly as before: hiding a card neverdiff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.javaindex 6b663b4f6,553270c33..7bf7f9608--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java@@@ -36,6 -36,8 +36,8 @@@ final class Configprivate static final String THEME_SIGNATURE_KEY = "theme_signature";final List<String> dockApps;- /** Grid apps fill the dock slots dock_apps leaves free (config.xml, fill_dock); off by default. */++ /** Grid apps fill the dock slots dock_apps leaves free (config.xml, fill_dock); on by default, false leaves the slots empty. */+ final boolean fillDock;final List<String> hiddenApps;final String liveTvPackage;final String liveTvAction;@@@ -60,16 -62,15 +62,17 @@@final File wallpaper;/** Whether the overlay file was present and parsed. */final boolean overlayApplied;+ /** Festive skin from a theme (festival, festival_until, greeting, accent_color); {@link Festival#NONE} if none. */+ final Festival festival;- private Config(List<String> dockApps, List<String> hiddenApps, String liveTvPackage, String liveTvAction,- String sourcePanelService, String sourcePanelAction, String inputAction,+ private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, String liveTvPackage,+ String liveTvAction, String sourcePanelService, String sourcePanelAction, String inputAction,int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,boolean shamsiDate, boolean moduleCards, boolean reducedMotion, String vpnApp,boolean showHomeSettingsShortcut, int backgroundColor, int skyIntensity,- File wallpaper, boolean overlayApplied) {+ File wallpaper, boolean overlayApplied, Festival festival) {this.dockApps = Collections.unmodifiableList(dockApps);+ this.fillDock = fillDock;this.hiddenApps = Collections.unmodifiableList(hiddenApps);this.liveTvPackage = liveTvPackage;this.liveTvAction = liveTvAction;@@@ -155,14 -157,11 +160,14 @@@if (wallpaper != null && !(wallpaper.isFile() && wallpaper.length() > 0)) wallpaper = null;// A theme can also switch the wallpaper off while the file is still there.if (json != null && json.has("wallpaper") && !bool(json, "wallpaper", true)) wallpaper = null;+ // A festive skin comes only from a theme; config.xml has no festival.+ Festival festival = json == null ? Festival.NONE : Festival.parse(string(json, "festival", ""),+ string(json, "festival_until", ""), string(json, "greeting", ""), string(json, "accent_color", ""));- return new Config(dock, hidden, liveTv, liveTvAction, panelService, panelAction, inputAction,+ return new Config(dock, fillDock, hidden, liveTv, liveTvAction, panelService, panelAction, inputAction,Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,shamsi, moduleCards, reducedMotion, vpn, homeSettings, background,- Math.max(0, Math.min(100, skyIntensity)), wallpaper, applied);+ Math.max(0, Math.min(100, skyIntensity)), wallpaper, applied, festival);}private static void syncThemeChoices(SharedPreferences choices, File dir, File config) {diff --cc launcher/app/src/main/java/com/gathin/tvhome/DockSlots.javaindex 000000000,e2f5df963..a9f9f0ad7mode 000000,100644..100644--- a/launcher/app/src/main/java/com/gathin/tvhome/DockSlots.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/DockSlots.java@@@ -1,0 -1,23 +1,23 @@@+ package com.gathin.tvhome;++ /**+ * The dock is the first row of the grid. dock_apps decides what is in it: a slot it leaves free stays- * empty instead of taking the first grid app (#162), unless fill_dock asks for the old behaviour.++ * empty instead of taking the first grid app (#162) when fill_dock is false; by default they fill.+ */+ final class DockSlots {+ private DockSlots() { }++ /**+ * Empty slots to put after the {@code docked} dock apps found. None when the dock is full, when no+ * dock app is installed (the first row fills so Home still has a dock) or when nothing follows.+ */+ static int empty(int docked, int dockSize, int tiles, boolean fill) {+ if (fill || docked <= 0 || docked >= dockSize || tiles <= docked) return 0;+ return dockSize - docked;+ }++ /** A position focus can land on: an empty slot sends it to the last dock app. */+ static int focusable(int position, int docked, int empty) {+ return empty > 0 && position >= docked && position < docked + empty ? docked - 1 : position;+ }+ }diff --cc launcher/app/src/main/res/values/config.xmlindex 11b7e2214,e25ce5e5d..89b686f96--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@@ -14,6 -14,9 +14,10 @@@<item>com.google.android.youtube.tv</item><item>in.startv.hotstar</item></string-array>- <!-- With fewer dock_apps than columns, the free dock slots stay empty. true fills them with the first- grid apps instead, as older versions did. -->- <bool name="fill_dock">false</bool>++ <!-- With fewer dock_apps than columns (or a dock app that is not installed), the free dock slots take++ the first grid apps, so the dock never shows a gap. false leaves them empty (#162); a theme can++ set "fill_dock": false. -->++ <bool name="fill_dock">true</bool><!-- Apps never shown as tiles (e.g. the Live TV app, which the Inputs menu already covers). --><string-array name="hidden_apps">diff --cc themes/README.mdindex 152306f29,c8bc38f9f..12ab84c75--- a/themes/README.md+++ b/themes/README.md@@@ -27,6 -27,7 +27,7 @@@ is ignored, and a file that doesn't par| Key | Type | Meaning ||---|---|---|| `dock_apps` | list of package names | The dock row, in order; missing apps are skipped |-| `fill_dock` | bool | Fill the dock slots `dock_apps` leaves free with the first grid apps; false (empty slots) by default |++| `fill_dock` | bool | Fill the dock slots `dock_apps` leaves free with the first grid apps (true by default); false leaves them empty || `hidden_apps` | list of package names | Never shown as tiles || `live_tv_package`, `live_tv_action` | string | The Live TV app and, if it has no leanback entry, the action to start it with || `source_panel_service`, `source_panel_action` | string | The TV's own source panel, for sets with no TvInputManager |