forked from jens/Automation
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:
commit
5d67452486
@ -10,13 +10,13 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.RadioButton;
|
import android.widget.RadioButton;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.sql.Time;
|
import java.sql.Time;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
@ -27,6 +27,7 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
CheckBox checkMonday, checkTuesday, checkWednesday, checkThursday, checkFriday, checkSaturday, checkSunday, chkRepeat;
|
CheckBox checkMonday, checkTuesday, checkWednesday, checkThursday, checkFriday, checkSaturday, checkSunday, chkRepeat;
|
||||||
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
|
RadioButton radioTimeFrameEntering, radioTimeFrameLeaving;
|
||||||
EditText etRepeatEvery;
|
EditText etRepeatEvery;
|
||||||
|
TextView tvDaysHint;
|
||||||
|
|
||||||
static Trigger editedTimeFrameTrigger = null;
|
static Trigger editedTimeFrameTrigger = null;
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
radioTimeFrameLeaving = (RadioButton)findViewById(R.id.radioTimeFrameLeaving);
|
radioTimeFrameLeaving = (RadioButton)findViewById(R.id.radioTimeFrameLeaving);
|
||||||
chkRepeat = (CheckBox)findViewById(R.id.chkRepeat);
|
chkRepeat = (CheckBox)findViewById(R.id.chkRepeat);
|
||||||
etRepeatEvery = (EditText)findViewById(R.id.etRepeatEvery);
|
etRepeatEvery = (EditText)findViewById(R.id.etRepeatEvery);
|
||||||
|
tvDaysHint = (TextView)findViewById(R.id.tvDaysHint);
|
||||||
|
|
||||||
bSaveTimeFrame.setOnClickListener(new OnClickListener()
|
bSaveTimeFrame.setOnClickListener(new OnClickListener()
|
||||||
{
|
{
|
||||||
@ -181,6 +183,31 @@ public class ActivityManageTriggerTimeFrame extends Activity
|
|||||||
editedTimeFrameTrigger.setTimeFrame(new TimeFrame(editedTimeFrameTrigger.getTriggerParameter2()));
|
editedTimeFrameTrigger.setTimeFrame(new TimeFrame(editedTimeFrameTrigger.getTriggerParameter2()));
|
||||||
loadVariableIntoGui();
|
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()
|
private void loadVariableIntoGui()
|
||||||
|
@ -925,20 +925,24 @@ public class Trigger
|
|||||||
if(
|
if(
|
||||||
// Regular case, start time is lower than end time
|
// Regular case, start time is lower than end time
|
||||||
(
|
(
|
||||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||||
&&
|
&&
|
||||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0
|
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
|
||||||
|
&&
|
||||||
|
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
||||||
|
||
|
||||||
|
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
|
||||||
)
|
)
|
||||||
|
|
|
||||||
// Other case, start time higher than end time, timeframe goes over midnight
|
|
||||||
(
|
|
||||||
Miscellaneous.compareTimes(tf.getTriggerTimeStart(), tf.getTriggerTimeStop()) < 0
|
|
||||||
&&
|
|
||||||
(Miscellaneous.compareTimes(tf.getTriggerTimeStart(), nowTime) >= 0
|
|
||||||
||
|
|
||||||
Miscellaneous.compareTimes(nowTime, tf.getTriggerTimeStop()) > 0)
|
|
||||||
)
|
|
||||||
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// We are in the timeframe
|
// We are in the timeframe
|
||||||
|
@ -71,12 +71,19 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="#aa000000" />
|
android:background="#aa000000" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvCurrentNfcIdValue"
|
android:id="@+id/tvCurrentNfcIdValue"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/timeFrameWhichDays"
|
android:text="@string/timeFrameWhichDays"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
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
|
<CheckBox
|
||||||
android:id="@+id/checkMonday"
|
android:id="@+id/checkMonday"
|
||||||
|
@ -701,6 +701,7 @@
|
|||||||
<string name="profileXrequiresThis">Profil \"%1$s\" benötigt dies.</string>
|
<string name="profileXrequiresThis">Profil \"%1$s\" benötigt dies.</string>
|
||||||
<string name="lastProfile">Letztes Profil:</string>
|
<string name="lastProfile">Letztes Profil:</string>
|
||||||
<string name="queryAllPackages">Liste von installierten Anwendungen auslesen</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="serviceStarts">Dienst startet</string>
|
||||||
<string name="deviceStarts">Gerät startet</string>
|
<string name="deviceStarts">Gerät startet</string>
|
||||||
<string name="deviceHasJustStarted">Gerät ist gerade gestartet</string>
|
<string name="deviceHasJustStarted">Gerät ist gerade gestartet</string>
|
||||||
|
@ -700,6 +700,7 @@
|
|||||||
<string name="profileXrequiresThis">El perfil \"%1$s\" requiere esto.</string>
|
<string name="profileXrequiresThis">El perfil \"%1$s\" requiere esto.</string>
|
||||||
<string name="lastProfile">Último perfil:</string>
|
<string name="lastProfile">Último perfil:</string>
|
||||||
<string name="queryAllPackages">Obtener una lista de las aplicaciones instaladas</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="deviceStarts">Dispositivo esta enciendo</string>
|
||||||
<string name="serviceStarts">Servicio esta enciendo</string>
|
<string name="serviceStarts">Servicio esta enciendo</string>
|
||||||
<string name="deviceHasJustStarted">el dispositivo justamente ha encendido</string>
|
<string name="deviceHasJustStarted">el dispositivo justamente ha encendido</string>
|
||||||
|
@ -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="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="lastProfile">Ultimo profilo:</string>
|
||||||
<string name="queryAllPackages">Ottenere un elenco delle applicazioni installate</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="deviceStarts">Device starts</string>
|
||||||
<string name="serviceStarts">Avvio del servizio</string>
|
<string name="serviceStarts">Avvio del servizio</string>
|
||||||
<string name="deviceHasJustStarted">Il dispositivo è appena stato avviato</string>
|
<string name="deviceHasJustStarted">Il dispositivo è appena stato avviato</string>
|
||||||
|
@ -699,6 +699,7 @@
|
|||||||
<string name="profileXrequiresThis">Profiel \"%1$s\" vereist dit.</string>
|
<string name="profileXrequiresThis">Profiel \"%1$s\" vereist dit.</string>
|
||||||
<string name="lastProfile">Laatste profiel:</string>
|
<string name="lastProfile">Laatste profiel:</string>
|
||||||
<string name="queryAllPackages">Een lijst met geïnstalleerde toepassingen ophalen</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="deviceHasJustStarted">apparaat is net gestart</string>
|
||||||
<string name="serviceHasJustStarted">service is net begonnen</string>
|
<string name="serviceHasJustStarted">service is net begonnen</string>
|
||||||
<string name="serviceStarts">Service start</string>
|
<string name="serviceStarts">Service start</string>
|
||||||
|
@ -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="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="lastProfile">Last profile:</string>
|
||||||
<string name="queryAllPackages">Get a list of installed applications</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="deviceStarts">Device starts</string>
|
||||||
<string name="serviceStarts">Service starts</string>
|
<string name="serviceStarts">Service starts</string>
|
||||||
<string name="deviceHasJustStarted">device has just started</string>
|
<string name="deviceHasJustStarted">device has just started</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user