WZWren / night-sentry

0 stars 0 forks source link

Widget does not scale well with different devices #15

Open WZWren opened 1 year ago

WZWren commented 1 year ago

From user testing, the widget does not render properly, clipping in places it shouldn't.

WhatsApp Image 2023-07-21 at 10 10 54 PM

In bad cases, some widget buttons lose functionality - this is likely due to the widget library we have employed, and we would need to investigate this issue.

WZWren commented 1 year ago

On investigation, it is indeed due to the react-native-android-widget library - this is due to a fix pushed by the author to ensure button alignment matches the UI elements. (see https://github.com/sAleksovski/react-native-android-widget/issues/31#issuecomment-1645023985 and https://github.com/sAleksovski/react-native-android-widget/issues/20#issuecomment-1583094892).

As the library is relatively new, and the author has commented on difficulties getting the true width from some android launchers, we may need to consider porting to a Native implementation of widgets. The app workflow currently uses EAS-Expo, however, which severely limits the our options to create one as expo conventionally needs to be ejected to be used with native code. However, gaishimo's eas-widget-example repository has an example of an EAS workflow for widgets that aims to mimic what npx expo eject does during compilation of the app (https://github.com/gaishimo/eas-widget-example).

Workaround

Owing to time constraints, we have to change the implementation of the current widget on the library. From user testing, there is a commonality in the cropping of the widget in that the widget always starts aligned to the top right corner of the tile. Instead of wrestling with the widget, we will simply have a top-right aligned full-body interactive button to send the alert from.

concept

This is an unfortunate workaround for now, but it will have to work until we port the widget over to Native code.