httptoolkit / httptoolkit-android

Automatic Android interception & debugging with HTTP Toolkit, for Android
https://httptoolkit.com
GNU Affero General Public License v3.0
493 stars 77 forks source link

Support adaptive icons #10

Closed X1nto closed 1 year ago

X1nto commented 1 year ago
This PR enables support for Android's adaptive icons, including the new Material You monochrome version: Before After
Screenshot_20230405-163002~2 Screenshot_20230406-000752~2

~Note: Since I had no access to the original SVG of HTTPToolkit's icon, I had to make my own. It's super close to the original icon but you still might want to use your own original icon instead. I attached my recreation SVG file just in case: http-toolkit-icons.zip~

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

pimterry commented 1 year ago

Interesting! I'm definitely open to this. I'm not sure exactly how the adaptive icons etc work, so I'll look into that first, and I'll need to do some testing on devices to see how it appears everywhere.

A couple of things I notice here already though:

In case it's useful, the original SVG is here: logo-icon

I think when the icon was originally set up though, I used the Android new project tools, uploaded that SVG and then configured the zoom manually from there, so I'm not sure exactly what scaling that should use I'm afraid.

pimterry commented 1 year ago

I've also just noticed that the build isn't working - it seems that GitHub isn't running it at all. I think this might be due to an old OS configuration that they've now deprecated. I've just fixed that on master, so if you rebase this PR then that should start working correctly.

X1nto commented 1 year ago

I've also just noticed that the build isn't working - it seems that GitHub isn't running it at all. I think this might be due to an old OS configuration that they've now deprecated. I've just fixed that on master, so if you rebase this PR then that should start working correctly.

Done!

X1nto commented 1 year ago

Hm, it seems like I accidentally pushed some .idea files. I suggest .gitignoring the whole .idea folder.

X1nto commented 1 year ago

Interesting! I'm definitely open to this. I'm not sure exactly how the adaptive icons etc work, so I'll look into that first, and I'll need to do some testing on devices to see how it appears everywhere.

A couple of things I notice here already though:

  • It seems like the new icon here is noticeably smaller than the original, which leaves a lot of white space. Can you make it a bit bigger, so they match?
  • This removes the reference to @mipmap/ic_launcher_foreground, but still leaves all the app/src/main/res/mipmap-*/ic_launcher_foreground.png logo files everywhere. Should those now be removed?

In case it's useful, the original SVG is here: logo-icon

I think when the icon was originally set up though, I used the Android new project tools, uploaded that SVG and then configured the zoom manually from there, so I'm not sure exactly what scaling that should use I'm afraid.

Oh, didn't see this comment. I'll update the monochrome accordingly.

X1nto commented 1 year ago

Updated both monochrome and mipmap icons, just to make them on par (the size now matches the previous size, see the edited PR description), also removed all of the @mipmap/ic_launcher_foreground as per your observation, since they're not used anywhere anymore.

pimterry commented 1 year ago

Thanks! I've forced push to rebase (instead of copying the commit) but otherwise this all looks good to me, nice work :+1:. I'll ship a new release with the update shortly.

By the way, in case you're not aware, HTTP Toolkit Pro is free for contributors - I've set up an account linked to your Git commit email, you can just click 'Get Pro' then 'Log into existing account' and enter your email there to log in. Thanks again!

X1nto commented 1 year ago

By the way, in case you're not aware, HTTP Toolkit Pro is free for contributors - I've set up an account linked to your Git commit email, you can just click 'Get Pro' then 'Log into existing account' and enter your email there to log in. Thanks again!

Thank you! Have a nice day.