sAleksovski / react-native-android-widget

Build Android Widgets with React Native
https://sAleksovski.github.io/react-native-android-widget/
MIT License
546 stars 22 forks source link

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

Closed abdul-wajid-afridi closed 4 months ago

abdul-wajid-afridi commented 4 months ago

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=""

abdul-wajid-afridi commented 4 months ago

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

show pop up `

sAleksovski commented 4 months ago

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,
}}
abdul-wajid-afridi commented 4 months ago

yes i pressed the long button but it does not show configuration at the start when dragging widget it show but when hold widget it does not show any configuration about widget

On Sun, 10 Mar 2024, 1:38 am Stefan Aleksovski, @.***> wrote:

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, }}

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1986970606, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSEPXJUXAWRNB434UG3YXNXLTAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBWHE3TANRQGY . You are receiving this because you authored the thread.Message ID: @.***>

sAleksovski commented 4 months ago

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.

abdul-wajid-afridi commented 4 months ago

does other launcher supports this? because everyone might not have nova launcher

On Sun, 10 Mar 2024, 12:22 pm Stefan Aleksovski, @.***> wrote:

Screenshot_20240310_081951_Nova.Launcher.jpg (view on web) https://github.com/sAleksovski/react-native-android-widget/assets/7473800/39696a80-c7b2-4004-927e-1307342195e7

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.

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1987116900, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSG4XRWG3VH6T4F3M3TYXQC3BAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGEYTMOJQGA . You are receiving this because you authored the thread.Message ID: @.***>

sAleksovski commented 4 months ago

Nova was just an example, other launchers support this too

abdul-wajid-afridi commented 4 months ago

but i tried your example too and also i created my own configurable widgets but it does not show settings is it need any other configuration too because i am stuck from past 10 days and this does not show settings i tried everything. even i copy past your example for testing that even doesn't work

On Sun, 10 Mar 2024, 12:49 pm Stefan Aleksovski, @.***> wrote:

Nova was just an example, other launchers support this too

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1987133410, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSAGCXBCTWYQ5DGUNVTYXQGCLAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGEZTGNBRGA . You are receiving this because you authored the thread.Message ID: @.***>

sAleksovski commented 4 months ago

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

abdul-wajid-afridi commented 4 months ago

i see 'Remove' and 'App info' only

On Sun, 10 Mar 2024, 1:14 pm Stefan Aleksovski, @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1987139538, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSFZH7KBL3AP2MZLXE3YXQI5FAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGEZTSNJTHA . You are receiving this because you authored the thread.Message ID: @.***>

sAleksovski commented 4 months ago

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,
}}
abdul-wajid-afridi commented 4 months ago

so this mean i will use the deep linking

On Sun, 10 Mar 2024, 2:12 pm Stefan Aleksovski, @.***> wrote:

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, }}

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1987153352, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSFJ5ADVQHS4Q6YZ66LYXQPWPAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGE2TGMZVGI . You are receiving this because you authored the thread.Message ID: @.***>

abdul-wajid-afridi commented 4 months ago

how can we pass dynamic colors to svgwidgets?

On Sun, 10 Mar 2024, 2:24 pm Abdul Wajid Afridi, @.***> wrote:

so this mean i will use the deep linking

On Sun, 10 Mar 2024, 2:12 pm Stefan Aleksovski, @.***> wrote:

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, }}

— Reply to this email directly, view it on GitHub https://github.com/sAleksovski/react-native-android-widget/issues/71#issuecomment-1987153352, or unsubscribe https://github.com/notifications/unsubscribe-auth/APNJUSFJ5ADVQHS4Q6YZ66LYXQPWPAVCNFSM6AAAAABEOKA5ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXGE2TGMZVGI . You are receiving this because you authored the thread.Message ID: @.***>

sAleksovski commented 4 months ago

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.