8000 Android Adaptive Icon by AndrewEQ · Pull Request #363 · fuse-open/uno · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Android Adaptive Icon #363

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

Merged
merged 1 commit into from
Oct 4, 2020
Merged

Conversation

AndrewEQ
Copy link
Contributor
@AndrewEQ AndrewEQ commented Oct 2, 2020

Tutorial: https://medium.com/@andrewq/how-to-use-fuse-open-android-adaptive-icons-6778c41d6b82

Added support for defining an adaptive icon

  • still allows legacy definition
  • added default fuse open adaptive icon

Notes:

  • adaptive icons are only visible in API 26+ (Oreo 8.0.0)
  • each icon(foreground/background) must be 108dp*108dp
  • easiest solution to get going is to design svg's, then use Android Studio 3's new wizard to generate your image assets: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
  • in the wizard, you need to name your image asset "icon", then copy over the assets to your fuse project.

.unoproj Usage:

At a minimum, need to set Android.Icons.AdaptiveIconEnabled to true to see the default adaptive icon.

"Android": {
    "Icons": {
      "MDPI": "Assets/Icons/Android/mipmap-mdpi/icon.png",
      "HDPI": "Assets/Icons/Android/mipmap-hdpi/icon.png",
      "XHDPI": "Assets/Icons/Android/mipmap-xhdpi/icon.png",
      "XXHDPI": "Assets/Icons/Android/mipmap-xxhdpi/icon.png",
      "XXXHDPI": "Assets/Icons/Android/mipmap-xxxhdpi/icon.png",
      "ANYDPI_v26": "Assets/Icons/Android/mipmap-anydpi-v26/icon.xml",
      "foreground": "Assets/Icons/Android/drawable/icon_foreground.xml",
      "background": "Assets/Icons/Android/drawable/icon_background.xml",

      "MDPI_Round": "AppStoreAssets/Icons/Android/mipmap-mdpi/icon_round.png",
      "HDPI_Round": "AppStoreAssets/Icons/Android/mipmap-hdpi/icon_round.png",
      "XHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xhdpi/icon_round.png",
      "XXHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xxhdpi/icon_round.png",
      "XXXHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xxxhdpi/icon_round.png",
      "ANYDPI_v26_Round": "AppStoreAssets/Icons/Android/mipmap-anydpi-v26/icon_round.xml"
    }
  },

To enable the adaptive icon, you must add -DUSE_ADAPTIVE_ICON or -DUSE_ROUND_ADAPTIVE_ICON to your build command. e.g. uno build -t=android -DUSE_ADAPTIVE_ICON

@mortend
Copy link
Member
mortend commented Oct 2, 2020

Awesome initiative on making the tutorial. Kudos!

@AndrewEQ AndrewEQ force-pushed the android-adaptive-icon branch from a2cc8ca to f85e6ff Compare October 2, 2020 13:16
@AndrewEQ AndrewEQ force-pushed the android-adaptive-icon branch 2 times, most recently from d51c82d to f877190 Compare October 2, 2020 15:57
Tutorial: https://medium.com/@andrewq/how-to-use-fuse-open-android-adaptive-icons-6778c41d6b82

Added support for defining an adaptive icon
- still allows legacy definition
- added default fuse open adaptive icon

Notes:
- adaptive icons are only visible in API 26+ (Oreo 8.0.0)
- each icon(foreground/background) must be 108dp*108dp
- easiest solution to get going is to design svg's, then use Android Studio 3's new wizard to generate your image assets: https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
- in the wizard, you need to name your image asset "icon", then copy over the assets to your fuse project.

.unoproj Usage:

At a minimum, need to set Android.Icons.AdaptiveIconEnabled to true to see the default adaptive icon.

```
"Android": {
    "Icons": {
      "MDPI": "Assets/Icons/Android/mipmap-mdpi/icon.png",
      "HDPI": "Assets/Icons/Android/mipmap-hdpi/icon.png",
      "XHDPI": "Assets/Icons/Android/mipmap-xhdpi/icon.png",
      "XXHDPI": "Assets/Icons/Android/mipmap-xxhdpi/icon.png",
      "XXXHDPI": "Assets/Icons/Android/mipmap-xxxhdpi/icon.png",
      "ANYDPI_v26": "Assets/Icons/Android/mipmap-anydpi-v26/icon.xml",
      "foreground": "Assets/Icons/Android/drawab
8000
le/icon_foreground.xml",
      "background": "Assets/Icons/Android/drawable/icon_background.xml",

      "MDPI_Round": "AppStoreAssets/Icons/Android/mipmap-mdpi/icon_round.png",
      "HDPI_Round": "AppStoreAssets/Icons/Android/mipmap-hdpi/icon_round.png",
      "XHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xhdpi/icon_round.png",
      "XXHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xxhdpi/icon_round.png",
      "XXXHDPI_Round": "AppStoreAssets/Icons/Android/mipmap-xxxhdpi/icon_round.png",
      "ANYDPI_v26_Round": "AppStoreAssets/Icons/Android/mipmap-anydpi-v26/icon_round.xml"
    }
  },
```

To enable the adaptive icon, you must add `-DUSE_ADAPTIVE_ICON` or `-DUSE_ROUND_ADAPTIVE_ICON` to your build command. e.g. `uno build -t=android -DUSE_ADAPTIVE_ICON`
@AndrewEQ AndrewEQ force-pushed the android-adaptive-icon branch from f877190 to 487d088 Compare October 3, 2020 12:07
@AndrewEQ
Copy link
Contributor Author
AndrewEQ commented Oct 3, 2020

Made an option for the round masking: -DUSE_ROUND_ADAPTIVE_ICON

@mortend
Copy link
Member
mortend commented Oct 4, 2020

For information: It's possible provide defines in the project file.

"Android": {
    "Defines": [
        "USE_ADAPTIVE_ICON",
        "USE_ROUND_ADAPTIVE_ICON"
    ],
    "Icons": {
        /* ... */
    }
}

@mortend mortend merged commit c13ce69 into fuse-open:master Oct 4, 2020
@AndrewEQ
Copy link
Contributor Author
8000 AndrewEQ commented Oct 4, 2020

Oh right, forgot about that, cool will include it in the tutorial too.

mortend added a commit to mortend/uno that referenced this pull request Dec 24, 2020
We forgot to add these files to our project in fuse-open#363.
mortend added a commit to mortend/uno that referenced this pull request Dec 26, 2020
We forgot to add these files to our project in fuse-open#363.
mortend added a commit to mortend/uno that referenced this pull request Dec 26, 2020
We forgot to add these files to our project in fuse-open#363.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0