diff --git a/.changeset/wild-rings-sell.md b/.changeset/wild-rings-sell.md new file mode 100644 index 0000000..9eb93a1 --- /dev/null +++ b/.changeset/wild-rings-sell.md @@ -0,0 +1,5 @@ +--- +"react-native-bottom-tabs": patch +--- + +fix: low resolution svgs on Android diff --git a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt index 0cf9cef..c895fe1 100644 --- a/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt +++ b/packages/react-native-bottom-tabs/android/src/main/java/com/rcttabview/RCTTabView.kt @@ -24,6 +24,9 @@ import coil3.ImageLoader import coil3.asDrawable import coil3.request.ImageRequest import coil3.svg.SvgDecoder +import coil3.size.Precision +import coil3.size.Size as CoilSize +import coil3.size.Scale import com.facebook.react.bridge.ReadableArray import com.facebook.react.common.assets.ReactFontManager import com.facebook.react.modules.core.ReactChoreographer @@ -336,8 +339,12 @@ class ReactBottomNavigationView(context: Context) : LinearLayout(context) { onDrawableReady(it) return } + val iconSizePx = bottomNavigation.itemIconSize val request = ImageRequest.Builder(context) .data(imageSource.getUri(context)) + .size(CoilSize(iconSizePx, iconSizePx)) + .scale(Scale.FILL) + .precision(Precision.EXACT) .target { drawable -> post { val stateDrawable = drawable.asDrawable(context.resources)