diff --git a/CHANGELOG.md b/CHANGELOG.md index 423cd1a7..0dbc46de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [3.0.141] - 2026-09-16 + +### Bug Fixes +- **pager-view (Android)**: Load the native tab bar, category item and column label fonts from the app's bundled assets (OK-63273). They resolved `fontFamily` with `Typeface.create`, which only knows system font families, so a bundled family such as `Roobert-Medium` silently fell back to the system font on Android while iOS resolved it through `UIAppFonts`. The typeface now comes from `ReactFontManager`, the lookup React Native `Text` uses: registered custom fonts, then `assets/fonts/.ttf|otf`, and only then `Typeface.create`. The `fontFamily` prop is unchanged. This upstreams the patch-package patch app-monorepo carried for `react-native-pager-view`. + +### Chores +- Bump all 40 publishable packages to 3.0.141. + +## [3.0.140] - 2026-09-16 + +### Features +- **tab-view (Android)**: Add `ignoreKeyboardInsets`, default `true`. Set it to `false` to pad the tab bar by the keyboard height so it rises above the soft keyboard. The IME inset is read explicitly instead of through the compat system-window inset, and combined with the navigation bar inset so the prop stays independent of `ignoreBottomInsets`. The value lives in JS, so apps can switch the behavior without a native release. + +### Bug Fixes +- **tab-view (Android)**: Keep the bottom tab bar under the soft keyboard (OK-63557). Material's `BottomNavigationView` padded itself with `getSystemWindowInsetBottom()`, which carries the IME height while the window uses `adjustResize`, and react-native-keyboard-controller switches the window to `adjustResize` whenever a `KeyboardAwareScrollView`, `KeyboardStickyView` or keyboard animation hook is mounted. On those screens the bar grew by the keyboard height, its items sat directly on top of the keyboard, and `onTabBarMeasured` reported the inflated height to JS. The bar now pads for system bars and display cutouts only unless `ignoreKeyboardInsets` is turned off. +- **tab-view (Android)**: `setIgnoreBottomInsets(false)` no longer clears the inset listener, which also dropped the navigation bar padding. Both inset flags are re-applied when a uiMode change recreates the bottom navigation view. + +### Chores +- Bump all 40 publishable packages to 3.0.140. + ## [3.0.139] - 2026-09-16 ### Chores diff --git a/native-modules/native-logger/package.json b/native-modules/native-logger/package.json index 34bd5cb6..a06d9ead 100644 --- a/native-modules/native-logger/package.json +++ b/native-modules/native-logger/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-native-logger", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-native-logger", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-aes-crypto/package.json b/native-modules/react-native-aes-crypto/package.json index d46997fb..ac47b4b6 100644 --- a/native-modules/react-native-aes-crypto/package.json +++ b/native-modules/react-native-aes-crypto/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-aes-crypto", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-aes-crypto", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-app-update/package.json b/native-modules/react-native-app-update/package.json index a6b10056..49f181ef 100644 --- a/native-modules/react-native-app-update/package.json +++ b/native-modules/react-native-app-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-app-update", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-app-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-async-storage/package.json b/native-modules/react-native-async-storage/package.json index cb21b5f8..b96fb12f 100644 --- a/native-modules/react-native-async-storage/package.json +++ b/native-modules/react-native-async-storage/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-async-storage", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-async-storage", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-background-thread/package.json b/native-modules/react-native-background-thread/package.json index f4bc3922..05a5b5ae 100644 --- a/native-modules/react-native-background-thread/package.json +++ b/native-modules/react-native-background-thread/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-background-thread", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-background-thread", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-bundle-crypto/package.json b/native-modules/react-native-bundle-crypto/package.json index 960901e8..1c1b2bc2 100644 --- a/native-modules/react-native-bundle-crypto/package.json +++ b/native-modules/react-native-bundle-crypto/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-bundle-crypto", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-bundle-crypto", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-bundle-update/package.json b/native-modules/react-native-bundle-update/package.json index 046dd3e8..7568999f 100644 --- a/native-modules/react-native-bundle-update/package.json +++ b/native-modules/react-native-bundle-update/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-bundle-update", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-bundle-update", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-check-biometric-auth-changed/package.json b/native-modules/react-native-check-biometric-auth-changed/package.json index ed5b2902..a6ddfb0a 100644 --- a/native-modules/react-native-check-biometric-auth-changed/package.json +++ b/native-modules/react-native-check-biometric-auth-changed/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-check-biometric-auth-changed", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-check-biometric-auth-changed", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-cloud-fs/package.json b/native-modules/react-native-cloud-fs/package.json index a0d48394..593d78b5 100644 --- a/native-modules/react-native-cloud-fs/package.json +++ b/native-modules/react-native-cloud-fs/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-cloud-fs", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-cloud-fs TurboModule for OneKey", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-cloud-kit-module/package.json b/native-modules/react-native-cloud-kit-module/package.json index 7f703dd1..eac355d3 100644 --- a/native-modules/react-native-cloud-kit-module/package.json +++ b/native-modules/react-native-cloud-kit-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-cloud-kit-module", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-cloud-kit-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-device-utils/package.json b/native-modules/react-native-device-utils/package.json index 44ea721a..18b05390 100644 --- a/native-modules/react-native-device-utils/package.json +++ b/native-modules/react-native-device-utils/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-device-utils", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-device-utils", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-dns-lookup/package.json b/native-modules/react-native-dns-lookup/package.json index ac495aae..4e72fc63 100644 --- a/native-modules/react-native-dns-lookup/package.json +++ b/native-modules/react-native-dns-lookup/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-dns-lookup", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-dns-lookup", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-get-random-values/package.json b/native-modules/react-native-get-random-values/package.json index 348dcbf9..9fe23667 100644 --- a/native-modules/react-native-get-random-values/package.json +++ b/native-modules/react-native-get-random-values/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-get-random-values", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-get-random-values", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-keychain-module/package.json b/native-modules/react-native-keychain-module/package.json index 8c84748e..69281084 100644 --- a/native-modules/react-native-keychain-module/package.json +++ b/native-modules/react-native-keychain-module/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-keychain-module", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-keychain-module", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-lite-card/package.json b/native-modules/react-native-lite-card/package.json index 79a3df90..0b5ff1ae 100644 --- a/native-modules/react-native-lite-card/package.json +++ b/native-modules/react-native-lite-card/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-lite-card", - "version": "3.0.139", + "version": "3.0.141", "description": "lite card", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-network-info/package.json b/native-modules/react-native-network-info/package.json index 160e5b38..042463ef 100644 --- a/native-modules/react-native-network-info/package.json +++ b/native-modules/react-native-network-info/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-network-info", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-network-info", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-network-throttle/package.json b/native-modules/react-native-network-throttle/package.json index dfb5a7ff..32918453 100644 --- a/native-modules/react-native-network-throttle/package.json +++ b/native-modules/react-native-network-throttle/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-network-throttle", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-network-throttle", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-pbkdf2/package.json b/native-modules/react-native-pbkdf2/package.json index 593bd29b..cfaa3cfa 100644 --- a/native-modules/react-native-pbkdf2/package.json +++ b/native-modules/react-native-pbkdf2/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-pbkdf2", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-pbkdf2", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-perf-memory/package.json b/native-modules/react-native-perf-memory/package.json index 5119a3cc..3017319d 100644 --- a/native-modules/react-native-perf-memory/package.json +++ b/native-modules/react-native-perf-memory/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-perf-memory", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-perf-memory", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-perf-stats/package.json b/native-modules/react-native-perf-stats/package.json index 60404ef3..ba106997 100644 --- a/native-modules/react-native-perf-stats/package.json +++ b/native-modules/react-native-perf-stats/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-perf-stats", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-perf-stats", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-ping/package.json b/native-modules/react-native-ping/package.json index 58ecba05..c44fb382 100644 --- a/native-modules/react-native-ping/package.json +++ b/native-modules/react-native-ping/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-ping", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-ping TurboModule for OneKey", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-range-downloader/package.json b/native-modules/react-native-range-downloader/package.json index 6cb95c1b..1713b03d 100644 --- a/native-modules/react-native-range-downloader/package.json +++ b/native-modules/react-native-range-downloader/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-range-downloader", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-range-downloader", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-sni-connect/package.json b/native-modules/react-native-sni-connect/package.json index 41d23fa6..0f3900cf 100644 --- a/native-modules/react-native-sni-connect/package.json +++ b/native-modules/react-native-sni-connect/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-sni-connect", - "version": "3.0.139", + "version": "3.0.141", "description": "A React Native library for SNI-based HTTP requests with DNS caching and request management", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-splash-screen/package.json b/native-modules/react-native-splash-screen/package.json index 45b75c29..879f8d6f 100644 --- a/native-modules/react-native-splash-screen/package.json +++ b/native-modules/react-native-splash-screen/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-splash-screen", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-splash-screen", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-split-bundle-loader/package.json b/native-modules/react-native-split-bundle-loader/package.json index 1e00ee7b..0a74b332 100644 --- a/native-modules/react-native-split-bundle-loader/package.json +++ b/native-modules/react-native-split-bundle-loader/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-split-bundle-loader", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-split-bundle-loader", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-tcp-socket/package.json b/native-modules/react-native-tcp-socket/package.json index 3bceac45..23a741ef 100644 --- a/native-modules/react-native-tcp-socket/package.json +++ b/native-modules/react-native-tcp-socket/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-tcp-socket", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-tcp-socket", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-modules/react-native-zip-archive/package.json b/native-modules/react-native-zip-archive/package.json index 4d860c1a..6b142145 100644 --- a/native-modules/react-native-zip-archive/package.json +++ b/native-modules/react-native-zip-archive/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-zip-archive", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-zip-archive Nitro HybridObject for OneKey", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-auto-size-input/package.json b/native-views/react-native-auto-size-input/package.json index 8d5ccb3e..0fe1fe0b 100644 --- a/native-views/react-native-auto-size-input/package.json +++ b/native-views/react-native-auto-size-input/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-auto-size-input", - "version": "3.0.139", + "version": "3.0.141", "description": "Auto-sizing text input with font scaling, prefix and suffix support", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-chart-webview/package.json b/native-views/react-native-chart-webview/package.json index c28ef9bf..244cfd93 100644 --- a/native-views/react-native-chart-webview/package.json +++ b/native-views/react-native-chart-webview/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-chart-webview", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-chart-webview", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-image/package.json b/native-views/react-native-image/package.json index af9843cb..e4e07ac9 100644 --- a/native-views/react-native-image/package.json +++ b/native-views/react-native-image/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-image", - "version": "3.0.139", + "version": "3.0.141", "description": "High-performance native image view for OneKey", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", @@ -81,7 +81,7 @@ "typescript": "^5.9.2" }, "peerDependencies": { - "@onekeyfe/react-native-skeleton": "3.0.139", + "@onekeyfe/react-native-skeleton": "3.0.141", "react": "*", "react-native": "*", "react-native-nitro-modules": "0.37.0" diff --git a/native-views/react-native-native-list/package.json b/native-views/react-native-native-list/package.json index 28281aaa..61138b80 100644 --- a/native-views/react-native-native-list/package.json +++ b/native-views/react-native-native-list/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-native-list", - "version": "3.0.139", + "version": "3.0.141", "description": "Template-driven native RecyclerView and UICollectionView for React Native", "source": "./src/index.ts", "main": "./lib/module/index.js", @@ -83,8 +83,8 @@ "typescript": "^5.9.2" }, "peerDependencies": { - "@onekeyfe/react-native-image": "3.0.139", - "@onekeyfe/react-native-native-logger": "3.0.139", + "@onekeyfe/react-native-image": "3.0.141", + "@onekeyfe/react-native-native-logger": "3.0.141", "react": "*", "react-native": "*", "react-native-nitro-modules": "0.37.0" diff --git a/native-views/react-native-native-sheet/package.json b/native-views/react-native-native-sheet/package.json index d785886a..a3be6713 100644 --- a/native-views/react-native-native-sheet/package.json +++ b/native-views/react-native-native-sheet/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-native-sheet", - "version": "3.0.139", + "version": "3.0.141", "description": "Native bottom sheet host for arbitrary React Native content", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/native-views/react-native-pager-view/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt b/native-views/react-native-pager-view/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt index 565d4ab0..8b541705 100644 --- a/native-views/react-native-pager-view/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt +++ b/native-views/react-native-pager-view/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt @@ -14,6 +14,7 @@ import android.widget.FrameLayout import android.widget.HorizontalScrollView import android.widget.TextView import androidx.core.graphics.ColorUtils +import com.facebook.react.common.assets.ReactFontManager import org.json.JSONArray import org.json.JSONObject import kotlin.math.ceil @@ -46,6 +47,18 @@ private fun parseHeaderItems(value: String?): List.ttf and registered custom fonts; Typeface.create only +// knows system families and silently falls back to the default font. +private fun resolveHeaderTypeface(context: Context, fontFamily: String?): Typeface = + ReactFontManager.getInstance().getTypeface( + fontFamily?.takeIf(String::isNotEmpty) ?: DEFAULT_HEADER_FONT_FAMILY, + Typeface.NORMAL, + context.assets, + ) + private class CollapsiblePagerHorizontalItemsView( context: Context, private val showsProgressIndicator: Boolean, @@ -177,7 +190,7 @@ private class CollapsiblePagerHorizontalItemsView( } private fun applyTypeface() { - val typeface = Typeface.create(fontFamily ?: "sans-serif-medium", Typeface.NORMAL) + val typeface = resolveHeaderTypeface(context, fontFamily) buttons.forEach { button -> button.typeface = typeface button.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize.toFloat()) @@ -452,7 +465,7 @@ internal class CollapsiblePagerNativeSubHeaderView(context: Context) : ViewGroup selectedBackgroundColor, activeTextColor, ) - val typeface = Typeface.create(fontFamily ?: "sans-serif-medium", Typeface.NORMAL) + val typeface = resolveHeaderTypeface(context, fontFamily) listOf(leading, middle, trailing).forEach { label -> label.typeface = typeface label.setTextSize(TypedValue.COMPLEX_UNIT_SP, columnFontSize.toFloat()) diff --git a/native-views/react-native-pager-view/package.json b/native-views/react-native-pager-view/package.json index a89146fe..9150ead8 100644 --- a/native-views/react-native-pager-view/package.json +++ b/native-views/react-native-pager-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-pager-view", - "version": "3.0.139", + "version": "3.0.141", "description": "React Native wrapper for Android and iOS ViewPager", "source": "./src/index.tsx", "main": "./lib/module/index.js", @@ -66,7 +66,7 @@ "typescript": "^5.9.2" }, "peerDependencies": { - "@onekeyfe/react-native-native-logger": "3.0.139", + "@onekeyfe/react-native-native-logger": "3.0.141", "react": "*", "react-native": "*" }, diff --git a/native-views/react-native-perp-depth-bar/package.json b/native-views/react-native-perp-depth-bar/package.json index 37c3f02f..cbd1b6af 100644 --- a/native-views/react-native-perp-depth-bar/package.json +++ b/native-views/react-native-perp-depth-bar/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-perp-depth-bar", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-perp-depth-bar", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-scroll-guard/package.json b/native-views/react-native-scroll-guard/package.json index 895a54cc..fb9c53bd 100644 --- a/native-views/react-native-scroll-guard/package.json +++ b/native-views/react-native-scroll-guard/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-scroll-guard", - "version": "3.0.139", + "version": "3.0.141", "description": "A native view wrapper that prevents parent scrollable containers (PagerView/ViewPager2) from intercepting child scroll gestures", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-segment-slider/package.json b/native-views/react-native-segment-slider/package.json index e0fa5d76..226f1d43 100644 --- a/native-views/react-native-segment-slider/package.json +++ b/native-views/react-native-segment-slider/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-segment-slider", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-segment-slider", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-skeleton/package.json b/native-views/react-native-skeleton/package.json index be86beab..9abd76e7 100644 --- a/native-views/react-native-skeleton/package.json +++ b/native-views/react-native-skeleton/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-skeleton", - "version": "3.0.139", + "version": "3.0.141", "description": "react-native-skeleton", "main": "./lib/module/index.js", "types": "./lib/typescript/src/index.d.ts", diff --git a/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabView.kt b/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabView.kt index 1b9816ae..be8420a3 100644 --- a/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabView.kt +++ b/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabView.kt @@ -20,6 +20,8 @@ import android.view.ViewGroup import android.widget.FrameLayout import android.widget.LinearLayout import android.widget.TextView +import androidx.core.view.ViewCompat +import androidx.core.view.WindowInsetsCompat import androidx.core.view.forEachIndexed import coil3.ImageLoader import coil3.asDrawable @@ -45,15 +47,54 @@ private fun getMaterialContext(context: Context): Context { } class ExtendedBottomNavigationView(context: Context) : BottomNavigationView(getMaterialContext(context)) { + private val basePaddingStart = paddingStart + private val basePaddingTop = paddingTop + private val basePaddingEnd = paddingEnd + private val basePaddingBottom = paddingBottom + private var ignoreBottomInsets = false + private var ignoreKeyboardInsets = true + + init { + // OneKey patch: Material pads the bar with getSystemWindowInsetBottom(), which + // includes the IME height only while the window uses adjustResize (switched on by + // react-native-keyboard-controller hooks), so whether the bar rose above the + // keyboard depended on the screen. Pad for system bars, and add the IME only when + // ignoreKeyboardInsets is turned off. + ViewCompat.setOnApplyWindowInsetsListener(this) { view, insets -> + val barInsets = insets.getInsets( + WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() + ) + val navigationBarBottom = if (ignoreBottomInsets) 0 else barInsets.bottom + val keyboardBottom = if (ignoreKeyboardInsets) { + 0 + } else { + insets.getInsets(WindowInsetsCompat.Type.ime()).bottom + } + val isRtl = view.layoutDirection == View.LAYOUT_DIRECTION_RTL + view.setPaddingRelative( + basePaddingStart + if (isRtl) barInsets.right else barInsets.left, + basePaddingTop, + basePaddingEnd + if (isRtl) barInsets.left else barInsets.right, + basePaddingBottom + maxOf(navigationBarBottom, keyboardBottom), + ) + insets + } + } fun setIgnoreBottomInsets(ignore: Boolean) { - if (ignore) { - setOnApplyWindowInsetsListener { v, insets -> insets } - setPadding(paddingLeft, paddingTop, paddingRight, 0) - } else { - setOnApplyWindowInsetsListener(null) - requestApplyInsets() + if (ignoreBottomInsets == ignore) { + return + } + ignoreBottomInsets = ignore + requestApplyInsets() + } + + fun setIgnoreKeyboardInsets(ignore: Boolean) { + if (ignoreKeyboardInsets == ignore) { + return } + ignoreKeyboardInsets = ignore + requestApplyInsets() } override fun getMaxItemCount(): Int { @@ -106,6 +147,8 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { private var lastReportedSize: Size? = null private var hasCustomAppearance = false private var uiModeConfiguration: Int = Configuration.UI_MODE_NIGHT_UNDEFINED + private var ignoreBottomInsets = false + private var ignoreKeyboardInsets = true private val imageLoader = ImageLoader.Builder(context) .components { @@ -289,9 +332,15 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { } fun setIgnoreBottomInsets(ignore: Boolean) { + ignoreBottomInsets = ignore bottomNavigation.setIgnoreBottomInsets(ignore) } + fun setIgnoreKeyboardInsets(ignore: Boolean) { + ignoreKeyboardInsets = ignore + bottomNavigation.setIgnoreKeyboardInsets(ignore) + } + fun setTabBarHidden(isHidden: Boolean) { if (isHidden) { bottomNavigation.visibility = GONE @@ -576,6 +625,8 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { // We also opt-out of this recreation when custom styles are used. removeView(bottomNavigation) bottomNavigation = ExtendedBottomNavigationView(context) + bottomNavigation.setIgnoreBottomInsets(ignoreBottomInsets) + bottomNavigation.setIgnoreKeyboardInsets(ignoreKeyboardInsets) addView(bottomNavigation) updateItems(items) setLabeled(this.labeled) diff --git a/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabViewManager.kt b/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabViewManager.kt index 7011ae30..1e3bcdf0 100644 --- a/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabViewManager.kt +++ b/native-views/react-native-tab-view/android/src/main/java/com/rcttabview/RCTTabViewManager.kt @@ -193,6 +193,10 @@ class RCTTabViewManager(context: ReactApplicationContext) : view?.setIgnoreBottomInsets(value) } + override fun setIgnoreKeyboardInsets(view: ReactBottomNavigationView?, value: Boolean) { + view?.setIgnoreKeyboardInsets(value) + } + // iOS-only props (no-ops on Android) // selectedIcons feeds UITabBarItem.selectedImage on iOS; Android keeps // swapping the icon in JS via the focusedKey-driven `icons` array. diff --git a/native-views/react-native-tab-view/package.json b/native-views/react-native-tab-view/package.json index 6edf25dd..123c5379 100644 --- a/native-views/react-native-tab-view/package.json +++ b/native-views/react-native-tab-view/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-tab-view", - "version": "3.0.139", + "version": "3.0.141", "description": "Native Bottom Tabs for React Native (UIKit implementation)", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/native-views/react-native-tab-view/src/TabView.tsx b/native-views/react-native-tab-view/src/TabView.tsx index 679c26d3..3f1803f7 100644 --- a/native-views/react-native-tab-view/src/TabView.tsx +++ b/native-views/react-native-tab-view/src/TabView.tsx @@ -190,6 +190,12 @@ interface Props { * Whether to ignore bottom system insets (navigation bar). Android only. */ ignoreBottomInsets?: boolean; + /** + * Whether the tab bar ignores the soft keyboard. Defaults to true, so the + * keyboard covers the tab bar as on iOS. Set to false to pad the tab bar by + * the keyboard height so it rises above the keyboard. Android only. + */ + ignoreKeyboardInsets?: boolean; /** * Whether to delay freeze/unfreeze by 200ms on tab switch. * Defaults to false (immediate freeze). Set to true to restore the diff --git a/native-views/react-native-tab-view/src/TabViewNativeComponent.ts b/native-views/react-native-tab-view/src/TabViewNativeComponent.ts index b9044262..80d5e86a 100644 --- a/native-views/react-native-tab-view/src/TabViewNativeComponent.ts +++ b/native-views/react-native-tab-view/src/TabViewNativeComponent.ts @@ -62,6 +62,7 @@ export interface TabViewProps extends ViewProps { fontWeight?: string; fontSize?: Int32; ignoreBottomInsets?: boolean; + ignoreKeyboardInsets?: WithDefault; } export default codegenNativeComponent('RNCTabView'); diff --git a/native-views/react-native-text-input/package.json b/native-views/react-native-text-input/package.json index 9a6a145c..923fb1e9 100644 --- a/native-views/react-native-text-input/package.json +++ b/native-views/react-native-text-input/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-text-input", - "version": "3.0.139", + "version": "3.0.141", "description": "React Native TextInput with native paste events", "source": "./src/index.tsx", "main": "./lib/module/index.js", diff --git a/native-views/react-native-text/package.json b/native-views/react-native-text/package.json index 81eabfd4..a23e581b 100644 --- a/native-views/react-native-text/package.json +++ b/native-views/react-native-text/package.json @@ -1,6 +1,6 @@ { "name": "@onekeyfe/react-native-text", - "version": "3.0.139", + "version": "3.0.141", "description": "Opt-in native text rendering for React Native", "source": "./src/index.ts", "main": "./lib/module/index.js", diff --git a/yarn.lock b/yarn.lock index 21ee9a03..b20987c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3550,7 +3550,7 @@ __metadata: react-test-renderer: "npm:19.2.3" typescript: "npm:^5.9.2" peerDependencies: - "@onekeyfe/react-native-skeleton": 3.0.139 + "@onekeyfe/react-native-skeleton": 3.0.141 react: "*" react-native: "*" react-native-nitro-modules: 0.37.0 @@ -3651,8 +3651,8 @@ __metadata: react-native-nitro-modules: "npm:0.37.0" typescript: "npm:^5.9.2" peerDependencies: - "@onekeyfe/react-native-image": 3.0.139 - "@onekeyfe/react-native-native-logger": 3.0.139 + "@onekeyfe/react-native-image": 3.0.141 + "@onekeyfe/react-native-native-logger": 3.0.141 react: "*" react-native: "*" react-native-nitro-modules: 0.37.0 @@ -3804,7 +3804,7 @@ __metadata: react-native-builder-bob: "npm:^0.40.13" typescript: "npm:^5.9.2" peerDependencies: - "@onekeyfe/react-native-native-logger": 3.0.139 + "@onekeyfe/react-native-native-logger": 3.0.141 react: "*" react-native: "*" languageName: unknown