Skip to content

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

Merge PR #730: launcher: answer VIEW_INPUTS with the Inputs menu

Gathin239586e7f8b142
diff --cc launcher/app/src/main/java/com/gathin/tvhome/Config.java
index fcd7c70da,79c372ba8..9fa072656
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@@ -146,35 -126,25 +146,39 @@@ final class Config
final boolean cinematicHome;
/** The glow in the focused app's colour behind the dock (config.xml, ambient_glow); false keeps the background plain. */
final boolean ambientGlow;
+ /** The focus highlight in the focused app's colour on every tile (config.xml, app_glow), as cinematic_home does for the dock. */
+ final boolean appGlow;
/** Minutes Home may sit untouched before the clock screensaver (config.xml, home_idle_clock_minutes); 0 is off. */
final int homeIdleClockMinutes;
+ /** The dock band as light frosted glass like the pills (config.xml, dock_glass); false keeps the solid band. */
+ final boolean dockGlass;
+ /** Shape of the glow behind the focused app (config.xml, glow_style): {@link #GLOW_RADIAL} or {@link #GLOW_HORIZON}. */
+ final String glowStyle;
+
+ static final String GLOW_RADIAL = "radial", GLOW_HORIZON = "horizon";
+ /** Show each rotating wallpaper's name from wallpapers/captions.txt (config.xml / theme wallpaper_captions). */
+ final boolean wallpaperCaptions;
+ /** Answer VIEW_INPUTS with the Inputs menu (handle_view_inputs); see InputsRequestActivity. */
+ final boolean handleViewInputs;
private Config(List<String> dockApps, boolean fillDock, List<String> hiddenApps, String liveTvPackage,
- 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, boolean showNetworkPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, String vpnApp,
+ String liveTvAction, String liveTvInputId, Map<String, String> launchActions, Map<String, String> appLabels,
+ Map<String, String> appBanners, String sourcePanelService, String sourcePanelAction,
+ String sourcePanelExtra, boolean coocaaSources, String inputAction,
+ String inputUriScheme, int columns, int rowsBelowDock, boolean animations, boolean advancedEffects,
+ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean bootToLiveTv, boolean dockTitle, boolean dockRow, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, boolean focusOvershoot, 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, String wallpaperOrder, boolean overlayApplied,
- Festival festival, int[] inputKeycodes, List<String> appKeys,
- List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, int homeIdleClockMinutes,
+ int wallpaperRotationMinutes, int wallpaperDim, int dockOpacity, String wallpaperOrder, boolean overlayApplied,
+ Festival festival, int[] inputKeycodes, List<String> appKeys, String stockHomeRedirect,
+ List<RaceWeekend.Race> raceCalendar, boolean cinematicHome, boolean ambientGlow, boolean appGlow, int homeIdleClockMinutes,
- boolean keyFilter, boolean dockGlass, String glowStyle, boolean wallpaperCaptions) {
++ boolean keyFilter, boolean dockGlass, String glowStyle, boolean wallpaperCaptions,
+ boolean handleViewInputs) {
+ this.handleViewInputs = handleViewInputs;
this.inputKeycodes = inputKeycodes;
this.appKeys = Collections.unmodifiableList(appKeys);
+ this.keyFilter = keyFilter;
+ this.stockHomeRedirect = stockHomeRedirect;
this.dockApps = Collections.unmodifiableList(dockApps);
this.fillDock = fillDock;
this.hiddenApps = Collections.unmodifiableList(hiddenApps);
@@@ -294,15 -239,11 +298,16 @@@
int[] settingsKeycodes = res.getIntArray(R.array.settings_key_keycodes);
boolean settingsKeyPanel = res.getBoolean(R.bool.settings_key_panel);
int[] inputKeycodes = res.getIntArray(R.array.input_key_keycodes);
+ boolean handleViewInputs = res.getBoolean(R.bool.handle_view_inputs);
List<String> appKeys = new ArrayList<>(Arrays.asList(res.getStringArray(R.array.app_keys)));
+ String stockHomeRedirect = res.getString(R.string.stock_home_redirect).trim();
boolean cinematic = res.getBoolean(R.bool.cinematic_home);
boolean ambientGlow = res.getBoolean(R.bool.ambient_glow);
+ boolean appGlow = res.getBoolean(R.bool.app_glow);
int idleClockMinutes = res.getInteger(R.integer.home_idle_clock_minutes);
+ boolean keyFilter = res.getBoolean(R.bool.key_filter);
+ boolean dockGlass = res.getBoolean(R.bool.dock_glass);
+ String glowStyle = res.getString(R.string.glow_style);
boolean applied = false;
File dir = dir(ctx);
@@@ -356,15 -289,11 +361,16 @@@
settingsKeycodes = intArray(json, "settings_key_keycodes", settingsKeycodes);
settingsKeyPanel = bool(json, "settings_key_panel", settingsKeyPanel);
inputKeycodes = intArray(json, "input_key_keycodes", inputKeycodes);
+ handleViewInputs = bool(json, "handle_view_inputs", handleViewInputs);
appKeys = stringList(json, "app_keys", appKeys);
+ stockHomeRedirect = string(json, "stock_home_redirect", stockHomeRedirect);
cinematic = bool(json, "cinematic_home", cinematic);
ambientGlow = bool(json, "ambient_glow", ambientGlow);
+ appGlow = bool(json, "app_glow", appGlow);
idleClockMinutes = integer(json, "home_idle_clock_minutes", idleClockMinutes, 0, 1440);
+ keyFilter = bool(json, "key_filter", keyFilter);
+ dockGlass = bool(json, "dock_glass", dockGlass);
+ glowStyle = string(json, "glow_style", glowStyle);
}
// A theme push or reset invalidates choices made on the TV. On first use, remember the
// current theme without clearing choices from an older launcher version.
@@@ -417,15 -345,15 +423,15 @@@
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, fillDock, hidden, liveTv, liveTvAction, packageMap(launchActions), packageMap(appLabels),
+ return new Config(dock, fillDock, hidden, liveTv, liveTvAction, liveTvInputId, packageMap(launchActions), packageMap(appLabels),
packageMap(appBanners), panelService,
- panelAction, inputAction,
+ panelAction, panelExtra, coocaaSources, inputAction, inputUriScheme,
Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,
- shamsi, greetingName, moduleCards, reducedMotion, dockTitle, dockRow, reorderButton, showNetworkPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, vpn, homeSettings, showStats, library, background,
+ shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, dockTitle, dockRow, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, focusOvershoot, vpn, homeSettings, showStats, library, background,
Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, wallpaperEnabled, wallpaper,
- wallpapers, rotationMinutes, wallpaperDim, wallpaperOrder, applied,
- festival, inputKeycodes, appKeys, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow,
- Math.max(0, idleClockMinutes), handleViewInputs);
+ wallpapers, rotationMinutes, wallpaperDim, dockOpacity, wallpaperOrder, applied,
+ festival, inputKeycodes, appKeys, stockHomeRedirect, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow, appGlow,
- Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions);
++ Math.max(0, idleClockMinutes), keyFilter, dockGlass, glowStyle, wallpaperCaptions, handleViewInputs);
}
/**
diff --cc launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
index 90eec8f64,195a3a5f7..118c8a510
--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java
@@@ -9,11 -9,10 +9,12 @@@ import android.content.BroadcastReceive
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.content.IntentFilter;
+ import android.content.pm.PackageManager;
import android.content.pm.ApplicationInfo;
import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;