Skip to content

Commit

Permalink
fixes: on layouts ui
Browse files Browse the repository at this point in the history
  • Loading branch information
muindi.stephen committed Apr 16, 2024
1 parent 8c099e8 commit 9a9b715
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CropCycleTasksListFragment : Fragment() {
toast("Enter some text in order to search")
false
}
filterCycles(searchText)
searching(searchText)
true
} else {
false
Expand Down Expand Up @@ -161,6 +161,10 @@ class CropCycleTasksListFragment : Fragment() {
})
}

private fun searching(s: String) {
val filteredList = cycleList.filter { it.farmId.equals(s, ignoreCase = true) }
cycleListAdapter.submitList(filteredList.toMutableList())
}
private fun filterCycles(s: String) {
val filteredList = cycleList.filter { it.type.equals(s, ignoreCase = true) }
cycleListAdapter.submitList(filteredList.toMutableList())
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/fragment_detailed_farm_cycle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="18dp"
android:layout_marginTop="105dp"
android:layout_marginTop="125dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -87,7 +87,7 @@
android:background="@drawable/custom_cell"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textSize="11sp"
android:textColor="@color/black"
Expand All @@ -103,7 +103,7 @@
android:layout_marginStart="0dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textStyle="bold"
android:textColor="@color/black"
Expand All @@ -122,7 +122,7 @@
android:text="End Date"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="8dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textStyle="bold"
android:textSize="11sp"
Expand Down

0 comments on commit 9a9b715

Please sign in to comment.