Skip to content

Commit

Permalink
style: ktfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarinibruno committed Dec 19, 2024
1 parent a77620f commit 56df919
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
28 changes: 14 additions & 14 deletions app/src/main/java/com/android/periodpals/ui/alert/AlertLists.kt
Original file line number Diff line number Diff line change
Expand Up @@ -209,31 +209,31 @@ fun AlertListsScreen(
context = context,
currentRadius = radiusInMeters,
location = selectedLocation,
product = productFilter?.let { productToPeriodPalsIcon(it).textId }
?: FILTERS_NO_PREFERENCE_TEXT,
product =
productFilter?.let { productToPeriodPalsIcon(it).textId }
?: FILTERS_NO_PREFERENCE_TEXT,
urgency =
urgencyFilter?.let {
urgencyToPeriodPalsIcon(it).textId
} ?: FILTERS_NO_PREFERENCE_TEXT,
urgencyFilter?.let { urgencyToPeriodPalsIcon(it).textId }
?: FILTERS_NO_PREFERENCE_TEXT,
onDismiss = { showFilterDialog = false },
onLocationSelected = { selectedLocation = it },
onSave = { radius, product, urgency ->
radiusInMeters = radius
productFilter = stringToProduct(product)
urgencyFilter = stringToUrgency(urgency)
isFilterApplied =
(radius != 100.0) ||
(productFilter != Product.NO_PREFERENCE) ||
(urgencyFilter != null)
(radius != 100.0) ||
(productFilter != Product.NO_PREFERENCE) ||
(urgencyFilter != null)

selectedLocation?.let {
alertViewModel.fetchAlertsWithinRadius(
location = it,
radius = radiusInMeters,
onSuccess = {
Log.d(TAG, "Successfully fetched alerts within radius: $radiusInMeters")
},
onFailure = { e -> Log.e(TAG, "Error fetching alerts within radius", e) })
location = it,
radius = radiusInMeters,
onSuccess = {
Log.d(TAG, "Successfully fetched alerts within radius: $radiusInMeters")
},
onFailure = { e -> Log.e(TAG, "Error fetching alerts within radius", e) })
} ?: Log.d(TAG, "Selected location is null")

// if a product filter was selected, show only alerts with said product marked as needed
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/android/periodpals/ui/map/Map.kt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ fun MapScreen(
onFailure = { e -> Log.e(TAG, "Error fetching alerts within radius", e) })
} ?: Log.d(TAG, "Selected location is null")

// if a product filter was selected, show only alerts with said product marked as needed
// if a product filter was selected, show only alerts with said product marked as
// needed
// (or alerts with no product preference)
// if an urgency filter was selected, show only alerts with said urgency
alertViewModel.setFilter {
Expand Down

0 comments on commit 56df919

Please sign in to comment.