How to specify tint as custom attribute on ImageView when using MotionLayout
Clash Royale CLAN TAG#URR8PPP
How to specify tint as custom attribute on ImageView when using MotionLayout
How do I specify a tint color to an imageView as a custom attribute when using MotionLayout. Currently I can only specify a custom background color in my MotionScene
xml file:
MotionScene
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/imageView"
android:layout_width="180dp"
android:layout_height="180dp"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent"
motion:layout_constraintVertical_bias="0.75"
motion:srcCompat="@drawable/ic_android_black_24dp" >
<CustomAttribute
motion:attributeName="backgroundColor"
motion:customColorValue="#9999FF" />
</Constraint>
</ConstraintSet>
1 Answer
1
Since tint takes a color value, it should be almost identical to backgroundColor
backgroundColor
<CustomAttribute
motion:attributeName="tint"
motion:customColorValue="@color/your_tint_color" />
<CustomAttribute
motion:attributeName="tint"
motion:customColorValue="@color/your_tint_color" />
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.