In Android 10, users can enable full screen gesture mode. I want to detect whether the device in full screen gesture mode or not. I can't find anything in documentation. How to do it programmatically at run time?
Java or kotlin language answer is OK.
Any official API or workaround...
Beginning with Android 10 (API level 29), the Android system supports fully gesture-based navigation. There are two things that app developers should do to ensure their apps are compatible with this feature: Extend app content from edge to edge.
You can use below code to check gesture or navigation mode
public static int isEdgeToEdgeEnabled(Context context) { Resources resources = context.getResources(); int resourceId = resources.getIdentifier("config_navBarInteractionMode", "integer", "android"); if (resourceId > 0) { return resources.getInteger(resourceId); } return 0; }
The value that returned by isEdgeToEdgeEnabled function will follow below:
0 : Navigation is displaying with 3 buttons
1 : Navigation is displaying with 2 button(Android P navigation mode)
2 : Full screen gesture(Gesture on android Q)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With