-
Notifications
You must be signed in to change notification settings - Fork 90
Creating listview programmatically will result in crash with "java.lang.IllegalArgumentException: RecyclerView Id can't be -1" #1842
Comments
The reason why I pass in data directly is because I want to manipulate them before giving to the list view. I tried onInit first but it won't work since it won't happen until window is attached. so I think since I create my own Compose to wrap a Beagle component, I will bind the data myself and once I get the data and after I manipulate them, I pass it to the list view created programmatically. |
Hello Brian. Hope you're well! Before addressing this issue, I must make some remarks:
Nonetheless, this is an unexpected error and might be a reflection of a bigger problem, so we'll investigate it and keep you posted. You also said that you need to manipulate the data before passing it to the component. The recommended way of manipulating data in Beagle is not to create a new custom component, but instead, create a new custom operation. Let's say you have a List of numbers and you want to pass their summed values to a component, you'd use the expression About SwiftUI and ComposeJust to make it clear, we're not ignoring SwiftUI and Compose, but Beagle would need a full rewrite to not just support them, but actually take advantage of their architecture. We're making such rewrite, it's called Nimbus. We didn't call it Beagle because it would create some unnecessary confusion. Don't worry, Beagle will still be maintained. Nimbus is not ready for production yet, but we've recently published the first beta. |
Thanks for your reply. How do you add custom action to the
doesn't work for me as my operation (fixdata) never execute. |
😆 It should be |
I'm glad it worked Brian! I'll still check the index problem. |
|
Since this problem only happens with Jetpack Compose, I consider fixing it as a new feature. As stated before, Beagle was not initially made for Compose. Unfortunately we don't have a dedicated team for Beagle right now and we'll only be fixing critical bugs for the time being. Community pull requests will be still welcomed. |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
I have a Compose view to include a listview (as AndroidView) and pass in the data (value) directly as dataSource. However, when it scrolls to the end, the app crash with
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
dataSource
is direct data, so there is no expression, just value (array of hash map)Expected Results
No crash when scrolling in any way.
The view.id is -1 (NO ID) and component's id doesn't seem to set.
Code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: