Commit Graph

4 Commits

Author SHA1 Message Date
MrYoranimo 35217aa405 Xiaomi: add support for 2x3 widget layouts
The Xiaomi Smart Band 8 Pro shows widgets in a two by three grid.
Previously, opening the widget configuration for such a device from the
device-specific preferences would crash Gadgetbridge because the layouts
in such a grid was not supported.

This commit adds definitions for layouts in a 2x3 grid to the
WidgetLayout enum, adds a definition for a full screen widget to the
WidgetType enum, defines rendering definitions for the new layouts to
WidgetScreenDetailsActivity, and defines translations for the new
layouts and type to XiaomiWidgetManager.
2024-04-12 20:54:49 +02:00
MrYoranimo 0b731611b9 Xiaomi: refactor WidgetManager for Redmi Watch 4
The Redmi Watch 4 reports both an unsupported widget type and layout
style:

- The firmware supports a screen layout for a single full screens
  widget, which is defined by layout ID 128;
- A full screen widget is a single 2x2 part, which is not supported.

This commit adds support for both the new layout and the new widget
type.

Furthermore, this commit refactors the XiaomiWidgetManager. Previously,
the supported layouts were determined by the types of parts supported by
the device. However, the supported layouts are reported by the device
through a bitfield in the widget capabilities message of which the purpose
was unknown, which is now used to determine the supported layouts.
2024-04-12 20:54:49 +02:00
FYG_license_bot_ignore_me 4c7476845b Update license headers and CONTRIBUTORS file 2024-01-10 19:01:48 +01:00
José Rebelo 6de7af62e3 Xiaomi: Manage widgets 2023-12-11 22:00:16 +00:00