1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 11:26:47 +01:00

added render property to widget intent

This commit is contained in:
dakhnod 2020-01-04 00:24:29 +01:00
parent 822759c238
commit 98540fbdb6
3 changed files with 5 additions and 4 deletions

View File

@ -269,7 +269,8 @@ public class QHybridSupport extends QHybridBaseSupport {
case QHYBRID_COMMAND_SET_WIDGET_CONTENT: {
String id = String.valueOf(intent.getExtras().get("EXTRA_WIDGET_ID"));
String content = String.valueOf(intent.getExtras().get("EXTRA_CONTENT"));
watchAdapter.setWidgetContent(id, content);
boolean render = intent.getBooleanExtra("EXTRA_RENDER", true);
watchAdapter.setWidgetContent(id, content, render);
break;
}
}

View File

@ -106,6 +106,6 @@ public abstract class WatchAdapter {
public void setMusicState(MusicStateSpec stateSpec) {
}
public void setWidgetContent(String widgetID, String content) {
public void setWidgetContent(String widgetID, String content, boolean render) {
}
}

View File

@ -185,7 +185,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
}
@Override
public void setWidgetContent(String widgetID, String content) {
public void setWidgetContent(String widgetID, String content, boolean render) {
boolean update = false;
for(CustomWidget widget : this.widgets){
CustomWidgetElement element = widget.getElement(widgetID);
@ -195,7 +195,7 @@ public class FossilHRWatchAdapter extends FossilWatchAdapter {
update = true;
}
if(update) renderWidgets();
if(render && update) renderWidgets();
}
private void negotiateSymmetricKey() {