diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/PackageConfig.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/PackageConfig.java index f3c2c7e35..33df74279 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/PackageConfig.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/PackageConfig.java @@ -32,8 +32,8 @@ public class PackageConfig implements Serializable { this.id = id; } PackageConfig(String packageName, String appName) { - this.min = 0; - this.hour = 0; + this.min = -1; + this.hour = -1; this.packageName = packageName; this.appName = appName; this.respectSilentMode = false; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/TimePicker.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/TimePicker.java index d09171df3..c2616881d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/TimePicker.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/qhybrid/TimePicker.java @@ -139,10 +139,6 @@ public class TimePicker extends AlertDialog.Builder { } }); dialog = show(); - if(this.settings.getHour() == -1 && this.settings.getMin() == -1) { - dialog.getButton(AlertDialog.BUTTON_POSITIVE).setClickable(false); - dialog.getButton(AlertDialog.BUTTON_POSITIVE).setAlpha(0.4f); - } pickerView.setOnTouchListener(new View.OnTouchListener() { @Override @@ -233,17 +229,7 @@ public class TimePicker extends AlertDialog.Builder { linePaint.setStyle(Paint.Style.FILL_AND_STROKE); linePaint.setColor(Color.BLACK); - if (settings.getMin() == -1) { - linePaint.setAlpha(100); - pickerCanvas.drawLine(width / 2, height / 2, width / 2, height / 2f - radius3, linePaint); - - paint.setAlpha(255); - paint.setColor(Color.WHITE); - pickerCanvas.drawCircle(width / 2f, height / 2f - radius3, radius, paint); - paint.setAlpha(100); - paint.setColor(Color.BLUE); - pickerCanvas.drawCircle(width / 2f, height / 2f - radius3, radius, paint); - } else { + if (settings.getMin() != -1) { paint.setAlpha(255); float x = (float) (width / 2f + Math.sin(Math.toRadians(settings.getMin())) * (float) radius3); float y = (float) (height / 2f - Math.cos(Math.toRadians(settings.getMin())) * (float) radius3); @@ -257,19 +243,7 @@ public class TimePicker extends AlertDialog.Builder { ); pickerCanvas.drawText(String.valueOf(settings.getMin() / 6), x, y - textShiftY, text); } - if (settings.getHour() == -1) { - paint.setAlpha(100); - if (settings.getMin() != -1) { - linePaint.setAlpha(100); - pickerCanvas.drawLine(width / 2, height / 2, width / 2, height / 2f - radius2, linePaint); - } - paint.setAlpha(255); - paint.setColor(Color.WHITE); - pickerCanvas.drawCircle(width / 2f, height / 2f - radius2, radius, paint); - paint.setAlpha(100); - paint.setColor(Color.BLUE); - pickerCanvas.drawCircle(width / 2f, height / 2f - radius2, radius, paint); - } else { + if (settings.getHour() != -1) { paint.setAlpha(255); float x = (float) (width / 2f + Math.sin(Math.toRadians(settings.getHour())) * (float) radius2); float y = (float) (height / 2f - Math.cos(Math.toRadians(settings.getHour())) * (float) radius2);