From 41ad3be223607e0cfb08010128477d397976db6b Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 21 Apr 2022 23:34:35 +0200 Subject: [PATCH] minor style update for better readability --- .../simplemobiletools/clock/extensions/Context.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt index ded9a7ee..55139531 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt @@ -311,9 +311,15 @@ fun Context.getTimerNotification(timer: Timer, pendingIntent: PendingIntent, add notificationManager.createNotificationChannel(this) } + val title = if (timer.label.isEmpty()) { + getString(R.string.timer) + } else { + timer.label + } + val reminderActivityIntent = getReminderActivityIntent() 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)) .setSmallIcon(R.drawable.ic_hourglass_vector) .setContentIntent(pendingIntent) @@ -368,7 +374,12 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): No } 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() .setUsage(AudioAttributes.USAGE_ALARM) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)