From b01b2f9bf74ca7886e00a451ed24fcca4f7fd257 Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Wed, 22 Oct 2025 19:06:52 +0200 Subject: [PATCH] feat(android): allow VectorDrawables in ImageView --- .../java/ti/modules/titanium/ui/widget/TiUIImageView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIImageView.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIImageView.java index 70aa2a6d7a3..be21794b49a 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIImageView.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIImageView.java @@ -34,6 +34,7 @@ import ti.modules.titanium.ui.ImageViewProxy; import android.app.Activity; import android.graphics.Bitmap; +import android.graphics.drawable.VectorDrawable; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -664,7 +665,10 @@ private void setImageInternal() if (imageSources.size() == 1) { TiDrawableReference imageref = imageSources.get(0); - + if (imageref.getDrawable() instanceof VectorDrawable) { + view.setBackground(imageref.getDrawable()); + return; + } // Check if the image is cached in memory var key = imageref.getKey(); Bitmap bitmap = TiImageCache.getBitmap(key);