mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
minor style update for better readability
This commit is contained in:
@ -311,9 +311,15 @@ fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, add
|
|||||||
notificationManager.createNotificationChannel(this)
|
notificationManager.createNotificationChannel(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val title = if (timer.label.isEmpty()) {
|
||||||
|
getString(R.string.timer)
|
||||||
|
} else {
|
||||||
|
timer.label
|
||||||
|
}
|
||||||
|
|
||||||
val reminderActivityIntent = getReminderActivityIntent()
|
val reminderActivityIntent = getReminderActivityIntent()
|
||||||
val builder = NotificationCompat.Builder(this)
|
val builder = NotificationCompat.Builder(this)
|
||||||
.setContentTitle(if (timer.label.isEmpty()) getString(R.string.timer) else timer.label)
|
.setContentTitle(title)
|
||||||
.setContentText(getString(R.string.time_expired))
|
.setContentText(getString(R.string.time_expired))
|
||||||
.setSmallIcon(R.drawable.ic_hourglass_vector)
|
.setSmallIcon(R.drawable.ic_hourglass_vector)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
@ -368,7 +374,12 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): No
|
|||||||
}
|
}
|
||||||
|
|
||||||
val channelId = "simple_alarm_channel_$soundUri"
|
val channelId = "simple_alarm_channel_$soundUri"
|
||||||
val label = if (alarm.label.isNotEmpty()) alarm.label else getString(R.string.alarm)
|
val label = if (alarm.label.isNotEmpty()) {
|
||||||
|
alarm.label
|
||||||
|
} else {
|
||||||
|
getString(R.string.alarm)
|
||||||
|
}
|
||||||
|
|
||||||
val audioAttributes = AudioAttributes.Builder()
|
val audioAttributes = AudioAttributes.Builder()
|
||||||
.setUsage(AudioAttributes.USAGE_ALARM)
|
.setUsage(AudioAttributes.USAGE_ALARM)
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||||
|
Reference in New Issue
Block a user