Skip to content

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

Launcher: show_library_pill, to drop the App library pill while library_button is on (#1081)

Mazin Kanugae1f747c6a270
diff --git a/docs/app-library.md b/docs/app-library.md
index 99944b6a6..0a4f04a59 100644
--- a/docs/app-library.md
+++ b/docs/app-library.md
@@ -37,6 +37,10 @@ subtle tint. Updating an existing app does not mark it as new.
Right from the final app reaches the library pill; Up returns to the last row.
Hebrew mirrors the horizontal direction, so Left from the final app reaches it.
+With `"library_button": true` the library also has a round button in the top bar. Add
+`"show_library_pill": false` to drop the pill after the last row; the button is then the way in, and
+Down from the last row and Right from the final app (Left in Hebrew) stay where they are.
+
With `tile_menu` on, holding OK on a Home tile offers Remove from Home as well, next to Move and App info.
The remote's Menu key opens that same menu on the focused tile. With `tile_menu` off,
Menu keeps its normal behavior. Settings-key mappings take priority; Menu is left alone
diff --git a/docs/switches.md b/docs/switches.md
index 38819542e..eb8546f82 100644
--- a/docs/switches.md
+++ b/docs/switches.md
@@ -45,3 +45,4 @@ fits the rules; keys from before the rule sit on its wanted list until a screens
| `dock_band_all` | <img src="switches/single_row.jpg" width="320" alt="dock_band_all on a TV"> |
| `uniform_tiles` | <img src="switches/uniform_tiles.jpg" width="320" alt="uniform_tiles on a TV"> |
| `lunar_date` | <img src="switches/lunar_date.jpg" width="320" alt="lunar_date on a TV"> |
+| `show_library_pill` | <img src="switches/show_library_pill.jpg" width="320" alt="show_library_pill on a TV"> |
diff --git a/docs/switches/show_library_pill.jpg b/docs/switches/show_library_pill.jpg
new file mode 100644
index 000000000..49512a851
Binary files /dev/null and b/docs/switches/show_library_pill.jpg differ
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
index e208aa822..eb56debc3 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java
@@ -229,7 +229,7 @@ public class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
this.animations = cfg.animations;
this.advancedEffects = cfg.animations && cfg.advancedEffects;
this.showHomeSettings = cfg.showHomeSettingsShortcut;
- this.showLibrary = cfg.appLibrary;
+ this.showLibrary = LibraryApps.showPill(cfg.appLibrary, cfg.libraryButton, cfg.showLibraryPill);
this.reducedMotion = cfg.reducedMotion;
this.focusOvershoot = cfg.focusOvershoot;
this.rowsBelowDock = cfg.rowsBelowDock;
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/Config.java b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
index 92f2ff9ab..4abef6115 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/Config.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/Config.java
@@ -119,6 +119,8 @@ final class Config {
final boolean iconOnlyInputs;
/** App library as a round button in the top bar (config.xml library_button); needs app_library. */
final boolean libraryButton;
+ /** The App library pill after the last Home row; false hides it while libraryButton is on (show_library_pill). */
+ final boolean showLibraryPill;
/** With icon_only_buttons, the Wi-Fi pill keeps the network name up to this width in dp (0: icon only). */
final int wifiLabelWidth;
/** Decode wallpapers in 32-bit colour instead of RGB_565 (config.xml wallpaper_true_color). */
@@ -242,7 +244,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 openOnStartChoice, boolean dockTitle, boolean dockRow, boolean topMenu, boolean launcherSettingsButton, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean iconOnlyInputs, boolean libraryButton, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, boolean focusOvershoot, String vpnApp,
+ boolean shamsiDate, String greetingName, boolean moduleCards, boolean reducedMotion, boolean bootToLiveTv, boolean openOnStartChoice, boolean dockTitle, boolean dockRow, boolean topMenu, boolean launcherSettingsButton, boolean reorderButton, boolean showNetworkPill, boolean showInputsPill, boolean iconOnlyButtons, boolean iconOnlyInputs, boolean libraryButton, boolean showLibraryPill, int wifiLabelWidth, boolean alwaysShowNames, boolean wallpaperTrueColor, boolean focusOvershoot, String vpnApp,
boolean showHomeSettingsShortcut, boolean showStats, boolean appLibrary, boolean appLibrarySelection, boolean uniformTiles, 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,
@@ -295,6 +297,7 @@ final class Config {
this.iconOnlyButtons = iconOnlyButtons;
this.iconOnlyInputs = iconOnlyInputs;
this.libraryButton = libraryButton;
+ this.showLibraryPill = showLibraryPill;
this.wifiLabelWidth = wifiLabelWidth;
this.alwaysShowNames = alwaysShowNames;
this.wallpaperTrueColor = wallpaperTrueColor;
@@ -407,6 +410,7 @@ final class Config {
boolean iconOnlyButtons = res.getBoolean(R.bool.icon_only_buttons);
boolean iconOnlyInputs = res.getBoolean(R.bool.icon_only_inputs);
boolean libraryButton = res.getBoolean(R.bool.library_button);
+ boolean showLibraryPill = res.getBoolean(R.bool.show_library_pill);
int wifiLabelWidth = res.getInteger(R.integer.wifi_label_width);
boolean alwaysShowNames = res.getBoolean(R.bool.always_show_names);
boolean wallpaperTrueColor = res.getBoolean(R.bool.wallpaper_true_color);
@@ -501,6 +505,7 @@ final class Config {
iconOnlyButtons = bool(json, "icon_only_buttons", iconOnlyButtons);
iconOnlyInputs = bool(json, "icon_only_inputs", iconOnlyInputs);
libraryButton = bool(json, "library_button", libraryButton);
+ showLibraryPill = bool(json, "show_library_pill", showLibraryPill);
wifiLabelWidth = integer(json, "wifi_label_width", wifiLabelWidth, 0, 300);
alwaysShowNames = bool(json, "always_show_names", alwaysShowNames);
wallpaperTrueColor = bool(json, "wallpaper_true_color", wallpaperTrueColor);
@@ -601,7 +606,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, openOnStartChoice, dockTitle, dockRow, topMenu, launcherSettingsButton, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, iconOnlyInputs, libraryButton, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, focusOvershoot, vpn, homeSettings, showStats, library, librarySelection, uniformTiles, background,
+ shamsi, greetingName, moduleCards, reducedMotion, bootToLiveTv, openOnStartChoice, dockTitle, dockRow, topMenu, launcherSettingsButton, reorderButton, showNetworkPill, showInputsPill, iconOnlyButtons, iconOnlyInputs, libraryButton, showLibraryPill, wifiLabelWidth, alwaysShowNames, wallpaperTrueColor, focusOvershoot, vpn, homeSettings, showStats, library, librarySelection, uniformTiles, 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, fadeRows,
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/LibraryApps.java b/launcher/app/src/main/java/com/gathin/tvhome/LibraryApps.java
index b55407306..0fc276541 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/LibraryApps.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/LibraryApps.java
@@ -102,6 +102,11 @@ final class LibraryApps {
return !removedFromHome && (explicitlyAdded || (tvApp && !themeHidden));
}
+ /** The pill after the last Home row: show_library_pill false hides it only while the top-bar button is a way in. */
+ static boolean showPill(boolean library, boolean button, boolean pill) {
+ return library && (pill || !button);
+ }
+
static boolean recent(long installedAt, long now) {
return installedAt > 0 && installedAt <= now && now - installedAt <= RECENT_MS;
}
diff --git a/launcher/app/src/main/res/values/config.xml b/launcher/app/src/main/res/values/config.xml
index 8dbd32bec..8fe547e44 100644
--- a/launcher/app/src/main/res/values/config.xml
+++ b/launcher/app/src/main/res/values/config.xml
@@ -257,6 +257,10 @@
<bool name="wifi_status_warnings">false</bool>
<!-- The app library as a round button in the top bar, beside Settings (app_library must be on too). -->
<bool name="library_button">false</bool>
+ <!-- The App library pill after the last Home row. false hides it while library_button is on, so the top-bar
+ button stays the way in, and Down from the last row stays put as with app_library off. Can also be set
+ with "show_library_pill": false in a theme's config.json. -->
+ <bool name="show_library_pill">true</bool>
<!-- 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 the Wi-Fi pill as an icon. -->
<integer name="wifi_label_width">0</integer>
diff --git a/launcher/app/src/test/java/com/gathin/tvhome/LibraryAppsTest.java b/launcher/app/src/test/java/com/gathin/tvhome/LibraryAppsTest.java
index b3e91ac26..e207fc712 100644
--- a/launcher/app/src/test/java/com/gathin/tvhome/LibraryAppsTest.java
+++ b/launcher/app/src/test/java/com/gathin/tvhome/LibraryAppsTest.java
@@ -9,6 +9,15 @@ import java.util.Set;
import static org.junit.Assert.*;
public class LibraryAppsTest {
+ @Test public void thePillHidesOnlyWhileTheTopBarButtonIsAWayIn() {
+ assertTrue(LibraryApps.showPill(true, false, true));
+ assertTrue(LibraryApps.showPill(true, true, true));
+ assertTrue(LibraryApps.showPill(true, false, false));
+ assertFalse(LibraryApps.showPill(true, true, false));
+ assertFalse(LibraryApps.showPill(false, true, true));
+ assertFalse(LibraryApps.showPill(false, false, true));
+ }
+
@Test public void hidingKeepsTheNextAppOrThePreviousAppAtTheEnd() {
assertEquals(1, LibraryApps.nextAfterRemoval(0, 5));
assertEquals(3, LibraryApps.nextAfterRemoval(2, 5));
diff --git a/themes/README.md b/themes/README.md
index a4c5310cd..75152a7f8 100644
--- a/themes/README.md
+++ b/themes/README.md
@@ -70,6 +70,7 @@ A new key needs one there in the same pull request.
| `wifi_status_warnings` | bool | With `wifi_status_color`, the icon orange while connected without internet (a captive portal waiting for its login page) and red while offline, instead of white (`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 |
+| `show_library_pill` | bool | The App library pill after the last Home row (`true` by default); `false` hides it while `library_button` is on, so the top-bar button stays the way in and Down from the last row stays put, as with `app_library` off |
| `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 |
| `wallpaper_true_color` | bool | Decode wallpapers in 32-bit colour (8 MB at 1080p) instead of RGB_565 (4 MB), which bands dark gradients such as a night sky; for TVs with 2 GB or more (`false` by default) |
| `app_library` | bool | An App library pill after the last Home row: every installed app, add one to Home or take it off (`false` by default). The choices stay on the TV when a theme is pushed or reset; see [docs/app-library.md](../docs/app-library.md) |