mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Fossil HR: Clean up obsolete JSON generation methods
This commit is contained in:
parent
069bb5617d
commit
1f9989d295
@ -207,184 +207,6 @@ public class HybridHRWatchfaceFactory {
|
||||
return appWriter.getWapp();
|
||||
}
|
||||
|
||||
private String getBatteryLayout() throws JSONException {
|
||||
JSONArray batteryLayout = new JSONArray();
|
||||
|
||||
JSONObject complicationBackground = new JSONObject();
|
||||
complicationBackground.put("id", 0);
|
||||
complicationBackground.put("type", "complication_background");
|
||||
complicationBackground.put("background", "#background");
|
||||
complicationBackground.put("visible", true);
|
||||
complicationBackground.put("inversion", false);
|
||||
JSONObject goalRing = new JSONObject();
|
||||
goalRing.put("is_enable", "#goal_ring");
|
||||
goalRing.put("end_angle", "#fi");
|
||||
goalRing.put("is_invert", "#$e");
|
||||
complicationBackground.put("goal_ring", goalRing);
|
||||
JSONObject dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", "#size.w");
|
||||
dimension.put("height", "#size.h");
|
||||
complicationBackground.put("dimension", dimension);
|
||||
JSONObject placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", "#pos.Ue");
|
||||
placement.put("top", "#pos.Qe");
|
||||
complicationBackground.put("placement", placement);
|
||||
batteryLayout.put(complicationBackground);
|
||||
|
||||
JSONObject complicationContent = new JSONObject();
|
||||
complicationContent.put("id", 1);
|
||||
complicationContent.put("parent_id", 0);
|
||||
complicationContent.put("type", "complication_content");
|
||||
complicationContent.put("icon", "icBattery");
|
||||
complicationContent.put("text_low", "#ci");
|
||||
complicationContent.put("visible", true);
|
||||
complicationContent.put("inversion", "#$e");
|
||||
dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", 76);
|
||||
dimension.put("height", 76);
|
||||
complicationContent.put("dimension", dimension);
|
||||
placement = new JSONObject();
|
||||
placement.put("type", "relative");
|
||||
complicationContent.put("placement", placement);
|
||||
batteryLayout.put(complicationContent);
|
||||
|
||||
JSONObject chargingStatus = new JSONObject();
|
||||
chargingStatus.put("id", 2);
|
||||
chargingStatus.put("parent_id", 1);
|
||||
chargingStatus.put("type", "solid");
|
||||
chargingStatus.put("color", "#nt");
|
||||
chargingStatus.put("visible", true);
|
||||
chargingStatus.put("inversion", false);
|
||||
dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", "#it");
|
||||
dimension.put("height", 6);
|
||||
chargingStatus.put("dimension", dimension);
|
||||
placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", 29);
|
||||
placement.put("top", 23);
|
||||
chargingStatus.put("placement", placement);
|
||||
batteryLayout.put(chargingStatus);
|
||||
|
||||
JSONObject image = new JSONObject();
|
||||
image.put("id", 3);
|
||||
image.put("parent_id", 1);
|
||||
image.put("type", "image");
|
||||
image.put("image_name", "icBattCharging");
|
||||
image.put("draw_mode", 1);
|
||||
image.put("visible", "#et");
|
||||
image.put("inversion", false);
|
||||
placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", 34);
|
||||
placement.put("top", 21);
|
||||
image.put("placement", placement);
|
||||
dimension = new JSONObject();
|
||||
dimension.put("width", 6);
|
||||
dimension.put("height", 9);
|
||||
image.put("dimension", dimension);
|
||||
batteryLayout.put(image);
|
||||
|
||||
return batteryLayout.toString();
|
||||
}
|
||||
|
||||
private String getComplicationLayout() throws JSONException {
|
||||
JSONArray complicationLayout = new JSONArray();
|
||||
|
||||
JSONObject complicationBackground = new JSONObject();
|
||||
complicationBackground.put("id", 0);
|
||||
complicationBackground.put("type", "complication_background");
|
||||
complicationBackground.put("background", "#background");
|
||||
complicationBackground.put("visible", true);
|
||||
complicationBackground.put("inversion", false);
|
||||
JSONObject goalRing = new JSONObject();
|
||||
goalRing.put("is_enable", "#goal_ring");
|
||||
goalRing.put("end_angle", "#fi");
|
||||
goalRing.put("is_invert", "#$e");
|
||||
complicationBackground.put("goal_ring", goalRing);
|
||||
JSONObject dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", "#size.w");
|
||||
dimension.put("height", "#size.h");
|
||||
complicationBackground.put("dimension", dimension);
|
||||
JSONObject placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", "#pos.Ue");
|
||||
placement.put("top", "#pos.Qe");
|
||||
complicationBackground.put("placement", placement);
|
||||
complicationLayout.put(complicationBackground);
|
||||
|
||||
JSONObject complicationContent = new JSONObject();
|
||||
complicationContent.put("id", 1);
|
||||
complicationContent.put("parent_id", 0);
|
||||
complicationContent.put("type", "complication_content");
|
||||
complicationContent.put("icon", "#icon");
|
||||
complicationContent.put("text_high", "#dt");
|
||||
complicationContent.put("text_low", "#ci");
|
||||
complicationContent.put("visible", true);
|
||||
complicationContent.put("inversion", "#$e");
|
||||
dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", "#size.w");
|
||||
dimension.put("height", "#size.h");
|
||||
complicationContent.put("dimension", dimension);
|
||||
placement = new JSONObject();
|
||||
placement.put("type", "relative");
|
||||
complicationContent.put("placement", placement);
|
||||
complicationLayout.put(complicationContent);
|
||||
|
||||
return complicationLayout.toString();
|
||||
}
|
||||
|
||||
private String getImageLayout() throws JSONException {
|
||||
JSONArray imageLayout = new JSONArray();
|
||||
|
||||
JSONObject container = new JSONObject();
|
||||
container.put("id", 0);
|
||||
container.put("type", "container");
|
||||
container.put("direction", 1);
|
||||
container.put("main_alignment", 1);
|
||||
container.put("cross_alignment", 1);
|
||||
container.put("visible", true);
|
||||
container.put("inversion", false);
|
||||
JSONObject dimension = new JSONObject();
|
||||
dimension.put("type", "rigid");
|
||||
dimension.put("width", 240);
|
||||
dimension.put("height", 240);
|
||||
container.put("dimension", dimension);
|
||||
JSONObject placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", 0);
|
||||
placement.put("top", 0);
|
||||
container.put("placement", placement);
|
||||
imageLayout.put(container);
|
||||
|
||||
JSONObject image = new JSONObject();
|
||||
image.put("id", 1);
|
||||
image.put("parent_id", 0);
|
||||
image.put("type", "image");
|
||||
image.put("image_name", "#name");
|
||||
image.put("draw_mode", 1);
|
||||
image.put("visible", true);
|
||||
image.put("inversion", false);
|
||||
placement = new JSONObject();
|
||||
placement.put("type", "absolute");
|
||||
placement.put("left", "#pos.Ue");
|
||||
placement.put("top", "#pos.Qe");
|
||||
image.put("placement", placement);
|
||||
dimension = new JSONObject();
|
||||
dimension.put("width", "#size.w");
|
||||
dimension.put("height", "#size.h");
|
||||
image.put("dimension", dimension);
|
||||
imageLayout.put(image);
|
||||
|
||||
return imageLayout.toString();
|
||||
}
|
||||
|
||||
private String getConfiguration() throws JSONException {
|
||||
JSONObject configuration = new JSONObject();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user