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...
解决方案
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)