mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
adding a context null check
This commit is contained in:
@ -19,7 +19,7 @@ import com.simplemobiletools.commons.extensions.beVisibleIf
|
|||||||
import com.simplemobiletools.commons.extensions.getProperTextColor
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import kotlinx.android.synthetic.main.fragment_clock.view.*
|
import kotlinx.android.synthetic.main.fragment_clock.view.*
|
||||||
import java.util.*
|
import java.util.Calendar
|
||||||
|
|
||||||
class ClockFragment : Fragment() {
|
class ClockFragment : Fragment() {
|
||||||
private val ONE_SECOND = 1000L
|
private val ONE_SECOND = 1000L
|
||||||
@ -111,8 +111,8 @@ class ClockFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun updateAlarm() {
|
fun updateAlarm() {
|
||||||
view.apply {
|
context?.getClosestEnabledAlarmString { nextAlarm ->
|
||||||
requireContext().getClosestEnabledAlarmString { nextAlarm ->
|
view.apply {
|
||||||
clock_alarm.beVisibleIf(nextAlarm.isNotEmpty())
|
clock_alarm.beVisibleIf(nextAlarm.isNotEmpty())
|
||||||
clock_alarm.text = nextAlarm
|
clock_alarm.text = nextAlarm
|
||||||
clock_alarm.colorCompoundDrawable(requireContext().getProperTextColor())
|
clock_alarm.colorCompoundDrawable(requireContext().getProperTextColor())
|
||||||
|
Reference in New Issue
Block a user