| name | Hero Section UI Stability |
| description | Best practices for stable, flicker-free Hero cards in MainActivity and History. |
Hero Section UI Stability
This skill documents the layout and animation standards to prevent flickering and layout jitters in high-impact Hero sections.
Layout Constraints
- Width Management: Hero amount
TextViews MUST use android:layout_width="match_parent" instead of wrap_content to prevent the card from recalculating its center or width during numeric transitions.
- Line Control: Always set
android:maxLines="1" and android:ellipsize="end" to guarantee vertical stability.
- Auto-Scaling Typography: Use Material 3 auto-sizing to handle varying currency lengths and massive amounts:
app:autoSizeTextType="uniform"
app:autoSizeMinTextSize="24sp"
app:autoSizeMaxTextSize="45sp"
Animation Stability
- Decimal Preservation: During count-up animations, the logic MUST determine if the target value has decimals and maintain that decimal count throughout the animation. Flashing from
120 to 120.4 to 121 causes horizontal jittering and MUST be avoided.
- Formatting Parity: Every frame of an animation must re-apply the 50% smaller symbol and standard spacing through
SpannableStringBuilder to ensure a smooth, coherent transition.
Performance Checklist