fix(ADFA-2579): Make font slider responsive#862
Conversation
📝 WalkthroughRelease Notes - Font Slider Responsiveness FixSummaryFixes unresponsive font size slider control by removing special-case handling that was blocking drag and touch events. Changes
Impact
|
| Cohort / File(s) | Summary |
|---|---|
Gesture handling simplification common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt |
Removed Slider-specific recursion path from applyLongPressRecursively. All ViewGroup children now processed uniformly via recursive calls without special setupGestureHandling invocation for Sliders. |
Dialog long-press interaction preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt |
Replaced per-item ListView OnItemLongClickListener with recursive long-press handler applied to dialog's decor view, broadening tooltip trigger to all long-presses within the dialog rather than just list items. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- fix(ADFA-1752): Resolve scroll issue in editor palette #773 — Modifies
setupGestureHandlingimplementation in the same file, directly related to the removed Slider gesture handling code.
Suggested reviewers
- Daniel-ADFA
- itsaky-adfa
Poem
🐰 Sliders once caught in special care,
Now glide through views both here and there,
Recursion flows so pure and clean,
No branching paths to block the scene,
Tooltips dance on every press! 🎯
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly indicates the primary change: making the font slider responsive, which directly addresses the linked issue about the unresponsive slider. |
| Description check | ✅ Passed | The description is directly related to the changeset, clearly stating the intent to resolve the unresponsive font slider issue and referencing the linked issue #845. |
| Linked Issues check | ✅ Passed | The code changes address the unresponsive slider issue by removing Slider-specific recursion handling and applying a recursive long-press handler to the dialog's decor view, which should restore slider responsiveness. |
| Out of Scope Changes check | ✅ Passed | All changes are scoped to the font slider responsiveness issue: removing problematic Slider-specific handling in ViewExtensions and updating the dialog preference's long-press handler application. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
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.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt`:
- Around line 49-52: List-based dialog preferences
(SingleChoicePreference/MultiChoicePreference) never get long-press tooltips
because setSingleChoiceItems/setMultiChoiceItems create a ListView and
applyLongPressRecursively (in ViewExtensions.kt) bails out for ListView, so
TooltipManager.showIdeCategoryTooltip attached in DialogPreference.kt never
reaches list items; fix by adding list-item-specific long-press wiring in
ChoiceBasedDialogPreference: after building the AlertDialog in
DialogPreference.createDialog (or in ChoiceBasedDialogPreference), find the
dialog's ListView (alertDialog.listView or
alertDialog.window?.decorView?.findViewById<ListView>(android.R.id.list)) and
iterate its children to set the same long-press listener that calls
TooltipManager.showIdeCategoryTooltip(preference.context, view, tooltipTag) (or
modify applyLongPressRecursively to descend into ListView children) so list rows
receive the tooltip handler.
Resolve issue with font slider not responding to drag events
Fixes #845