How to intercept this click event when android keyboard shrinks down

  android, question

clipboard.png

The whole picture is like this.

Cases of Soft Keyboard Expression Fluent Switching (Not Top Up, Highly Adaptive)
keyboard_preview.gif?raw=true

Among them:
The code for judging whether to display is as follows:

View rootView = ((Activity) context).getWindow().getDecorView();
 rootView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
 
 @Override
 public void onGlobalLayout() {
 Rect r = new Rect();
 rootView.getWindowVisibleDisplayFrame(r);
 Int visibleHeight = r.height () plus r.top;
 if (visibleHeight < rootView.getHeight()) {
 //soft keyboard display ing
 }else{
 //pack up the soft keyboard, click on the input method to pack up and walk here.
 bracket
 bracket
 });