Is it possible to change system navigation to gesture or 3-button navigation programmatically?
-
I know hiding gesturebar systemwide is possible within the phone. I know changing systemwide navigation programatically is possible using ADB. But I've never heard of a method of doing it within the phone like hiding gesturebar. Even if you find a way to do it, you shouldn't use it if you're going to release your app publicly.Shazniq– Shazniq2021-06-24 23:36:32 +00:00Commented Jun 24, 2021 at 23:36
-
@Shazniq Adb could also help me actually. Do you know the commands?tomas– tomas2021-06-25 08:17:46 +00:00Commented Jun 25, 2021 at 8:17
-
@tomas I've updated my answer with the adb commandsMatPag– MatPag2021-06-25 15:37:38 +00:00Commented Jun 25, 2021 at 15:37
2 Answers
This is not supported currently.
You can't change navigation in behalf of user. This is an important user preference and enabling apps to change the system navigation type would create confusion only. I don't think it will ever be supported.
Moreover there is no action here to even "guide" the user to the specific settings screen
On some devices this can be changed with adb commands (but there is no warranty those commands will work in future)
//Enable gesture navigation
adb shell cmd overlay enable com.android.internal.systemui.navbar.gestural
//Enable 2-button navigation
adb shell cmd overlay enable com.android.internal.systemui.navbar.twobutton
//Enable 3-button navigation
adb shell cmd overlay enable com.android.internal.systemui.navbar.threebutton
Comments
Disabling navbar by
cmd overlay enable com.android.internal.systemui.navbar.gestural
works well but enabling it back doesnt change ui size so some elements of programs ui (bottom bar) could be overlayed by navbar. To fix it i found a trick. To enable it use
cmd overlay disable com.android.internal.systemui.navbar.gestural
cmd overlay enable com.android.internal.systemui.navbar.threebutton