I have such a image file in my Android drawable folder, but I want to keep the height constant at 150. So I want to do 225/150 instead of 300/200. I tried as follows:
android:width="225dp"
android:height="150dp"
android:viewportWidth="225"
android:viewportHeight="150"
but my image is not shrinking properly. How can I do it? The whole code is as below:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="300dp"
android:height="200dp"
android:viewportWidth="300"
android:viewportHeight="200">
<path
android:fillColor="#FFFFFF"
android:pathData="M0,0h300v200L0,200L0,0z" />
<path
android:fillColor="#006233"
android:pathData="M0,0h150v200L0,200L0,0z" />
<group>
<clip-path android:pathData="M0,0h300v200L0,200L0,0zM162.076,140c22.091,0 40,-17.909 40,-40c0,-22.091 -17.909,-40 -40,-40s-40,17.909 -40,40C122.076,122.091 139.985,140 162.076,140" />
<path
android:fillColor="#D21034"
android:pathData="M150,100m-50,0a50,50 0,1 1,100 0a50,50 0,1 1,-100 0" />
</group>
<path
android:fillColor="#D21034"
android:pathData="M177.951,123.776v-25h-15L177.951,123.776z" />
<path
android:fillColor="#D21034"
android:pathData="M177.951,123.776l-14.694,-20.225l12.135,-8.817L177.951,123.776z" />
<path
android:fillColor="#D21034"
android:pathData="M195.225,100l-23.776,7.726l-4.635,-14.266L195.225,100z" />
<path
android:fillColor="#D21034"
android:pathData="M195.225,100l-23.776,-7.725l-4.635,14.266L195.225,100z" />
<path
android:fillColor="#D21034"
android:pathData="M177.951,76.223v25h-15L177.951,76.223z" />
<path
android:fillColor="#D21034"
android:pathData="M150,114.694l23.776,-7.725l-4.635,-14.266L150,114.694z" />
<path
android:fillColor="#D21034"
android:pathData="M150,114.694l14.694,-20.225l12.135,8.817L150,114.694z" />
<path
android:fillColor="#D21034"
android:pathData="M150,85.305l14.694,20.226l12.135,-8.817L150,85.305z" />
<path
android:fillColor="#D21034"
android:pathData="M150,85.305l23.776,7.726l-4.635,14.266L150,85.305z" />
<path
android:fillColor="#D21034"
android:pathData="M177.951,76.223l-14.694,20.226l12.135,8.817L177.951,76.223z" />
</vector>