Skip to content

Commit

Permalink
Fix: Fixed alignment for other languages (#169)
Browse files Browse the repository at this point in the history
Signed-off-by: HᴇCᴏᴅᴇs2ᴍᴜᴄʜ <wayne6324@gmail.com>
  • Loading branch information
HeCodes2Much authored Nov 25, 2024
1 parent fdc46ee commit 2412585
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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"
}
}
}

0 comments on commit 2412585

Please sign in to comment.