From 2dc86ca88dc3a78ff9733a2428bb094746885418 Mon Sep 17 00:00:00 2001 From: Honk2 Date: Sun, 5 Jan 2025 19:01:53 +0100 Subject: [PATCH] moved Close button to the left Added Delete buton to the right --- .../fossify/phone/activities/CallActivity.kt | 14 ++++++++++- app/src/main/res/layout/activity_call.xml | 25 +++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt b/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt index c9397500..c50f380a 100644 --- a/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt +++ b/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt @@ -13,6 +13,7 @@ import android.os.Looper import android.os.PowerManager import android.telecom.Call import android.telecom.CallAudioState +import android.view.KeyEvent import android.view.MotionEvent import android.view.View import android.view.WindowManager @@ -216,6 +217,8 @@ class CallActivity : SimpleActivity() { dialpad0Holder.setOnLongClickListener { dialpadPressed('+'); true } dialpadAsteriskHolder.setOnClickListener { dialpadPressed('*') } dialpadHashtagHolder.setOnClickListener { dialpadPressed('#') } + dialpadClearChar.setOnClickListener { clearChar(it) } + dialpadClearChar.setOnLongClickListener { clearInput() } } dialpadWrapper.setBackgroundColor( @@ -226,7 +229,7 @@ class CallActivity : SimpleActivity() { } ) - arrayOf(dialpadClose, callSimImage).forEach { + arrayOf(dialpadClose, callSimImage, dialpadClearChar).forEach { it.applyColorFilter(getProperTextColor()) } @@ -877,4 +880,13 @@ class CallActivity : SimpleActivity() { view.applyColorFilter(getProperBackgroundColor().getContrastColor()) } } + + private fun clearChar(view: View) { + binding.dialpadInput.dispatchKeyEvent(binding.dialpadInput.getKeyEvent(KeyEvent.KEYCODE_DEL)) + } + + private fun clearInput(): Boolean { + binding.dialpadInput.setText(""); + return true; + } } diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index 203df030..d09bec1d 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -446,13 +446,29 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> + + + android:src="@drawable/ic_clear_vector" />