Fix clock showing 12 hour format when 24 hour format is chosen
Test: Manually Bug: 271988126 Change-Id: I89f5b7e48deb5bc120c15306757d55b3dc1ddb75
This commit is contained in:
@@ -25,6 +25,7 @@ import android.graphics.Rect
|
||||
import android.text.format.DateFormat
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.View.OnAttachStateChangeListener
|
||||
import android.view.ViewTreeObserver
|
||||
import android.widget.FrameLayout
|
||||
import androidx.annotation.VisibleForTesting
|
||||
@@ -105,6 +106,24 @@ constructor(
|
||||
}
|
||||
updateFontSizes()
|
||||
updateTimeListeners()
|
||||
value.smallClock.view.addOnAttachStateChangeListener(
|
||||
object : OnAttachStateChangeListener {
|
||||
override fun onViewAttachedToWindow(p0: View?) {
|
||||
value.events.onTimeFormatChanged(DateFormat.is24HourFormat(context))
|
||||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(p0: View?) {
|
||||
}
|
||||
})
|
||||
value.largeClock.view.addOnAttachStateChangeListener(
|
||||
object : OnAttachStateChangeListener {
|
||||
override fun onViewAttachedToWindow(p0: View?) {
|
||||
value.events.onTimeFormatChanged(DateFormat.is24HourFormat(context))
|
||||
}
|
||||
|
||||
override fun onViewDetachedFromWindow(p0: View?) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user