Skip to content

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

Launcher: keep the dock band's rounded ends inside the grid (#454)

Riku Pirttinokka8692455d2934
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java b/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
index 2961c32c3..2868ef704 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/DockDecoration.java
@@ -61,7 +61,11 @@ public class DockDecoration extends RecyclerView.ItemDecoration {
}
if (!any) return;
float pad = 14 * density;
- rect.inset(-pad, -pad);
+ // The band can only draw inside the grid, and the first and last dock tiles sit 12dp in from its
+ // edges: a full 14dp at the sides sliced the rounded ends flat (#454). Keep the sides, with the
+ // 1dp edge line, inside the grid; the top and bottom have room.
+ float side = Math.max(0f, Math.min(pad, Math.min(rect.left, parent.getWidth() - rect.right) - density));
+ rect.inset(-side, -pad);
float radius = 26 * density;
c.drawRoundRect(rect, radius, radius, band);
c.drawRoundRect(rect, radius, radius, edge);