nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.63k stars 45 forks source link

Where to find icons for `androidIconName` prop #90

Open JohnSawiris opened 4 months ago

JohnSawiris commented 4 months ago

It is challenging to find icons for android, I was able to find this list but a lot of the icons there don't work with the androidIconName prop. Is the list of icons I linked to above the intended list to use or is there a different one?

dedanmsafari commented 4 months ago

Also how can i use Ionicons on Zeego...Am aiming for parity on both android and ios.....Having to use different icons for both platforms simply is good DX for me

nandorojo commented 4 months ago

I believe the list is the official Material icons from Google.

To use Ionicons you’d need to use ItemImage

JohnSawiris commented 4 months ago

Thanks @nandorojo

dedanmsafari commented 4 months ago

@nandorojo According to the documentation you state that ItemImage are not yet supported on Android..An example would be highly aprreciated.Thank you

dedanmsafari commented 4 months ago

Thanks @nandorojo

Where you able to get the Icons from material-icons to work?..if so please post a snippet i would highly appreciate. on my end only drawables work..on hover the prop states that

"The name of an android-only resource drawable. For a full list, see https://developer.android.com/reference/android/R.drawable.html.

@platform — android"

JohnSawiris commented 4 months ago

Thanks @nandorojo

Where you able to get the Icons from material-icons to work?..if so please post a snippet i would highly appreciate. on my end only drawables work..on hover the prop states that

"The name of an android-only resource drawable. For a full list, see https://developer.android.com/reference/android/R.drawable.html.

@platform — android"

@dedanmsafari I haven't gotten around to it yet but If I get something working I'll post it. I was going to try ItemImage instead of fiddling around with androidIconName.

@nandorojo do you mean this list? If yes, then none of them didn't worked in my case. In this example it appears to use the icons from Drawable not from Material Icons.

Anubiso commented 2 months ago

I only found a list here: https://web.archive.org/web/20171031105029/http://androiddrawables.com:80/ but most of these icons are really old and ugly. Nesting a icon directly into ItemIcon doesn't work on Android. Using ItemImage doesn't work on Android. So we are stuck with the old icons, showing no icons at all on android or rendering a completely different component on android.

nandorojo commented 1 week ago

Yeah Android's native menu kind of sucks. Maybe we can make one ourselves someday for v3

sidorchukandrew commented 1 week ago

You can add Material icons to your Android project. Here's how:

  1. Open your project in Android studio
  2. Right click on drawable (under app/res/drawable) and click New Vector Asset
  3. Click the "Clip art" section as seen in the screenshot below
  4. Find whatever icon you'd like, edit the color, size and name.
  5. Go through the wizard and hit "Finish".
  6. Now under the android prop for ItemIcon you can reference it by the name you gave it in step 4. Screenshot 2024-10-22 at 8 07 00 PM

If you're using Expo, you'll need to write a config plugin that copies the icon into your Android directory during prebuild.