switch_with_description.xml (2360B)
1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- This Source Code Form is subject to the terms of the Mozilla Public 3 - License, v. 2.0. If a copy of the MPL was not distributed with this 4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 5 <androidx.constraintlayout.widget.ConstraintLayout 6 xmlns:android="http://schemas.android.com/apk/res/android" 7 xmlns:app="http://schemas.android.com/apk/res-auto" 8 xmlns:tools="http://schemas.android.com/tools" 9 android:layout_width="match_parent" 10 android:layout_height="match_parent"> 11 12 <TextView 13 android:id="@+id/title" 14 style="@style/SwitchTitle" 15 android:layout_width="0dp" 16 android:layout_height="wrap_content" 17 android:layout_marginStart="44dp" 18 android:layout_marginTop="4dp" 19 android:layout_marginEnd="64dp" 20 android:clickable="false" 21 android:focusable="false" 22 android:importantForAccessibility="no" 23 app:layout_constraintBottom_toTopOf="@id/description" 24 app:layout_constraintEnd_toEndOf="parent" 25 app:layout_constraintStart_toStartOf="parent" 26 app:layout_constraintTop_toTopOf="parent" 27 app:layout_constraintVertical_chainStyle="packed" 28 tools:text="Title" /> 29 30 <TextView 31 android:id="@+id/description" 32 style="@style/SwitchDescription" 33 android:layout_width="0dp" 34 android:layout_height="wrap_content" 35 android:layout_marginBottom="4dp" 36 android:clickable="false" 37 android:focusable="false" 38 android:importantForAccessibility="no" 39 app:layout_constraintBottom_toBottomOf="parent" 40 app:layout_constraintEnd_toEndOf="@id/title" 41 app:layout_constraintStart_toStartOf="@id/title" 42 app:layout_constraintTop_toBottomOf="@id/title" 43 app:layout_constraintVertical_chainStyle="packed" 44 tools:text="Description" /> 45 46 <com.google.android.material.switchmaterial.SwitchMaterial 47 android:id="@+id/switch_widget" 48 android:theme="@style/SwitchTheme" 49 android:layout_width="match_parent" 50 android:layout_height="match_parent" 51 app:layout_constraintBottom_toBottomOf="@id/description" 52 app:layout_constraintEnd_toEndOf="parent" 53 app:layout_constraintTop_toTopOf="parent" /> 54 </androidx.constraintlayout.widget.ConstraintLayout>