Compare commits

...

6 Commits

Author SHA1 Message Date
5856c93fc8 Merge branch 'development' into development-stable
# Conflicts:
#	app/src/main/res/values-it/strings.xml
2022-06-25 02:07:14 +02:00
8201b1d4e4 new version prep 2022-06-25 01:44:24 +02:00
Jens
ce9480d188 bug manage startOtherActivity 2022-06-13 23:15:25 +02:00
9c76340f24 bluetooth not present notice 2022-06-11 13:25:13 +02:00
9162bcb451 Merge remote-tracking branch 'origin/development' into development-stable 2022-06-07 17:21:07 +02:00
92e58149a7 run executable action 2022-06-02 17:43:46 +02:00
17 changed files with 139 additions and 63 deletions

View File

@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 119,
"versionName": "1.7.5-googlePlay",
"versionCode": 120,
"versionName": "1.7.6-googlePlay",
"outputFile": "app-googlePlayFlavor-release.apk"
}
],

View File

@ -192,9 +192,34 @@ public class ActivityManageActionStartActivity extends Activity
@Override
public void onClick(View v)
{
if(saveAction())
if(checkInput())
{
ActivityManageActionStartActivity.this.setResult(RESULT_OK);
Intent returnData = new Intent();
returnData.putExtra(ActivityManageRule.intentNameActionParameter1, rbStartAppSelectByAction.isChecked());
String parameter2 = "";
if (rbStartAppSelectByActivity.isChecked())
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
else {
if (etPackageName.getText().toString() != null && etPackageName.getText().toString().length() > 0)
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
else
parameter2 += Actions.dummyPackageString + ";" + etActivityOrActionPath.getText().toString();
}
if (rbStartAppByActivity.isChecked())
parameter2 += ";" + startByActivityString;
else
parameter2 += ";" + startByBroadcastString;
for (String s : intentPairList)
parameter2 += ";" + s;
returnData.putExtra(ActivityManageRule.intentNameActionParameter2, parameter2);
setResult(RESULT_OK, returnData);
finish();
}
}
@ -250,11 +275,8 @@ public class ActivityManageActionStartActivity extends Activity
});
Intent i = getIntent();
if(i.getBooleanExtra("edit", false) == true)
{
edit = true;
loadValuesIntoGui();
}
if(i.hasExtra(ActivityManageRule.intentNameActionParameter1))
loadValuesIntoGui(i);
}
private class CustomPackageInfo extends PackageInfo implements Comparable<CustomPackageInfo>
@ -281,7 +303,6 @@ public class ActivityManageActionStartActivity extends Activity
}
private static List<PackageInfo> pInfos = null;
public static Action resultingAction;
private static final String[] supportedIntentTypes = { "boolean", "byte", "char", "double", "float", "int", "long", "short", "String", "Uri" };
private ArrayList<String> intentPairList = new ArrayList<String>();
@ -539,13 +560,13 @@ public class ActivityManageActionStartActivity extends Activity
progressDialog = ProgressDialog.show(ActivityManageActionStartActivity.this, "", ActivityManageActionStartActivity.this.getResources().getString(R.string.gettingListOfInstalledApplications));
}
private void loadValuesIntoGui()
private void loadValuesIntoGui(Intent input)
{
boolean selectionByAction = resultingAction.getParameter1();
boolean selectionByAction = input.getBooleanExtra(ActivityManageRule.intentNameActionParameter1, true);
rbStartAppSelectByActivity.setChecked(!selectionByAction);
rbStartAppSelectByAction.setChecked(selectionByAction);
String[] params = resultingAction.getParameter2().split(";");
String[] params = input.getStringExtra(ActivityManageRule.intentNameActionParameter2).split(";");
rbStartAppByActivity.setChecked(params[2].equals(startByActivityString));
rbStartAppByBroadcast.setChecked(params[2].equals(startByBroadcastString));
@ -591,8 +612,8 @@ public class ActivityManageActionStartActivity extends Activity
intentPairAdapter.notifyDataSetChanged();
}
private boolean saveAction()
boolean checkInput()
{
if(rbStartAppSelectByActivity.isChecked())
{
@ -615,36 +636,7 @@ public class ActivityManageActionStartActivity extends Activity
return false;
}
}
if(resultingAction == null)
resultingAction = new Action();
resultingAction.setParameter1(rbStartAppSelectByAction.isChecked());
resultingAction.setAction(Action_Enum.startOtherActivity);
String parameter2 = "";
if(rbStartAppSelectByActivity.isChecked())
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
else
{
if(etPackageName.getText().toString() != null && etPackageName.getText().toString().length() > 0)
parameter2 += etPackageName.getText().toString() + ";" + etActivityOrActionPath.getText().toString();
else
parameter2 += Actions.dummyPackageString + ";" + etActivityOrActionPath.getText().toString();
}
if(rbStartAppByActivity.isChecked())
parameter2 += ";" + startByActivityString;
else
parameter2 += ";" + startByBroadcastString;
for(String s : intentPairList)
parameter2 += ";" + s;
resultingAction.setParameter2(parameter2);
return true;
}

