Skip to content

ADFA-2686: Centralize the feedback FAB into one consistent size#1507

Open
hal-eisen-adfa wants to merge 3 commits into
stagefrom
ADFA-2686-consistent-feedback-FAB
Open

ADFA-2686: Centralize the feedback FAB into one consistent size#1507
hal-eisen-adfa wants to merge 3 commits into
stagefrom
ADFA-2686-consistent-feedback-FAB

Conversation

@hal-eisen-adfa

@hal-eisen-adfa hal-eisen-adfa commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

The "Send feedback" FAB was declared independently at every call site, so its size drifted. OnboardingActivity built it in code with no fabCustomSize (defaulting to Material's 56dp), while the five XML screens used 32dp. Per the ticket, this centralizes the FAB into one definition so it's the same (smaller) size everywhere.

Fixes ADFA-2686Feedback button wrong size.

Changes

  • New app/src/main/res/layout/feedback_fab.xml — single source of the FAB's appearance (size, icon, elevation, content description).
  • New dimens in resources/.../dimens.xml: feedback_fab_size (32dp) and feedback_fab_icon_size (controls how snugly the icon fills the circle).
  • 5 activity layouts (activity_editor/main/about/preferences/plugin_manager.xml) now <include> the shared FAB, supplying only positioning (uniform bottom|start + 16dp margin).
  • OnboardingActivity inflates the shared layout instead of hand-building the FAB — fixing the 56dp outlier.
  • 5 call sites reference binding.fabFeedback.root (nullable ?.root in AboutActivity, whose land/sw600dp variants omit the FAB) because the FAB now comes from an included binding.
  • FeedbackButtonManager behavior (drag / position persistence / click → feedback email flow / long-press tooltip) is unchanged.

Verification

Built :app:AssembleV8Debug, installed on the emulator, and confirmed the feedback FAB renders as the same 32dp circle (48dp Material touch target) on the editor, main, about, preferences, plugin-manager, and onboarding screens. Onboarding was the previous 56dp outlier — verified by clearing app data to force the real onboarding flow and comparing measured bounds (144px view now vs. 168px/56dp before).

Onboarding — before Onboarding — after
56dp FAB (no fabCustomSize) 32dp FAB, matches all other screens

The "Send feedback" FAB was declared independently at every call site, so
its size drifted: OnboardingActivity built it in code with no fabCustomSize
(defaulting to Material's 56dp), while the five XML screens used 32dp.

Define the FAB's appearance once in res/layout/feedback_fab.xml (size, icon,
elevation, content description) and reuse it via <include> in the five
activity layouts and via LayoutInflater in OnboardingActivity. Size is driven
by new feedback_fab_size (32dp) and feedback_fab_icon_size dimens, the latter
controlling how snugly the icon fills the circle.

Since the FAB now comes from an included binding, call sites reference
binding.fabFeedback.root (nullable ?.root in AboutActivity, whose land/
sw600dp variants omit the FAB). Drag/position/click behavior in
FeedbackButtonManager is unchanged.

Verified on emulator: the feedback FAB now renders as the same 32dp circle on
the editor, main, about, preferences, plugin-manager and onboarding screens
(onboarding was previously the 56dp outlier).

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 254cae34-dbd7-43cd-a4df-f1ba93438536

📥 Commits

Reviewing files that changed from the base of the PR and between 7f3ff75 and 100fdbc.

📒 Files selected for processing (10)
  • app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt
  • app/src/main/res/layout-land/activity_about.xml
  • app/src/main/res/layout-sw600dp/activity_about.xml
  • app/src/main/res/layout/activity_about.xml
  • app/src/main/res/layout/activity_editor.xml
  • app/src/main/res/layout/activity_main.xml
  • app/src/main/res/layout/activity_plugin_manager.xml
  • app/src/main/res/layout/activity_preferences.xml
  • app/src/main/res/layout/feedback_fab.xml
  • resources/src/main/res/values/dimens.xml
🚧 Files skipped from review as they are similar to previous changes (9)
  • app/src/main/res/layout/feedback_fab.xml
  • app/src/main/res/layout/activity_editor.xml
  • app/src/main/res/layout-sw600dp/activity_about.xml
  • app/src/main/res/layout/activity_preferences.xml
  • app/src/main/res/layout/activity_main.xml
  • app/src/main/res/layout-land/activity_about.xml
  • app/src/main/res/layout/activity_plugin_manager.xml
  • app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt
  • app/src/main/res/layout/activity_about.xml

📝 Walkthrough
  • Centralized the “Send feedback” FAB into a shared feedback_fab layout and included it across onboarding and XML-based screens, including landscape and sw600dp About variants.
  • Standardized FAB sizing to 32dp and icon sizing to 26dp via new shared dimension resources (feedback_fab_size, feedback_fab_icon_size).
  • Centralized FAB margin to 16dp (feedback_fab_margin) and replaced hardcoded spacing with shared dimensions across affected layouts.
  • Updated activities to inflate/use the shared FAB definition and wired FeedbackButtonManager against the included view’s root (...fabFeedback.root) to keep existing drag, persistence, click, and tooltip behavior consistent.
  • Updated OnboardingActivity to inflate the shared FAB layout instead of constructing the FAB programmatically.
  • Risk / best-practice watchouts: verify all included-screen variants (especially AboutActivity’s qualifiers) still provide the expected fab_feedback view (or handle nullable presence) so FeedbackButtonManager wiring remains correct after switching to fabFeedback.root.

Walkthrough

The feedback FAB is centralized in a shared layout with reusable dimensions. Activity layouts include it, onboarding inflates it directly, and feedback manager initialization now receives the included FAB root view.

Changes

Feedback FAB integration

Layer / File(s) Summary
Shared FAB layout and dimensions
app/src/main/res/layout/feedback_fab.xml, resources/src/main/res/values/dimens.xml
Defines the feedback FAB’s shared icon, accessibility text, elevation, and dimension-based sizing.
Host layout integration
app/src/main/res/layout/activity_*.xml, app/src/main/res/layout-land/activity_about.xml, app/src/main/res/layout-sw600dp/activity_about.xml, app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt
Replaces inline FAB declarations with the shared layout, adds it to alternate About layouts, and updates onboarding to inflate it while applying positioning parameters.
Feedback manager root wiring
app/src/main/java/com/itsaky/androidide/activities/{AboutActivity,MainActivity,PluginManagerActivity,PreferencesActivity}.kt, app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt
Passes each included feedback FAB’s root view to FeedbackButtonManager.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: itsaky-adfa, daniel-adfa, dara-abijo-adfa

Poem

I’m a bunny with a button bright,
Shared in layouts, neat and light.
Root views hop through every screen,
Feedback FABs stay crisp and clean.
One little tap, one happy cheer!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: centralizing the feedback FAB and standardizing its size.
Description check ✅ Passed The description is clearly related to the changeset and matches the shared FAB layout and sizing updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-2686-consistent-feedback-FAB

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/res/layout/feedback_fab.xml (1)

15-16: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Prefer app:elevation over android:elevation for FloatingActionButton.

FloatingActionButton manages its own shadow/elevation internally via the Material component library. Using android:elevation can interfere with the FAB's shadow rendering on certain API levels. app:elevation is the Material Components-recommended attribute. Additionally, consider app:srcCompat instead of android:src for consistency with other FABs in the codebase (e.g., fab_install_plugin in activity_plugin_manager.xml uses app:srcCompat).

♻️ Proposed refactor
-    android:elevation="16dp"
-    android:src="`@drawable/baseline_feedback_64`"
+    app:elevation="16dp"
+    app:srcCompat="`@drawable/baseline_feedback_64`"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/res/layout/feedback_fab.xml` around lines 15 - 16, Update the
FloatingActionButton attributes in feedback_fab.xml to use app:elevation instead
of android:elevation, and replace android:src with app:srcCompat to match the
established FAB pattern used by fab_install_plugin.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/src/main/res/layout/feedback_fab.xml`:
- Around line 15-16: Update the FloatingActionButton attributes in
feedback_fab.xml to use app:elevation instead of android:elevation, and replace
android:src with app:srcCompat to match the established FAB pattern used by
fab_install_plugin.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7f70916-2d28-4365-a866-5e1ff4aff02c

📥 Commits

Reviewing files that changed from the base of the PR and between 232cec2 and 3835304.

📒 Files selected for processing (13)
  • app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/MainActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/OnboardingActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/PluginManagerActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/PreferencesActivity.kt
  • app/src/main/java/com/itsaky/androidide/activities/editor/BaseEditorActivity.kt
  • app/src/main/res/layout/activity_about.xml
  • app/src/main/res/layout/activity_editor.xml
  • app/src/main/res/layout/activity_main.xml
  • app/src/main/res/layout/activity_plugin_manager.xml
  • app/src/main/res/layout/activity_preferences.xml
  • app/src/main/res/layout/feedback_fab.xml
  • resources/src/main/res/values/dimens.xml

The land and sw600dp variants of activity_about.xml omitted the feedback
FAB, which violates the invariant that every page must always offer feedback.
Add the shared feedback_fab include to both variants (bottom|start, matching
portrait).

Now that fab_feedback is present in every activity_about variant, its
View Binding field is non-null, so AboutActivity uses binding.fabFeedback.root
(dropping the previous nullable ?.root) — consistent with the other screens.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/src/main/res/layout-land/activity_about.xml (1)

121-128: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a shared dimension resource for the feedback FAB margin instead of hardcoded 16dp. Both About variants hardcode 16dp on the FAB include, while the rest of these files consistently use @dimen/ resources for margins. This breaks the PR's centralization goal.

  • app/src/main/res/layout-land/activity_about.xml#L121-L128: replace android:layout_margin="16dp" with a shared dimension reference (e.g., @dimen/feedback_fab_margin).
  • app/src/main/res/layout-sw600dp/activity_about.xml#L121-L128: apply the same dimension reference.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/res/layout-land/activity_about.xml` around lines 121 - 128,
Replace the hardcoded feedback FAB margin in the include blocks of
app/src/main/res/layout-land/activity_about.xml lines 121-128 and
app/src/main/res/layout-sw600dp/activity_about.xml lines 121-128 with the shared
feedback FAB dimension resource, such as `@dimen/feedback_fab_margin`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/src/main/res/layout-land/activity_about.xml`:
- Around line 121-128: Replace the hardcoded feedback FAB margin in the include
blocks of app/src/main/res/layout-land/activity_about.xml lines 121-128 and
app/src/main/res/layout-sw600dp/activity_about.xml lines 121-128 with the shared
feedback FAB dimension resource, such as `@dimen/feedback_fab_margin`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e802edc4-c2d0-4815-ad9b-28cc6309093d

📥 Commits

Reviewing files that changed from the base of the PR and between 3835304 and 7f3ff75.

📒 Files selected for processing (3)
  • app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt
  • app/src/main/res/layout-land/activity_about.xml
  • app/src/main/res/layout-sw600dp/activity_about.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/java/com/itsaky/androidide/activities/AboutActivity.kt

@hal-eisen-adfa hal-eisen-adfa requested a review from a team July 11, 2026 15:46
- feedback_fab.xml: use app:elevation and app:srcCompat (Material-recommended
  attributes) instead of android:elevation / android:src.
- Centralize the FAB margin: add @dimen/feedback_fab_margin (16dp) and reference
  it from all 7 feedback-FAB includes (editor/main/about/preferences/plugin_manager
  plus about land/sw600dp variants) instead of hardcoding 16dp.
- OnboardingActivity: read the same dimen via getDimensionPixelSize instead of a
  hardcoded 16dp TypedValue conversion, so the margin lives in one place.
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.

1 participant