Skip to content

Commit

Permalink
chore: use dimension for most layout distances (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
khwolf authored Jan 3, 2024
1 parent 41bdc8f commit 96a334e
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 174 deletions.
8 changes: 4 additions & 4 deletions app/src/main/res/layout/add_app_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
android:id="@+id/add_app_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/margin_top_small"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
tools:context=".ui.options.AddAppFragment">

<EditText
Expand Down Expand Up @@ -40,7 +40,7 @@
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="@dimen/margin_top_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/add_app_fragment_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:id="@+id/aa_list_item_app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:padding="@dimen/padding"
android:stateListAnimator="@xml/animate_scale"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="@dimen/font_size_apps_list_item">
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/app_drawer_fragment_header_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:padding="6dp"
android:padding="@dimen/padding"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textSize="@dimen/font_size_customize_group_header"
tools:text="A" />

<View
android:id="@+id/divider"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_marginStart="@dimen/margin_sides_small"
android:layout_marginEnd="@dimen/margin_sides_small"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/customise_apps_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
android:id="@+id/customise_apps_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/margin_top_small"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
tools:context=".ui.options.CustomiseAppsFragment">

<ImageView
android:id="@+id/customise_apps_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:padding="@dimen/padding"
android:paddingStart="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -36,7 +36,7 @@
android:id="@+id/customise_apps_fragment_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
android:layout_marginTop="@dimen/margin_top_small"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -48,7 +48,7 @@
android:id="@+id/customise_apps_fragment_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginBottom="@dimen/margin_bottom_small"
android:padding="@dimen/_12sdp"
android:text="@string/customise_apps_fragment_add"
android:textAppearance="@style/TextAppearance.AppCompat"
Expand All @@ -59,7 +59,7 @@
android:id="@+id/customise_apps_fragment_remove_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginBottom="@dimen/margin_bottom_small"
android:text="@string/customise_apps_fragment_remove_all"
android:padding="@dimen/_12sdp"
android:textSize="@dimen/font_size_add_apps_action"
Expand Down
14 changes: 6 additions & 8 deletions app/src/main/res/layout/customise_apps_fragment_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp">
android:layout_marginTop="@dimen/margin_top_small"
android:layout_marginBottom="@dimen/margin_bottom_small">

<TextView
android:id="@+id/ca_list_item_drag_handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:paddingStart="12dp"
android:paddingLeft="12dp"
android:paddingEnd="12dp"
android:paddingRight="12dp"
android:padding="@dimen/padding"
android:paddingStart="@dimen/padding"
android:paddingEnd="@dimen/padding"
android:text="="
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="@dimen/font_size_customize_apps_list_item"
Expand All @@ -42,7 +40,7 @@
android:id="@+id/ca_list_item_more_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:padding="@dimen/padding"
app:layout_constraintBottom_toBottomOf="@+id/ca_list_item_app_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/ca_list_item_app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
android:id="@+id/customize_app_drawer_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
android:layout_marginTop="@dimen/margin_top_small"
tools:context=".ui.options.CustomizeAppDrawerFragment">

<ImageView
android:id="@+id/customize_app_drawer_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:padding="@dimen/padding"
android:paddingStart="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -37,7 +37,7 @@
android:id="@+id/customize_app_drawer_fragment_app_list"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="@dimen/_16sdp"
android:layout_marginTop="@dimen/margin_top"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -50,7 +50,7 @@
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginTop="@dimen/margin_top_small"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/customize_app_drawer_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
android:id="@+id/customize_app_drawer_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
android:layout_marginTop="@dimen/margin_top_small"
tools:context=".ui.options.CustomizeAppDrawerFragment">

<ImageView
android:id="@+id/customize_app_drawer_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:padding="@dimen/padding"
android:paddingStart="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -37,7 +37,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/margin_list_items"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides_small"
android:overScrollMode="ifContentScrolls"
android:scrollbars="none"
app:layout_constraintTop_toBottomOf="@id/customize_app_drawer_title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
android:id="@+id/customize_app_drawer_fragment_app_list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="6dp"
android:padding="@dimen/padding"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="@dimen/font_size_visible_app_list_item" />
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/customize_app_drawer_fragment_search_field_options"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
android:layout_marginTop="@dimen/margin_top_small"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.options.CustomizeSearchFieldFragment">
Expand All @@ -14,7 +14,7 @@
android:id="@+id/customise_apps_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:padding="@dimen/padding"
android:paddingStart="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -36,8 +36,8 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/_16sdp"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginTop="@dimen/margin_top"
android:layout_marginStart="@dimen/margin_sides_small"
android:overScrollMode="ifContentScrolls"
android:scrollbars="none"
app:layout_constraintTop_toBottomOf="@id/customise_apps_fragment_title">
Expand Down
24 changes: 12 additions & 12 deletions app/src/main/res/layout/customize_quick_buttons_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
android:id="@+id/customize_quick_buttons_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
android:layout_marginTop="@dimen/margin_top_small"
tools:context=".ui.options.CustomizeQuickButtonsFragment">

<ImageView
android:id="@+id/customize_quick_buttons_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:padding="@dimen/padding"
android:paddingStart="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -36,9 +36,9 @@
android:id="@+id/customize_quick_buttons_fragment_left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginBottom="@dimen/_8sdp"
android:padding="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides_small"
android:layout_marginBottom="@dimen/margin_bottom_small"
android:padding="@dimen/padding"
android:background="@layout/imageview_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -48,9 +48,9 @@
android:id="@+id/customize_quick_buttons_fragment_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/_8sdp"
android:layout_marginBottom="@dimen/margin_bottom_small"
android:alpha="1"
android:padding="@dimen/_8sdp"
android:padding="@dimen/padding"
android:background="@layout/imageview_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/customize_quick_buttons_fragment_right"
Expand All @@ -61,9 +61,9 @@
android:id="@+id/customize_quick_buttons_fragment_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/_8sdp"
android:layout_marginBottom="@dimen/_8sdp"
android:padding="@dimen/_8sdp"
android:layout_marginEnd="@dimen/margin_sides_small"
android:layout_marginBottom="@dimen/margin_bottom_small"
android:padding="@dimen/padding"
android:background="@layout/imageview_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
15 changes: 7 additions & 8 deletions app/src/main/res/layout/home_fragment_content.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="@dimen/margin_sides_small"
android:layout_marginEnd="@dimen/margin_sides_small"
tools:showIn="@layout/home_fragment_default">


<EditText
android:id="@+id/app_drawer_edit_text"
android:padding="@dimen/padding"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginTop="@dimen/margin_top_large"
android:ems="10"
android:hint="@string/add_apps_fragment_search_apps"
android:imeOptions="actionDone"
Expand All @@ -26,23 +25,23 @@
android:id="@+id/home_fragment_call"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8sdp"
android:padding="@dimen/padding"
app:srcCompat="@drawable/ic_call"
tools:ignore="ContentDescription" />

<ImageView
android:id="@+id/home_fragment_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8sdp"
android:padding="@dimen/padding"
app:srcCompat="@drawable/ic_photo_camera"
tools:ignore="ContentDescription" />

<ImageView
android:id="@+id/home_fragment_options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8sdp"
android:padding="@dimen/padding"
app:srcCompat="@drawable/ic_cog"
tools:ignore="ContentDescription" />

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/main_fragment_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
android:id="@+id/home_fragment_list_item_app_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:padding="12dp"
android:layout_marginTop="@dimen/margin_list_items_top"
android:layout_marginBottom="@dimen/margin_list_items_top"
android:padding="@dimen/padding"
android:stateListAnimator="@xml/animate_scale"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textSize="@dimen/font_size_home_app_list_item">
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/options_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/options_fragment"
android:layout_marginStart="@dimen/_16sdp"
android:layout_marginEnd="@dimen/_16sdp"
android:layout_marginTop="@dimen/_8sdp"
android:layout_marginStart="@dimen/margin_sides"
android:layout_marginEnd="@dimen/margin_sides"
android:layout_marginTop="@dimen/margin_top_small"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.options.OptionsFragment">
Expand All @@ -14,8 +14,8 @@
android:id="@+id/options_fragment_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_8ssp"
android:paddingStart="0dp"
android:padding="@dimen/padding"
android:paddingStart="0px"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/ic_back"
Expand All @@ -36,8 +36,8 @@
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="@dimen/_16sdp"
android:layout_marginStart="@dimen/_8sdp"
android:layout_marginTop="@dimen/margin_top"
android:layout_marginStart="@dimen/margin_sides_small"
android:overScrollMode="ifContentScrolls"
android:scrollbars="none"
app:layout_constraintTop_toBottomOf="@+id/options_fragment_title" >
Expand Down
Loading

0 comments on commit 96a334e

Please sign in to comment.