Commit 1ccd6b0
feat: Add Android Adaptive Icons support (#163)
* feat: Add Android Adaptive Icons support
Implement adaptive icons for Android 8.0 (API 26) and above following official Android guidelines.
Changes:
- Create mipmap-anydpi-v26 directory with ic_launcher.xml and ic_launcher_round.xml
- Add ic_launcher_foreground.xml with V2EX logo scaled for 108dp canvas
- Add ic_launcher_background.xml with solid color background
- Support monochrome layer for Android 13+ Material You theming
- Maintain backward compatibility with existing PNG icons for older devices
The implementation uses the existing logo_svg.xml and respects day/night theme colors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* docs: Add documentation comments for adaptive icon scaling calculations
Address Copilot review feedback by adding detailed comments explaining
the magic numbers used for scaling and positioning the logo within the
adaptive icon safe zone.
- Document 108x108dp canvas and 66x66dp safe zone dimensions
- Explain scale factor calculation: 0.061 ≈ 66dp / 1024 viewport
- Explain translation calculation: 21.06 = (108dp - 66dp) / 2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Add dark mode support for adaptive icon background
Fix launcher icon visibility issue in dark mode where white background
made the white logo invisible.
Changes:
- Add values-night/ic_launcher_background.xml with dark color (#111214)
- Dark background ensures white logo remains visible in night mode
- Matches the app's night theme color scheme (night_default_page_bg)
- Light mode continues to use light background (#EEEEEE)
Before: White icon on white background (invisible in dark mode)
After: White icon on dark background (visible in dark mode)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* fix: Center adaptive icon logo horizontally
Fix horizontal alignment issue where the logo appeared slightly
left-aligned in the adaptive icon.
Root cause analysis:
- Original logo SVG has viewport 1024x1024
- Logo path content spans ~285-720px (center at ~502px)
- Logo is inherently off-center by ~10px in original viewport
- Previous centering calculation assumed logo was centered in viewport
Changes:
- Adjust scale from 0.061 to 0.0645 for better fit
- Increase translateX from 21.06 to 21.65 to compensate for logo offset
- Keep translateY at 21 (vertical centering is correct)
- Add detailed comments explaining the offset calculation
Result: Logo now appears properly centered in adaptive icon canvas
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent 40fb779 commit 1ccd6b0
File tree
5 files changed
+48
-0
lines changed- app/src/main/res
- drawable
- mipmap-anydpi-v26
- values-night
5 files changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments