Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/mobile/cmd/gomobile: icon support in gomobile #9985
There are some useful defaults we could have for app icons. Place an icon in /assets/icon.png, and it gets used.
But it turns out there are many icons. Android has an arbitrary number of potential sizes, depending on the DPI of the screen. iOS has a series of fixed sizes. Both also have much larger store icons (1024x1024 and 512x512).
Given the large number of android combinations, automatic scaling might make sense. However users may need the ability to provide multiple icons, as small images often require artistic adjustment to the number of pixels. One possibility is /assets/iconUxV.png.
There's so many ways to go about this. As a lowest common denominator, simply having an
As an addition to this, it may be reasonable to allow someone to tweak how scaling is done with a name modifier, e.g.
With regards to platform specifics, things may get a little crazy when trying to remain platform agnostic. For example, Android defines the mipmap resource directory specifically for defining icons where assets provided may be displayed larger than what is normally provided in a drawable qualifier (mdpi, hdpi, etc) for cases where something like a home screen may display icons larger than what was intended by the system.
With things like this in mind, I don't think it would be unreasonable to allow finite control over defining icon resources to assure the app is presentable for it's intended audience, but this does push against the grain of platform agnostic behavior with gomobile.
With regards to Android, I'm unaware if simply packing the icons in the apk is enough (that'd be great). I suspect that a resources.arsc will need to be generated to identify the drawables for their intended configurations, such as with internal/binres.
@rucuriousyet this push added the ability to generate resource tables for apks which is then used for the simplest form of icon support, picking up on an
It's desirable to support specifying the icon for each density and this pushed removed technical hurdles related.
It's also desirable to support iOS but I don't have the requisite hardware to test an implementation. From what I read a year ago, my impression is iOS support would be comparatively trivial.
Awesome! I just wish there was some notation of this in the gomobile wiki…
-sent from my OnePlus X
On Nov 3, 2017 6:48 PM, "Daniel Skinner" ***@***.***> wrote: It has. You'll need to install the latest version of cmd/gomobile to use. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#9985 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AIIciAYjIXHx66_FyYCQfqKr9xTLKp45ks5sy5hPgaJpZM4DlHEN> .