-
Couldn't load subscription status.
- Fork 46
feat: Add Android Adaptive Icons support #163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements Android Adaptive Icons support for the V2EX client app, providing modern launcher icon capabilities for Android 8.0+ while maintaining backward compatibility with older versions.
- Adds adaptive icon descriptors for both standard and round launcher icons
- Creates foreground layer using existing V2EX logo with proper scaling for 108dp canvas
- Implements solid color background layer and monochrome support for Material You theming
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml |
Standard adaptive icon descriptor with background, foreground, and monochrome layers |
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml |
Round adaptive icon descriptor (identical to standard) |
app/src/main/res/drawable/ic_launcher_foreground.xml |
Vector drawable for foreground layer using scaled V2EX logo |
app/src/main/res/drawable/ic_launcher_background.xml |
Vector drawable for solid color background layer |
| <group android:scaleX="0.061" | ||
| android:scaleY="0.061" | ||
| android:translateX="21.06" | ||
| android:translateY="21.06"> |
Copilot
AI
Oct 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic numbers 0.061 and 21.06 should be documented with comments explaining the calculation. Consider adding comments to clarify that these values position the logo within the 66x66dp safe zone of the 108x108dp canvas.
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Summary
Implement Android Adaptive Icons to provide modern launcher icon support for Android 8.0 (API 26) and above, following official Android design guidelines.
Changes
mipmap-anydpi-v26directory with adaptive icon descriptorsic_launcher_foreground.xmlwith V2EX logo optimized for 108dp canvasic_launcher_background.xmlwith solid color backgroundTechnical Details
Adaptive Icon Structure
Theme Support
The foreground layer respects existing theme colors:
Device Compatibility
Benefits
Testing
Screenshots
Please add screenshots showing the adaptive icon on your device launcher
🤖 Generated with Claude Code