Skip to content

Commit

Permalink
Remove all linear layouts from tools fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
kylecorry31 committed Nov 12, 2023
1 parent 34c17f5 commit 2f974a1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ class ToolsFragment : BoundFragment<FragmentToolsBinding>() {
if (filter.isNullOrBlank()) {
binding.pinned.isVisible = true
binding.pinnedTitle.isVisible = true
binding.pinnedEditBtn.isVisible = true
} else {
binding.pinned.isVisible = false
binding.pinnedTitle.isVisible = false
binding.pinnedEditBtn.isVisible = false
}

val tools = if (filter.isNullOrBlank()) {
Expand Down
94 changes: 44 additions & 50 deletions app/src/main/res/layout/fragment_tools.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,30 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">

<LinearLayout
<TextView
android:id="@+id/pinned_title"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:text="@string/pinned"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" />

<ImageButton
android:id="@+id/pinned_edit_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:backgroundTint="@android:color/transparent"
app:srcCompat="@drawable/ic_edit"
app:tint="?android:textColorSecondary" />

</LinearLayout>
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:text="@string/pinned"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
app:layout_constraintEnd_toStartOf="@id/pinned_edit_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageButton
android:id="@+id/pinned_edit_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@id/pinned_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/pinned_title"
app:srcCompat="@drawable/ic_edit"
app:tint="?android:textColorSecondary" />


<androidx.gridlayout.widget.GridLayout
Expand All @@ -89,34 +86,31 @@
app:layout_constraintTop_toBottomOf="@id/pinned_title"
app:useDefaultMargins="false" />

<LinearLayout
<TextView
android:id="@+id/tools_title"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@id/pinned">

<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:text="@string/tools"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" />

<ImageButton
android:id="@+id/sort_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:backgroundTint="@android:color/transparent"
app:srcCompat="@drawable/sort_ascending"
app:tint="?android:textColorSecondary" />

</LinearLayout>
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:text="@string/tools"
android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
app:layout_constraintEnd_toStartOf="@id/sort_btn"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/pinned" />

<ImageButton
android:id="@+id/sort_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:backgroundTint="@android:color/transparent"
app:layout_constraintBottom_toBottomOf="@id/tools_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tools_title"
app:srcCompat="@drawable/sort_ascending"
app:tint="?android:textColorSecondary" />

<androidx.gridlayout.widget.GridLayout
android:id="@+id/tools"
Expand Down

0 comments on commit 2f974a1

Please sign in to comment.