View File

@ -354,8 +354,8 @@ public class ActivityManageRule extends Activity
{
case startOtherActivity:
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionStartActivity.class);
ActivityManageActionStartActivity.resultingAction = a;
intent.putExtra("edit", true);
intent.putExtra(intentNameActionParameter1, a.getParameter1());
intent.putExtra(intentNameActionParameter2, a.getParameter2());
startActivityForResult(intent, requestCodeActionStartActivityEdit);
break;
case triggerUrl:
@ -731,13 +731,15 @@ public class ActivityManageRule extends Activity
}
else if(triggerType == Trigger_Enum.bluetoothConnection)
{
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();;
// if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
// //Miscellaneous.messageBox("Bluetooth", getResources().getString(R.string.deviceDoesNotHaveBluetooth), ActivityManageRule.this).show();
// Toast.makeText(ActivityManageRule.this, getResources().getString(R.string.deviceDoesNotHaveBluetooth), Toast.LENGTH_LONG).show();
newTrigger.setTriggerType(Trigger_Enum.bluetoothConnection);
ActivityManageTriggerBluetooth.editedBluetoothTrigger = newTrigger;
Intent bluetoothEditor = new Intent(myContext, ActivityManageTriggerBluetooth.class);
startActivityForResult(bluetoothEditor, requestCodeTriggerBluetoothAdd);
return;
}
else if(triggerType == Trigger_Enum.screenState)
@ -1355,8 +1357,10 @@ public class ActivityManageRule extends Activity
// manage start of other activity
if(resultCode == RESULT_OK)
{
newAction = ActivityManageActionStartActivity.resultingAction;
newAction.setParentRule(ruleToEdit);
newAction.setAction(Action_Enum.startOtherActivity);
newAction.setParameter1(data.getBooleanExtra(intentNameActionParameter1, true));
newAction.setParameter2(data.getStringExtra(intentNameActionParameter2));
ruleToEdit.getActionSet().add(newAction);
this.refreshActionList();
}
@ -1366,9 +1370,14 @@ public class ActivityManageRule extends Activity
// manage start of other activity
if(resultCode == RESULT_OK)
{
newAction = ActivityManageActionStartActivity.resultingAction;
newAction.setParentRule(ruleToEdit);
// ruleToEdit.getActionSet().add(newAction);
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
if(data.hasExtra(intentNameActionParameter1))
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(intentNameActionParameter1, true));
if(data.hasExtra(intentNameActionParameter2))
ruleToEdit.getActionSet().get(editIndex).setParameter2(data.getStringExtra(intentNameActionParameter2));
this.refreshActionList();
}
}
@ -1500,11 +1509,11 @@ public class ActivityManageRule extends Activity
{
if(resultCode == RESULT_OK)
{
if(data.hasExtra("autoBrightness"))
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra("autoBrightness", false));
if(data.hasExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness))
ruleToEdit.getActionSet().get(editIndex).setParameter1(data.getBooleanExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, false));
if(data.hasExtra("brightnessValue"))
ruleToEdit.getActionSet().get(editIndex).setParameter2(String.valueOf(data.getIntExtra("brightnessValue", 0)));
if(data.hasExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue))
ruleToEdit.getActionSet().get(editIndex).setParameter2(String.valueOf(data.getIntExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, 0)));
ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);

View File

@ -2,6 +2,7 @@ package com.jens.automation2;
import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@ -12,6 +13,7 @@ import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.jens.automation2.receivers.BluetoothReceiver;
@ -22,6 +24,7 @@ public class ActivityManageTriggerBluetooth extends Activity
RadioButton radioAnyBluetoothDevice, radioNoDevice, radioDeviceFromList, radioBluetoothConnected, radioBluetoothDisconnected, radioBluetoothInRange, radioBluetoothOutRange;
Button bSaveBluetoothTrigger;
Spinner spinnerBluetoothDevices;
TextView tvBluetoothNotPresentNotice;
ArrayAdapter<String> bluetoothDevicesSpinnerAdapter;
@ -40,9 +43,15 @@ public class ActivityManageTriggerBluetooth extends Activity
radioBluetoothOutRange = (RadioButton)findViewById(R.id.radioBluetoothOutRange);
bSaveBluetoothTrigger = (Button)findViewById(R.id.bSaveBluetoothTrigger);
spinnerBluetoothDevices = (Spinner)findViewById(R.id.spinnerBluetoothDevices);
tvBluetoothNotPresentNotice = (TextView)findViewById(R.id.tvBluetoothNotPresentNotice);
bluetoothDevicesSpinnerAdapter = new ArrayAdapter<String>(this, R.layout.text_view_for_poi_listview_mediumtextsize, BluetoothReceiver.getAllPairedBluetoothDevicesStrings());
if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH))
tvBluetoothNotPresentNotice.setVisibility(View.VISIBLE);
else
tvBluetoothNotPresentNotice.setVisibility(View.GONE);
radioDeviceFromList.setOnCheckedChangeListener(new OnCheckedChangeListener()
{
@Override

View File

@ -1,5 +1,7 @@
package com.jens.automation2;
import androidx.annotation.NonNull;
import java.sql.Time;
public class TimeObject
@ -65,4 +67,12 @@ public class TimeObject
return ro;
}
@NonNull
@Override
public String toString()
{
Time time = Time.valueOf(this.getHours() + ":" + this.getMinutes() + ":" + this.getSeconds());
return time.toString();
}
}

