I need to fit 4 circular progress bars horizontally, like this:
so I decided to use new material component Circular Progress Indicator (https://material.io/components/progress-indicators/android). I spread chain these 4 progress bar
in constrait layout, but them don't scale. It looks like they are still having deafult 24dp size. Even if I try to hardcode width and height to 200dp for example, the output is still small progress bar.
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progressBarCalories"
style="@style/ProgressBarCircular"
android:layout_marginTop="32dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="6dp"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintTop_toBottomOf="@id/wrapperCookingTime"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/progressBarProtein"
tools:progress="75"/>
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progressBarProtein"
style="@style/ProgressBarCircular"
android:layout_marginTop="32dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintTop_toBottomOf="@id/wrapperCookingTime"
app:layout_constraintStart_toEndOf="@id/progressBarCalories"
app:layout_constraintEnd_toStartOf="@id/progressBarCarbs"
tools:progress="75"/>
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progressBarCarbs"
style="@style/ProgressBarCircular"
android:layout_marginTop="32dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintTop_toBottomOf="@id/wrapperCookingTime"
app:layout_constraintStart_toEndOf="@id/progressBarProtein"
app:layout_constraintEnd_toStartOf="@id/progressBarFat"
tools:progress="75"/>
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progressBarFat"
style="@style/ProgressBarCircular"
android:layout_marginTop="32dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="16dp"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintTop_toBottomOf="@id/wrapperCookingTime"
app:layout_constraintStart_toEndOf="@id/progressBarCarbs"
app:layout_constraintEnd_toEndOf="parent"
tools:progress="75"/>
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progressBar"
style="@style/ProgressBarCircular"
android:layout_marginTop="32dp"
app:layout_constraintWidth_min="200dp"
android:minWidth="200dp"
android:layout_width="200dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/progressBarFat"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:progress="75"/>
question from:
https://stackoverflow.com/questions/65871383/circular-progress-indicator-ignores-width-height-attributes-and-doesnt-scale 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…