From b6d795838985a6086dc4ae900d5e7718d2aa2b02 Mon Sep 17 00:00:00 2001 From: jens Date: Sun, 30 Mar 2025 17:50:39 +0200 Subject: [PATCH] Invert variable check --- .../ActivityManageTriggerCheckVariable.java | 16 ++++++++++++++++ .../activity_manage_trigger_check_variable.xml | 7 +++++++ app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 25 insertions(+) diff --git a/app/src/main/java/com/jens/automation2/ActivityManageTriggerCheckVariable.java b/app/src/main/java/com/jens/automation2/ActivityManageTriggerCheckVariable.java index 1062375..ff24d44 100644 --- a/app/src/main/java/com/jens/automation2/ActivityManageTriggerCheckVariable.java +++ b/app/src/main/java/com/jens/automation2/ActivityManageTriggerCheckVariable.java @@ -5,6 +5,8 @@ import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; +import android.widget.CheckBox; +import android.widget.CompoundButton; import android.widget.EditText; import androidx.annotation.Nullable; @@ -14,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; public class ActivityManageTriggerCheckVariable extends Activity { EditText etVariableKeyTrigger, etVariableValueTrigger; + CheckBox chkTriggerVariableDirection; Button bTriggerVariableSave; @Override @@ -25,6 +28,7 @@ public class ActivityManageTriggerCheckVariable extends Activity etVariableKeyTrigger = (EditText) findViewById(R.id.etVariableKeyTrigger); etVariableValueTrigger = (EditText) findViewById(R.id.etVariableValueTrigger); + chkTriggerVariableDirection = (CheckBox)findViewById(R.id.chkTriggerVariableDirection); bTriggerVariableSave = (Button) findViewById(R.id.bTriggerVariableSave); Intent input = getIntent(); @@ -36,6 +40,18 @@ public class ActivityManageTriggerCheckVariable extends Activity etVariableValueTrigger.setText(conditions[1]); } + chkTriggerVariableDirection.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() + { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean checked) + { + if(checked) + chkTriggerVariableDirection.setText(getResources().getString(R.string.matches)); + else + chkTriggerVariableDirection.setText(getResources().getString(R.string.doesNotMatch)); + } + }); + bTriggerVariableSave.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/res/layout/activity_manage_trigger_check_variable.xml b/app/src/main/res/layout/activity_manage_trigger_check_variable.xml index f92b143..75941bf 100644 --- a/app/src/main/res/layout/activity_manage_trigger_check_variable.xml +++ b/app/src/main/res/layout/activity_manage_trigger_check_variable.xml @@ -62,6 +62,13 @@ + + A profile is a collection of settings for ringtones, volumes and other audio related settings that you can have applied from rules or apply it manually.\n\nIt is also possible to query for the last activated profile as a trigger. In the normal case it will only query if the profile was the last activated one (regardless if specific audio settings have been changed in the meantime). But you can also have the individual settings compared. In version 1.8.2 it was necessary to revise the way actions to start other programs were saved. Compatibility could not be ensured. Please check and edit your start other activity actions to make sure they are still working. In the following dialog do not try to select specific files, but choose the folder in which the Automation backup files reside. If the choose button is disabled, you have found an Android limitation. In that case try moving the files to a subdirectory first. + matches + does not match \ No newline at end of file