I have a layout in which three checkboxes are all located at the same position. Only one of the checkboxes is enabled and visible at a time, depending on other parameters. I'm getting a "cb_xxx <Checkbox> is covered by cb_yyy <Checkbox>" warning because they both occupy the same space, which is understandable.
I know I can just disable or ignore the warning, but it got me wondering if there's a better way to do what I want to do. Thanks!
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=";
xmlns:app=";
xmlns:tools=";
android:id="@+id/main"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
tools:context=".MyActivity"
>
<CheckBox
android:id="@+id/cb_type1"
android:text="Type1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText"
/>
<CheckBox
android:id="@+id/cb_type2"
android:text="Type2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText"
/>
<CheckBox
android:id="@+id/cb_type3"
android:text="Type3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="HardcodedText"
/>
</androidx.constraintlayout.widget.ConstraintLayout>