{"content":"Command: cd /Users/nickchen/WorkBuddy/2026-10-23-15-17-57/cleanyourtv && sed -n '1,120p' launcher/app/src/main/java/com/gathin/tvhome/AppAdapter.java\nStdout: package com.gathin.tvhome;\r\n\r\nimport android.app.Activity;\r\nimport android.content.ActivityNotFoundException;\r\nimport android.content.ComponentName;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.content.pm.PackageManager;\r\nimport android.content.pm.ResolveInfo;\r\nimport android.content.res.Resources;\r\nimport android.graphics.Bitmap;\r\nimport android.graphics.Canvas;\r\nimport android.graphics.Color;\r\nimport android.graphics.Outline;\r\nimport android.graphics.PixelFormat;\r\nimport android.graphics.Rect;\r\nimport android.graphics.drawable.Drawable;\r\nimport android.net.Uri;\r\nimport android.provider.Settings;\r\nimport android.util.DisplayMetrics;\r\nimport android.view.KeyEvent;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.view.ViewOutlineProvider;\r\nimport android.view.animation.DecelerateInterpolator;\r\nimport android.view.animation.OvershootInterpolator;\r\nimport android.widget.ImageView;\r\nimport android.widget.TextView;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.recyclerview.widget.RecyclerView;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.Arrays;\r\nimport java.util.Collections;\r\nimport java.util.HashMap;\r\nimport java.util.HashSet;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\n/**\r\n * App tiles. The first {@link MainActivity#COLUMNS} positions are the pinned dock (favourites, fixed order,\r\n * then empty slots up to a full row, see {@link DockSlots}), then the module cards the owner chose to show\r\n * (by label), the rest is alphabetical.\r\n */\r\npublic class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\r\n\r\n    interface TileListener {\r\n        void onTileFocused(int position, View card);\r\n\r\n        /** Called for a D-pad direction key on a tile. Return true when handled (focus stays put). */\r\n        boolean onTileVerticalKey(int position, int keyCode);\r\n\r\n        void onLibraryRequested();\r\n        void onLibraryFocused();\r\n        /** Hold OK on a tile: the activity shows the tile menu (move, remove from Home, app info). */\r\n        void onTileLongPress(int position, View card);\r\n        void onLibraryUp();\r\n    }\r\n\r\n    static final class Entry {\r\n        static final int APP = 0, HOME_SETTINGS = 1, CARD = 2, EMPTY = 3;\r\n\r\n        final int kind;\r\n        final String label;\r\n        final ComponentName component;\r\n        final String pkg;\r\n        final Drawable banner;\r\n        final Drawable icon;\r\n        /** Text under the tile when it is focused in the grid: the label, plus the caption for a card. */\r\n        final String name;\r\n        /** Ambient glow colour; 0 until sampled from the banner, or the card's accent from the start. */\r\n        int ambient;\r\n\r\n        Entry(String label, ComponentName component, Drawable banner, Drawable icon) {\r\n            this(APP, label, component, banner, icon, null, 0);\r\n        }\r\n\r\n        Entry(int kind, String label, ComponentName component, Drawable banner, Drawable icon, String caption, int accent) {\r\n            this.kind = kind;\r\n            this.label = label;\r\n            this.component = component;\r\n            this.pkg = component.getPackageName();\r\n            this.banner = banner;\r\n            this.icon = icon;\r\n            this.name = caption == null ? label : label + \" \\u00B7 \" + caption;\r\n            this.ambient = accent;\r\n        }\r\n    }\r\n\r\n    static final float FOCUS_SCALE = 1.10f;\r\n    /** Design size of a tile (dp); tiles shrink from here when the columns don't fit, see tileWidthPx. */\r\n    static final float DESIGN_W_DP = 180f, DESIGN_H_DP = 101f;\r\n\r\n    /**\r\n     * Tile width for a grid of this inner width: the cell minus room for the focus zoom and the glass\r\n     * highlight, capped at the design size so 4 columns on a 1080p TV look exactly as before.\r\n     */\r\n    static int tileWidthPx(int innerWidthPx, int columns, float density) {\r\n        int design = Math.round(DESIGN_W_DP * density);\r\n        if (innerWidthPx <= 0 || columns <= 0) return design;\r\n        int cell = innerWidthPx / columns;\r\n        int fit = (int) ((cell - 12 * density) / FOCUS_SCALE);\r\n        return Math.max(Math.round(80 * density), Math.min(design, fit));\r\n    }\r\n\r\n    static int tileHeightPx(int tileWidthPx) {\r\n        return Math.round(tileWidthPx * DESIGN_H_DP / DESIGN_W_DP);\r\n    }\r\n\r\n    /** Height of one grid item: the tile, the name label under it and the item's own padding. */\r\n    static int itemHeightPx(int tileHeightPx, float density) {\r\n        return itemHeightPx(tileHeightPx, true, density);\r\n    }\r\n\r\n    /** The same for either layout: the plain grid (dock_row false) uses the compact spacing. */\r\n    static int itemHeightPx(int tileHeightPx, boolean dockRow, float density) {\r\n\nStderr: (empty)\nExit Code: 0\nSignal: (none)","renderer":{"type":"text","value":"package com.gathin.tvhome;\r\n\r\nimport android.app.Activity;\r\nimport android.content.ActivityNotFoundException;\r\nimport android.content.ComponentName;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.content.pm.PackageManager;\r\nimport android.content.pm.ResolveInfo;\r\nimport android.content.res.Resources;\r\nimport android.graphics.Bitmap;\r\nimport android.graphics.Canvas;\r\nimport android.graphics.Color;\r\nimport android.graphics.Outline;\r\nimport android.graphics.PixelFormat;\r\nimport android.graphics.Rect;\r\nimport android.graphics.drawable.Drawable;\r\nimport android.net.Uri;\r\nimport android.provider.Settings;\r\nimport android.util.DisplayMetrics;\r\nimport android.view.KeyEvent;\r\nimport android.view.LayoutInflater;\r\nimport android.view.View;\r\nimport android.view.ViewGroup;\r\nimport android.view.ViewOutlineProvider;\r\nimport android.view.animation.DecelerateInterpolator;\r\nimport android.view.animation.OvershootInterpolator;\r\nimport android.widget.ImageView;\r\nimport android.widget.TextView;\r\nimport android.widget.Toast;\r\n\r\nimport androidx.annotation.NonNull;\r\nimport androidx.recyclerview.widget.RecyclerView;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.Arrays;\r\nimport java.util.Collections;\r\nimport java.util.HashMap;\r\nimport java.util.HashSet;\r\nimport java.util.List;\r\nimport java.util.Map;\r\nimport java.util.Set;\r\n\r\n/**\r\n * App tiles. The first {@link MainActivity#COLUMNS} positions are the pinned dock (favourites, fixed order,\r\n * then empty slots up to a full row, see {@link DockSlots}), then the module cards the owner chose to show\r\n * (by label), the rest is alphabetical.\r\n */\r\npublic class AppAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\r\n\r\n    interface TileListener {\r\n        void onTileFocused(int position, View card);\r\n\r\n        /** Called for a D-pad direction key on a tile. Return true when handled (focus stays put). */\r\n        boolean onTileVerticalKey(int position, int keyCode);\r\n\r\n        void onLibraryRequested();\r\n        void onLibraryFocused();\r\n        /** Hold OK on a tile: the activity shows the tile menu (move, remove from Home, app info). */\r\n        void onTileLongPress(int position, View card);\r\n        void onLibraryUp();\r\n    }\r\n\r\n    static final class Entry {\r\n        static final int APP = 0, HOME_SETTINGS = 1, CARD = 2, EMPTY = 3;\r\n\r\n        final int kind;\r\n        final String label;\r\n        final ComponentName component;\r\n        final String pkg;\r\n        final Drawable banner;\r\n        final Drawable icon;\r\n        /** Text under the tile when it is focused in the grid: the label, plus the caption for a card. */\r\n        final String name;\r\n        /** Ambient glow colour; 0 until sampled from the banner, or the card's accent from the start. */\r\n        int ambient;\r\n\r\n        Entry(String label, ComponentName component, Drawable banner, Drawable icon) {\r\n            this(APP, label, component, banner, icon, null, 0);\r\n        }\r\n\r\n        Entry(int kind, String label, ComponentName component, Drawable banner, Drawable icon, String caption, int accent) {\r\n            this.kind = kind;\r\n            this.label = label;\r\n            this.component = component;\r\n            this.pkg = component.getPackageName();\r\n            this.banner = banner;\r\n            this.icon = icon;\r\n            this.name = caption == null ? label : label + \" \\u00B7 \" + caption;\r\n            this.ambient = accent;\r\n        }\r\n    }\r\n\r\n    static final float FOCUS_SCALE = 1.10f;\r\n    /** Design size of a tile (dp); tiles shrink from here when the columns don't fit, see tileWidthPx. */\r\n    static final float DESIGN_W_DP = 180f, DESIGN_H_DP = 101f;\r\n\r\n    /**\r\n     * Tile width for a grid of this inner width: the cell minus room for the focus zoom and the glass\r\n     * highlight, capped at the design size so 4 columns on a 1080p TV look exactly as before.\r\n     */\r\n    static int tileWidthPx(int innerWidthPx, int columns, float density) {\r\n        int design = Math.round(DESIGN_W_DP * density);\r\n        if (innerWidthPx <= 0 || columns <= 0) return design;\r\n        int cell = innerWidthPx / columns;\r\n        int fit = (int) ((cell - 12 * density) / FOCUS_SCALE);\r\n        return Math.max(Math.round(80 * density), Math.min(design, fit));\r\n    }\r\n\r\n    static int tileHeightPx(int tileWidthPx) {\r\n        return Math.round(tileWidthPx * DESIGN_H_DP / DESIGN_W_DP);\r\n    }\r\n\r\n    /** Height of one grid item: the tile, the name label under it and the item's own padding. */\r\n    static int itemHeightPx(int tileHeightPx, float density) {\r\n        return itemHeightPx(tileHeightPx, true, density);\r\n    }\r\n\r\n    /** The same for either layout: the plain grid (dock_row false) uses the compact spacing. */\r\n    static int itemHeightPx(int tileHeightPx, boolean dockRow, float density) {"}}