From 35da1c86a8ca69bc04bd611cba073544dab6a4f6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 27 May 2022 19:02:17 +0200 Subject: [PATCH] use bigger buttons at notifications accept/decline buttons --- .../dialer/helpers/CallNotificationManager.kt | 6 +++--- app/src/main/res/layout/call_notification.xml | 2 ++ app/src/main/res/values/dimens.xml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt index ecd286c6..f036e5b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt @@ -56,8 +56,8 @@ class CallNotificationManager(private val context: Context) { val declinePendingIntent = PendingIntent.getBroadcast(context, DECLINE_CALL_CODE, declineCallIntent, PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_MUTABLE) - var callerName = if (callContact != null && callContact.name.isNotEmpty()) callContact.name else context.getString(R.string.unknown_caller) - if (callContact?.numberLabel?.isNotEmpty() == true) { + var callerName = if (callContact.name.isNotEmpty()) callContact.name else context.getString(R.string.unknown_caller) + if (callContact.numberLabel.isNotEmpty()) { callerName += " - ${callContact.numberLabel}" } @@ -85,7 +85,7 @@ class CallNotificationManager(private val context: Context) { val builder = NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.ic_phone_vector) .setContentIntent(openAppPendingIntent) - .setPriority(if(isHighPriority) NotificationCompat.PRIORITY_MAX else NotificationCompat.PRIORITY_DEFAULT) + .setPriority(if (isHighPriority) NotificationCompat.PRIORITY_MAX else NotificationCompat.PRIORITY_DEFAULT) .setCategory(Notification.CATEGORY_CALL) .setCustomContentView(collapsedView) .setOngoing(true) diff --git a/app/src/main/res/layout/call_notification.xml b/app/src/main/res/layout/call_notification.xml index fcd84178..81ee7d91 100644 --- a/app/src/main/res/layout/call_notification.xml +++ b/app/src/main/res/layout/call_notification.xml @@ -44,6 +44,7 @@ android:layout_height="@dimen/call_notification_button_size" android:layout_weight="1" android:background="@drawable/ripple_background" + android:padding="@dimen/small_margin" android:src="@drawable/ic_phone_down_red_vector" /> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 54eef688..08b31931 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -4,7 +4,7 @@ 50dp 50dp 72dp - 30dp + 40dp 120dp 30sp