View File

@ -29,6 +29,14 @@
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_margin="10dp" >
<TextView
android:id="@+id/tvBluetoothNotPresentNotice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/red"
android:layout_marginVertical="@dimen/default_margin"
android:text="@string/deviceDoesNotHaveBluetooth" />
<RadioGroup
android:layout_width="match_parent"

View File

@ -667,7 +667,7 @@
<string name="closeNotifications">Benachrichtigung(en) schließen</string>
<string name="comparisonCaseInsensitive">Groß-/Kleinschreibung ist egal.</string>
<string name="notificationCloseActionExplanation">Wenn Sie keine Kriterien angeben, werden ALLE Benachrichtigungen geschlossen. Es wird also empfohlen, zumindest eine Anwendung zu spezifizieren und/oder Titel oder Text anzugeben.</string>
<string name="profileWarning">Die Einstellungen, die Sie hier vornehmen, können dazu führen, dass Sie bestimmte Dinge auf Ihrem Telefon nicht mehr mitbekommen. Sie können sogar Ihren Wecker zum Schweigen bringen. Was auch immer Sie hier einstellen - es wird empfohlen, es zu testen.</string>
<string name="profileWarning">Die Einstellungen, die Sie hier vornehmen, können dazu führen, dass Sie bestimmte Dinge auf Ihrem Telefon nicht mehr mitbekommen. Sie können sogar Ihren Wecker zum Schweigen bringen. Was auch immer Sie hier einstellen - es wird empfohlen, daß Sie es testen - auch nach Android Updates.</string>
<string name="ifString">falls</string>
<string name="pleaseSelectActionValue">Bitte wählen Sie eine Aktion!</string>
<string name="android.permission.MEDIA_CONTENT_CONTROL">Medien steuern</string>

View File

@ -666,7 +666,7 @@
<string name="notificationCloseActionExplanation">Si no especifica ningún criterio, esta acción cerrará TODAS las notificaciones. Por lo tanto, se recomienda al menos especificar criterios para al menos 1 de la aplicación, título o texto.</string>
<string name="closeNotifications">Cerrar notificación(es)</string>
<string name="comparisonCaseInsensitive">Las comparaciones se realizan sin distinción de mayúsculas y minúsculas</string>
<string name="profileWarning">La configuración que realice aquí puede hacer que ya no note ciertas cosas de su teléfono. Incluso puede silenciar su alarma de despertar. Así que hagas lo que hagas, se recomienda que lo pruebes.</string>
<string name="profileWarning">La configuración que realice aquí puede hacer que ya no note ciertas cosas de su teléfono. Incluso puede silenciar su alarma de despertar. Así que hagas lo que hagas, se recomienda que lo pruebe - tambien despues upgrades de Android.</string>
<string name="ifString">si</string>
<string name="on">encendido</string>
<string name="off">apagado</string>

View File

@ -665,7 +665,7 @@
<string name="notificationCloseActionExplanation">Als u geen criteria opgeeft, worden met deze actie ALLE meldingen gesloten. Het is dus aan te raden om in ieder geval criteria te specificeren voor minimaal 1 van de toepassing, titel of tekst.</string>
<string name="closeNotifications">Melding(en) sluiten</string>
<string name="comparisonCaseInsensitive">Vergelijkingen worden gedaan case-INsensitief</string>
<string name="profileWarning">De instellingen die je hier maakt kunnen ervoor zorgen dat je bepaalde dingen niet meer van je telefoon merkt. Ze kunnen zelfs je wekker dempen. Dus wat je ook doet - het wordt aanbevolen om het te testen.</string>
<string name="profileWarning">De instellingen die je hier maakt kunnen ervoor zorgen dat je bepaalde dingen niet meer van je telefoon merkt. Ze kunnen zelfs je wekker dempen. Dus wat je ook doet - het wordt aanbevolen om het te testen - ook na Android upgrades.</string>
<string name="ifString">als</string>
<string name="emailContactNotice">E-mail is mijn favoriete contactmethode om bugs te melden, vragen te stellen of voorstellen te doen. Ga naar het controlecentrum voor meer informatie.</string>
<string name="controlCenter">Controlecentrum</string>

