1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-16 10:00:08 +02:00

Xiaomi: fix logic for ability to select widget workout type

This commit is contained in:
MrYoranimo 2024-01-04 22:39:23 +01:00 committed by José Rebelo
parent b31d98c7a0
commit b9cbd14ffe
2 changed files with 4 additions and 6 deletions

View File

@ -104,8 +104,7 @@ public class XiaomiWidgetManager implements WidgetManager {
type
);
// FIXME are there others?
if (widgetPart.getId() == 2321) {
if (widgetPart.getFunction() == 16) {
if (StringUtils.isBlank(newPart.getName())) {
newPart.setName(GBApplication.getContext().getString(R.string.menuitem_workout));
}
@ -170,8 +169,7 @@ public class XiaomiWidgetManager implements WidgetManager {
newPart.setName(rawPart1.getTitle());
}
// FIXME are there others?
if (widgetPart.getId() == 2321) {
if (widgetPart.getFunction() == 16) {
if (StringUtils.isBlank(newPart.getName())) {
newPart.setName(GBApplication.getContext().getString(R.string.menuitem_workout));
}

View File

@ -253,11 +253,11 @@ message WidgetParts {
message WidgetPart {
optional uint32 type = 1; // 1 for small 1x1, 2 for wide 2x1, 3 for tall 1x2
optional uint32 app = 2; // matches command type
optional uint32 function = 2; // matches command type
optional uint32 id = 3; // they all seem unique
optional string title = 4; // not set on create
optional uint32 subType = 5; // usually 0 if no subtype
optional string unknown6 = 6; // "" on get
optional string appId = 6; // "" on get
optional string unknown7 = 7; // "" on get
}