hemker / apkgrabber

APKGrabber is a tool that simplifies the process of finding updates for your installed apps.
GNU General Public License v3.0
425 stars 23 forks source link

Could you make the icon an Adaptive Icon? #27

Open effcol opened 5 years ago

effcol commented 5 years ago

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: APKGrabber Adaptive Icon Foreground Background layer: APKGrabber Adaptive Icon Background Foreground layer with drop shadow: APKGrabber Adaptive Icon Foreground Dropshadow APKGrabber Adaptive Icon.zip

effcol commented 5 years ago

Here's what the adaptive icon looks like when put together: APKGrabber Adaptive Icon Animation

hemker commented 5 years ago

@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

tjsuominen commented 5 years ago

Just a dummy question (and yes, I'm not a developer!), should / can those icons be vector based SVGs rather than raster based PNGs?

effcol commented 5 years ago

@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:

  1. Open the project in Android studio, go to the 'res' folder, right click on it and select 'New' > 'Image Asset'.
  2. Then make sure on the 'icon type' drop down, 'Launcher Icons (Adaptive and Legacy)' is selected.
  3. From there, import the forground layer and background layer you want out of the ones I've linked in the zip above and see if you prefer the one with the dropshadow or not :)
  4. Click 'next' and it'll take you to the confirmation page showing you which files it's adding and that it'll be replacing the previous icon files in those locations, in all the fixed sizes.
  5. Next, apply the new icons to the project and save.
  6. Finally, you go into the AndroidManifest.xml file and add 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 :)

effcol commented 5 years ago

@tjsuominen Looking at the Android Developer Guide, this can only be done with PNGs, JPEGs and GIFs, with PNGs being preferred. No SVG unfortunately :/

TPS commented 5 years ago

@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.

effcol commented 5 years ago

@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: image

TPS commented 5 years ago

According to https://developer.android.com/studio/write/vector-asset-studio.html, using Vector Asset Studio is what's needed.

TPS commented 5 years ago

Also, https://medium.com/androiddevelopers/vectordrawable-adaptive-icons-3fed3d3205b5 may be useful.

TPS commented 5 years ago

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.

effcol commented 5 years ago

@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.

effcol commented 5 years ago

@hemker Any update on if this will be added to the app? Using the PNG files it's really simple to implement :)

hemker commented 5 years ago

@effcol yap, planned that for the weekend :)

hemker commented 5 years ago

@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.

effcol commented 5 years ago

@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. InkedScreenshot_20190512-222919_APKGrabber_LI

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