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)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…