menu icon indicating copy to clipboard operation
menu copied to clipboard

How to use an "icon name included in the project" for the action image

Open jacklj opened this issue 3 years ago • 10 comments

Hi, it says in the README:

   * - Allows icon name included in project or system (Android) resources drawables and
   * in SF Symbol (iOS)

Does it mean you add the icon to the native project, and then you can refer to it? How do you do this?

Thanks

jacklj avatar Mar 05 '22 15:03 jacklj

You can find all the icons on Hotpot.

  • For Android Icons, click the Material Design option.
  • For iOS Icons, click the SF Symbols option.

Then to select an Icon, just click it, this copies the icon name to your clipboard.

Here's an example to get the Safari (Browser) icon, for iOS only.

{ id: 'open', title: 'Open', image: Platform.select({ ios: 'safari', }), }

Hope this answers your question 😁

kayode0x avatar Mar 05 '22 17:03 kayode0x

Thanks @kayode0x.

Sorry, I wasn’t clear enough - I know about using SF Symbols and Material Design icons.

The readme implies that you can alternatively use an “icon name that is included in the project” - or am I misreading it?

Thanks

jacklj avatar Mar 05 '22 18:03 jacklj

it is not working for android the app is crashing when i use the name you mentioned

hanishbasheer avatar May 02 '22 06:05 hanishbasheer

  • For Android Icons, click the Material Design option.
  • For iOS Icons, click the SF Symbols option.

Hi there, I'm experiencing the same issue as @hanishbasheer, my android icons are not working (they are working on iOS) It simply doesn't render any image even using the example code in the docs

lclarkg18 avatar Feb 28 '23 20:02 lclarkg18

Same issue on android React Native: 0.71.2 @react-native-menu/menu": "0.7.3"

Brma1048 avatar Mar 09 '23 12:03 Brma1048

Same for me, for android:

Using eg 'ic_menu_add' works and gives me a plus sign in a circle. But none of the names for android on Hotspot work in the code. And none of the icons for android on Hotspot seem to be named 'ic_menu_add'.

So it looks like the code is using a different set of icon names for android than Hotspot is.

Where do I find the list of icon names, and their images, that work in this code?

willxy avatar Jul 15 '23 19:07 willxy

@willxy you need to add the icons via android studio In Android Studio, right-click on the “drawable” folder and select “New” » “Vector Asset”.

Brma1048 avatar Jul 31 '23 14:07 Brma1048

@willxy you need to add the icons via android studio In Android Studio, right-click on the “drawable” folder and select “New” » “Vector Asset”.

Thanks this helped.

ShivamJoker avatar Oct 05 '23 08:10 ShivamJoker

@willxy you need to add the icons via android studio In Android Studio, right-click on the “drawable” folder and select “New” » “Vector Asset”.

This kinda worked for me but instead of using right-click on the "drawable" folder, I clicked on the "Resource Manager" tab on the left and then clicked the plus button and selected Vector Asset.

focux avatar Oct 13 '23 20:10 focux

For those wondering, the default icons present for android can be found here (those that don't need an extra-install step): https://developer.android.com/reference/android/R.drawable

For instance: android: "ic_menu_gallery"

PierreCapo avatar Jan 08 '24 09:01 PierreCapo