@momo-kits/foundation 0.161.2-beta.22 → 0.161.2-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Layout/Screen.tsx +11 -1
- package/package.json +1 -1
package/Layout/Screen.tsx
CHANGED
|
@@ -204,6 +204,13 @@ const Screen = forwardRef(
|
|
|
204
204
|
let handleScroll;
|
|
205
205
|
let Component: any = View;
|
|
206
206
|
|
|
207
|
+
// Only on Android 16+ (API 36), matching the native WindowUtils.syncImePaddingWithAnimation gate.
|
|
208
|
+
// The IME transition can momentarily report a smaller bottom inset; latch the largest seen so
|
|
209
|
+
// the footer keeps a constant nav-bar gap. The native side animates only the keyboard portion
|
|
210
|
+
// (ime - navBar), so the footer slides smoothly during hide instead of jumping after the
|
|
211
|
+
// keyboard is fully gone. Android <16 / iOS keep the original inset behavior untouched.
|
|
212
|
+
const useNativeKeyboardSync =
|
|
213
|
+
Platform.OS === 'android' && Number(Platform.Version) >= 36;
|
|
207
214
|
const maxBottomInset = useRef(0);
|
|
208
215
|
if (insets.bottom > maxBottomInset.current) {
|
|
209
216
|
maxBottomInset.current = insets.bottom;
|
|
@@ -211,7 +218,10 @@ const Screen = forwardRef(
|
|
|
211
218
|
const bottomInset =
|
|
212
219
|
Platform.OS === 'ios'
|
|
213
220
|
? Math.min(insets.bottom, 21)
|
|
214
|
-
:
|
|
221
|
+
: useNativeKeyboardSync
|
|
222
|
+
? maxBottomInset.current
|
|
223
|
+
: insets.bottom;
|
|
224
|
+
// AI-GENERATED END: stabilize Android bottom inset so the footer's nav-bar gap doesn't jump
|
|
215
225
|
let keyboardOffset = heightHeader - bottomInset;
|
|
216
226
|
if (headerType === 'extended' || animatedHeader || inputSearchProps) {
|
|
217
227
|
keyboardOffset = -bottomInset;
|