Android 12.0 SystemUI control system gesture left and right sliding back function

1 Overview

  In the 12.0 system rom customization product development, after 10.0, the system default gestures include three-button navigation and system gesture navigation. After the system systemui sets the default system gesture navigation, the left and right sliding gesture return function is implemented in the SystemUI.
Now There is a need to control the enabling and disabling of the left and right swipe gesture return function, so it is necessary to analyze the specific implementation process of the gesture return function, and then implement this function

2. SystemUI controls the system gesture to slide left and right to return to the core code of the function

frameworks/base/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
frameworks/base/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/EdgeBackGestureHandler.java

3. SystemUI control system gesture left and right sliding return function analysis
  3.1 NavigationBarView.java function analysis on system gestures


   The main code management of the navigation bar in the system systemui is in NavigationBarView.java to manage the code of the navigation bar, so analyze the relevant source code of NavigationBarView.java, NavigationBarView is constructed by creating an
    instance of EdgeBackGestureHandler, which is the entire return gesture The core management class.

  public NavigationBarView(Context context, AttributeSet attrs) {
          super(context, attrs);
  
          final Context darkContext = new ContextThemeWrapper(context,
 

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/130586487