From 76a85466cee3c8f0afc904c163ac50bec22e16d2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 May 2020 22:26:43 +0200 Subject: [PATCH 1/7] set the alpha of big contact image at View Details to 0 by default --- .../main/res/layout/activity_view_contact.xml | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/app/src/main/res/layout/activity_view_contact.xml b/app/src/main/res/layout/activity_view_contact.xml index 4858bef5..f1809df4 100644 --- a/app/src/main/res/layout/activity_view_contact.xml +++ b/app/src/main/res/layout/activity_view_contact.xml @@ -1,7 +1,5 @@ - @@ -25,7 +23,7 @@ android:id="@+id/contact_photo" android:layout_width="@dimen/contact_photo_size" android:layout_height="@dimen/contact_photo_size" - android:layout_marginBottom="@dimen/normal_margin"/> + android:layout_marginBottom="@dimen/normal_margin" /> + android:visibility="gone" /> + android:src="@drawable/ic_email_vector" /> + android:src="@drawable/ic_phone_vector" /> + android:src="@drawable/ic_sms_vector" /> @@ -94,7 +92,7 @@ android:paddingTop="@dimen/medium_margin" android:paddingEnd="@dimen/small_margin" android:paddingBottom="@dimen/small_margin" - android:src="@drawable/ic_person_vector"/> + android:src="@drawable/ic_person_vector" /> + android:textSize="@dimen/bigger_text_size" /> + android:textSize="@dimen/bigger_text_size" /> + android:textSize="@dimen/bigger_text_size" /> + android:textSize="@dimen/bigger_text_size" /> + android:textSize="@dimen/bigger_text_size" /> + android:textSize="@dimen/bigger_text_size" /> + android:src="@drawable/img_write_storage" + android:visibility="gone" /> From 78e87e2df51818301fcaae153b3af9d7222f6afa Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 May 2020 22:32:47 +0200 Subject: [PATCH 2/7] make sure the proper layouts are shown at incoming/outgoing calls --- .../contacts/pro/activities/CallActivity.kt | 5 +++++ app/src/main/res/layout/activity_call.xml | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt index 103eea42..68d3edc7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt @@ -159,6 +159,7 @@ class CallActivity : SimpleActivity() { private fun updateCallState(state: Int) { when (state) { + Call.STATE_RINGING -> callRinging() Call.STATE_ACTIVE -> callStarted() Call.STATE_DISCONNECTED -> endCall() Call.STATE_CONNECTING -> initOutgoingCallUI() @@ -190,6 +191,10 @@ class CallActivity : SimpleActivity() { ongoing_call_holder.beVisible() } + private fun callRinging() { + incoming_call_holder.beVisible() + } + private fun callStarted() { incoming_call_holder.beGone() ongoing_call_holder.beVisible() diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index dfd946cd..644dd093 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -44,7 +44,8 @@ + android:layout_height="match_parent" + android:visibility="gone"> + android:layout_height="match_parent" + android:visibility="gone"> Date: Fri, 1 May 2020 22:44:18 +0200 Subject: [PATCH 3/7] updating min SDK version to 23, Marshmallow Android 6 --- app/build.gradle | 2 +- .../contacts/pro/activities/DialerActivity.kt | 3 --- .../com/simplemobiletools/contacts/pro/services/CallService.kt | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9f791167..6cb925ec 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,7 +15,7 @@ android { defaultConfig { applicationId "com.simplemobiletools.contacts.pro" - minSdkVersion 21 + minSdkVersion 23 targetSdkVersion 29 versionCode 60 versionName "6.9.0" diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialerActivity.kt index b05ff469..7f5aee0e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialerActivity.kt @@ -1,10 +1,8 @@ package com.simplemobiletools.contacts.pro.activities import android.annotation.SuppressLint -import android.annotation.TargetApi import android.content.Intent import android.net.Uri -import android.os.Build import android.os.Bundle import android.telecom.PhoneAccount import android.telecom.TelecomManager @@ -16,7 +14,6 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.helpers.REQUEST_CODE_SET_DEFAULT_DIALER import com.simplemobiletools.contacts.pro.R -@TargetApi(Build.VERSION_CODES.M) class DialerActivity : SimpleActivity() { private var callNumber: Uri? = null diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/services/CallService.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/services/CallService.kt index 139bd208..644628ee 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/services/CallService.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/services/CallService.kt @@ -1,14 +1,11 @@ package com.simplemobiletools.contacts.pro.services import android.content.Intent -import android.os.Build import android.telecom.Call import android.telecom.InCallService -import androidx.annotation.RequiresApi import com.simplemobiletools.contacts.pro.activities.CallActivity import com.simplemobiletools.contacts.pro.helpers.CallManager -@RequiresApi(Build.VERSION_CODES.M) class CallService : InCallService() { override fun onCallAdded(call: Call) { super.onCallAdded(call) From 69ae4afc8157a98713b584c0af91b528a4ef3540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20F=C4=B1r=C4=B1nc=C4=B1?= Date: Sat, 2 May 2020 00:08:16 +0300 Subject: [PATCH 4/7] Update strings.xml --- app/src/main/res/values-tr/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index fea41639..2ae07ca5 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -103,14 +103,14 @@ Çevirici - Accept - Decline - Unknown Caller - Is Calling - Dialing - Call Ended - Call Ending - Ongoing Call + Kabul Et + Reddet + Bilinmeyen Arama + Arıyor + Çevriliyor + Arama Sonlandırıldı + Arama Sonlandırılıyor + Devam Eden Arama Hızlı arama @@ -173,7 +173,7 @@ Bu basit kişi düzenleyicisi, ana ekranda telefon numaralarını göstermek, kişi küçük resminin görünürlüğünü değiştirmek, yalnızca telefon numaralarına sahip kişileri göstermek, bir arama başlatmadan önce bir arama onay kutusu göstermek gibi birçok kullanışlı ayara sahiptir. Harfleri de kullanan hızlı bir çevirici ile birlikte gelir. - Kullanıcı deneyimini daha da geliştirmek için, bir kişiye tıklandığında neler olacağını özelleştirebilirsiniz. Bir çağrı başlatabilir, Ayrıntıları Görüntüle ekranına gidebilir veya seçilen kişiyi düzenleyebilirsiniz. + Kullanıcı deneyimini daha da geliştirmek için, bir kişiye tıklandığında neler olacağını özelleştirebilirsiniz. Bir arama başlatabilir, Ayrıntıları Görüntüle ekranına gidebilir veya seçilen kişiyi düzenleyebilirsiniz. İstenmeyen gelen aramaları önlemek için telefon numaralarını kolayca engelleyebilirsiniz. From 8fef03fa03f1ae2e317d9185bb0f868da50f1e98 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 May 2020 23:31:44 +0200 Subject: [PATCH 5/7] adding 2 new strings related to selecting a SIM card --- app/src/main/res/values-ar/strings.xml | 2 ++ app/src/main/res/values-az/strings.xml | 2 ++ app/src/main/res/values-cs/strings.xml | 2 ++ app/src/main/res/values-cy/strings.xml | 2 ++ app/src/main/res/values-da/strings.xml | 2 ++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-el/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-eu/strings.xml | 2 ++ app/src/main/res/values-fi/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-hr/strings.xml | 2 ++ app/src/main/res/values-hu/strings.xml | 2 ++ app/src/main/res/values-id/strings.xml | 2 ++ app/src/main/res/values-in/strings.xml | 2 ++ app/src/main/res/values-it/strings.xml | 2 ++ app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-ko-rKR/strings.xml | 2 ++ app/src/main/res/values-lt/strings.xml | 2 ++ app/src/main/res/values-nl/strings.xml | 2 ++ app/src/main/res/values-pl/strings.xml | 2 ++ app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values-pt/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-sk/strings.xml | 2 ++ app/src/main/res/values-sv/strings.xml | 2 ++ app/src/main/res/values-tr/strings.xml | 2 ++ app/src/main/res/values-uk/strings.xml | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values-zh-rTW/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 31 files changed, 62 insertions(+) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 917d6c63..00ade1ed 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 7f6b8438..6135e086 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index e03a1c19..92052208 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Rychlé vytáčení diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index 5d1eedf8..d49922ab 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 66768e8e..1b2a90a0 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c41b99d1..65b24c63 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index f79ca9e3..8d60f7be 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Ταχεία Κλήση diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index d5d50c0a..cc1d78ef 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index 3db5c68b..f65c3e45 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 7ef62ebb..149de07b 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 5c7cd66d..cfe05b8c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index a20c0d29..33393fd5 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 419d27b2..15fc551c 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-id/strings.xml b/app/src/main/res/values-id/strings.xml index ac3115ff..6e48e75c 100644 --- a/app/src/main/res/values-id/strings.xml +++ b/app/src/main/res/values-id/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index ac3115ff..6e48e75c 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 4622cc2b..b0651f6d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index df600c95..1f70c3f5 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index ed878c5f..e54ac1e1 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 354bfd72..c0e16ec1 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 5c63a8b5..ed725d5a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Snelkiezer diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 42e9932f..d98bbba5 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8cabf290..31b446c9 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d0921e3f..349a9303 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Ligação rápida diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 94b12b99..baf030ee 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -111,6 +111,8 @@ Вызов завершён Завершение вызова Текущий вызов + Select a SIM for this call + Always use this SIM for this number Быстрый набор diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 53ed85a2..01e7c5e2 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -111,6 +111,8 @@ Hovor ukončený Hovor končí Prebiehajúci hovor + Zvoľte SIM pre tento hovor + Stále použiť túto SIM pri volaní tohto čísla 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 ef29bb81..36a0a321 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 2ae07ca5..64524035 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -111,6 +111,8 @@ Arama Sonlandırıldı Arama Sonlandırılıyor Devam Eden Arama + Select a SIM for this call + Always use this SIM for this number Hızlı arama diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index a2fc5223..21f36bb2 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index eb60dfe3..051174a5 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 5e834514..fbcc4374 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number 快速撥號 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ddd2a7c2..ee20b9dc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -111,6 +111,8 @@ Call Ended Call Ending Ongoing Call + Select a SIM for this call + Always use this SIM for this number Speed dial From f177cbd0118028b8739869e379650b7878360fd6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 1 May 2020 23:50:22 +0200 Subject: [PATCH 6/7] adding an initial implementation of the PhoneAccount picker --- app/build.gradle | 2 +- .../contacts/pro/activities/CallActivity.kt | 33 ++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6cb925ec..01a77f74 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -57,7 +57,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.27.1' + implementation 'com.simplemobiletools:commons:5.27.2' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5' diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt index 68d3edc7..9f28ec2f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/CallActivity.kt @@ -16,11 +16,10 @@ import android.util.Size import android.view.WindowManager import android.widget.RemoteViews import androidx.core.app.NotificationCompat +import com.simplemobiletools.commons.dialogs.RadioGroupDialog import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.MINUTE_SECONDS -import com.simplemobiletools.commons.helpers.isOreoMr1Plus -import com.simplemobiletools.commons.helpers.isOreoPlus -import com.simplemobiletools.commons.helpers.isQPlus +import com.simplemobiletools.commons.helpers.* +import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.contacts.pro.R import com.simplemobiletools.contacts.pro.extensions.audioManager import com.simplemobiletools.contacts.pro.extensions.config @@ -163,6 +162,7 @@ class CallActivity : SimpleActivity() { Call.STATE_ACTIVE -> callStarted() Call.STATE_DISCONNECTED -> endCall() Call.STATE_CONNECTING -> initOutgoingCallUI() + Call.STATE_SELECT_PHONE_ACCOUNT -> showPhoneAccountPicker() } if (state == Call.STATE_DISCONNECTED || state == Call.STATE_DISCONNECTING) { @@ -202,6 +202,31 @@ class CallActivity : SimpleActivity() { callTimer.scheduleAtFixedRate(getCallTimerUpdateTask(), 1000, 1000) } + @SuppressLint("MissingPermission") + private fun showPhoneAccountPicker() { + if (!hasPermission(PERMISSION_READ_PHONE_STATE)) { + return + } + + val items = ArrayList() + telecomManager.callCapablePhoneAccounts.forEachIndexed { index, account -> + val phoneAccount = telecomManager.getPhoneAccount(account) + var label = phoneAccount.label.toString() + var address = phoneAccount.address.toString() + if (address.startsWith("tel:") && address.substringAfter("tel:").isNotEmpty()) { + address = Uri.decode(address.substringAfter("tel:")) + label += " ($address)" + } + + val radioItem = RadioItem(index, label, phoneAccount.accountHandle) + items.add(radioItem) + } + + RadioGroupDialog(this, items, titleId = R.string.select_sim) { + + } + } + private fun endCall() { CallManager.reject() if (proximityWakeLock?.isHeld == true) { From f802d74af6c87eba81ffc67a60e97fdfc9916ff3 Mon Sep 17 00:00:00 2001 From: spkprs Date: Sat, 2 May 2020 01:09:53 +0300 Subject: [PATCH 7/7] Update strings.xml --- app/src/main/res/values-el/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 8d60f7be..565bf54c 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -103,16 +103,16 @@ Πληκτρολόγιο - Accept - Decline - Unknown Caller - Is Calling - Dialing - Call Ended - Call Ending - Ongoing Call - Select a SIM for this call - Always use this SIM for this number + Αποδοχή + Απόρριψη + Άγνωστος + Καλεί + Πληκτρολόγηση + Τέλος Κλήσης + Τερματισμός Κλήσης + Τρέχουσα κλήση + Επιλέξτε SIM για αυτήν την κλήση + Χρήση πάντα αυτής της SIM για αυτόν τον αριθμό Ταχεία Κλήση