Skip to content

Commit

Permalink
Sync Notifications checkbox saves to config.
Browse files Browse the repository at this point in the history
  • Loading branch information
wmamos committed Feb 27, 2023
1 parent d1849b1 commit 555880e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ServerConfig extends ConfigItem {

// Settings
public boolean syncNotifications = true;
public boolean syncClipboard = true;
public boolean syncClipboard = false;
// Allow server to push data to us (receive)
public boolean fileSharingAllowPushing = false;
// Allow server to pull data from us (request)
Expand Down Expand Up @@ -121,6 +121,10 @@ public void fromJson(JsonObject jsonObject) {
//this.notificationBlacklistApps = new String[0];
this.notificationBlacklistApps = new ArrayList<String>();
}

if(jsonObject.has("syncNotifications")) {
this.syncNotifications = jsonObject.get("syncNotifications").getAsBoolean();
}
}

/**
Expand Down Expand Up @@ -155,6 +159,8 @@ public JsonObject toJson() {
jsonObject.add("notificationBlacklistApps", notificationBlacklistApps);
}

jsonObject.addProperty("syncNotifications", this.syncNotifications);

return jsonObject;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onClick(View view) {
if(server.syncNotifications) {
notificationsCheckbox.setChecked(false);
server.syncNotifications = false;
}
else {
notificationsCheckbox.setChecked(true);
server.syncNotifications = true;
}

Expand Down

0 comments on commit 555880e

Please sign in to comment.