Overlay widgets

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Overlay widgets

Post by Rafi4 » 22 Jul 2018 00:27

Hi Martin
Automagic is awesome. Please add one more option in overlay widget swipe as down & left,up & right. I like these options mostly.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Overlay widgets

Post by digitalstone » 22 Jul 2018 01:52

Just to verify beforehand:
Do you mean to be able to create an extra option of gesture, so you can for example: Swipe right to do 1 thing, but ALSO swipe left for another within the same grid-area?
That would actually be pretty sweet.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Overlay widgets

Post by Martin » 24 Jul 2018 13:52

@Rafi4: Could you please describe your request in more detail?

@digitalstone: You can already assign different actions for swipe left/right/up/down within a single clickable area. Just click on the right side of the clickable area (list icon), select a second gesture type like swipe left and assign another action to it.

Regards,
Martin

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Overlay widgets

Post by Rafi4 » 24 Jul 2018 14:04

Hi Martin
I want to (swipe down and swipe right) with one swipe. Because it is more difficult to understand for others.
I want to give more secure to my device with overlay widget.
Thanks a lot Martin
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
digitalstone
Posts: 342
Joined: 21 Oct 2017 12:36
Location: The Netherlands

Re: Overlay widgets

Post by digitalstone » 24 Jul 2018 17:11

@Martin: omg :oops:

@Rafi: You mean like sort of a combination-lock? You'll going to have to build that inside your flow.
Phone: LG Nexus 5X (rooted vanilla Android 7.1.2)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Overlay widgets

Post by Desmanto » 24 Jul 2018 17:31

Currently we have 7 possible actions to the widget, click, long-click, double click, Swipe Up, Swipe Right, Swipe Down, Swipe Left.

From what I get, Rafi4 want additional another 8 actions : Swipe Up-Right, Swipe Up-Left, Swipe Right-Up and so on.
I would against this, as it will add so many complexity. Current swipe method sometimes already reduce the perfomance of the widget action detection.

@Rafi4 : If you need additional swipe like that, you can create more row/column in the widget to accomodate extra swipe. Each with its own action to execute consecutively.
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.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Overlay widgets

Post by Rafi4 » 25 Jul 2018 04:35

Hi Desmanto
I agree with you. Only i want to give more secure to my device with overlay widgets.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Overlay widgets

Post by Desmanto » 25 Jul 2018 10:32

There is another way you can secure the widget. Swipe action in widget will give two additional variables : swipe_velocity_x and swipe_velocity_y. Both this correspond to how fast you swipe the widget when you trigger the action.

Try to put debug dialog to see what is the maximum speed recognized by your phone. It seems to depend on the screen resolution and density. At my previous phone it ranges from -24000 to 24000. While at current one, -16800 to 16800. Try it several times using debug dialog and change the speed on how fast you swipe the widget. When you know how fast is certain swipe speed, you can then filter for this value. Example use expression :

Code: Select all

swipe_velocity_y > 16000
True go to the main flow, false do nothing. At my phone, this mean i am required to swipe down very fast to go the main action (unlock the phone). Change to suit your phone and need.

Other method involving widget is using the screen_x and screen_y. You can put a moving the widget to certain area and stop it around there. When you click/swipe that widget, there will be screen_x and screen_y as the result. You can check if this x,y coordinate is within certain point, if true, continue to main flow; false, do nothing. Essentially you are creating a puzzle-like widget. The widget must be moved into the approximately correct position before executing.

You can even combine this with several other sensors such shake, proximity sensor, light sensor, device orientation and several other. So example after tapping the widget and swipe down very fast, you need to rotate the phone and face it downside for 2 seconds until it vibrate. Arrrgh, I can't stop, there are too many ways. Unlocking phone should be secure enough but also not until so inconvenient. Just use as much as you feel secure but still within reasonable convenience to use everyday.
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.

User avatar
Rafi4
Posts: 281
Joined: 01 Dec 2017 05:23

Re: Overlay widgets

Post by Rafi4 » 25 Jul 2018 14:31

Hi desmanto
Difficult to understand for me. Please give example.
No.1 Automation app in play store Automagic Premium
Samsung Galaxy j2 non rooted.
Android 5.1.1

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Overlay widgets

Post by Desmanto » 26 Jul 2018 06:20

I have made the test flow for proof of concept : http://automagic4android.com/flow.php?i ... 7e30132d02

The xml has 1 flow and 2 widgets. The flow has 4 branch :
1. To show the widget for testing
2. Process the long click from screen_x and screen_y
3. Process the swipe down and check the velocity
4. Process the swipe up and check device orientation
Velocity Widget.png
Velocity Widget.png (399.21 KiB) Viewed 18561 times
Red widget contains only long click, correspond to branch 2. Blue widget only contains 2 swipe actions (up and down), correspond to branch 3 and 4. All successful widget action will hide the trigger and show toast : Unlocked!!!

1. Tap once to test the widget, tap again within 5 seconds to hide the widget. You can add the shortcut to homescreen or execute it manually
2. to unlock using the red widget, move it near to the top left corner of your screen, x y must be within 100-200 (measured from the top left corner of the widget)
3. To unlock using the blue widget swipe down, swipe down as fast as you can. You might need to change the 16000 to suit your phone.
4. To unlock using blue widget swipe up, swipe up as usual, there will be vibrate. Then make sure the device is facing up for 3 seconds. There will be another vibrate to indicate it is success.

- All error toast message only appear in this test flow, to test concept. Don't show them up in the final flow, as it will give hint to unlock it.
- The widget is separated as if you use swipe action, the widget becames not draggable.
- Make sure you test it using small widget first. Wrong testing can ended up locking yourself from the phone. (need force restart by holding power 10 seconds)
- Replace the logic/action as needed. This flow is for proof of concept only.
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.

Locked