sAleksovski / react-native-android-widget

Build Android Widgets with React Native

Home Page:https://sAleksovski.github.io/react-native-android-widget/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open <ConfigurableWidget/> with clickAction inside any <widget/>

abdul-wajid-afridi opened this issue · comments

i don't know how to show the pop up with click on the widget as you have done with counter but i want to show that same setCount numbers with action click on the widget and show the pop up with clickAction=""

@sAleksovski how can i show that with clickAction on the homescreen widget <FlexWidget style={{ flexDirection: "row", flexGap: 4, }} clickAction="RENDER_WIDGET" >show pop up </FlexWidget>

You need to long-press the widget for the option to reconfigure it to be shown. This is an Android thing, and is not controlled by this library.

If you want to open it with a button in your widget, you will need to use a deep link in your app where you will render the same (or similar) component as in the configuration screen.

clickAction="OPEN_URI"
clickActionData={{
  uri: 'androidwidgetexample://deep-link-for-config-activity/' + widgetId,
}}

Screenshot_20240310_081951_Nova Launcher.jpg

You have to press the widget settings. This is on Nova launcher.
Your launcher might be different.

If you want a custom button on the widget, see my previous comment about how to implement it.

Nova was just an example, other launchers support this too

What do you see when you long press the widget?
Please share a screenshot

If it opens when you drop the widget, then your launcher does not support reconfiguration of the widget.

If you want to open it with a button in your widget, you will need to use a deep link in your app where you will render the same (or similar) component as in the configuration screen.

clickAction="OPEN_URI"
clickActionData={{
  uri: 'androidwidgetexample://deep-link-for-config-activity/' + widgetId,
}}

how can we pass dynamic colors to svgwidgets?

This is unrelated to this issue.
You can use string svg, and use string interpolation/concatenation to change the colors.

I'll close this issue since I explained how you can use deep-linking to open a screen.