-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget size issues on different Android launchers #34
Comments
We have a problem the size of the widget does not come at all, it returns width:0 and height: 0. Of all the tested phones, this is observed only on Samsungs. Debugging showed that the value 0 is returned by the method
in java/com/reactnativeandroidwidget/RNWidgetUtil.java Do you have ideas about what could be the problem? We've minimized the impact of this bug by setting default sizes for width and height, but even once valid non-zero values are received, they are stored in the app and used in the widget. |
Does it received 0 only when first added? I don't know any other way to get the widget size. Btw I have a Samsung phone and I receive correct sizes. |
Yes, 0 comes precisely for adding the widget. But this does not always happen. It's an interesting idea to update the widget again if the value is 0, I'll try. Maybe you're lucky. We have this problem consistently on Samsung S24+ and Samsung Galaxy A13 Android 14 |
We cannot render React Native views directly to the widget.
What this library does is render the React Native views to an image, and then show that image in the widget.
For it to look good, we need to know the exact size of the widget, so we can create an image that will fit the widget correctly.
On some Android launchers, the reported and actual size of the widget are not always the same.
Actual size (365dp x 318dp)
Reported size (365dp x 354dp)
I haven't found a reliable way to get the exact size, the current behavior is to crop the widget if the reported size is smaller.
The text was updated successfully, but these errors were encountered: