Open effcol opened 5 years ago
Here's what the adaptive icon looks like when put together:
@effcol Hey! Thank you very much for your icon, it's much cooler than my basic Gimp stuff :D I have a question - is there a 'Androidish' way to integrate such an icon? Can it replace all fixed sized icons that are used now?
Best Dennis
Just a dummy question (and yes, I'm not a developer!), should / can those icons be vector based SVGs rather than raster based PNGs?
@hemker Hey Dennis :) Yes it does replace all the fixed sized icons :) Google are considering this as basically an update to the 'legacy' fixed app icons, allowing for a limited amount of interactivity when the icons when moving them around.
From my pretty limited understanding of android app development, this is how to implement them in the app:
android:roundIcon="@mipmap/ic_launcher_round"
under android:icon="@mipmap/ic_launcher"
If there's anything I've missed out or something, check these two links as they;'re where I got most of that from :) - https://dev.to/_s_farias/how-to-create-adaptive-icons-for-android-using-android-studio-459h https://developer.android.com/studio/write/image-asset-studio
Hope that helps, Effie :)
@tjsuominen Looking at the Android Developer Guide, this can only be done with PNGs, JPEGs and GIFs, with PNGs being preferred. No SVG unfortunately :/
@effcol I'm not sure, but https://medium.com/@webalys/die-png-die-how-to-use-vector-icons-in-your-apps-d884c9c63e93 seems to suggest otherwise. Even the link you provided mentions VectorDrawable
in a related context.
@TPS You might be right that it's possible, but I haven't got it to work with an SVG file.
I exported the above files as SVGs, and put them into the Android Studio Image Asset creator, no icon gets loaded and an error message comes up saying:
❗ The specified asset could not be parsed. Please choose another asset.
Again, I don't know a huge amount about android app development, so there might be stuff i'm missing here and maybe it is possible. I'll link the SVG files below so someone can give it a go if they want :) APKGrabber Adaptive Icon SVG.zip
Here's how the Android Studio Image Asset creator should look with the file, using PNGs, for comparison if someone does give it a go:
According to https://developer.android.com/studio/write/vector-asset-studio.html, using Vector Asset Studio is what's needed.
Also, https://medium.com/androiddevelopers/vectordrawable-adaptive-icons-3fed3d3205b5 may be useful.
Further, https://xleon.net/xamarin/android/android-8-adaptative-vector-icons.html contains this fascinating note (emphasis mine):
TL;DR
Take a look at the Official UI guideline, a blog post about Understanding Android Adaptive Icons and another about Implementing Adaptive Icons.
IMO, the most remarkable improvement is that the launcher icon can now be an android vector xml. That means you can take any SVG file, convert it to the android xml format with a tool, and then use that single file in all 26+ devices.
@TPS Looks like i'm wrong about having vector icons, like I said I don't know that much about it to be honest. I don't have the time to delve into it right now, bit the latter 2 article links you provided seem to point people in the right direction for anyone wanting to do it.
If anyone wants to try and get vector icons working for this app feel free too, i've linked the vector files I made of the icon above.
In the meantime, the PNG files are there completely ready to be used as the icon for now, along with the instructions I provided above for them to implement.
@hemker Any update on if this will be added to the app? Using the PNG files it's really simple to implement :)
@effcol yap, planned that for the weekend :)
@effcol @TPS Works so far, but the notification message is missing the icon now. The logcat output is
D/skia: --- Failed to create image decoder with message 'unimplemented'
when trying to render the resource R.mipmap.ic_launcher. Any ideas?
Tested under Android 9.
@hemker Is the notification message missing the left or right icon here? I'm guessing it's the right one if it's not loading the ic_luancher.
If it is just the right app icon, which I think it might be considering it's the mipmap.ic_launcher trying to render, it seems like it's probably an issue with the Large Notification Icon:
Seems like maybe an issue with setLargeIcon()
in Notification.Builder
.
Might be worth changing setLargeIcon()
to point to R.mipmap.ic_launcher_round
instead of R.mipmap.ic_launcher
.
Not sure how else to help other than that, sorry :/ Looks like using the large icon with an app icon is going largely by the wayside with new android versions and apps, so I wouldn't think it's a dealbreaker to remove that completely from notifications and just keep the Small Notification Icon. But I guess that's your call :)
Sorry that's not loads of help, hopefully you figure it out
I took it upon myself to recreate the icon as an adaptive version, with separate background and foreground layers for parallax. Feel free to use it for the app, no worries if not :) The layers should be the right size and layout as per the material guidelines, and I kept the look/proportions the same as the existing app, so hopefully it's alright.
The zip below contains all the layers, as I'm not sure if uploading them straight to github adds compression, and there's also a version with a drop shadow which I think looks better than without, so I've linked both versions:
Foreground layer:
Background layer:
Foreground layer with drop shadow:
APKGrabber Adaptive Icon.zip