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
Make launcher settings a direct top-bar action
roninriddle354038508f5c
diff --git a/README.md b/README.mdindex 01c121e58..6b8a447de 100644--- a/README.md+++ b/README.md@@ -452,7 +452,7 @@ The **TV** needs Android 8.0 (API 26) or newer: `minSdk` is a compile-time floor| What | How it works ||---|---|| **Configure** | Dock order, hidden apps, Live TV app, 4 to 7 tiles per row, reduced motion. All in [`config.xml`](launcher/app/src/main/res/values/config.xml) |-| **Settings on the TV** | Hold OK on the Settings pill for Launcher settings: tiles per row, dock band opacity, animations, advanced effects |+| **Settings on the TV** | Hold OK on Settings for launcher settings. Optional `launcher_settings_button` makes a normal click open them directly; TV settings remain on the settings page and their app tile. || **Themes** | Background, wallpaper and layout from a `config.json` pushed over Wi-Fi, no rebuild. Five ship in [`themes/`](themes/) || **25 languages** | Follows the TV's language, with a fully mirrored right-to-left layout for Hebrew || **App library** | Optional: browse every installed app and add or remove Home shortcuts. See [the app library guide](docs/app-library.md) |diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 1fa0c7f2a..5115964c0 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -59,7 +59,11 @@### 在电视上调整设置-短按桌面的「设置」按钮进入电视系统设置;**在该按钮上长按遥控器确定键**,选择「简洁桌面设置」,可以调整:+默认短按「设置」打开电视系统设置,长按后可进入「简洁桌面设置」。在配置或主题中启用 `launcher_settings_button` 后,顶部改为独立的「简洁桌面设置」按钮,短按即可进入;长按仍可打开模块卡片和应用排序工具,电视系统设置也可从设置页面或下方应用图标进入。++启用独立按钮后,页面还提供「调整应用顺序」,点击即可返回桌面进入移动模式。++可调整:| 选项 | 作用 ||---|---|diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.javaindex f56a54dad..e72917cf6 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java@@ -83,6 +83,8 @@ final class Config {final boolean dockRow;/** Inputs, Wi-Fi and Settings folded into one gear button with a dropdown, like Google TV (config.xml top_menu). */final boolean topMenu;+ /** Direct launcher-settings header action; off by default (launcher_settings_button). */+ final boolean launcherSettingsButton;/** Names under every tile, dimmed until focused (config.xml always_show_names); the dock band grows for them. */final boolean alwaysShowNames;/** Reorder button in the top bar (config.xml reorder_button); the Settings long-press menu offers it either way. */@@ -171,7 +173,7 @@ final class Config {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 topMenu, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, boolean focusOvershoot, String vpnApp,+ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean bootToLiveTv, boolean dockTitle, boolean dockRow, boolean topMenu, boolean launcherSettingsButton, 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 restoreKeyServices, boolean wallpaperEnabled, File wallpaper, List<File> wallpapers,int wallpaperRotationMinutes, int wallpaperDim, int dockOpacity, String wallpaperOrder, boolean overlayApplied,@@ -211,6 +213,7 @@ final class Config {this.dockTitle = dockTitle;this.dockRow = dockRow;this.topMenu = topMenu;+ this.launcherSettingsButton = launcherSettingsButton;this.reorderButton = reorderButton;this.showNetworkPill = showNetworkPill;this.showInputsPill = showInputsPill;@@ -287,6 +290,7 @@ final class Config {boolean dockTitle = res.getBoolean(R.bool.dock_title);boolean dockRow = res.getBoolean(R.bool.dock_row);boolean topMenu = res.getBoolean(R.bool.top_menu);+ boolean launcherSettingsButton = res.getBoolean(R.bool.launcher_settings_button);boolean reorderButton = res.getBoolean(R.bool.reorder_button);boolean showNetworkPill = res.getBoolean(R.bool.show_network_pill);boolean showInputsPill = res.getBoolean(R.bool.show_inputs_pill);@@ -352,6 +356,7 @@ final class Config {dockTitle = bool(json, "dock_title", dockTitle);dockRow = bool(json, "dock_row", dockRow);topMenu = bool(json, "top_menu", topMenu);+ launcherSettingsButton = bool(json, "launcher_settings_button", launcherSettingsButton);reorderButton = bool(json, "reorder_button", reorderButton);showNetworkPill = bool(json, "show_network_pill", showNetworkPill);showInputsPill = bool(json, "show_inputs_pill", showInputsPill);@@ -439,7 +444,7 @@ final class Config {packageMap(appBanners), panelService,panelAction, panelExtra, coocaaSources, inputAction, inputUriScheme,Math.max(1, columns), Math.max(0, rowsBelow), animations, advancedEffects,- shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, dockTitle, dockRow, topMenu, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, focusOvershoot, vpn, homeSettings, showStats, library, background,+ shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, dockTitle, dockRow, topMenu, launcherSettingsButton, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, focusOvershoot, vpn, homeSettings, showStats, library, background,Math.max(0, Math.min(100, skyIntensity)), settingsKeycodes, settingsKeyPanel, restoreKeyServices, wallpaperEnabled, wallpaper,wallpapers, rotationMinutes, wallpaperDim, dockOpacity, wallpaperOrder, applied,festival, inputKeycodes, appKeys, stockHomeRedirect, json == null ? Collections.emptyList() : raceCalendar(json), cinematic, ambientGlow, appGlow,diff --git a/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.javaindex 129a3430c..956c08c93 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java@@ -7,6 +7,7 @@ import android.content.Intent;import android.content.SharedPreferences;import android.os.Bundle;import android.provider.Settings;+import android.view.View;import android.widget.LinearLayout;import android.widget.TextView;import android.widget.Toast;@@ -16,6 +17,7 @@ import java.util.List;/** Remote-friendly settings owned by the launcher; system settings stay one row away. */public final class LauncherSettingsActivity extends Activity {+ static final String EXTRA_REORDER = "com.gathin.tvhome.extra.REORDER_FROM_SETTINGS";private SharedPreferences choices;private final TextView[] columnChoices = new TextView[4];private final TextView[] rowChoices = new TextView[4];@@ -37,6 +39,12 @@ public final class LauncherSettingsActivity extends Activity {setContentView(R.layout.activity_launcher_settings);choices = getSharedPreferences(Config.SETTINGS_NAME, MODE_PRIVATE);Config config = Config.load(this);+ View reorderChoice = findViewById(R.id.reorderChoice);+ reorderChoice.setVisibility(config.launcherSettingsButton ? View.VISIBLE : View.GONE);+ reorderChoice.setOnClickListener(v -> {+ setResult(RESULT_OK, new Intent().putExtra(EXTRA_REORDER, true));+ finish();+ });columns = config.columns;rowsBelowDock = config.rowsBelowDock;dockOpacity = config.dockOpacity;@@ -132,7 +140,8 @@ public final class LauncherSettingsActivity extends Activity {findViewById(R.id.tvSettingsChoice).setOnClickListener(v ->open(SystemSettings.intent(this, Settings.ACTION_SETTINGS)));refresh();- columnChoices[Math.max(0, Math.min(columns - 4, 3))].requestFocus();+ if (config.launcherSettingsButton) reorderChoice.requestFocus();+ else columnChoices[Math.max(0, Math.min(columns - 4, 3))].requestFocus();}private void reverseRow(TextView[] views) {diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex 183e582af..4a283ce96 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -221,6 +221,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {private List<Cards.Card> cards = Collections.emptyList();/** The grid has been laid out and focused since the last resume; the card prompt waits for this. */private boolean tilesReady;+ private boolean settingsRecreationPending;private Dialog cardPrompt;/** Set when a decision could not be saved: no more prompts until the next resume, instead of asking in a loop. */private boolean promptsPaused;@@ -573,7 +574,16 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {open(systemIntent(Settings.ACTION_WIFI_SETTINGS));return true;});- btnSettings.setOnClickListener(v -> open(systemIntent(Settings.ACTION_SETTINGS)));+ launcherSettingsButton = cfg.launcherSettingsButton;+ if (launcherSettingsButton) {+ ((TextView) btnSettings).setText(R.string.launcher_settings);+ ((TextView) btnSettings).setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_home_settings_pill, 0, 0, 0);+ }+ btnSettings.setOnClickListener(v -> {+ if (launcherSettingsButton) startActivityForResult(+ new Intent(this, LauncherSettingsActivity.class), LAUNCHER_SETTINGS_REQUEST);+ else open(systemIntent(Settings.ACTION_SETTINGS));+ });btnReorder = findViewById(R.id.btnReorder);btnReorder.setOnClickListener(v -> toggleReorder());btnReorder.setVisibility(cfg.reorderButton ? View.VISIBLE : View.GONE);@@ -594,6 +604,8 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {showInputsPill = false;btnInputs.setVisibility(View.GONE);btnWifi.setVisibility(View.GONE);+ ((TextView) btnSettings).setText(R.string.settings);+ ((TextView) btnSettings).setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.ic_settings, 0, 0, 0);if (!iconOnlyButtons) makeIconOnly((TextView) btnSettings);btnSettings.setOnClickListener(v -> showTopMenu());// The lone gear sits at the header's middle, not on its bottom line like the row of pills.@@ -820,7 +832,22 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {super.onActivityResult(requestCode, resultCode, data);- if (requestCode == LAUNCHER_SETTINGS_REQUEST && resultCode == RESULT_OK) recreate();+ if (requestCode == LAUNCHER_SETTINGS_REQUEST && resultCode == RESULT_OK) {+ if (data != null && data.getBooleanExtra(LauncherSettingsActivity.EXTRA_REORDER, false)) {+ getIntent().putExtra(LauncherSettingsActivity.EXTRA_REORDER, true);+ }+ // The old activity must not consume the pending action while recreation is queued.+ settingsRecreationPending = true;+ // Reload saved layout choices before entering the existing Home reorder mode.+ recreate();+ }+ }++ private void startPendingSettingsReorder() {+ if (settingsRecreationPending || !tilesReady || !hasWindowFocus() || isFinishing()+ || !getIntent().getBooleanExtra(LauncherSettingsActivity.EXTRA_REORDER, false)) return;+ getIntent().removeExtra(LauncherSettingsActivity.EXTRA_REORDER);+ toggleReorder();}/** Rebuilds the tiles (and the module cards), then puts focus back where it was. */@@ -875,6 +902,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {if (pos < 0) hideHero();// A newly installed app may have brought a card with it.tilesReady = true;+ startPendingSettingsReorder();showCardPrompt();}}@@ -928,6 +956,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {if (returnToLibrary || libraryFocusPending) focusLibrary();else focusTile(pos >= 0 ? pos : returnSlot);tilesReady = true;+ startPendingSettingsReorder();showCardPrompt();});}@@ -1001,6 +1030,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {public void onWindowFocusChanged(boolean hasFocus) {super.onWindowFocusChanged(hasFocus);if (hasFocus) {+ startPendingSettingsReorder();if (libraryFocusPending && appLibrary == null) focusLibrary();showCardPrompt();}@@ -2300,6 +2330,7 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {private boolean iconOnlyButtons;/** config.xml top_menu: Inputs, Wi-Fi and Settings folded into one gear. */private boolean topMenu;+ private boolean launcherSettingsButton;/** icon_only_buttons without wifi_label_width: the Wi-Fi pill shows no network name. */private boolean wifiIconOnly;/** The app library button in the top bar (library_button). */@@ -2761,21 +2792,26 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {status.setText(network);status.setVisibility(View.VISIBLE);}- addInputRow(rows, popup, R.drawable.ic_settings, getString(R.string.settings), -1,- () -> open(systemIntent(Settings.ACTION_SETTINGS)));+ if (launcherSettingsButton) {+ addInputRow(rows, popup, R.drawable.ic_home_settings_pill, getString(R.string.launcher_settings), -1,+ () -> startActivityForResult(new Intent(this, LauncherSettingsActivity.class), LAUNCHER_SETTINGS_REQUEST));+ } else {+ addInputRow(rows, popup, R.drawable.ic_settings, getString(R.string.settings), -1,+ () -> open(systemIntent(Settings.ACTION_SETTINGS)));+ }panel.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);popup.setWidth(Math.max((int) (220 * density), Math.min(panel.getMeasuredWidth(), (int) (360 * density))));dropIn(popup, panel, anchor, getResources().getBoolean(R.bool.rtl_menu_bar) ? Gravity.START : Gravity.END);rows.getChildAt(0).requestFocus();}- /** Keep a normal Settings click for the TV; the launcher's choices live behind hold OK. */+ /** The header opens launcher settings directly; hold OK keeps the extra home actions available. */private void showSettingsMenu() {View anchor = findViewById(R.id.btnSettings);View panel = getLayoutInflater().inflate(R.layout.popup_inputs, root, false);LinearLayout rows = panel.findViewById(R.id.rows);PopupWindow popup = glassPopup(panel, (int) (200 * density));- addSettingsMenuRow(rows, popup, R.string.launcher_settings, () -> startActivityForResult(+ if (!launcherSettingsButton) addSettingsMenuRow(rows, popup, R.string.launcher_settings, () -> startActivityForResult(new Intent(this, LauncherSettingsActivity.class), LAUNCHER_SETTINGS_REQUEST));if (moduleCards) addSettingsMenuRow(rows, popup, R.string.module_cards, this::showModuleCards);if (dockRow) addSettingsMenuRow(rows, popup, R.string.dock_edit, this::startDockEdit);diff --git a/launcher/app/src/main/res/drawable/ic_home_settings_pill.xml b/launcher/app/src/main/res/drawable/ic_home_settings_pill.xmlnew file mode 100644index 000000000..bc506de55--- /dev/null+++ b/launcher/app/src/main/res/drawable/ic_home_settings_pill.xml@@ -0,0 +1,7 @@+<?xml version="1.0" encoding="utf-8"?>+<vector xmlns:android="http://schemas.android.com/apk/res/android"+ android:width="22dp" android:height="22dp"+ android:viewportWidth="24" android:viewportHeight="24">+ <path android:fillColor="#FFFFFFFF"+ android:pathData="M12,3L2,12H5V21H10V15H14V21H19V12H22Z" />+</vector>diff --git a/launcher/app/src/main/res/layout/activity_launcher_settings.xml b/launcher/app/src/main/res/layout/activity_launcher_settings.xmlindex 4aaba26e4..26240c51a 100644--- a/launcher/app/src/main/res/layout/activity_launcher_settings.xml+++ b/launcher/app/src/main/res/layout/activity_launcher_settings.xml@@ -21,6 +21,13 @@android:textColor="#FFFFFFFF"android:textSize="34sp" />+ <TextView+ android:id="@+id/reorderChoice"+ style="@style/SettingsRow"+ android:layout_marginTop="28dp"+ android:text="@string/reorder"+ android:visibility="gone" />+<TextViewandroid:layout_width="match_parent"android:layout_height="wrap_content"diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xmlindex 141d9dd14..4a1f70f77 100644--- a/launcher/app/src/main/res/values/config.xml+++ b/launcher/app/src/main/res/values/config.xml@@ -191,6 +191,9 @@<!-- Inputs, Wi-Fi and Settings folded into one round gear at the top right, like Google TV: OK drops a menuwith the three, hold OK keeps the launcher menu. Off by default; a theme can set "top_menu": true. --><bool name="top_menu">false</bool>+ <!-- A direct Launcher settings action instead of TV Settings in the header (or top_menu).+ Off by default; a theme can set "launcher_settings_button": true. -->+ <bool name="launcher_settings_button">false</bool><!-- The dock band as light frosted glass, like the Inputs, Wi-Fi and Settings pills, so a sky or wallpaper showsthrough it. false (the default) keeps the solid near-black band, or the cinematic shelf's dark glass. Canalso be set with "dock_glass": true in a theme's config.json. -->diff --git a/themes/README.md b/themes/README.mdindex d43bc1a52..066e0f609 100644--- a/themes/README.md+++ b/themes/README.md@@ -54,6 +54,7 @@ is ignored, and a file that doesn't parse is ignored as a whole, so a theme can| `show_inputs_pill` | bool | The Inputs pill in the top bar, shown when the TV has inputs (`true` by default); `false` hides it; what the remote's Input button does is unchanged || `icon_only_buttons` | bool | Wi-Fi and Settings as round icon buttons; Inputs keeps its label (`false` by default) || `top_menu` | bool | Inputs, Wi-Fi and Settings folded into one round gear, centred on the header: OK drops a menu with the three, hold OK keeps the launcher menu (`false` by default) |+| `launcher_settings_button` | bool | Make the header Settings action open Launcher settings directly with a matching 22dp home icon; also changes the Settings row when `top_menu` is on. Hold OK keeps module-card and ordering tools. The settings page includes Reorder apps and TV settings (`false` by default) || `wifi_label_width` | 0 to 300 | With `icon_only_buttons`, keep the network name on the Wi-Fi pill up to this width in dp, cut with an ellipsis; 0 leaves only the icon || `library_button` | bool | The app library as a round button in the top bar, beside Settings; needs `app_library`. Closing the library returns to it || `always_show_names` | bool | Names under every tile, dimmed until focused, the dock included (its band grows to hold them); `false` by default shows only the focused tile's name |