Skip to content
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

Dynamic shortcuts #1

Merged
merged 6 commits into from
Feb 17, 2023
Merged

Conversation

nschwing
Copy link
Owner

No description provided.

- `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.
@nschwing nschwing merged commit 8ad2b05 into nschwing:master Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants