header-action-styling
Standards for top-bar action icons, alignment, and tints
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Header Action Styling
This skill documents the standardized design for the application's header (Toolbar) actions.
Action Placement
| Action | Location | implementation |
|---|---|---|
| History | Hero Card | Tapping the "Remaining Expenses" hero card opens History. |
| Add New | FAB | Floating Action Button (Bottom Right) with colorPrimary. |
| Profile | Toolbar | Top right corner, clearly separated. |
| Search | Toolbar | Top left/center (Trigger layout). |
Toolbar Alignment Standards
1. Standard Menu APIs
Always use standard Android Menu Items (onCreateOptionsMenu) for action buttons (like Logout, Edit, Save).
- Why: Prevents clipping, ensures accessible touch targets (48dp), and handles safe area insets automatically.
-
Do Not: Inject custom
ConstraintLayoutorTextViewinto the Toolbar unless absolutely necessary for branding.
2. Optical Alignment
To achieve pixel-perfect visual alignment between different screen headers:
-
Standard Branding: Use
app:contentInsetEnd="24dp"for solid elements (like Profile Images). -
Action Icons: Use
app:contentInsetEnd="32dp"for Menu Items.- Context: A standard solid image touches the 24dp line. A standard Menu Icon (24dp inside 48dp ripple) has internal padding. Increasing inset to 32dp nudges the visual icon left, aligning its optical center/edge matches the solid image's presence.
Expressive Motion (M3E)
-
Logo Shake: Tapping the Profile/Logo image MUST trigger a premium rotation shake:
view.animate().rotationBy(15f).setDuration(100).withEndAction { view.animate().rotationBy(-30f).setDuration(200).withEndAction { view.animate().rotation(0f).setDuration(100).start() }.start() }.start() -
Tactile Spring: All header trigger layouts (Search, Profile) MUST use
AnimationHelper.applySpringOnTouch(). -
Mechanical Scroll: Toolbar transparency or elevation changes should coincide with scroll ticks if possible.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!