Merge remote-tracking branch 'origin/development-stable' into development

# Conflicts:
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-it/strings.xml
#	app/src/main/res/values-nl/strings.xml
#	app/src/main/res/values/strings.xml
This commit is contained in:
jens 2022-05-21 13:37:50 +02:00
commit 5d67452486
8 changed files with 64 additions and 21 deletions

View File

@ -10,13 +10,13 @@ import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import org.apache.commons.lang3.StringUtils;
import java.sql.Time;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
@ -27,6 +27,7 @@ public class ActivityManageTriggerTimeFrame extends Activity
CheckBox checkMonday, checkTuesday, checkWednesday, checkThursday, checkFriday, checkSaturday, checkSunday, chkRepeat;
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
EditText etRepeatEvery;
TextView tvDaysHint;
static Trigger editedTimeFrameTrigger = null;
@ -53,6 +54,7 @@ public class ActivityManageTriggerTimeFrame extends Activity
radioTimeFrameLeaving = (RadioButton)findViewById(R.id.radioTimeFrameLeaving);
chkRepeat = (CheckBox)findViewById(R.id.chkRepeat);
etRepeatEvery = (EditText)findViewById(R.id.etRepeatEvery);
tvDaysHint = (TextView)findViewById(R.id.tvDaysHint);
bSaveTimeFrame.setOnClickListener(new OnClickListener()
{
@ -181,6 +183,31 @@ public class ActivityManageTriggerTimeFrame extends Activity
editedTimeFrameTrigger.setTimeFrame(new TimeFrame(editedTimeFrameTrigger.getTriggerParameter2()));
loadVariableIntoGui();
}
TimePicker.OnTimeChangedListener pickerListener = new TimePicker.OnTimeChangedListener()
{
@Override
public void onTimeChanged(TimePicker timePicker, int i, int i1)
{
if(
startPicker.getCurrentHour() > stopPicker.getCurrentHour()
||
(
startPicker.getCurrentHour() == stopPicker.getCurrentHour()
&&
startPicker.getCurrentMinute() >= stopPicker.getCurrentMinute()
)
)
tvDaysHint.setText(getResources().getString(R.string.timeFrameDaysHint));
else
tvDaysHint.setText("");
}
};
startPicker.setOnTimeChangedListener(pickerListener);
stopPicker.setOnTimeChangedListener(pickerListener);
// Perform check once
pickerListener.onTimeChanged(null, 0, 0);
}
private void loadVariableIntoGui()

View File

@ -929,7 +929,7 @@ public class Trigger
&&
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0
)
|
||
// Other case, start time higher than end time, timeframe goes over midnight
(
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
@ -938,7 +938,11 @@ public class Trigger
||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
)
||
// further case: start and end times are identical, meaning a 24h window
(
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) == 0
)
)
{
// We are in the timeframe

View File

@ -78,6 +78,13 @@
android:text="@string/timeFrameWhichDays"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/tvDaysHint"
android:layout_marginVertical="@dimen/default_margin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/red" />
<CheckBox
android:id="@+id/checkMonday"
android:layout_width="wrap_content"

View File

@ -701,6 +701,7 @@
<string name="profileXrequiresThis">Profil \"%1$s\" benötigt dies.</string>
<string name="lastProfile">Letztes Profil:</string>
<string name="queryAllPackages">Liste von installierten Anwendungen auslesen</string>
<string name="timeFrameDaysHint">Wenn Sie ein Zeitfenster verwenden, das sich über Mitternacht erstreckt, müssen Sie auch den Folgetag auswählen, wenn der Auslöser auch nach Mitternacht noch auslösen soll.</string>
<string name="serviceStarts">Dienst startet</string>
<string name="deviceStarts">Gerät startet</string>
<string name="deviceHasJustStarted">Gerät ist gerade gestartet</string>

View File

@ -700,6 +700,7 @@
<string name="profileXrequiresThis">El perfil \"%1$s\" requiere esto.</string>
<string name="lastProfile">Último perfil:</string>
<string name="queryAllPackages">Obtener una lista de las aplicaciones instaladas</string>
<string name="timeFrameDaysHint">Si utiliza un marco de tiempo que se extiende más allá de la medianoche, también debe seleccionar el día siguiente si desea que la condición se aplique después de la medianoche.</string>
<string name="deviceStarts">Dispositivo esta enciendo</string>
<string name="serviceStarts">Servicio esta enciendo</string>
<string name="deviceHasJustStarted">el dispositivo justamente ha encendido</string>

View File

@ -701,6 +701,7 @@
<string name="locationNotWorkingOn12">Ottenere la posizione non sembra funzionare su dispositivi Android 12 al momento. Se non funziona per te, mi dispiace. Cercherò di risolvere questo problema non appena conoscerò la causa. Quindi, se cerchio rotante non smette di girare, sai perché.</string>
<string name="lastProfile">Ultimo profilo:</string>
<string name="queryAllPackages">Ottenere un elenco delle applicazioni installate</string>
<string name="timeFrameDaysHint">Se si utilizza un intervallo di tempo che si estende oltre la mezzanotte, è necessario selezionare anche il giorno successivo se si desidera che il trigger venga applicato dopo la mezzanotte.</string>
<string name="deviceStarts">Device starts</string>
<string name="serviceStarts">Avvio del servizio</string>
<string name="deviceHasJustStarted">Il dispositivo è appena stato avviato</string>

View File

@ -699,6 +699,7 @@
<string name="profileXrequiresThis">Profiel \"%1$s\" vereist dit.</string>
<string name="lastProfile">Laatste profiel:</string>
<string name="queryAllPackages">Een lijst met geïnstalleerde toepassingen ophalen</string>
<string name="timeFrameDaysHint">Als u een tijdsbestek gebruikt dat zich uitstrekt over middernacht, moet u ook de volgende dag selecteren als u wilt dat de trigger na middernacht van toepassing is.</string>
<string name="deviceHasJustStarted">apparaat is net gestart</string>
<string name="serviceHasJustStarted">service is net begonnen</string>
<string name="serviceStarts">Service start</string>

View File

@ -797,6 +797,7 @@
<string name="locationNotWorkingOn12">Getting the location does not seem to be working on Android 12 devices currently. If it isn\'t working for you, I\'m sorry. I\'ll try to fix this as soon as I know the cause. So if the donut doesn\'t stop spinning, you know why.</string>
<string name="lastProfile">Last profile:</string>
<string name="queryAllPackages">Get a list of installed applications</string>
<string name="timeFrameDaysHint">If you use a timeframe that stretches over midnight you need to select the following day as well if you want the trigger to apply after midnight.</string>
<string name="deviceStarts">Device starts</string>
<string name="serviceStarts">Service starts</string>
<string name="deviceHasJustStarted">device has just started</string>