I have a kind of simple donut chart gradually colored. I want this donut be faded depending on a value. For example if the value is 35 then 35 % of my donut would be not faded and 65 % would be faded. I don't want any animation.
This is an example of what I want to achieve :
The code for the donut without the masking feature :
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/donut"
android:layout_alignTop="@+id/imageView"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"/>
You could also use some masking in combination with a semi-transparent image using the following steps.
This will leave you with a partly faded donut following the same contours as the original.
I am sorry I don't have any masking-code at hand, but these steps would accomplish the desired result.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments