Issue
Here's my button:
<com.rey.material.widget.Button
android:id="@+id/joinOccasionBTN"
style="@style/Material.Drawable.Ripple.Wave.Light"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableStart="@drawable/ic_envelope"
android:drawablePadding="2dp"
android:gravity="center"
android:onClick="goToOccasion"
android:padding="20dp"
android:text="@string/join"
app:rd_enable="true"
app:rd_rippleType="wave" />
Here's ic_envelope
:
<vector android:height="24dp" android:viewportHeight="58.0"
android:viewportWidth="58.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#E95853" android:pathData="M27.14,0.73L0,26v0.04h58v-0.04L30.86,0.73C29.81,-0.24 28.19,-0.24 27.14,0.73z"/>
<path android:fillColor="#C64645" android:pathData="M0,26.04h58v31.96h-58z"/>
<path android:fillColor="#D75A4A" android:pathData="M0.09,26.05l57.51,31.71c-0.03,0.13 -0.03,0.11 -0.06,0.24H0.13C0.06,58 0,57.94 0,57.87l0,-31.77C0,26.06 0.05,26.03 0.09,26.05z"/>
<path android:fillColor="#ED7161" android:pathData="M57.91,26.05L29,41.99l28.6,15.77c-0.03,0.13 -0.03,0.11 -0.06,0.24h0.33C57.94,58 58,57.94 58,57.87V26.1C58,26.06 57.95,26.03 57.91,26.05z"/>
And finally the error:
Binary XML file line #1: invalid drawable tag vector
Which occurs on setting the layout How can I fix this?
Solution
Apparently, drawableStart
doesn't work with Vectors on pre-lollipop; which crashed my app. Removing that was the solution for me and the only solution since the only way to use them are with app:srcCompat
and setImageResource()
, which doesn't work for drawableX
.
Answered By - Ali Bdeir
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.