Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ class AppHelper @Inject constructor() {
}
}

fun getGravityFromSelectedItem(selectedItem: String): Int {
fun getGravityFromSelectedItem(selectedItem: Int): Int {
return when (selectedItem) {
"Left" -> Gravity.START
"Center" -> Gravity.CENTER
"Right" -> Gravity.END
0 -> Gravity.START
1 -> Gravity.CENTER
2 -> Gravity.END
else -> Gravity.START
}
}
Expand Down Expand Up @@ -387,4 +387,4 @@ class AppHelper @Inject constructor() {

// Data class to hold cached weather data along with timestamp
data class CachedWeatherData(val timestamp: Long, val weatherResponse: WeatherResponse)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class AlignmentBottomSheetDialogFragment : BottomSheetDialogFragment() {
val dialog = MaterialAlertDialogBuilder(requireContext())

dialog.setTitle(DIALOG_TITLE)
dialog.setItems(items) { _, which ->
val selectedItem = items[which]
dialog.setItems(items) { _, index ->
val selectedItem = index
val gravity = appHelper.getGravityFromSelectedItem(selectedItem)

when (selectedAlignment) {
Expand Down Expand Up @@ -215,4 +215,4 @@ class AlignmentBottomSheetDialogFragment : BottomSheetDialogFragment() {
private const val REQUEST_KEY_ALARM_CLOCK_ALIGNMENT = "REQUEST_KEY_ALARM_CLOCK_ALIGNMENT"
private const val REQUEST_KEY_WORD_ALIGNMENT = "REQUEST_KEY_WORD_ALIGNMENT"
}
}
}
Loading