Skip to content

Replace long-press widget picker with a desktop menu bottom sheet#94

Open
RobinJ1995 wants to merge 3 commits into
masterfrom
claude/home-screen-longpress-popover-v22cpu
Open

Replace long-press widget picker with a desktop menu bottom sheet#94
RobinJ1995 wants to merge 3 commits into
masterfrom
claude/home-screen-longpress-popover-v22cpu

Conversation

@RobinJ1995

Copy link
Copy Markdown
Owner

Long-pressing empty home screen space used to jump straight into the widget picker. It now opens a desktop menu: the home screen zooms out to 92% and darkens behind a scrim while a rounded frosted bottom sheet slides up from the bottom of the screen, offering:

  • Add widget — the existing widget picker
  • Customise — enters the customise UI (the same ViewModel-preserving relaunch the Preferences screen's Customise entry triggers)
  • Settings — opens the preferences screen (started for a result so the Customise UI result keeps working)

Tapping a row, tapping outside, pressing Back, or pressing Home dismisses it with the reverse animation (sheet slides down, screen zooms back in).

Implementation

  • New home/DesktopMenuOverlay — an in-activity overlay on android.R.id.content, mirroring folder/FolderOverlay's pattern: static active-slot tracking (isShowingIn/dismissActive/clearFor) so HomeActivity's Back callback and the Home-intent handler dismiss it, and cleanup in onDestroy. The zoom-out is a plain scale on the activity content — the wallpaper lives in its own system window and stays put behind it. All transitions settle immediately in battery saver, matching the dash.
  • The sheet (desktop_menu_sheet.xml) uses the app's existing "modern dialog" palette and row ripple, has a grab-handle pill, respects navigation-bar insets, and is capped at 480dp wide and centred on large screens.
  • WidgetHost_LongClickListener becomes WidgetsPager_LongClickListener (it no longer touched WidgetHost); its exit-widget-edit-mode-first branch is unchanged.
  • HomeActivity gains openPreferences() (extracted from lalPreferences_clicked) and openCustomiseMode() (the customise relaunch, shared with the result-code-4 path).
  • The Customise row reuses the existing option_customise/hint_customise strings; the Settings row's hint is "DistroHopper preferences".
  • AGENTS.md updated per its maintenance rule.

Tests

New Robolectric suite home/DesktopMenuOverlayTest: long-press opens the menu (and captures Back), the zoom-out applies and reverts, Back / outside-tap dismiss it, Add widget opens the picker dialog, Customise sets up the customise relaunch, Settings launches PreferencesActivity. HomeHomeButtonTest gains a case for Home dismissing the menu. Full unit-test suite passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_0173WtibvabeHoUt7TvEGaKa


Generated by Claude Code

claude added 2 commits July 16, 2026 23:40
Long-pressing empty home screen space used to jump straight into the
widget picker. It now opens a menu: the home screen zooms out and
darkens behind a scrim while a rounded frosted sheet slides up from the
bottom of the screen, offering "Add widget" (the existing picker) and
"Settings" (the preferences screen).

The menu is a new home/DesktopMenuOverlay — an in-activity overlay on
android.R.id.content following folder/FolderOverlay's pattern (static
active slot, Back/Home dismissal through HomeActivity, transitions
settle immediately in battery saver). The sheet respects navigation-bar
insets and is capped at 480dp wide on large screens. The old
WidgetHost_LongClickListener becomes WidgetsPager_LongClickListener
(it never touched WidgetHost directly any more); its exit-widget-edit-
mode branch is unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0173WtibvabeHoUt7TvEGaKa
Between "Add widget" and "Settings"; it enters the customise UI through
the same ViewModel-preserving relaunch the Preferences screen's
Customise entry triggers (HomeActivity.openCustomiseMode). Reuses the
existing option_customise/hint_customise strings; the Settings row's
hint becomes "DistroHopper preferences" so it no longer overlaps with
the new row's wording.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0173WtibvabeHoUt7TvEGaKa

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1db87d9b3e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/be/robinj/distrohopper/home/DesktopMenuOverlay.kt Outdated
HomeActivity is not recreated on rotation (configChanges), so an open
desktop menu survives it; the sheet's 480dp width cap, its navigation-
bar inset padding and the backdrop zoom pivot were all derived once at
show time and went stale. Re-derive them from a layout-change listener
on the scrim whenever the overlay's size actually changes.

Raised by Codex review on #94.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0173WtibvabeHoUt7TvEGaKa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants