android
android copied to clipboard
Android Navigation Back gesture activates buttons on dashboard
Home Assistant Android version: 2021.10.0-full
Android version: Android 12 (SPA1A.210812.015)
Phone model: Pixel 4a
Home Assistant version: core-2021.10.6
Last working Home Assistant release (if known): all affected
Description of problem: The android back gesture seems to activate the button which is present below the trace of the finger while performing the gesture (on finger lift-off). This is not the case for other apps i tested (e.g outlook, twitter, calculator, etc), therefore it seems to be an issue with the app.
Screenshot of problem: Here is a screen record, which shows the issue (around 5 sec at the shield icon, which triggers the error message on the bottom): https://photos.app.goo.gl/BT5ZShqgiFELMuxn7
I do not have this issue on my Pixel 4 XL on both android 11 and 12 do you see this issue in Chrome for Android? The apps that you mention are not webview apps so are not a fair comparison.
Also check that Android system webview and Chrome are both up to date. Disable any and all custom cards as well to see if those cause an issue.
issue is not present in Chrome.
WebView & Chrome Version: 94.0.4606.85
Intresstingly the issue only seems to be there if I use the back gesture from the right side of the phone --> a back swipe from the left side is working as it should be. Furthermore, I also noticed that i do not actualy have to lift the finger in most cases --> just tracing over the button is activating it.
What do you mean by activate? Just that the button highlights? Is it only on those button cards? What about entity card?
Checked: Problem does not occur with entity cards. By "activate" i am referring to the activation of the "tab-action", eg a light is turned on if the tab-action of a the button is set to "toogle".
Ok then yes this is definitely a frontend issue and not an app issue
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This issue is present with 2021.12.10.
I've noticed this as well. My phone did just update to andriod 12 recently but also home assistant did an update as well. I'm gonna roll back to last month or so and see if the problem persist. This is what happens to me. I swipe up and the button I'm on in home assistant or light whatever will turn on or off like i clicked it but also andriod will go home or back whatever gesture I did.
I have this issue and it is quite frustrating. I've turned on the lights on sleeping roommates more than once because of it. Oops.
Also having this issue on pixel 5 on Android 12. Really frustrating - hopefully can be fixed soon!
Same here, Samsung S20 , Android 12
Any update?
I've researched a bit and this seems to be relevant: https://developer.android.com/training/gestures/gesturenav
While the link to WindowInsets.getMandatorySystemGestureInsets()
sounds to be relevant just for home/switch gestures, it might be a solution for back as well. Probably, we don't just want to see mandatory (=IIUC home/switch, as you can't disable it) gestures insets, but all gestures insets: https://developer.android.com/reference/android/view/WindowInsets#getSystemGestureInsets() . (I know, this is deprecated, but there is a followup.)
Once we are able to get the insets, the question is how to implement it:
a. Implement it in the companion app. This would probably mean the app would have to reduce the size of the WebView. b. Implement it in the webinterface. This would require the companion app to pass the insets to the webpage.
@v6ak the back from the left does work as intended. Only the back gesture on the right side is problematic. It means there is an implementation in place, only partial, doesn't it?
Well, this might be purely accidental. If a margin is wide enough for whatever reason, it should be OK. It seems that left margin is a bit wider than the right one. Anyway, it doesn't imply the implementation is correct – the required and actual margins might vary by device, settings etc. So, it might break on some other device, new Android version etc.
I've also seen that the safe insets are available in CSS, so there is no need to pass them from the companion app: https://developer.mozilla.org/en-US/docs/Web/CSS/env
Still an issue in Android 13 and still really annoying.
It's even worse on Samsungs three button gestures. All gesture types trigger a click.
@Tau-Neutrino your photos link is broken.
Just want to add that I experience this consistently in Android 13 on a Google Pixel 6a. It has turned off my heat on a few occasions, which has the potential to lead to frozen and burst pipes in the winter. The two places I know for sure it has happened is on an entities card with light toggles and on a mushroom thermostat card.
Hello! We are also experiencing this bug and it's very frustrating!
Same issue here with my Samsung Android phone. Very often, when I try to close the app with swiping up from the bottom, I accidentally turn on/off some lights or open/close blinds. Often times I don't even realize it. This is very frustrating.
This does not happen when I use Home Assistant in Chrome on my Android, just in the Home Assistant Android app.
I can also confirm that this is an issue of the HA app. When navigating back in chrome, no HA buttons will be pressed. In the HA app I toggle buttons all the time when swiping back. Please fix :)
This also impacts the burger side bar menu (3 lines in the top left). it should be possible to swipe diagonally from the left screen edge to open the side bar menu however this doesn't work in the HA app on Android
Same issue here (Android 13 on Pixel 7). Very frustrating when I accidentally turn devices on and off while navigating around my dashboards!
This is a daily occurrence on Android 13, Samsung s22 ultra. I've had to design dashboards with double tap actions on the items near the bottom of the screen to avoid issues. Doesn't help if you have scrolled down at all.
I've also noticed picture cards (cameras) are more sensitive and almost always open.
No issues using the dash in chrome. Just HA companion app.
Meanwhile changed phone to pixel 7, Android 13 lates version. Same issue still present. The HA app is nearly unusable with Android gestures in my opinion....
This also impacts the burger side bar menu (3 lines in the top left). it should be possible to swipe diagonally from the left screen edge to open the side bar menu however this doesn't work in the HA app on Android
This swipe to open menu has been disabled thankfully as it was getting interfered by the back gesture causing the whole menu to be stuck one pixel out. Even if swiping diagonally is a bit different it's to precise of an action to put in the app imo.
It's been two years since this was reported. Ffs It's really annoying when things don't get done right in the first place. HA is the only app I know that has this issue:
https://github.com/home-assistant/android/assets/3942672/780bee18-2e56-45a2-b83d-0d722cd8de04
After some experimentations with the app source, I think that this issue is caused by the fact that the back gesture, as soon as it started by the user, causes a touchstart
event on the cards, which toggles the card state. This odd behavior looks like a WebView/Android bug to me, so I don't think that the HA app developers can do much about it.
A quick but ugly workaround that I'm currently using is to add a margin to the dashboard content, with a value that is sufficient to have the cards not placed in the edge areas of the screen where the back gesture happens. For example (last line):
title: Home
views:
- theme: Backend-selected
path: default_view
title: Home
icon: mdi:home-assistant
type: custom:grid-layout
subview: false
layout:
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr))
grid-template-rows: auto
margin: 0px 40px
After some experimentations with the app source, I think that this issue is caused by the fact that the back gesture, as soon as it started by the user, causes a
touchstart
event on the cards, which toggles the card state. This odd behavior looks like a WebView/Android bug to me, so I don't think that the HA app developers can do much about it.
So I opened my instance via reddit which opens a webview tap. Tried the bug. Didn't occur. Is this not the same webview?
Conversely if this is an Android/WebView defect could someone with knowledge with how to replicate log a defect in the Android project https://issuetracker.google.com/issues and link back to this ticket?