From 14f49c8a2b389493e22f720d6f9b62a56c6bda7d Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Thu, 12 May 2022 09:03:24 +0300 Subject: [PATCH 01/10] add icons --- .../dialer/activities/CallActivity.kt | 8 ++++++++ .../dialer/helpers/CallManager.kt | 8 ++++++++ .../dialer/services/CallService.kt | 6 ++++++ .../main/res/drawable/ic_add_call_vector.xml | 5 +++++ .../res/drawable/ic_call_merge_vector.xml | 5 +++++ .../main/res/drawable/ic_call_swap_vector.xml | 5 +++++ .../main/res/drawable/ic_people_vector.xml | 12 +++++++++++ app/src/main/res/layout/activity_call.xml | 20 +++++++++++++++---- 8 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_add_call_vector.xml create mode 100644 app/src/main/res/drawable/ic_call_merge_vector.xml create mode 100644 app/src/main/res/drawable/ic_call_swap_vector.xml create mode 100644 app/src/main/res/drawable/ic_people_vector.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt index 025121b8..d6b69655 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -135,6 +135,14 @@ class CallActivity : SimpleActivity() { toggleHold() } + call_conference.setOnClickListener { + /*if (is conference) { + // show manage conference screen + } else { + // show dialpad and contacts + }*/ + } + call_end.setOnClickListener { endCall() } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index f51ca7fb..c7083fb4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -43,6 +43,14 @@ class CallManager { return !isOnHold } + fun swap() { + + } + + fun merge() { + + } + fun registerCallback(callback: Call.Callback) { call?.registerCallback(callback) } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt index 67e54194..19c8f6f3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt @@ -2,18 +2,22 @@ package com.simplemobiletools.dialer.services import android.telecom.Call import android.telecom.InCallService +import android.util.Log import com.simplemobiletools.dialer.activities.CallActivity import com.simplemobiletools.dialer.extensions.isOutgoing import com.simplemobiletools.dialer.extensions.powerManager import com.simplemobiletools.dialer.helpers.CallManager import com.simplemobiletools.dialer.helpers.CallNotificationManager +const val TAG = "SimpleDialer:CallService" + class CallService : InCallService() { private val callNotificationManager by lazy { CallNotificationManager(this) } private val callListener = object : Call.Callback() { override fun onStateChanged(call: Call, state: Int) { super.onStateChanged(call, state) + Log.d(TAG, "onStateChanged: $call") if (state != Call.STATE_DISCONNECTED) { callNotificationManager.setupNotification() } @@ -22,6 +26,7 @@ class CallService : InCallService() { override fun onCallAdded(call: Call) { super.onCallAdded(call) + Log.d(TAG, "onCallAdded: $call") if (!powerManager.isInteractive || call.isOutgoing()) { startActivity(CallActivity.getStartIntent(this)) } @@ -33,6 +38,7 @@ class CallService : InCallService() { override fun onCallRemoved(call: Call) { super.onCallRemoved(call) + Log.d(TAG, "onCallRemoved: $call") CallManager.call = null CallManager.inCallService = null callNotificationManager.cancelNotification() diff --git a/app/src/main/res/drawable/ic_add_call_vector.xml b/app/src/main/res/drawable/ic_add_call_vector.xml new file mode 100644 index 00000000..059b7e05 --- /dev/null +++ b/app/src/main/res/drawable/ic_add_call_vector.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_call_merge_vector.xml b/app/src/main/res/drawable/ic_call_merge_vector.xml new file mode 100644 index 00000000..280463cd --- /dev/null +++ b/app/src/main/res/drawable/ic_call_merge_vector.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_call_swap_vector.xml b/app/src/main/res/drawable/ic_call_swap_vector.xml new file mode 100644 index 00000000..35ec9c98 --- /dev/null +++ b/app/src/main/res/drawable/ic_call_swap_vector.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_people_vector.xml b/app/src/main/res/drawable/ic_people_vector.xml new file mode 100644 index 00000000..4910d920 --- /dev/null +++ b/app/src/main/res/drawable/ic_people_vector.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index b2f10215..452d1038 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -160,7 +160,6 @@ android:padding="@dimen/medium_margin" android:src="@drawable/ic_pause_vector" app:layout_constraintEnd_toStartOf="@+id/call_conference" - app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" /> @@ -171,12 +170,25 @@ android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" android:padding="@dimen/medium_margin" - android:src="@drawable/ic_plus_vector" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.5" + android:src="@drawable/ic_add_call_vector" + app:layout_constraintEnd_toStartOf="@id/manage_conference" app:layout_constraintStart_toEndOf="@+id/call_toggle_hold" app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" /> + + Date: Sun, 15 May 2022 09:12:23 +0300 Subject: [PATCH 02/10] switch between two calls --- app/src/main/AndroidManifest.xml | 1 + .../dialer/activities/CallActivity.kt | 118 +++++++++++++----- .../dialer/extensions/Call.kt | 12 +- .../dialer/helpers/CallManager.kt | 97 ++++++++++++-- .../dialer/services/CallService.kt | 25 ++-- app/src/main/res/layout/activity_call.xml | 103 +++++++++++++-- 6 files changed, 297 insertions(+), 59 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c67b59fa..984deedb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -99,6 +99,7 @@ android:excludeFromRecents="true" android:exported="false" android:label="@string/ongoing_call" + android:launchMode="singleTask" android:screenOrientation="portrait" android:showOnLockScreen="true" /> diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt index 4703ccca..c07710a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -22,21 +22,21 @@ import com.simplemobiletools.commons.helpers.MINUTE_SECONDS import com.simplemobiletools.commons.helpers.isOreoMr1Plus import com.simplemobiletools.commons.helpers.isOreoPlus import com.simplemobiletools.dialer.R -import com.simplemobiletools.dialer.extensions.addCharacter -import com.simplemobiletools.dialer.extensions.audioManager -import com.simplemobiletools.dialer.extensions.config -import com.simplemobiletools.dialer.extensions.getHandleToUse +import com.simplemobiletools.dialer.extensions.* import com.simplemobiletools.dialer.helpers.CallContactAvatarHelper import com.simplemobiletools.dialer.helpers.CallManager +import com.simplemobiletools.dialer.helpers.CallManagerListener import com.simplemobiletools.dialer.models.CallContact import kotlinx.android.synthetic.main.activity_call.* import kotlinx.android.synthetic.main.dialpad.* +const val TAG = "SimpleDialer:CallManager" + class CallActivity : SimpleActivity() { companion object { fun getStartIntent(context: Context): Intent { val openAppIntent = Intent(context, CallActivity::class.java) - openAppIntent.flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT or Intent.FLAG_ACTIVITY_NEW_TASK + openAppIntent.flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT or Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT return openAppIntent } } @@ -62,24 +62,21 @@ class CallActivity : SimpleActivity() { audioManager.mode = AudioManager.MODE_IN_CALL - CallManager.getCallContact(applicationContext) { contact -> - callContact = contact - val avatar = callContactAvatarHelper.getCallContactAvatar(contact) - runOnUiThread { - updateOtherPersonsInfo(avatar) - checkCalledSIMCard() - } - } - addLockScreenFlags() - CallManager.registerCallback(callCallback) - updateCallState(CallManager.getState()) + CallManager.addListener(callCallback) + } + + override fun onResume() { + super.onResume() + updateCallState(CallManager.getPrimaryCall()) + updateCallOnHoldState(CallManager.getSecondaryCall()) + updateCallContactInfo(CallManager.getPrimaryCall()) } override fun onDestroy() { super.onDestroy() - CallManager.unregisterCallback(callCallback) + CallManager.removeListener(callCallback) disableProximitySensor() } @@ -135,12 +132,23 @@ class CallActivity : SimpleActivity() { toggleHold() } - call_conference.setOnClickListener { - /*if (is conference) { - // show manage conference screen - } else { - // show dialpad and contacts - }*/ + call_add.setOnClickListener { + Intent(applicationContext, DialpadActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY) + startActivity(this) + } + } + + call_swap.setOnClickListener { + CallManager.swap() + } + + call_merge.setOnClickListener { + CallManager.merge() + } + + call_manage.setOnClickListener { + // TODO open conference participants list } call_end.setOnClickListener { @@ -347,6 +355,14 @@ class CallActivity : SimpleActivity() { } } + private fun getContactNameOrNumber(contact: CallContact): String { + return contact.name.ifEmpty { + contact.number.ifEmpty { + getString(R.string.unknown_caller) + } + } + } + @SuppressLint("MissingPermission") private fun checkCalledSIMCard() { try { @@ -375,7 +391,8 @@ class CallActivity : SimpleActivity() { } } - private fun updateCallState(state: Int) { + private fun updateCallState(call: Call?) { + val state = call?.getStateCompat() when (state) { Call.STATE_RINGING -> callRinging() Call.STATE_ACTIVE -> callStarted() @@ -394,9 +411,35 @@ class CallActivity : SimpleActivity() { call_status_label.text = getString(statusTextId) } - val isActiveCall = state == Call.STATE_ACTIVE || state == Call.STATE_HOLDING - call_toggle_hold.isEnabled = isActiveCall - call_toggle_hold.alpha = if (isActiveCall) 1.0f else 0.5f + val isSingleCallActionsEnabled = (state == Call.STATE_ACTIVE || state == Call.STATE_DISCONNECTED + || state == Call.STATE_DISCONNECTING || state == Call.STATE_HOLDING) + setActionButtonEnabled(call_toggle_hold, isSingleCallActionsEnabled) + setActionButtonEnabled(call_add, isSingleCallActionsEnabled) + } + + private fun updateCallOnHoldState(call: Call?) { + val hasCallOnHold = call != null + if (hasCallOnHold) { + CallManager.getCallContact(applicationContext, call) { contact -> + runOnUiThread { + on_hold_caller_name.text = getContactNameOrNumber(contact) + } + } + } + on_hold_status_holder.beVisibleIf(hasCallOnHold) + controls_single_call.beVisibleIf(!hasCallOnHold) // TODO and not conference + controls_two_calls.beVisibleIf(hasCallOnHold) + } + + private fun updateCallContactInfo(call: Call?) { + CallManager.getCallContact(applicationContext, call) { contact -> + callContact = contact + val avatar = callContactAvatarHelper.getCallContactAvatar(contact) + runOnUiThread { + updateOtherPersonsInfo(avatar) + checkCalledSIMCard() + } + } } private fun acceptCall() { @@ -417,6 +460,7 @@ class CallActivity : SimpleActivity() { enableProximitySensor() incoming_call_holder.beGone() ongoing_call_holder.beVisible() + callDurationHandler.removeCallbacks(updateCallDurationTask) callDurationHandler.post(updateCallDurationTask) } @@ -456,10 +500,19 @@ class CallActivity : SimpleActivity() { } } - private val callCallback = object : Call.Callback() { + private val callCallback = object : CallManagerListener { override fun onStateChanged(call: Call, state: Int) { - super.onStateChanged(call, state) - updateCallState(state) + updateCallState(call) + } + + override fun onCallPutOnHold(call: Call?) { + updateCallOnHoldState(call) + } + + override fun onCallsChanged(active: Call, onHold: Call?) { + updateCallState(active) + updateCallOnHoldState(onHold) + updateCallContactInfo(active) } } @@ -507,4 +560,9 @@ class CallActivity : SimpleActivity() { proximityWakeLock!!.release() } } + + private fun setActionButtonEnabled(button: ImageView, isEnabled: Boolean) { + button.isEnabled = isEnabled + button.alpha = if (isEnabled) 1.0f else 0.4f + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt index edca4412..e66f1b16 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt @@ -9,8 +9,10 @@ import com.simplemobiletools.commons.helpers.isSPlus private val OUTGOING_CALL_STATES = arrayOf(STATE_CONNECTING, STATE_DIALING, STATE_SELECT_PHONE_ACCOUNT) @Suppress("DEPRECATION") -fun Call.getStateCompat(): Int { - return if (isSPlus()) { +fun Call?.getStateCompat(): Int { + return if (this == null) { + Call.STATE_DISCONNECTED + } else if (isSPlus()) { details.state } else { state @@ -20,3 +22,9 @@ fun Call.getStateCompat(): Int { fun Call.isOutgoing(): Boolean { return OUTGOING_CALL_STATES.contains(getStateCompat()) } + +fun Call.hasCapability(capability: Int): Boolean = details.callCapabilities and capability != 0 + +fun Call.hasProperty(property: Int): Boolean = details.hasProperty(property) + +fun Call?.isConference(): Boolean = this?.details?.hasProperty(Call.Details.PROPERTY_CONFERENCE) == true diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index c7083fb4..4349d195 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -5,6 +5,7 @@ import android.net.Uri import android.telecom.Call import android.telecom.InCallService import android.telecom.VideoProfile +import android.util.Log import com.simplemobiletools.commons.extensions.getMyContactsCursor import com.simplemobiletools.commons.extensions.getPhoneNumberTypeText import com.simplemobiletools.commons.helpers.MyContactsContentProvider @@ -12,12 +13,64 @@ import com.simplemobiletools.commons.helpers.SimpleContactsHelper import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.dialer.extensions.getStateCompat import com.simplemobiletools.dialer.models.CallContact +import java.util.concurrent.CopyOnWriteArraySet + +const val TAG = "SimpleDialer:CallManager" // inspired by https://github.com/Chooloo/call_manage class CallManager { companion object { var call: Call? = null var inCallService: InCallService? = null + val calls = mutableListOf() + private val listeners = CopyOnWriteArraySet() + + fun onCallAdded(call: Call) { + this.call = call + calls.add(call) + call.registerCallback(object : Call.Callback() { + override fun onStateChanged(call: Call, state: Int) { + Log.d(TAG, "onStateChanged: $call") + for (listener in listeners) { + listener.onStateChanged(call, state) + } + if (state == Call.STATE_HOLDING && calls.size > 1) { + for (listener in listeners) { + listener.onCallPutOnHold(call) + } + } + if (state == Call.STATE_ACTIVE && calls.size == 1) { + for (listener in listeners) { + listener.onCallPutOnHold(null) + } + } + if ((state == Call.STATE_CONNECTING || state == Call.STATE_DIALING || state == Call.STATE_ACTIVE) && calls.size > 1) { + if (CallManager.call != call) { + CallManager.call = call + Log.d(TAG, "onCallsChanged") + for (listener in listeners) { + listener.onCallsChanged(call, getSecondaryCall()) + } + } + } + } + }) + } + + fun onCallRemoved(call: Call) { + calls.remove(call) + } + + fun getPrimaryCall(): Call? { + return call + } + + fun getSecondaryCall(): Call? { + if (calls.size == 1) { + return null + } + return calls.find { it.getStateCompat() == Call.STATE_HOLDING } + } fun accept() { call?.answer(VideoProfile.STATE_AUDIO_ONLY) @@ -43,27 +96,33 @@ class CallManager { return !isOnHold } - fun swap() { + val isConference: Boolean + get() = call?.details?.hasProperty(Call.Details.PROPERTY_CONFERENCE) ?: false + fun swap() { + getSecondaryCall()?.unhold() } fun merge() { - +// val conferenceableCalls = call!!.conferenceableCalls +// if (conferenceableCalls.isNotEmpty()) { +// call!!.conference(conferenceableCalls.first()) +// } else { +// if (call!!.hasCapability(Call.Details.CAPABILITY_MERGE_CONFERENCE)) { +// call!!.mergeConference() +// } +// } } - fun registerCallback(callback: Call.Callback) { - call?.registerCallback(callback) + fun addListener(listener: CallManagerListener) { + listeners.add(listener) } - fun unregisterCallback(callback: Call.Callback) { - call?.unregisterCallback(callback) + fun removeListener(listener: CallManagerListener) { + listeners.remove(listener) } - fun getState() = if (call == null) { - Call.STATE_DISCONNECTED - } else { - call!!.getStateCompat() - } + fun getState() = getPrimaryCall()?.getStateCompat() fun keypad(c: Char) { call?.playDtmfTone(c) @@ -71,6 +130,10 @@ class CallManager { } fun getCallContact(context: Context, callback: (CallContact?) -> Unit) { + return getCallContact(context, call, callback) + } + + fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Unit) { val privateCursor = context.getMyContactsCursor(false, true) ensureBackgroundThread { val callContact = CallContact("", "", "", "") @@ -126,10 +189,20 @@ class CallManager { fun getCallDuration(): Int { return if (call != null) { - ((System.currentTimeMillis() - call!!.details.connectTimeMillis) / 1000).toInt() + val connectTimeMillis = call!!.details.connectTimeMillis + if (connectTimeMillis == 0L) { + return 0 + } + ((System.currentTimeMillis() - connectTimeMillis) / 1000).toInt() } else { 0 } } } } + +interface CallManagerListener { + fun onStateChanged(call: Call, state: Int) + fun onCallPutOnHold(call: Call?) + fun onCallsChanged(active: Call, onHold: Call?) +} diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt index 19c8f6f3..d3912049 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt @@ -17,7 +17,6 @@ class CallService : InCallService() { private val callListener = object : Call.Callback() { override fun onStateChanged(call: Call, state: Int) { super.onStateChanged(call, state) - Log.d(TAG, "onStateChanged: $call") if (state != Call.STATE_DISCONNECTED) { callNotificationManager.setupNotification() } @@ -27,26 +26,36 @@ class CallService : InCallService() { override fun onCallAdded(call: Call) { super.onCallAdded(call) Log.d(TAG, "onCallAdded: $call") - if (!powerManager.isInteractive || call.isOutgoing()) { + CallManager.onCallAdded(call) + if ((!powerManager.isInteractive || call.isOutgoing())) { startActivity(CallActivity.getStartIntent(this)) } - CallManager.call = call + call.registerCallback(callListener) CallManager.inCallService = this - CallManager.registerCallback(callListener) callNotificationManager.setupNotification() + Log.d(TAG, "onCallAdded: calls=${CallManager.calls.size}") } override fun onCallRemoved(call: Call) { super.onCallRemoved(call) Log.d(TAG, "onCallRemoved: $call") - CallManager.call = null - CallManager.inCallService = null - callNotificationManager.cancelNotification() + call.unregisterCallback(callListener) + CallManager.onCallRemoved(call) + if (CallManager.calls.isEmpty()) { + CallManager.call = null + CallManager.inCallService = null + callNotificationManager.cancelNotification() + } else { + // TODO if left more than 1 + CallManager.call = CallManager.calls.first() + callNotificationManager.setupNotification() + startActivity(CallActivity.getStartIntent(this)) + } + Log.d(TAG, "onCallRemoved: calls=${CallManager.calls.size}") } override fun onDestroy() { super.onDestroy() - CallManager.unregisterCallback(callListener) callNotificationManager.cancelNotification() } } diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index f7b11b25..019d5641 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -102,6 +102,54 @@ app:layout_constraintTop_toTopOf="@+id/call_sim_image" tools:text="1" /> + + + + + + + + + + + app:layout_constraintStart_toEndOf="@+id/call_add" + app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" /> + + + + + + + + Date: Mon, 16 May 2022 19:58:09 +0300 Subject: [PATCH 03/10] create conference --- .../dialer/activities/CallActivity.kt | 73 ++++++++----- .../dialer/helpers/CallManager.kt | 100 +++++++++++++----- .../dialer/services/CallService.kt | 2 - .../main/res/drawable/ic_people_vector.xml | 12 --- app/src/main/res/layout/activity_call.xml | 6 ++ app/src/main/res/values/strings.xml | 6 ++ 6 files changed, 129 insertions(+), 70 deletions(-) delete mode 100644 app/src/main/res/drawable/ic_people_vector.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt index 80d034bd..3148920f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -23,9 +23,7 @@ import com.simplemobiletools.commons.helpers.isOreoMr1Plus import com.simplemobiletools.commons.helpers.isOreoPlus import com.simplemobiletools.dialer.R import com.simplemobiletools.dialer.extensions.* -import com.simplemobiletools.dialer.helpers.CallContactAvatarHelper -import com.simplemobiletools.dialer.helpers.CallManager -import com.simplemobiletools.dialer.helpers.CallManagerListener +import com.simplemobiletools.dialer.helpers.* import com.simplemobiletools.dialer.models.CallContact import kotlinx.android.synthetic.main.activity_call.* import kotlinx.android.synthetic.main.dialpad.* @@ -57,6 +55,11 @@ class CallActivity : SimpleActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_call) + if (CallManager.call == null) { + finish() + return + } + updateTextColors(call_holder) initButtons() @@ -65,13 +68,13 @@ class CallActivity : SimpleActivity() { addLockScreenFlags() CallManager.addListener(callCallback) + + updateCallContactInfo(CallManager.getPrimaryCall()) } override fun onResume() { super.onResume() - updateCallState(CallManager.getPrimaryCall()) - updateCallOnHoldState(CallManager.getSecondaryCall()) - updateCallContactInfo(CallManager.getPrimaryCall()) + updateState() } override fun onDestroy() { @@ -171,7 +174,10 @@ class CallActivity : SimpleActivity() { dialpad_hashtag_holder.setOnClickListener { dialpadPressed('#') } dialpad_wrapper.setBackgroundColor(getProperBackgroundColor()) - arrayOf(call_toggle_microphone, call_toggle_speaker, call_dialpad, dialpad_close, call_sim_image).forEach { + arrayOf( + call_toggle_microphone, call_toggle_speaker, call_dialpad, dialpad_close, + call_sim_image, call_toggle_hold, call_add, call_swap, call_merge, call_manage + ).forEach { it.applyColorFilter(getProperTextColor()) } @@ -410,11 +416,23 @@ class CallActivity : SimpleActivity() { if (statusTextId != 0) { call_status_label.text = getString(statusTextId) } + } - val isSingleCallActionsEnabled = (state == Call.STATE_ACTIVE || state == Call.STATE_DISCONNECTED - || state == Call.STATE_DISCONNECTING || state == Call.STATE_HOLDING) - setActionButtonEnabled(call_toggle_hold, isSingleCallActionsEnabled) - setActionButtonEnabled(call_add, isSingleCallActionsEnabled) + private fun updateState() { + val phoneState = CallManager.getPhoneState() + if (phoneState is SingleCall) { + updateCallState(phoneState.call) + updateCallOnHoldState(null) + val state = phoneState.call.getStateCompat() + val isSingleCallActionsEnabled = (state == Call.STATE_ACTIVE || state == Call.STATE_DISCONNECTED + || state == Call.STATE_DISCONNECTING || state == Call.STATE_HOLDING) + setActionButtonEnabled(call_toggle_hold, isSingleCallActionsEnabled) + setActionButtonEnabled(call_add, isSingleCallActionsEnabled) + call_manage.beVisibleIf(phoneState.call.isConference()) + } else if (phoneState is TwoCalls) { + updateCallState(phoneState.active) + updateCallOnHoldState(phoneState.onHold) + } } private fun updateCallOnHoldState(call: Call?) { @@ -427,17 +445,23 @@ class CallActivity : SimpleActivity() { } } on_hold_status_holder.beVisibleIf(hasCallOnHold) - controls_single_call.beVisibleIf(!hasCallOnHold) // TODO and not conference + controls_single_call.beVisibleIf(!hasCallOnHold) controls_two_calls.beVisibleIf(hasCallOnHold) } private fun updateCallContactInfo(call: Call?) { - CallManager.getCallContact(applicationContext, call) { contact -> - callContact = contact - val avatar = callContactAvatarHelper.getCallContactAvatar(contact) - runOnUiThread { - updateOtherPersonsInfo(avatar) - checkCalledSIMCard() + if (call.isConference()) { + caller_avatar.setImageDrawable(null) + caller_number.text = null + caller_name_label.text = getString(R.string.conference) + } else { + CallManager.getCallContact(applicationContext, call) { contact -> + callContact = contact + val avatar = callContactAvatarHelper.getCallContactAvatar(contact) + runOnUiThread { + updateOtherPersonsInfo(avatar) + checkCalledSIMCard() + } } } } @@ -502,17 +526,12 @@ class CallActivity : SimpleActivity() { private val callCallback = object : CallManagerListener { override fun onStateChanged(call: Call, state: Int) { - updateCallState(call) + updateState() } - override fun onCallPutOnHold(call: Call?) { - updateCallOnHoldState(call) - } - - override fun onCallsChanged(active: Call, onHold: Call?) { - updateCallState(active) - updateCallOnHoldState(onHold) - updateCallContactInfo(active) + override fun onPrimaryCallChanged(call: Call) { + updateCallContactInfo(call) + updateState() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index 4349d195..e8f7c996 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -12,6 +12,8 @@ import com.simplemobiletools.commons.helpers.MyContactsContentProvider import com.simplemobiletools.commons.helpers.SimpleContactsHelper import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.dialer.extensions.getStateCompat +import com.simplemobiletools.dialer.extensions.hasCapability +import com.simplemobiletools.dialer.extensions.isConference import com.simplemobiletools.dialer.models.CallContact import java.util.concurrent.CopyOnWriteArraySet @@ -28,37 +30,73 @@ class CallManager { fun onCallAdded(call: Call) { this.call = call calls.add(call) + for (listener in listeners) { + listener.onPrimaryCallChanged(call) + } call.registerCallback(object : Call.Callback() { override fun onStateChanged(call: Call, state: Int) { Log.d(TAG, "onStateChanged: $call") + updateState() for (listener in listeners) { listener.onStateChanged(call, state) } - if (state == Call.STATE_HOLDING && calls.size > 1) { - for (listener in listeners) { - listener.onCallPutOnHold(call) - } - } - if (state == Call.STATE_ACTIVE && calls.size == 1) { - for (listener in listeners) { - listener.onCallPutOnHold(null) - } - } - if ((state == Call.STATE_CONNECTING || state == Call.STATE_DIALING || state == Call.STATE_ACTIVE) && calls.size > 1) { - if (CallManager.call != call) { - CallManager.call = call - Log.d(TAG, "onCallsChanged") - for (listener in listeners) { - listener.onCallsChanged(call, getSecondaryCall()) - } - } - } + } + + override fun onConferenceableCallsChanged(call: Call, conferenceableCalls: MutableList) { + Log.d(TAG, "onConferenceableCallsChanged: $call, conferenceableCalls size=${conferenceableCalls.size}") + updateState() } }) } fun onCallRemoved(call: Call) { calls.remove(call) + updateState() + } + + fun getPhoneState(): PhoneState { + return when (calls.size) { + 0 -> { + NoCall + } + 1 -> { + SingleCall(calls.first()) + } + 2 -> { + val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE } + val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING } + val onHold = calls.find { it.getStateCompat() == Call.STATE_HOLDING } + if (active != null && newCall != null) { + TwoCalls(newCall, active) + } else if(newCall != null && onHold != null) { + TwoCalls(newCall, onHold) + } else if(active != null && onHold != null) { + TwoCalls(active, onHold) + } else { + TwoCalls(calls[0], calls[1]) + } + } + else -> { + SingleCall(calls.find { it.isConference() }!!) + // TODO handle the call on hold (outside the conference) + } + } + } + + private fun updateState() { + val primaryCall = when (val phoneState = getPhoneState()) { + is NoCall -> null + is SingleCall -> phoneState.call + is TwoCalls -> phoneState.active + } + if (primaryCall == null) { + call = null + } else if (primaryCall != call) { + call = primaryCall + for (listener in listeners) { + listener.onPrimaryCallChanged(primaryCall) + } + } } fun getPrimaryCall(): Call? { @@ -104,14 +142,14 @@ class CallManager { } fun merge() { -// val conferenceableCalls = call!!.conferenceableCalls -// if (conferenceableCalls.isNotEmpty()) { -// call!!.conference(conferenceableCalls.first()) -// } else { -// if (call!!.hasCapability(Call.Details.CAPABILITY_MERGE_CONFERENCE)) { -// call!!.mergeConference() -// } -// } + val conferenceableCalls = call!!.conferenceableCalls + if (conferenceableCalls.isNotEmpty()) { + call!!.conference(conferenceableCalls.first()) + } else { + if (call!!.hasCapability(Call.Details.CAPABILITY_MERGE_CONFERENCE)) { + call!!.mergeConference() + } + } } fun addListener(listener: CallManagerListener) { @@ -203,6 +241,10 @@ class CallManager { interface CallManagerListener { fun onStateChanged(call: Call, state: Int) - fun onCallPutOnHold(call: Call?) - fun onCallsChanged(active: Call, onHold: Call?) + fun onPrimaryCallChanged(call: Call) } + +sealed class PhoneState +object NoCall : PhoneState() +class SingleCall(val call: Call?) : PhoneState() +class TwoCalls(val active: Call, val onHold: Call) : PhoneState() diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt index d3912049..0bcddd5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt @@ -46,8 +46,6 @@ class CallService : InCallService() { CallManager.inCallService = null callNotificationManager.cancelNotification() } else { - // TODO if left more than 1 - CallManager.call = CallManager.calls.first() callNotificationManager.setupNotification() startActivity(CallActivity.getStartIntent(this)) } diff --git a/app/src/main/res/drawable/ic_people_vector.xml b/app/src/main/res/drawable/ic_people_vector.xml deleted file mode 100644 index 4910d920..00000000 --- a/app/src/main/res/drawable/ic_people_vector.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index 7d73de8f..bf927509 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -118,6 +118,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/normal_margin" + android:contentDescription="@null" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -203,6 +204,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/hold_call" android:padding="@dimen/medium_margin" android:src="@drawable/ic_pause_vector" app:layout_constraintEnd_toStartOf="@id/call_add" @@ -215,6 +217,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/call_add" android:padding="@dimen/medium_margin" android:src="@drawable/ic_add_call_vector" app:layout_constraintEnd_toEndOf="@id/call_manage" @@ -227,6 +230,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/call_manage" android:padding="@dimen/medium_margin" android:src="@drawable/ic_people_vector" android:visibility="gone" @@ -240,6 +244,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/call_swap" android:padding="@dimen/medium_margin" android:src="@drawable/ic_call_swap_vector" app:layout_constraintEnd_toStartOf="@+id/call_merge" @@ -254,6 +259,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" + android:contentDescription="@string/call_merge" android:padding="@dimen/medium_margin" android:src="@drawable/ic_call_merge_vector" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 928b9370..49689d9a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -51,6 +51,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage calls + Conference Speed dial From 1bf9ea626bd00f9d2456fcba193acd36d1699dd9 Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Thu, 19 May 2022 12:13:56 +0300 Subject: [PATCH 04/10] manage conference --- app/src/main/AndroidManifest.xml | 6 + .../dialer/activities/CallActivity.kt | 65 +++++--- .../dialer/activities/ConferenceActivity.kt | 18 ++ .../dialer/adapters/ConferenceCallsAdapter.kt | 93 +++++++++++ .../dialer/extensions/Call.kt | 16 +- .../dialer/helpers/CallContactHelper.kt | 71 ++++++++ .../dialer/helpers/CallManager.kt | 154 +++++++----------- .../dialer/helpers/CallNotificationManager.kt | 2 +- .../dialer/services/CallService.kt | 14 +- .../res/drawable/ic_call_split_vector.xml | 5 + app/src/main/res/layout/activity_call.xml | 28 ++-- .../main/res/layout/activity_conference.xml | 17 ++ .../main/res/layout/item_conference_call.xml | 60 +++++++ 13 files changed, 399 insertions(+), 150 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt create mode 100644 app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt create mode 100644 app/src/main/res/drawable/ic_call_split_vector.xml create mode 100644 app/src/main/res/layout/activity_conference.xml create mode 100644 app/src/main/res/layout/item_conference_call.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 984deedb..3b25121b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -82,6 +82,12 @@ android:label="@string/speed_dial" android:parentActivityName=".activities.SettingsActivity" /> + + 1) { accounts.forEachIndexed { index, account -> - if (account == CallManager.call?.details?.accountHandle) { + if (account == CallManager.getPrimaryCall()?.details?.accountHandle) { call_sim_id.text = "${index + 1}" call_sim_id.beVisible() call_sim_image.beVisible() @@ -395,8 +406,9 @@ class CallActivity : SimpleActivity() { } } - private fun updateCallState(call: Call?) { - val state = call?.getStateCompat() + private fun updateCallState(call: Call) { + val state = call.getStateCompat() + Log.d(TAG, "updateCallState: $state") when (state) { Call.STATE_RINGING -> callRinging() Call.STATE_ACTIVE -> callStarted() @@ -407,17 +419,22 @@ class CallActivity : SimpleActivity() { val statusTextId = when (state) { Call.STATE_RINGING -> R.string.is_calling - Call.STATE_DIALING -> R.string.dialing + Call.STATE_CONNECTING, Call.STATE_DIALING -> R.string.dialing else -> 0 } if (statusTextId != 0) { call_status_label.text = getString(statusTextId) } + + call_manage.beVisibleIf(call.hasCapability(Call.Details.CAPABILITY_MANAGE_CONFERENCE)) + setActionButtonEnabled(call_swap, state == Call.STATE_ACTIVE) + setActionButtonEnabled(call_merge, state == Call.STATE_ACTIVE) } private fun updateState() { val phoneState = CallManager.getPhoneState() + Log.d(TAG, "updateState: $phoneState") if (phoneState is SingleCall) { updateCallState(phoneState.call) updateCallOnHoldState(null) @@ -426,7 +443,6 @@ class CallActivity : SimpleActivity() { || state == Call.STATE_DISCONNECTING || state == Call.STATE_HOLDING) setActionButtonEnabled(call_toggle_hold, isSingleCallActionsEnabled) setActionButtonEnabled(call_add, isSingleCallActionsEnabled) - call_manage.beVisibleIf(phoneState.call.isConference()) } else if (phoneState is TwoCalls) { updateCallState(phoneState.active) updateCallOnHoldState(phoneState.onHold) @@ -436,7 +452,7 @@ class CallActivity : SimpleActivity() { private fun updateCallOnHoldState(call: Call?) { val hasCallOnHold = call != null if (hasCallOnHold) { - CallManager.getCallContact(applicationContext, call) { contact -> + getCallContact(applicationContext, call) { contact -> runOnUiThread { on_hold_caller_name.text = getContactNameOrNumber(contact) } @@ -448,18 +464,15 @@ class CallActivity : SimpleActivity() { } private fun updateCallContactInfo(call: Call?) { - if (call.isConference()) { - caller_avatar.setImageDrawable(null) - caller_number.text = null - caller_name_label.text = getString(R.string.conference) - } else { - CallManager.getCallContact(applicationContext, call) { contact -> - callContact = contact - val avatar = callContactAvatarHelper.getCallContactAvatar(contact) - runOnUiThread { - updateOtherPersonsInfo(avatar) - checkCalledSIMCard() - } + getCallContact(applicationContext, call) { contact -> + if (call != CallManager.getPrimaryCall()) { + return@getCallContact + } + callContact = contact + val avatar = if (!call.isConference()) callContactAvatarHelper.getCallContactAvatar(contact) else null + runOnUiThread { + updateOtherPersonsInfo(avatar) + checkCalledSIMCard() } } } @@ -489,7 +502,7 @@ class CallActivity : SimpleActivity() { private fun showPhoneAccountPicker() { if (callContact != null) { getHandleToUse(intent, callContact!!.number) { handle -> - CallManager.call?.phoneAccountSelected(handle, false) + CallManager.getPrimaryCall()?.phoneAccountSelected(handle, false) } } } @@ -523,11 +536,13 @@ class CallActivity : SimpleActivity() { } private val callCallback = object : CallManagerListener { - override fun onStateChanged(call: Call, state: Int) { + override fun onStateChanged() { updateState() } override fun onPrimaryCallChanged(call: Call) { + Log.d(TAG, "onPrimaryCallChanged: $call") + callDurationHandler.removeCallbacks(updateCallDurationTask) updateCallContactInfo(call) updateState() } @@ -535,7 +550,7 @@ class CallActivity : SimpleActivity() { private val updateCallDurationTask = object : Runnable { override fun run() { - callDuration = CallManager.getCallDuration() + callDuration = CallManager.getPrimaryCall().getCallDuration() if (!isCallEnded) { call_status_label.text = callDuration.getFormattedDuration() callDurationHandler.postDelayed(this, 1000) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt new file mode 100644 index 00000000..6ad3c2d1 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt @@ -0,0 +1,18 @@ +package com.simplemobiletools.dialer.activities + +import android.os.Bundle +import com.simplemobiletools.dialer.R +import com.simplemobiletools.dialer.adapters.ConferenceCallsAdapter +import com.simplemobiletools.dialer.helpers.CallManager +import kotlinx.android.synthetic.main.activity_conference.* + +class ConferenceActivity : SimpleActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_conference) + supportActionBar + + conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {} + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt new file mode 100644 index 00000000..2d9b339d --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt @@ -0,0 +1,93 @@ +package com.simplemobiletools.dialer.adapters + +import android.telecom.Call +import android.view.Menu +import android.view.ViewGroup +import com.bumptech.glide.Glide +import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter +import com.simplemobiletools.commons.helpers.LOWER_ALPHA +import com.simplemobiletools.commons.helpers.SimpleContactsHelper +import com.simplemobiletools.commons.views.MyRecyclerView +import com.simplemobiletools.dialer.R +import com.simplemobiletools.dialer.activities.SimpleActivity +import com.simplemobiletools.dialer.extensions.hasCapability +import com.simplemobiletools.dialer.helpers.getCallContact +import kotlinx.android.synthetic.main.item_conference_call.view.* + +class ConferenceCallsAdapter( + activity: SimpleActivity, recyclerView: MyRecyclerView, val data: ArrayList, itemClick: (Any) -> Unit +) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) { + + override fun actionItemPressed(id: Int) { + } + + override fun getActionMenuId(): Int = 0 + + override fun getIsItemSelectable(position: Int): Boolean = false + + override fun getItemCount(): Int = data.size + + override fun getItemKeyPosition(key: Int): Int = -1 + + override fun getItemSelectionKey(position: Int): Int? = null + + override fun getSelectableItemCount(): Int = data.size + + override fun onActionModeCreated() { + } + + override fun onActionModeDestroyed() { + } + + override fun prepareActionMode(menu: Menu) { + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_conference_call, parent) + + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + val call = data[position] + holder.bindView(call, allowSingleClick = false, allowLongClick = false) { itemView, _ -> + getCallContact(itemView.context, call) { callContact -> + itemView.post { + itemView.item_conference_call_name.text = callContact.name.ifEmpty { itemView.context.getString(R.string.unknown_caller) } + SimpleContactsHelper(activity).loadContactImage( + callContact.photoUri, + itemView.item_conference_call_image, + callContact.name, + activity.getDrawable(R.drawable.ic_person_vector) + ) + } + } + val canSeparate = call.hasCapability(Call.Details.CAPABILITY_SEPARATE_FROM_CONFERENCE) + val canDisconnect = call.hasCapability(Call.Details.CAPABILITY_DISCONNECT_FROM_CONFERENCE) + itemView.item_conference_call_split.isEnabled = canSeparate + itemView.item_conference_call_split.alpha = if (canSeparate) 1.0f else LOWER_ALPHA + itemView.item_conference_call_split.setOnClickListener { + call.splitFromConference() + data.removeAt(position) + notifyItemRemoved(position) + if (data.size == 1) { + activity.finish() + } + } + itemView.item_conference_call_end.isEnabled = canDisconnect + itemView.item_conference_call_end.alpha = if (canDisconnect) 1.0f else LOWER_ALPHA + itemView.item_conference_call_end.setOnClickListener { + call.disconnect() + data.removeAt(position) + notifyItemRemoved(position) + if (data.size == 1) { + activity.finish() + } + } + } + bindViewHolder(holder) + } + + override fun onViewRecycled(holder: ViewHolder) { + super.onViewRecycled(holder) + if (!activity.isDestroyed && !activity.isFinishing) { + Glide.with(activity).clear(holder.itemView.item_conference_call_image) + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt index e66f1b16..80f1173f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/extensions/Call.kt @@ -19,12 +19,22 @@ fun Call?.getStateCompat(): Int { } } +fun Call?.getCallDuration(): Int { + return if (this != null) { + val connectTimeMillis = details.connectTimeMillis + if (connectTimeMillis == 0L) { + return 0 + } + ((System.currentTimeMillis() - connectTimeMillis) / 1000).toInt() + } else { + 0 + } +} + fun Call.isOutgoing(): Boolean { return OUTGOING_CALL_STATES.contains(getStateCompat()) } -fun Call.hasCapability(capability: Int): Boolean = details.callCapabilities and capability != 0 - -fun Call.hasProperty(property: Int): Boolean = details.hasProperty(property) +fun Call.hasCapability(capability: Int): Boolean = (details.callCapabilities and capability) != 0 fun Call?.isConference(): Boolean = this?.details?.hasProperty(Call.Details.PROPERTY_CONFERENCE) == true diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt new file mode 100644 index 00000000..3f234793 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt @@ -0,0 +1,71 @@ +package com.simplemobiletools.dialer.helpers + +import android.content.Context +import android.net.Uri +import android.telecom.Call +import com.simplemobiletools.commons.extensions.getMyContactsCursor +import com.simplemobiletools.commons.extensions.getPhoneNumberTypeText +import com.simplemobiletools.commons.helpers.MyContactsContentProvider +import com.simplemobiletools.commons.helpers.SimpleContactsHelper +import com.simplemobiletools.commons.helpers.ensureBackgroundThread +import com.simplemobiletools.dialer.R +import com.simplemobiletools.dialer.extensions.isConference +import com.simplemobiletools.dialer.models.CallContact + +fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Unit) { + if (call.isConference()) { + callback(CallContact(context.getString(R.string.conference), "", "", "")) + return + } + val privateCursor = context.getMyContactsCursor(false, true) + ensureBackgroundThread { + val callContact = CallContact("", "", "", "") + val handle = try { + call?.details?.handle?.toString() + } catch (e: NullPointerException) { + null + } + + if (handle == null) { + callback(callContact) + return@ensureBackgroundThread + } + + val uri = Uri.decode(handle) + if (uri.startsWith("tel:")) { + val number = uri.substringAfter("tel:") + SimpleContactsHelper(context).getAvailableContacts(false) { contacts -> + val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor) + if (privateContacts.isNotEmpty()) { + contacts.addAll(privateContacts) + } + + val contactsWithMultipleNumbers = contacts.filter { it.phoneNumbers.size > 1 } + val numbersToContactIDMap = HashMap() + contactsWithMultipleNumbers.forEach { contact -> + contact.phoneNumbers.forEach { phoneNumber -> + numbersToContactIDMap[phoneNumber.value] = contact.contactId + numbersToContactIDMap[phoneNumber.normalizedNumber] = contact.contactId + } + } + + callContact.number = number + val contact = contacts.firstOrNull { it.doesHavePhoneNumber(number) } + if (contact != null) { + callContact.name = contact.name + callContact.photoUri = contact.photoUri + + if (contact.phoneNumbers.size > 1) { + val specificPhoneNumber = contact.phoneNumbers.firstOrNull { it.value == number } + if (specificPhoneNumber != null) { + callContact.numberLabel = context.getPhoneNumberTypeText(specificPhoneNumber.type, specificPhoneNumber.label) + } + } + } else { + callContact.name = number + } + callback(callContact) + } + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index e8f7c996..ea3d1b40 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -1,35 +1,31 @@ package com.simplemobiletools.dialer.helpers -import android.content.Context -import android.net.Uri +import android.annotation.SuppressLint import android.telecom.Call import android.telecom.InCallService import android.telecom.VideoProfile import android.util.Log -import com.simplemobiletools.commons.extensions.getMyContactsCursor -import com.simplemobiletools.commons.extensions.getPhoneNumberTypeText -import com.simplemobiletools.commons.helpers.MyContactsContentProvider -import com.simplemobiletools.commons.helpers.SimpleContactsHelper -import com.simplemobiletools.commons.helpers.ensureBackgroundThread import com.simplemobiletools.dialer.extensions.getStateCompat import com.simplemobiletools.dialer.extensions.hasCapability import com.simplemobiletools.dialer.extensions.isConference -import com.simplemobiletools.dialer.models.CallContact import java.util.concurrent.CopyOnWriteArraySet const val TAG = "SimpleDialer:CallManager" +const val TAG2 = TAG /*"SimpleDialer:CallState"*/ // inspired by https://github.com/Chooloo/call_manage class CallManager { companion object { - var call: Call? = null + @SuppressLint("StaticFieldLeak") var inCallService: InCallService? = null - val calls = mutableListOf() + private var call: Call? = null + private val calls = mutableListOf() private val listeners = CopyOnWriteArraySet() fun onCallAdded(call: Call) { this.call = call calls.add(call) + Log.d(TAG, "onCallAdded (${calls.size}): $call") for (listener in listeners) { listener.onPrimaryCallChanged(call) } @@ -37,13 +33,15 @@ class CallManager { override fun onStateChanged(call: Call, state: Int) { Log.d(TAG, "onStateChanged: $call") updateState() - for (listener in listeners) { - listener.onStateChanged(call, state) - } + } + + override fun onDetailsChanged(call: Call, details: Call.Details) { + Log.d(TAG, "onDetailsChanged") + updateState() } override fun onConferenceableCallsChanged(call: Call, conferenceableCalls: MutableList) { - Log.d(TAG, "onConferenceableCallsChanged: $call, conferenceableCalls size=${conferenceableCalls.size}") + Log.d(TAG, "onConferenceableCallsChanged (${conferenceableCalls.size}): $call") updateState() } }) @@ -51,34 +49,59 @@ class CallManager { fun onCallRemoved(call: Call) { calls.remove(call) + Log.d(TAG, "onCallRemoved (${calls.size}): $call") updateState() } fun getPhoneState(): PhoneState { return when (calls.size) { 0 -> { + Log.d(TAG2, "No call") NoCall } 1 -> { + Log.d(TAG2, "Single call") SingleCall(calls.first()) } 2 -> { + Log.d(TAG2, "Two calls") val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE } val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING } val onHold = calls.find { it.getStateCompat() == Call.STATE_HOLDING } if (active != null && newCall != null) { TwoCalls(newCall, active) - } else if(newCall != null && onHold != null) { + } else if (newCall != null && onHold != null) { TwoCalls(newCall, onHold) - } else if(active != null && onHold != null) { + } else if (active != null && onHold != null) { TwoCalls(active, onHold) } else { TwoCalls(calls[0], calls[1]) } } else -> { - SingleCall(calls.find { it.isConference() }!!) - // TODO handle the call on hold (outside the conference) + val conference = calls.find { it.isConference() }!! + val secondCall = if (conference.children.size + 1 != calls.size) { + calls.filter { !it.isConference() } + .subtract(conference.children.toSet()) + .firstOrNull() + } else { + null + } + Log.d(TAG2, "Conference call (${conference.children.size} children)") + Log.d(TAG2, "secondCall: $secondCall") + if (secondCall == null) { + Log.d(TAG2, "Conference call (single)") + SingleCall(conference) + } else { + val newCallState = secondCall.getStateCompat() + if (newCallState == Call.STATE_ACTIVE || newCallState == Call.STATE_CONNECTING || newCallState == Call.STATE_DIALING) { + Log.d(TAG2, "Conference call and regular call (conference on hold)") + TwoCalls(secondCall, conference) + } else { + Log.d(TAG2, "Conference call and regular call (regular call on hold)") + TwoCalls(conference, secondCall) + } + } } } } @@ -89,6 +112,7 @@ class CallManager { is SingleCall -> phoneState.call is TwoCalls -> phoneState.active } + var notify = true if (primaryCall == null) { call = null } else if (primaryCall != call) { @@ -96,6 +120,12 @@ class CallManager { for (listener in listeners) { listener.onPrimaryCallChanged(primaryCall) } + notify = false + } + if (notify) { + for (listener in listeners) { + listener.onStateChanged() + } } } @@ -103,11 +133,8 @@ class CallManager { return call } - fun getSecondaryCall(): Call? { - if (calls.size == 1) { - return null - } - return calls.find { it.getStateCompat() == Call.STATE_HOLDING } + fun getConferenceCalls(): List { + return calls.find { it.isConference() }?.children ?: emptyList() } fun accept() { @@ -134,11 +161,10 @@ class CallManager { return !isOnHold } - val isConference: Boolean - get() = call?.details?.hasProperty(Call.Details.PROPERTY_CONFERENCE) ?: false - fun swap() { - getSecondaryCall()?.unhold() + if (calls.size > 1) { + calls.find { it.getStateCompat() == Call.STATE_HOLDING }?.unhold() + } } fun merge() { @@ -166,85 +192,15 @@ class CallManager { call?.playDtmfTone(c) call?.stopDtmfTone() } - - fun getCallContact(context: Context, callback: (CallContact?) -> Unit) { - return getCallContact(context, call, callback) - } - - fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Unit) { - val privateCursor = context.getMyContactsCursor(false, true) - ensureBackgroundThread { - val callContact = CallContact("", "", "", "") - val handle = try { - call?.details?.handle?.toString() - } catch (e: NullPointerException) { - null - } - - if (handle == null) { - callback(callContact) - return@ensureBackgroundThread - } - - val uri = Uri.decode(handle) - if (uri.startsWith("tel:")) { - val number = uri.substringAfter("tel:") - SimpleContactsHelper(context).getAvailableContacts(false) { contacts -> - val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor) - if (privateContacts.isNotEmpty()) { - contacts.addAll(privateContacts) - } - - val contactsWithMultipleNumbers = contacts.filter { it.phoneNumbers.size > 1 } - val numbersToContactIDMap = HashMap() - contactsWithMultipleNumbers.forEach { contact -> - contact.phoneNumbers.forEach { phoneNumber -> - numbersToContactIDMap[phoneNumber.value] = contact.contactId - numbersToContactIDMap[phoneNumber.normalizedNumber] = contact.contactId - } - } - - callContact.number = number - val contact = contacts.firstOrNull { it.doesHavePhoneNumber(number) } - if (contact != null) { - callContact.name = contact.name - callContact.photoUri = contact.photoUri - - if (contact.phoneNumbers.size > 1) { - val specificPhoneNumber = contact.phoneNumbers.firstOrNull { it.value == number } - if (specificPhoneNumber != null) { - callContact.numberLabel = context.getPhoneNumberTypeText(specificPhoneNumber.type, specificPhoneNumber.label) - } - } - } else { - callContact.name = number - } - callback(callContact) - } - } - } - } - - fun getCallDuration(): Int { - return if (call != null) { - val connectTimeMillis = call!!.details.connectTimeMillis - if (connectTimeMillis == 0L) { - return 0 - } - ((System.currentTimeMillis() - connectTimeMillis) / 1000).toInt() - } else { - 0 - } - } } } interface CallManagerListener { - fun onStateChanged(call: Call, state: Int) + fun onStateChanged() fun onPrimaryCallChanged(call: Call) } sealed class PhoneState object NoCall : PhoneState() -class SingleCall(val call: Call?) : PhoneState() +class SingleCall(val call: Call) : PhoneState() class TwoCalls(val active: Call, val onHold: Call) : PhoneState() 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 324123b4..ecd286c6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallNotificationManager.kt @@ -28,7 +28,7 @@ class CallNotificationManager(private val context: Context) { @SuppressLint("NewApi") fun setupNotification() { - CallManager.getCallContact(context.applicationContext) { callContact -> + getCallContact(context.applicationContext, CallManager.getPrimaryCall()) { callContact -> val callContactAvatar = callContactAvatarHelper.getCallContactAvatar(callContact) val callState = CallManager.getState() val isHighPriority = context.powerManager.isInteractive && callState == Call.STATE_RINGING diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt index b6ba9283..43315238 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/services/CallService.kt @@ -4,15 +4,13 @@ import android.app.KeyguardManager import android.content.Context import android.telecom.Call import android.telecom.InCallService -import android.util.Log import com.simplemobiletools.dialer.activities.CallActivity import com.simplemobiletools.dialer.extensions.getStateCompat import com.simplemobiletools.dialer.extensions.isOutgoing import com.simplemobiletools.dialer.extensions.powerManager import com.simplemobiletools.dialer.helpers.CallManager import com.simplemobiletools.dialer.helpers.CallNotificationManager - -const val TAG = "SimpleDialer:CallService" +import com.simplemobiletools.dialer.helpers.NoCall class CallService : InCallService() { private val callNotificationManager by lazy { CallNotificationManager(this) } @@ -45,18 +43,18 @@ class CallService : InCallService() { override fun onCallRemoved(call: Call) { super.onCallRemoved(call) - Log.d(TAG, "onCallRemoved: $call") call.unregisterCallback(callListener) + val wasPrimaryCall = call == CallManager.getPrimaryCall() CallManager.onCallRemoved(call) - if (CallManager.calls.isEmpty()) { - CallManager.call = null + if (CallManager.getPhoneState() == NoCall) { CallManager.inCallService = null callNotificationManager.cancelNotification() } else { callNotificationManager.setupNotification() - startActivity(CallActivity.getStartIntent(this)) + if (wasPrimaryCall) { + startActivity(CallActivity.getStartIntent(this)) + } } - Log.d(TAG, "onCallRemoved: calls=${CallManager.calls.size}") } override fun onDestroy() { diff --git a/app/src/main/res/drawable/ic_call_split_vector.xml b/app/src/main/res/drawable/ic_call_split_vector.xml new file mode 100644 index 00000000..5afba98d --- /dev/null +++ b/app/src/main/res/drawable/ic_call_split_vector.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index bf927509..52e3ae73 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -207,9 +207,9 @@ android:contentDescription="@string/hold_call" android:padding="@dimen/medium_margin" android:src="@drawable/ic_pause_vector" - app:layout_constraintEnd_toStartOf="@id/call_add" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" /> + app:layout_constraintEnd_toEndOf="@+id/call_toggle_microphone" + app:layout_constraintStart_toStartOf="@+id/call_toggle_microphone" + app:layout_constraintTop_toBottomOf="@+id/call_toggle_microphone" /> + app:layout_constraintEnd_toEndOf="@+id/call_dialpad" + app:layout_constraintStart_toStartOf="@+id/call_dialpad" + app:layout_constraintTop_toBottomOf="@+id/call_dialpad" + tools:visibility="visible" /> + app:layout_constraintStart_toStartOf="@+id/call_toggle_microphone" + app:layout_constraintTop_toBottomOf="@+id/call_toggle_microphone" /> + + + + + diff --git a/app/src/main/res/layout/item_conference_call.xml b/app/src/main/res/layout/item_conference_call.xml new file mode 100644 index 00000000..0833746b --- /dev/null +++ b/app/src/main/res/layout/item_conference_call.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + From a94496c55ca819e3f39de463d251e6db0b60216f Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Thu, 19 May 2022 12:28:58 +0300 Subject: [PATCH 05/10] update resources --- app/src/main/res/layout/activity_call.xml | 2 +- app/src/main/res/values-bg/strings.xml | 6 ++++++ app/src/main/res/values-ca/strings.xml | 8 +++++++- app/src/main/res/values-cs/strings.xml | 8 +++++++- app/src/main/res/values-da/strings.xml | 6 ++++++ app/src/main/res/values-de/strings.xml | 6 ++++++ app/src/main/res/values-el/strings.xml | 6 ++++++ app/src/main/res/values-eo/strings.xml | 6 ++++++ app/src/main/res/values-es/strings.xml | 6 ++++++ app/src/main/res/values-et/strings.xml | 6 ++++++ app/src/main/res/values-fi/strings.xml | 6 ++++++ app/src/main/res/values-fr/strings.xml | 6 ++++++ app/src/main/res/values-gl/strings.xml | 6 ++++++ app/src/main/res/values-hr/strings.xml | 6 ++++++ app/src/main/res/values-hu/strings.xml | 6 ++++++ app/src/main/res/values-id/strings.xml | 6 ++++++ app/src/main/res/values-it/strings.xml | 6 ++++++ app/src/main/res/values-ja/strings.xml | 6 ++++++ app/src/main/res/values-lt/strings.xml | 6 ++++++ app/src/main/res/values-ml/strings.xml | 6 ++++++ app/src/main/res/values-nb-rNO/strings.xml | 6 ++++++ app/src/main/res/values-nl/strings.xml | 8 +++++++- app/src/main/res/values-pl/strings.xml | 8 +++++++- app/src/main/res/values-pt-rBR/strings.xml | 6 ++++++ app/src/main/res/values-pt/strings.xml | 6 ++++++ app/src/main/res/values-ro/strings.xml | 6 ++++++ app/src/main/res/values-ru/strings.xml | 6 ++++++ app/src/main/res/values-sk/strings.xml | 6 ++++++ app/src/main/res/values-sv/strings.xml | 6 ++++++ app/src/main/res/values-tr/strings.xml | 8 +++++++- app/src/main/res/values-uk/strings.xml | 8 +++++++- app/src/main/res/values-zh-rCN/strings.xml | 8 +++++++- app/src/main/res/values-zh-rTW/strings.xml | 6 ++++++ app/src/main/res/values/strings.xml | 2 +- 34 files changed, 201 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index 52e3ae73..bc436dcb 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -230,7 +230,7 @@ android:layout_height="@dimen/dialpad_button_size" android:layout_marginTop="@dimen/bigger_margin" android:background="?attr/selectableItemBackgroundBorderless" - android:contentDescription="@string/call_manage" + android:contentDescription="@string/conference_manage" android:padding="@dimen/medium_margin" android:src="@drawable/ic_people_vector" android:visibility="gone" diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 362e3cbf..30a463ab 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Бързо набиране Управление на бързото набиране diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 45824070..789e6db9 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -47,6 +47,12 @@ Trucada en espera Reprèn la trucada En espera + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Marcatge ràpid Gestiona el marcatge ràpid @@ -66,4 +72,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 10e75b2d..726b18f0 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Rychlé vytáčení Spravujte rychlou volbu @@ -89,4 +95,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 3e872a25..9a8ea6e7 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Hurtigopkald Administrér hurtigopkald diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5b8b0ef1..19c91a88 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Kurzwahl Kurzwahlnummern verwalten diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 3460f71a..83623ff3 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -50,6 +50,12 @@ Αναμονή Κλήσης Συνέχιση Κλήσης Σε Αναμονή + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Ταχεία κλήση diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 1cb048f9..55f8791f 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -51,6 +51,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Speed dial diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 034edd79..9e6776a9 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Marcado rápido Administrar marcado rápido diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index 03156089..9db88df1 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Kiirvalimine Klõpsa numbrit ja seosta ta konkreetse telefoniraamatu kirjega. Hiljem saad samale numbrile pikalt vajutades alustada kõnet määratud telefoninumbrile. diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 4b282eae..9c435086 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Pikavalinta Pikavalinnan asetukset diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 21ddbee9..f1efe9a7 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Numérotation rapide Gérer la numérotation rapide diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 7ad2eb8d..7992fee5 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Marcación rápida Xestionar marcacións rápidas diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index ea8d7596..acdaf48f 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Brzo biranje Upravljajte brzim biranjem diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 7dce2a65..dcd524d6 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Gyors tárcsázó Gyors tárcsázó kezelése diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index 12a84dcd..1cf3774a 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Panggilan cepat Kelola panggilan cepat diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 9cb90b2d..e8189a29 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Contatti veloci Gestisci i contatti veloci diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index e80a3d90..f250b88f 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference スピードダイヤル スピードダイヤルの管理 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 3965a88d..cadc4e52 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Spartusis rinkimas Tvarkyti spartųjį rinkimą diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index 421bb22f..75e69c6d 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -50,6 +50,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference സ്പീഡ് ഡയൽ diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index bc8d131c..f9da0b13 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Hurtigvalg Administrer hurtigvalg diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 566bca95..ea80b104 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -47,6 +47,12 @@ In wacht Hervatten In de wacht + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Snelkiesnummer Snelkiezen beheren @@ -67,4 +73,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 53342a16..ce1bd325 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -47,6 +47,12 @@ Wstrzymaj połączenie Wznów połączenie Wstrzymane + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Szybkie wybieranie Zarządzaj szybkim wybieraniem @@ -89,4 +95,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 1021b603..d3068e16 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Ligação rápida Gerenciar ligações rápidas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index e0f70658..84aff255 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Marcação rápida Gerir marcações rápidas diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 26191471..254b0a46 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Apelare rapidă Gestionați apelarea rapidă diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4f5dd650..1260d75f 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Быстрый вызов Управление быстрым вызовом diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index bd336bc1..01d0abdf 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -51,6 +51,12 @@ Podržať hovor Obnoviť hovor Podržaný hovor + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Rýchle vytáčanie diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 279a1b31..a0a772a0 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Snabbuppringning Hantera snabbuppringning diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 962cebba..a790df02 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -47,6 +47,12 @@ Aramayı beklet Aramayı devam ettir Beklemede + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Hızlı arama Hızlı aramayı yönet @@ -66,4 +72,4 @@ Bazı dizeleri bulamadınız mı? Burada daha fazlası var: https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index fb967106..cda650ec 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -46,7 +46,13 @@ Завершити виклик Перевести в утримання Зняти з утримання - Дзвінок утримується + Утримується + Поміняти + З\'єднати + Роз\'єднати + Додати дзвінок + Керувати конференц-викликом + Конференц-виклик Швидкий виклик Управління швидким викликом diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index a0626fa4..ed180af7 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -47,6 +47,12 @@ 保持通话 继续通话 暂停 + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference 快速拨号 管理快速拨号 @@ -89,4 +95,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 6aadb180..4236c343 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -47,6 +47,12 @@ Hold call Resume call On Hold + Swap calls + Merge calls + Split call + Add call + Manage conference call + Conference Speed dial diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 49689d9a..c32cc0e8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -55,7 +55,7 @@ Merge calls Split call Add call - Manage calls + Manage conference call Conference From 936f232f44fc3ab9b36f96a67bcc0436e24c5ab3 Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Thu, 19 May 2022 12:31:05 +0300 Subject: [PATCH 06/10] remove debug logs --- .../dialer/activities/CallActivity.kt | 6 ------ .../dialer/helpers/CallManager.kt | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt index d632805d..d99c868f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -14,7 +14,6 @@ import android.os.Looper import android.os.PowerManager import android.telecom.Call import android.telecom.CallAudioState -import android.util.Log import android.view.MotionEvent import android.view.WindowManager import android.widget.ImageView @@ -30,8 +29,6 @@ import com.simplemobiletools.dialer.models.CallContact import kotlinx.android.synthetic.main.activity_call.* import kotlinx.android.synthetic.main.dialpad.* -const val TAG = "SimpleDialer:CallActivityTag" - class CallActivity : SimpleActivity() { companion object { fun getStartIntent(context: Context): Intent { @@ -408,7 +405,6 @@ class CallActivity : SimpleActivity() { private fun updateCallState(call: Call) { val state = call.getStateCompat() - Log.d(TAG, "updateCallState: $state") when (state) { Call.STATE_RINGING -> callRinging() Call.STATE_ACTIVE -> callStarted() @@ -434,7 +430,6 @@ class CallActivity : SimpleActivity() { private fun updateState() { val phoneState = CallManager.getPhoneState() - Log.d(TAG, "updateState: $phoneState") if (phoneState is SingleCall) { updateCallState(phoneState.call) updateCallOnHoldState(null) @@ -541,7 +536,6 @@ class CallActivity : SimpleActivity() { } override fun onPrimaryCallChanged(call: Call) { - Log.d(TAG, "onPrimaryCallChanged: $call") callDurationHandler.removeCallbacks(updateCallDurationTask) updateCallContactInfo(call) updateState() diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index ea3d1b40..f23af27a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -4,15 +4,11 @@ import android.annotation.SuppressLint import android.telecom.Call import android.telecom.InCallService import android.telecom.VideoProfile -import android.util.Log import com.simplemobiletools.dialer.extensions.getStateCompat import com.simplemobiletools.dialer.extensions.hasCapability import com.simplemobiletools.dialer.extensions.isConference import java.util.concurrent.CopyOnWriteArraySet -const val TAG = "SimpleDialer:CallManager" -const val TAG2 = TAG /*"SimpleDialer:CallState"*/ - // inspired by https://github.com/Chooloo/call_manage class CallManager { companion object { @@ -25,23 +21,19 @@ class CallManager { fun onCallAdded(call: Call) { this.call = call calls.add(call) - Log.d(TAG, "onCallAdded (${calls.size}): $call") for (listener in listeners) { listener.onPrimaryCallChanged(call) } call.registerCallback(object : Call.Callback() { override fun onStateChanged(call: Call, state: Int) { - Log.d(TAG, "onStateChanged: $call") updateState() } override fun onDetailsChanged(call: Call, details: Call.Details) { - Log.d(TAG, "onDetailsChanged") updateState() } override fun onConferenceableCallsChanged(call: Call, conferenceableCalls: MutableList) { - Log.d(TAG, "onConferenceableCallsChanged (${conferenceableCalls.size}): $call") updateState() } }) @@ -49,22 +41,18 @@ class CallManager { fun onCallRemoved(call: Call) { calls.remove(call) - Log.d(TAG, "onCallRemoved (${calls.size}): $call") updateState() } fun getPhoneState(): PhoneState { return when (calls.size) { 0 -> { - Log.d(TAG2, "No call") NoCall } 1 -> { - Log.d(TAG2, "Single call") SingleCall(calls.first()) } 2 -> { - Log.d(TAG2, "Two calls") val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE } val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING } val onHold = calls.find { it.getStateCompat() == Call.STATE_HOLDING } @@ -87,18 +75,13 @@ class CallManager { } else { null } - Log.d(TAG2, "Conference call (${conference.children.size} children)") - Log.d(TAG2, "secondCall: $secondCall") if (secondCall == null) { - Log.d(TAG2, "Conference call (single)") SingleCall(conference) } else { val newCallState = secondCall.getStateCompat() if (newCallState == Call.STATE_ACTIVE || newCallState == Call.STATE_CONNECTING || newCallState == Call.STATE_DIALING) { - Log.d(TAG2, "Conference call and regular call (conference on hold)") TwoCalls(secondCall, conference) } else { - Log.d(TAG2, "Conference call and regular call (regular call on hold)") TwoCalls(conference, secondCall) } } From 7142b6363b9353da81c59f8eb96d6039b0d09906 Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Thu, 19 May 2022 14:06:07 +0300 Subject: [PATCH 07/10] refactoring --- .../simplemobiletools/dialer/activities/CallActivity.kt | 8 +++++--- .../dialer/activities/ConferenceActivity.kt | 1 - .../dialer/adapters/ConferenceCallsAdapter.kt | 9 +++------ .../dialer/helpers/CallContactHelper.kt | 1 + .../com/simplemobiletools/dialer/helpers/CallManager.kt | 8 ++------ 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt index d99c868f..a7e39db9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -587,8 +587,10 @@ class CallActivity : SimpleActivity() { } } - private fun setActionButtonEnabled(button: ImageView, isEnabled: Boolean) { - button.isEnabled = isEnabled - button.alpha = if (isEnabled) 1.0f else LOWER_ALPHA + private fun setActionButtonEnabled(button: ImageView, enabled: Boolean) { + button.apply { + isEnabled = enabled + alpha = if (enabled) 1.0f else LOWER_ALPHA + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt index 6ad3c2d1..f3633b23 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/ConferenceActivity.kt @@ -11,7 +11,6 @@ class ConferenceActivity : SimpleActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_conference) - supportActionBar conference_calls_list.adapter = ConferenceCallsAdapter(this, conference_calls_list, ArrayList(CallManager.getConferenceCalls())) {} } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt index 2d9b339d..ebdb962d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt @@ -33,14 +33,11 @@ class ConferenceCallsAdapter( override fun getSelectableItemCount(): Int = data.size - override fun onActionModeCreated() { - } + override fun onActionModeCreated() {} - override fun onActionModeDestroyed() { - } + override fun onActionModeDestroyed() {} - override fun prepareActionMode(menu: Menu) { - } + override fun prepareActionMode(menu: Menu) {} override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_conference_call, parent) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt index 3f234793..9d0b4cb5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallContactHelper.kt @@ -17,6 +17,7 @@ fun getCallContact(context: Context, call: Call?, callback: (CallContact) -> Uni callback(CallContact(context.getString(R.string.conference), "", "", "")) return } + val privateCursor = context.getMyContactsCursor(false, true) ensureBackgroundThread { val callContact = CallContact("", "", "", "") diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt index f23af27a..57b6239c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/CallManager.kt @@ -46,12 +46,8 @@ class CallManager { fun getPhoneState(): PhoneState { return when (calls.size) { - 0 -> { - NoCall - } - 1 -> { - SingleCall(calls.first()) - } + 0 -> NoCall + 1 -> SingleCall(calls.first()) 2 -> { val active = calls.find { it.getStateCompat() == Call.STATE_ACTIVE } val newCall = calls.find { it.getStateCompat() == Call.STATE_CONNECTING || it.getStateCompat() == Call.STATE_DIALING } From dd2c2f00ad977e66dc75c9cf72542944487911e5 Mon Sep 17 00:00:00 2001 From: Mysochenko Yuriy Date: Fri, 20 May 2022 09:42:01 +0300 Subject: [PATCH 08/10] fix code formatting --- .../dialer/adapters/ConferenceCallsAdapter.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt index ebdb962d..961eda02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/adapters/ConferenceCallsAdapter.kt @@ -18,8 +18,7 @@ class ConferenceCallsAdapter( activity: SimpleActivity, recyclerView: MyRecyclerView, val data: ArrayList, itemClick: (Any) -> Unit ) : MyRecyclerViewAdapter(activity, recyclerView, itemClick) { - override fun actionItemPressed(id: Int) { - } + override fun actionItemPressed(id: Int) {} override fun getActionMenuId(): Int = 0 From 5e743ec6a835fc181194e3069f2f7ffecb3fe328 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 23 May 2022 14:31:52 +0200 Subject: [PATCH 09/10] updating the french app name --- app/src/main/res/values-fr/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ada667b7..12d3ceb0 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,6 +1,6 @@ - Simple Dialer + Simple Téléphone Téléphone Veuillez faire de cette application votre application de téléphone par défaut Veuillez permettre l\'affichage sur d\'autres applications pour un comportement fiable @@ -89,4 +89,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + From fde8ceabf93ecba4d99a0f952f0f9324890dae23 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 23 May 2022 14:48:44 +0200 Subject: [PATCH 10/10] updating the slovak strings --- app/src/main/res/values-sk/strings.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 01d0abdf..94f67e92 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -51,12 +51,12 @@ Podržať hovor Obnoviť hovor Podržaný hovor - Swap calls - Merge calls - Split call - Add call - Manage conference call - Conference + Prehodiť hovory + Zlúčiť hovory + Rozdeliť call + Pridať hovor + Spravovať konferenčný hovor + Konferencia Rýchle vytáčanie