define widths in dimens.xml

This commit is contained in:
Luke Wass 2025-06-08 10:51:31 -05:00
parent 15f1cb5b48
commit 02cb846067
9 changed files with 34 additions and 33 deletions

View file

@ -94,7 +94,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pin_shortcut_label" app:layout_constraintTop_toBottomOf="@id/pin_shortcut_label"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<Button <Button
android:id="@+id/pin_shortcut_button_bind" android:id="@+id/pin_shortcut_button_bind"
@ -105,7 +105,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pin_shortcut_switch_visible" app:layout_constraintTop_toBottomOf="@id/pin_shortcut_switch_visible"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
@ -120,6 +120,6 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -43,14 +43,12 @@
android:id="@+id/button_container" android:id="@+id/button_container"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="320dp"
app:layout_constraintWidth_min="320dp"
app:layout_constraintWidth_default="wrap"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
app:layout_constraintTop_toBottomOf="@id/crash_info_text" android:maxWidth="@dimen/max_button_width"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/crash_info_text">
<Button <Button
android:id="@+id/report_crash_button_copy" android:id="@+id/report_crash_button_copy"
@ -58,9 +56,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:minHeight="48dp"
android:text="@string/report_crash_button_copy" android:text="@string/report_crash_button_copy"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<Button <Button
android:id="@+id/report_crash_button_mail" android:id="@+id/report_crash_button_mail"
@ -68,9 +67,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:minHeight="48dp"
android:text="@string/report_crash_button_mail" android:text="@string/report_crash_button_mail"
app:layout_constraintTop_toBottomOf="@id/report_crash_button_copy" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintTop_toBottomOf="@id/report_crash_button_copy" />
<Button <Button
android:id="@+id/report_crash_button_report" android:id="@+id/report_crash_button_report"
@ -78,10 +77,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="48dp" android:minHeight="48dp"
android:text="@string/report_crash_button_report" android:text="@string/report_crash_button_report"
app:layout_constraintTop_toBottomOf="@id/report_crash_button_mail" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" /> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/report_crash_button_mail" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -23,7 +23,7 @@
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" app:layout_constraintWidth_max="@dimen/max_button_width"
tools:text="#ffbb00" /> tools:text="#ffbb00" />
<TextView <TextView
@ -34,7 +34,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_select_color_preview" app:layout_constraintTop_toBottomOf="@id/dialog_select_color_preview"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<SeekBar <SeekBar
android:id="@+id/dialog_select_color_seekbar_alpha" android:id="@+id/dialog_select_color_seekbar_alpha"
@ -45,7 +45,7 @@
app:layout_constraintTop_toBottomOf="@id/label_alpha" app:layout_constraintTop_toBottomOf="@id/label_alpha"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<TextView <TextView
android:id="@+id/label_red" android:id="@+id/label_red"
@ -55,7 +55,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_alpha" app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_alpha"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<SeekBar <SeekBar
android:id="@+id/dialog_select_color_seekbar_red" android:id="@+id/dialog_select_color_seekbar_red"
@ -66,7 +66,7 @@
app:layout_constraintTop_toBottomOf="@id/label_red" app:layout_constraintTop_toBottomOf="@id/label_red"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<TextView <TextView
android:id="@+id/label_green" android:id="@+id/label_green"
@ -76,7 +76,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_red" app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_red"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<SeekBar <SeekBar
android:id="@+id/dialog_select_color_seekbar_green" android:id="@+id/dialog_select_color_seekbar_green"
@ -87,7 +87,7 @@
app:layout_constraintTop_toBottomOf="@id/label_green" app:layout_constraintTop_toBottomOf="@id/label_green"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<TextView <TextView
android:id="@+id/label_blue" android:id="@+id/label_blue"
@ -97,7 +97,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_green" app:layout_constraintTop_toBottomOf="@id/dialog_select_color_seekbar_green"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<SeekBar <SeekBar
android:id="@+id/dialog_select_color_seekbar_blue" android:id="@+id/dialog_select_color_seekbar_blue"
@ -109,6 +109,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -42,7 +42,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_report_bug_device_info" app:layout_constraintTop_toBottomOf="@id/dialog_report_bug_device_info"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
<TextView <TextView
android:id="@+id/dialog_report_bug_security_info" android:id="@+id/dialog_report_bug_security_info"
@ -66,7 +66,7 @@
app:layout_constraintTop_toBottomOf="@id/dialog_report_bug_security_info" app:layout_constraintTop_toBottomOf="@id/dialog_report_bug_security_info"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintWidth_max="320dp" /> app:layout_constraintWidth_max="@dimen/max_button_width" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -24,7 +24,7 @@
<Button <Button
android:id="@+id/dialog_select_lock_method_button_device_admin" android:id="@+id/dialog_select_lock_method_button_device_admin"
android:text="@string/screen_lock_method_use_device_admin" android:text="@string/screen_lock_method_use_device_admin"
android:layout_width="320dp" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:minHeight="48dp" android:minHeight="48dp"
android:layout_marginBottom="12dp" /> android:layout_marginBottom="12dp" />
@ -32,7 +32,7 @@
<Button <Button
android:id="@+id/dialog_select_lock_method_button_accessibility" android:id="@+id/dialog_select_lock_method_button_accessibility"
android:text="@string/screen_lock_method_use_accessibility" android:text="@string/screen_lock_method_use_accessibility"
android:layout_width="320dp" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:minHeight="48dp" /> android:minHeight="48dp" />

View file

@ -36,8 +36,8 @@
android:id="@+id/bottomBar" android:id="@+id/bottomBar"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxWidth="600dp" android:maxWidth="@dimen/max_search_bar_width"
app:layout_constraintWidth_max="600dp" app:layout_constraintWidth_max="@dimen/max_search_bar_width"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"

View file

@ -28,7 +28,7 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintWidth_max="320dp"> app:layout_constraintWidth_max="@dimen/max_button_width">
<LinearLayout <LinearLayout
android:id="@+id/settings_actions_buttons" android:id="@+id/settings_actions_buttons"

View file

@ -18,7 +18,7 @@
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minWidth="320dp" android:minWidth="@dimen/max_button_width"
android:orientation="vertical"> android:orientation="vertical">
<Button <Button

View file

@ -2,4 +2,6 @@
<!-- Default screen margins, per the Android Design guidelines. --> <!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="appbar_padding">16dp</dimen> <dimen name="appbar_padding">16dp</dimen>
<dimen name="app_icon_side">40dip</dimen> <dimen name="app_icon_side">40dip</dimen>
<dimen name="max_button_width">400dp</dimen>
<dimen name="max_search_bar_width">600dp</dimen>
</resources> </resources>