How to specify tint as custom attribute on ImageView when using MotionLayout

The name of the pictureThe name of the pictureThe name of the pictureClash 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.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS