Skip to content

Fix #19323: Resolve deck description dialog shaking#20053

Closed
Ayush-Patel-56 wants to merge 1 commit into
ankidroid:mainfrom
Ayush-Patel-56:fix-deck-description-shake
Closed

Fix #19323: Resolve deck description dialog shaking#20053
Ayush-Patel-56 wants to merge 1 commit into
ankidroid:mainfrom
Ayush-Patel-56:fix-deck-description-shake

Conversation

@Ayush-Patel-56
Copy link
Copy Markdown
Contributor

Purpose / Description

Fixes a visual glitch where the deck description dialog would shake or jitter when adding new lines. The issue was caused by a circular layout dependency between the TextInputLayout and its child TextInputEditText.

Fixes

Approach

The TextInputLayout was set to wrap_content (calculating height based on children), while its child TextInputEditText was set to match_parent (calculating height based on parent). This created a conflict where the layout engine struggled to resolve the height during content updates (like adding newlines), causing the "shaking".

I changed the android:layout_height of the TextInputEditText to wrap_content. This breaks the circular dependency, allowing the text input to grow naturally with its content, which the parent container then correctly wraps.

How Has This Been Tested?

manually tested on an Android Virtual Device (AVD):

  1. Open the Deck Description dialog.
  2. Add text and insert multiple new lines.
  3. Verified that the dialog expands smoothly without shaking.

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Copy Markdown
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Doesn't seem fixed. Please upload a video of testing results.

screen-20260109-151049.mp4

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Jan 9, 2026
Changed TextInputEditText height to wrap_content to fix circular layout dependency.
@Ayush-Patel-56 Ayush-Patel-56 force-pushed the fix-deck-description-shake branch from 41eb360 to 7783ba8 Compare January 9, 2026 09:42
@Ayush-Patel-56
Copy link
Copy Markdown
Contributor Author

Doesn't seem fixed. Please upload a video of testing results.

screen-20260109-151049.mp4

Thanks for the video, that was helpful. The previous attempt to just fix the dimensions within the NestedScrollView was clearly insufficient as the resizing loop persisted.

I have now completely refactored the layout to use a ConstraintLayout.

Changes:

  • Static Layout: Replaced the NestedScrollView (which was causing the dynamic resizing/shaking loop) with a ConstraintLayout.
  • Fixed-height Input: The TextInputLayout is constrained to fill the remaining space between the toolbar and the bottom options (0dp height). This forces the input field to remain a static size regardless of content.
  • Internal Scrolling: The TextInputEditText now handles its own vertical scrolling internally within these fixed bounds, which completely eliminates the shaking behavior.

I've tested this and it results in a solid UI that doesn't shake when editing lines.

screen-20260109-152329.2.1.mp4

@david-allison
Copy link
Copy Markdown
Member

david-allison commented Jan 9, 2026

Closing as-per our AI policy. This feels LLM generated: https://github.com/ankidroid/Anki-Android/blob/main/AI_POLICY.md#new-contributors

@Ayush-Patel-56 Ayush-Patel-56 deleted the fix-deck-description-shake branch January 9, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deck description dialog shakes sometimes

2 participants