ankidroid / ankidroid/Anki-Android
Dark smudge artifact at top of card content when flipping (New study screen, dark mode, "Show answer feedback" + Frame style "Box")
- Ngôn ngữ chính
- Kotlin
- Star
- 11.8k
- Fork
- 2.9k
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 171
Mô tả
### Checked for duplicates?
- [x] This issue is not a duplicate
### Does it also happen in the desktop version?
- [x] This bug does not occur in the latest version of Anki Desktop
### What are the steps to reproduce this bug?
1. Enable Dark mode (nightMode)
2. Enable "Show answer feedback" (Settings > Reviewer)
3. Set "Frame style" to "Box" (Settings > Reviewer > Frame style)
4. Study a card with a custom note type that uses `backdrop-filter` / a translucent background on the card content, e.g.:
.card-content {
background: rgba(30, 32, 38, 0.5);
backdrop-filter: blur(22px) saturate(160%);
border-radius: 15px;
}
5. Tap "Show answer" to flip the card, then rate it (Again/Hard/Good/Easy)
### Expected behaviour
What happened: A faint dark smudge briefly appears at the top edge of the card content exactly when the card flips, right where the answer feedback icon (tick/cross) fades in/out.
This is only reproducible when ALL of the following are true at the same time:
- Dark mode is on
- "Show answer feedback" is enabled
- Frame style = "Box" (elevation = 0, no rounded corners)
- The card's CSS uses backdrop-filter / a translucent background near the top of the card content
Switching Frame style back to "Card" (default, with elevation + rounded corners) makes the artifact disappear completely, with everything else unchanged. Light mode never shows the artifact, regardless of Frame style.
What should have happened: The card content should render cleanly, without any visual artifact, right after the card flips.
https://github.com/user-attachments/assets/ded624ab-ffee-4f05-a4e5-1d96d4587ecc
### Debug info
```text
AnkiDroid Version = 2.24.0 (ebcf8e0e34921628b9b8a496c66ffd4adbb3705f)
Backend Version = 0.1.64-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 13 (SDK 33)
ProductFlavor = play
Device Info = Xiaomi | Xiaomi | nabu | nabu | 21051182C | qcom
WebView Info = [com.google.android.webview | 787104603]: Mozilla/5.0 (Linux; Android 13; 21051182C Build/TKQ1.221013.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/150.0.7871.46 Safari/537.36
ACRA UUID = 9699e0bd-2a17-41b9-b655-18109769a080
FSRS = 5.1.0 (Enabled: true)
Crash Reports Enabled = true
```
### (Optional) Anything else you want to share?
My hypothesis (from reading the source):
- AnswerFeedbackView (AnkiDroid/src/main/java/com/ichi2/anki/ui/windows/reviewer/AnswerFeedbackView.kt) fades in/out using the legacy android.view.animation.Animation (AlphaAnimation via answer_feedback_fade_in.xml / answer_feedback_fade_out.xml), not a modern property animator or hardware-layer-backed animation.
- It's positioned as a sibling view stacked directly on top of the WebView, inside web_view_container (AnkiDroid/src/main/res/layout/fragment_reviewer.xml, lines ~85-137), near the top edge with a 6dp margin.
- When Frame style = "Card" (default), the MaterialCardView keeps its cardElevation and rounded-corner outline clipping. This appears to force the whole container into a single composited hardware layer, which seems to mask the compositing artifact.
- When Frame style = "Box", cardElevation is set to 0F and shapeAppearanceModel is cleared (PreviewerHelpers.kt, setFrameStyle()), removing that outline-clip layer. Without it, the legacy Animation on AnswerFeedbackView appears to composite incorrectly against the WebView's own backdrop-filter blur, producing the dark smudge.
- This may be specific to how Android's WebView/RenderNode compositing interacts with legacy Animation-based views that lack their own hardware layer. It might be worth testing with setLayerType(LAYER_TYPE_HARDWARE, null) or a ViewPropertyAnimator-based fade instead of the legacy Animation class on AnswerFeedbackView.
Happy to test a PR if someone points me to where to patch.
### Research
- [x] I have checked the [manual](https://docs.ankidroid.org/) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/FAQ) and could not find a solution to my issue
- [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release ([instructions](https://docs.ankidroid.org/manual.html#betaTesting))
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.