sAleksovski / react-native-android-widget

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

Handling click on second-level children of ListWidget #53

Closed robinmitra closed 9 months ago

robinmitra commented 10 months ago

Hello, thanks for your work on this library 🙌🏼

I'm aware that only the first-level children of ListWidget can be clicked as per:

Only the first-level children of the ListWidget can be "clicked". We can still set clickAction on the sub-widgets, but they will not respond to clicks.

However, I thought I'd still ask in case you have any suggestions for implementing my use-case:

I have a list of tasks in a widget, and each task has a checkbox before it. When a user taps on the checkbox, the task should be completed. If they tap on the title of the task, the task should be opened in the app.

Is this pattern possible using this library? I saw the ListWidget example which appears to have an archive button next to each item, but it doesn't do anything.

sAleksovski commented 10 months ago

Hi,

That pattern is currently not possible using this library. I might try to implement it when I have some free time.

The example list widget has an archive icon, but it does not do anything, just replicates the Gmail widget look.

sAleksovski commented 9 months ago

I just released 0.11.1 that allows handling click on second-level children in ListWidget.

You can check the updated ListWidget example.

robinmitra commented 9 months ago

That's amazing! I'll try it out tonight. Thank you so much 😃