diff --git a/android/src/main/java/com/rcttabview/RCTTabView.kt b/android/src/main/java/com/rcttabview/RCTTabView.kt index 1b062071..2245f4af 100644 --- a/android/src/main/java/com/rcttabview/RCTTabView.kt +++ b/android/src/main/java/com/rcttabview/RCTTabView.kt @@ -4,7 +4,6 @@ import android.annotation.SuppressLint import android.content.Context import android.content.res.ColorStateList import android.graphics.Typeface -import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.ColorDrawable import android.graphics.drawable.Drawable import android.os.Build @@ -17,6 +16,7 @@ import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.appcompat.content.res.AppCompatResources +import com.bumptech.glide.Glide import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.request.RequestListener @@ -177,7 +177,7 @@ class ReactBottomNavigationView(context: Context) : BottomNavigationView(context @SuppressLint("CheckResult") private fun getDrawable(imageSource: ImageSource, onDrawableReady: (Drawable?) -> Unit) { - GlideApp.with(context) + Glide.with(context) .`as`(Drawable::class.java) .load(imageSource.uri) .listener(object : RequestListener { diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index ede40c18..804b13df 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1209,7 +1209,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-bottom-tabs (0.4.0): + - react-native-bottom-tabs (0.5.0): - DoubleConversion - glog - RCT-Folly (= 2024.01.01.00) @@ -1222,7 +1222,7 @@ PODS: - React-graphics - React-ImageManager - React-jsi - - react-native-bottom-tabs/common (= 0.4.0) + - react-native-bottom-tabs/common (= 0.5.0) - React-NativeModulesApple - React-RCTFabric - React-rendererdebug @@ -1230,11 +1230,11 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - SDWebImage (~> 5.11.1) - - SDWebImageSVGCoder (~> 1.7.0) + - SDWebImage (>= 5.19.1) + - SDWebImageSVGCoder (>= 1.7.0) - SwiftUIIntrospect (~> 1.0) - Yoga - - react-native-bottom-tabs/common (0.4.0): + - react-native-bottom-tabs/common (0.5.0): - DoubleConversion - glog - RCT-Folly (= 2024.01.01.00) @@ -1254,8 +1254,8 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - SDWebImage (~> 5.11.1) - - SDWebImageSVGCoder (~> 1.7.0) + - SDWebImage (>= 5.19.1) + - SDWebImageSVGCoder (>= 1.7.0) - SwiftUIIntrospect (~> 1.0) - Yoga - react-native-safe-area-context (4.11.0): @@ -1681,9 +1681,9 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - SDWebImage (5.11.1): - - SDWebImage/Core (= 5.11.1) - - SDWebImage/Core (5.11.1) + - SDWebImage (5.20.0): + - SDWebImage/Core (= 5.20.0) + - SDWebImage/Core (5.20.0) - SDWebImageSVGCoder (1.7.0): - SDWebImage/Core (~> 5.6) - SocketRocket (0.7.0) @@ -1945,7 +1945,7 @@ SPEC CHECKSUMS: React-logger: 4072f39df335ca443932e0ccece41fbeb5ca8404 React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4 React-microtasksnativemodule: 2eb1a69d35e700f752944644c0295cf7161d06c5 - react-native-bottom-tabs: 930f7bdb6e9122a519f7a50a83908e6fe04090e6 + react-native-bottom-tabs: fde2fbce1c50e4df9288e0d4f983301e02e88d81 react-native-safe-area-context: c6e59b0ac0acb3ddc3247235215775441ca1b2ff React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9 React-NativeModulesApple: 651670a799672bd54469f2981d91493dda361ddf @@ -1978,12 +1978,12 @@ SPEC CHECKSUMS: RNGestureHandler: 6a34af1ea5d9321af615933c271b0c37a00ff473 RNScreens: d4551ceaec50b2fd6648e36d2e47dd42ef9ccfef RNVectorIcons: a1344e212e80e6e0f4537a9960148201175f4225 - SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d + SDWebImage: 73c6079366fea25fa4bb9640d5fb58f0893facd8 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d SwiftUIIntrospect: fee9aa07293ee280373a591e1824e8ddc869ba5d Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63 -PODFILE CHECKSUM: ec8970ff5a624fb462d3b2cd6e966645a41c4daa +PODFILE CHECKSUM: 1c1dbca3e400ef935aa9a150cb2dcb58fb8c4536 COCOAPODS: 1.15.2 diff --git a/ios/TabViewImpl.swift b/ios/TabViewImpl.swift index 693733b6..270fea30 100644 --- a/ios/TabViewImpl.swift +++ b/ios/TabViewImpl.swift @@ -84,9 +84,6 @@ struct TabViewImpl: View { .introspectTabView(closure: { tabController in tabBar = tabController.tabBar }) - .onChange(of: tabBar) { newValue in - updateTabBarAppearance(props: props, tabBar: tabBar) - } .configureAppearance(props: props, tabBar: tabBar) .tintColor(props.selectedActiveTintColor) .getSidebarAdaptable(enabled: props.sidebarAdaptable ?? false) @@ -130,6 +127,7 @@ struct TabViewImpl: View { .tabBadge(tabData?.badge) #if os(iOS) .onAppear { + updateTabBarAppearance(props: props, tabBar: tabBar) guard index >= 4, let key = tabData?.key, props.selectedPage != key else { return } diff --git a/ios/TabViewProvider.swift b/ios/TabViewProvider.swift index 11ea934a..1ccee0f3 100644 --- a/ios/TabViewProvider.swift +++ b/ios/TabViewProvider.swift @@ -215,7 +215,8 @@ import SDWebImageSVGCoder } let context: [SDWebImageContextOption: Any]? = isSVG ? [ - .imageThumbnailPixelSize: iconSize + .imageThumbnailPixelSize: iconSize, + .imagePreserveAspectRatio: true ] : nil SDWebImageManager.shared.loadImage( @@ -227,11 +228,7 @@ import SDWebImageSVGCoder guard let self = self else { return } DispatchQueue.main.async { if let image { - if isSVG { - self.props.icons[index] = image - } else { - self.props.icons[index] = image.resizeImageTo(size: self.iconSize) - } + self.props.icons[index] = image.resizeImageTo(size: self.iconSize) } } } diff --git a/react-native-bottom-tabs.podspec b/react-native-bottom-tabs.podspec index 94cde62b..9fc6ac04 100644 --- a/react-native-bottom-tabs.podspec +++ b/react-native-bottom-tabs.podspec @@ -26,8 +26,8 @@ Pod::Spec.new do |s| end s.dependency "SwiftUIIntrospect", '~> 1.0' - s.dependency 'SDWebImage', '~> 5.11.1' - s.dependency 'SDWebImageSVGCoder', '~> 1.7.0' + s.dependency 'SDWebImage', '>= 5.19.1' + s.dependency 'SDWebImageSVGCoder', '>= 1.7.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES'