I have a bar that should have a height according to the viewmodel.heartStrengthLiveData value (0..100). I want to set height with app:layout_constraintHeight_percent="..." with databinding.
How can i do this?
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/heart_strength_bgc"
android:layout_width="@dimen/cardiogram_status_bar_width"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/default_screen_margin"
android:background="@drawable/chart_widget_background_dark_gray"
app:layout_constraintBottom_toBottomOf="@+id/cardiogram_background_light"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/cardiogram_background_light" >
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/heart_strength"
android:layout_width="0dp"
android:layout_height="0dp"
app:heartStrength="@{viewmodel.heartStrengthLiveData}"
android:background="@drawable/chart_widget_background_light_gray"
android:backgroundTint="@color/turquoise"
app:layout_constraintHeight_percent="0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
