Skip to content

Commit

Permalink
fix: change clock based on user locale (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adolar0042 authored Dec 30, 2024
1 parent 6c5b68b commit 3f45453
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class ItemFragment : Fragment() {

setupTransition(view)
applyInsets {
binding.coverContainer.updateLayoutParams<MarginLayoutParams> { topMargin = it.top }
binding.recyclerView.applyContentInsets(it)
binding.fabContainer.applyFabInsets(it, systemInsets.value)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.content.DialogInterface
import android.os.Bundle
import android.text.format.DateFormat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand Down Expand Up @@ -77,8 +78,9 @@ class SleepTimerBottomSheet : BottomSheetDialogFragment() {
binding.topAppBar.setOnMenuItemClickListener {
when (it.itemId) {
R.id.schedule -> {
val is24Hour = DateFormat.is24HourFormat(context)
val picker = MaterialTimePicker.Builder()
.setTimeFormat(TimeFormat.CLOCK_12H)
.setTimeFormat(if (is24Hour) TimeFormat.CLOCK_24H else TimeFormat.CLOCK_12H)
.setTitleText(getString(R.string.sleep_on_specific_time))
.build()
picker.addOnCancelListener { picker.dismiss() }
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">0dp</item>
<item name="cardBackgroundColor">?attr/colorSurfaceContainerHigh</item>
<item name="layout_constraintBottom_toBottomOf">parent</item>
<item name="layout_constraintDimensionRatio">1,1</item>
<item name="layout_constraintEnd_toEndOf">parent</item>
<item name="layout_constraintHeight_max">@dimen/max_cover_size</item>
Expand Down

0 comments on commit 3f45453

Please sign in to comment.