Hi,
I have some code here that doesn't seem to work. Does anyone have an idea why and how to correct it?
The source_class_name variable becomes available after the UI Event trigger. The value is "android_widget_Button" (text).
Examples Inside Script Trigger:
If source_class_name == "android_widget_Button"
{
true
}
else
{
false
}
Example 2 - Inside Expression Condition:
source_class_name == "android_widget_Button"
Thanks.
Julian
UI Event Trigger: Source_Class_Name
Moderator: Martin
Re: UI Event Trigger: Source_Class_Name
UI Event is the trigger. After trigger add condition as your second example
True continue to your main branch of the flow. False do nothing (or something else if you need to).
If that still doesn't work, you need to explain first what you need achieve. Maybe there is another way to do it.
Code: Select all
source_class_name == "android_widget_Button"
If that still doesn't work, you need to explain first what you need achieve. Maybe there is another way to do it.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 27
- Joined: 13 Jul 2017 08:47
Re: UI Event Trigger: Source_Class_Name
Hi,
The provided if and expression exampled oes not work. The result is always false.
I don't know what else I can tell you.
Julian
The provided if and expression exampled oes not work. The result is always false.
I don't know what else I can tell you.
Julian
Re: UI Event Trigger: Source_Class_Name
Which mean the event triggered the flow doesn't have "android_widget_Button". Add a condition debug dialog in the false branch and check the variable source_class_name value. Maybe there is different value at every trigger. In that case, you might want to use variable logger to log all the possible value : viewtopic.php?f=3&t=7285
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 27
- Joined: 13 Jul 2017 08:47
Re: UI Event Trigger: Source_Class_Name
The ....Button does exist.
This is why I have contacted support because the result is always false.
Is the syntax correct?
Julian.
This is why I have contacted support because the result is always false.
Is the syntax correct?
Julian.
Re: UI Event Trigger: Source_Class_Name
The syntax is correct already, with double equal sign
Use the debug dialog when the false is returned, scroll to find the source_class_name and copy the value from there, paste it back to the expression. You might have upper/lower case problem here.
BTW, what is the button/UI that trigger this flow?
Code: Select all
source_class_name == "android_widget_Button"
BTW, what is the button/UI that trigger this flow?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
-
- Posts: 27
- Joined: 13 Jul 2017 08:47
Re: UI Event Trigger: Source_Class_Name
Hi, fixed. There was a space at the end of the ....Button which I couldn't see.
There is now no issue.
Thanks for your help.
Julian
There is now no issue.
Thanks for your help.
Julian