Setting a value when maxValue is not 100 gives odd results
JonnoFTW opened this issue · 1 comments
JonnoFTW commented
I have my CPV setup like this:
<at.grabner.circleprogress.CircleProgressView
android:id="@+id/waterLevel"
android:layout_width="277dp"
android:layout_height="277dp"
android:onClick="requestUpdate"
CircleProgressView:cpv_autoTextSize="true"
CircleProgressView:cpv_barColor="@color/primaryColor"
CircleProgressView:cpv_barWidth="35dp"
CircleProgressView:cpv_innerContourSize="0dp"
CircleProgressView:cpv_maxValue="300"
CircleProgressView:cpv_outerContourSize="0dp"
CircleProgressView:cpv_rimColor="@color/primaryLightColor"
CircleProgressView:cpv_rimWidth="35dp"
CircleProgressView:cpv_seekMode="false"
CircleProgressView:cpv_showUnit="true"
CircleProgressView:cpv_spinColor="@color/primaryColor"
CircleProgressView:cpv_textColor="@color/primaryDarkColor"
CircleProgressView:cpv_textScale="1"
CircleProgressView:cpv_unit="mm"
CircleProgressView:cpv_unitColor="@color/primaryLightColor"
CircleProgressView:cpv_unitPosition="right_bottom"
CircleProgressView:cpv_unitScale="1"
CircleProgressView:cpv_value="0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Notice my maxValue
is 300mm. When I call setValue
inside my code like this:
mWaterLevel.setValueAnimated(138, 150);
The CPV looks like this:
Shouldn't the value in the centre say 138
instead of 46
? How can I achieve this? Is it just displaying the value I gave a percentage of maxValue
?
JonnoFTW commented
I had to set:
CircleProgressView:cpv_textMode="Value"
My bad