-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dynamic Shortcuts integration #48
base: master
Are you sure you want to change the base?
Conversation
- `tunnel_list_item` got a new checkbox to toggle shortcut display for specific tunnel - `ObservableTunnel` got updated to support querying and setting shortcuts. Responsibility delegated to `TunnelManager` - `TunnelManager` got updated to handle shortcuts when a tunnel changes. Actual shortcut logic will be handled by `ShortcutManager` - Added skeleton for `ShortcutManager` - `strings.xml` updated with tooltip text for the shortcut checkbox. This tooltip only works for API 26+
- `ShortcutManager` now able to add 2 kinds of dynamic shortcuts for a specific tunnel (tunnel up and tunnel down). - Modified `TunnelToggleActivity` so that it can be called from the shortcuts. Instead of only being able to toggle last used tunnel, now it can be instructed to 'up' or 'down' any specified tunnel.
Previously it was API 24+, because TileService is only available there. But now `TunnelToggleActivity` can also be used from shortcuts, meaning we need it to work on older APIs too.
Also, `colorOnPrimary` was "white" on my physical device (Samsung S21 API 31) and blended into the background, but looked fine in emulator (API29). I did not investigate further. The above should look the same as the ToggleSwitch next to it. As far as I could test this will look "secondary blue" on older devices, and adhere to Material You dynamic colors on newer devices.
Would be great to see this merged / released. Looking for a solution to auto-toggle via Samsung Bixby Routines as soon as I leave my Home-WiFi. |
Just to be completely transparent regarding this feature. However the idea of using the shortcut as a way to toggle automatically with Bixby Routines does have its drawbacks. In my eyes this is a Bixby limitation. Bixby Routines should enable toggling of custom VPN tunnels or let us use custom broadcast messages (to toggle the tunnel in this case). Nevertheless I still use it and it's better than always having to do this manually.. |
Thanks for the updated Info - without going to much offtopic: do you know If Bixby Routines gained functionality with OneUI 5 so toggling VPNs defined via 3rd Party Apps Work Out of the Box? |
Don't know yet, haven't checked. |
Please, is it possible to post the compiled android app with Dynamic Shortcuts? Thank you! |
581ab92
to
ec126a9
Compare
5692307
to
ee16d13
Compare
Could it merged / released? Very useful feature. |
a1670c8
to
dc1860c
Compare
baa1257
to
79b8c34
Compare
c046706
to
40eaa54
Compare
827495b
to
4ba8794
Compare
Added support for Android Dynamic Shortcuts. Dynamic Shortcuts is a standard Android feature that is supported by most of the launchers.
How does this work for users?
Now users can request the app to add shortcuts to their favourite tunnels. When the user enables this for a specific tunnel, 2 dynamic shortcuts are created, one to UP the tunnel, other is to DOWN it.
Additionally this functionality enables users to use certain automation apps to automatically toggle tunnels. For example the built-in Bixby Routines on Samsung devices. (This was my original motivation for adding this feature, but I was trying to incorporate it in a way that could benefit all users.)
What changes were made to previous components to support this?
TunnelToggleActivity
is now more broadly used. Previously it seemed to be only called fromTileService
in certain situations.Limitations and possible points for future improvement
To my best knowledge all of these -- expect the first point -- were there previous to my PR, and I can help to sort these out if needed.
TunnelToggleActivity
can be shown briefly when a tunnel is toggled, and it can look weird. This could possibly be solved by adding some design to the activity and showing it a bit longer in a controlled manner, maybe with some animation.