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

Update on orientation change

polasymbiose opened this issue · comments

Hi,

Widgets dont seem to update dimensions on orientation change.
I have tried with width: 'match_parent' and flex: 1 on the parent FlexWidget.

For example, when i add a simple Container with a border on tablet landscape and turn to portrait, the borders are cut.

<FlexWidget style={{ height: 'match_parent', width: 'match_parent', borderWidth: 1, }} />

Bildschirmfoto 2024-05-31 um 08 33 36 Bildschirmfoto 2024-05-31 um 08 33 44

Any proposals how to handle this?

As far as I know this is not possible to achieve by using this library.
Android does not call any method in the AppWidgetProvider on screen rotation, so there is no way for us to listen to orientation changes.
Other apps can achieve this because they use different layout for landscape and portrait mode, but still no method is called.

This is similar to #36

I'll close this since it is not possible (or I couldn't find a way), but feel free to reopen it if you find a way and I can try to implement it.