File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
cordova/cordova-plugin-ionic-keyboard/src/android Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 3333import android .view .DisplayCutout ;
3434
3535import androidx .core .view .WindowInsetsCompat ;
36+ import androidx .core .view .OnApplyWindowInsetsListener ;
37+ import androidx .core .view .ViewCompat ;
3638
3739
3840
@@ -132,8 +134,9 @@ public void onGlobalLayout() {
132134
133135 if (isKeyboardVisible ){
134136 float keyboardHeight = insets .getInsets (WindowInsetsCompat .Type .ime ()).bottom / density ;
137+ float systemBarsHeight = insets .getInsets (WindowInsetsCompat .Type .systemBars ()).bottom / density ;
135138
136- pixelHeightDiff = (int ) keyboardHeight ;
139+ pixelHeightDiff = (int ) Math . max ( 0 , keyboardHeight - systemBarsHeight ) ;
137140 }
138141
139142
@@ -176,6 +179,12 @@ private int computeUsableHeight() {
176179 }
177180 };
178181
182+ if (Build .VERSION .SDK_INT >= 30 ) {
183+ ViewCompat .setOnApplyWindowInsetsListener ((View ) webView .getView (), (v , insets ) -> {
184+ return insets ;
185+ });
186+ }
187+
179188 mChildOfContent = content .getChildAt (0 );
180189 rootView .getViewTreeObserver ().addOnGlobalLayoutListener (list );
181190 frameLayoutParams = (FrameLayout .LayoutParams ) mChildOfContent .getLayoutParams ();
You can’t perform that action at this time.
0 commit comments