View File

@ -764,7 +764,7 @@
<string name="notificationCloseActionExplanation">If you don\'t specify any criteria this action will close ALL notifications. So it\'s advised to at least specify criteria for at least 1 of application, title or text.</string>
<string name="closeNotifications">Close notification(s)</string>
<string name="comparisonCaseInsensitive">Comparisons are done case-INsensitive</string>
<string name="profileWarning">The settings you can adjust here, can cause that you don\'t notice certain things from your phone anymore. They may even silence your wakeup alarm. So whatever you do - it is recommended you test it.</string>
<string name="profileWarning">The settings you can adjust here, can cause that you don\'t notice certain things from your phone anymore. They may even silence your wakeup alarm. So whatever you do - it is highly recommended that you test it - also after Android updates.</string>
<string name="ifString">if</string>
<string name="emailContactNotice">Email is my preferred method of contact to report bugs, ask questions or make proposals. Go to control center to learn more.</string>
<string name="controlCenter">Control center</string>

View File

@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@ -0,0 +1,9 @@
* Neuer Auslöser: Gerät hat gerade gestartet
* Neuer Auslöser: Dienst wurde gerade gestartet
* Neuer Auslöser: Auf Broadcasts reagieren
* Neuer Parameter für Auslöser Bildschirmstatus: Neuer Status "gesperrt"
* Neue Aktion: Broadcasts verschicken
* Neue Übersetzung: Russisch
* Übersetzungen aktualisiert
* Behoben: Absturz beim Editieren von Benachrichtigungs-Auslösern
* Behoben: Zeitraum Auslöser - Zeit konnte sich beim Durchqueren von Zeitzonen ändern

View File

@ -3,5 +3,8 @@
* New trigger: Respond to customizable broadcasts
* New parameter for trigger Screen state: New state "locked"
* New action: Send broadcasts
* New translation: Russian
* Translations updated
* Fixed: Crash when editing notification trigger
* Fixed: TimeFrame trigger - time may have changed when crossing timezones
* Fixed: TimeFrame trigger - time may have changed when crossing timezones or daylight saving changes
* Fixed: Bug when adding more than one startOtherActivity action

View File

@ -0,0 +1,9 @@
* Nuevo condición: el dispositivo acaba de comenzar
* Nuevo condición: el servicio acaba de comenzar
* Nuevo condición: Responder a transmisiones personalizables
* Nuevo parámetro para el estado de la pantalla del disparador: Nuevo estado "bloqueado"
* Nueva acción: Enviar transmisiones
* Nueva traducción: ruso
* Traducciones actualizadas
* Corregido: Bloqueo al editar el condición de notificación
* Corregido: disparador de marco de tiempo: el tiempo puede haber cambiado al cruzar zonas horarias

View File

@ -0,0 +1,9 @@
* Nuovo trigger: il dispositivo è appena iniziato
* Nuovo trigger: il servizio è appena iniziato
* Nuovo trigger: rispondi alle trasmissioni personalizzabili
* Nuovo parametro per lo stato dello schermo del trigger: nuovo stato "bloccato"
* Nuova azione: Invia trasmissioni
* Nuova traduzione: Russo
* Traduzioni aggiornate
* Risolto: Crash durante la modifica del trigger di notifica
* Risolto: trigger TimeFrame - l'ora potrebbe essere cambiata quando si attraversano i fusi orari

View File

@ -0,0 +1,9 @@
* Nieuwe trigger: apparaat is net gestart
* Nieuwe trigger: service is net begonnen
* Nieuwe trigger: Reageer op aanpasbare uitzendingen
* Nieuwe parameter voor trigger Schermstatus: Nieuwe status "vergrendeld"
* Nieuwe actie: Stuur uitzendingen
* Nieuwe vertaling: Russisch
* Vertalingen bijgewerkt
* Opgelost: Crash bij het bewerken van melding trigger
* Fixed: TimeFrame trigger - tijd kan zijn veranderd bij het overschrijden van tijdzones

View File

@ -0,0 +1,9 @@
* Новый триггер: устройство только что запустилось
* Новый триггер: сервис только что запущен
* Новый триггер: реакция на настраиваемые трансляции
* Новый параметр для триггера Состояние экрана: Новое состояние "заблокировано"
* Новое действие: Отправка трансляций
* Новый перевод: русский
* Переводы обновлены
* Исправлено: Сбой при редактировании триггера уведомления
* Исправлено: Триггер таймфрейма - время могло измениться при пересечении часовых поясов