From 2246e47a9c84105e21294ec139c820488dbd54dd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 May 2020 16:04:02 +0200 Subject: [PATCH 01/11] adding chinese app data translation --- .../android/zh-rCN/full_description.txt | 22 +++++++++++++++++++ .../android/zh-rCN/short_description.txt | 1 + fastlane/metadata/android/zh-rCN/title.txt | 1 + 3 files changed, 24 insertions(+) create mode 100644 fastlane/metadata/android/zh-rCN/full_description.txt create mode 100644 fastlane/metadata/android/zh-rCN/short_description.txt create mode 100644 fastlane/metadata/android/zh-rCN/title.txt diff --git a/fastlane/metadata/android/zh-rCN/full_description.txt b/fastlane/metadata/android/zh-rCN/full_description.txt new file mode 100644 index 00000000..b9422db9 --- /dev/null +++ b/fastlane/metadata/android/zh-rCN/full_description.txt @@ -0,0 +1,22 @@ +A lightweight app for handling your calls, no matter where are you. Comes with a handy call log for easy call initiation. + +There is a quick dialpad at your service too, with smart contact suggestions. It supports letters too. + +You can easily block phone numbers to avoid unwanted incoming calls. + +Supported Speed dialing makes calling your favorite contacts with this true phone a breeze. + +To help you manage your calls quickly the Phone app also supports favorite contacts and creating shortcuts of any contact on the home screen. + +It comes with material design and dark theme by default, provides great user experience for easy usage. The lack of internet access gives you more privacy, security and stability than other apps. + +不包含广告及非必要的权限,而且完全开放源代码,并提供自定义颜色。 + +于此查看简易工具系列全套: +https://www.simplemobiletools.com + +Facebook: +https://www.facebook.com/simplemobiletools + +Reddit: +https://www.reddit.com/r/SimpleMobileTools diff --git a/fastlane/metadata/android/zh-rCN/short_description.txt b/fastlane/metadata/android/zh-rCN/short_description.txt new file mode 100644 index 00000000..23fbcb4a --- /dev/null +++ b/fastlane/metadata/android/zh-rCN/short_description.txt @@ -0,0 +1 @@ +易于上手的通话管理器,包含电话本、号码阻止和多 SIM 卡支持 diff --git a/fastlane/metadata/android/zh-rCN/title.txt b/fastlane/metadata/android/zh-rCN/title.txt new file mode 100644 index 00000000..71deb16a --- /dev/null +++ b/fastlane/metadata/android/zh-rCN/title.txt @@ -0,0 +1 @@ +简易拨号器 - 轻松管理你的手机通话 From a7d36936d7d4ece1fba173f45a8a0d5d0fc27d87 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 May 2020 23:08:16 +0200 Subject: [PATCH 02/11] fix #40, try harder at fetching contact name at Recents --- app/build.gradle | 2 +- .../dialer/helpers/RecentsHelper.kt | 138 +++++++++++------- 2 files changed, 86 insertions(+), 54 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b0156352..c9654edf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -56,6 +56,6 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.28.21' + implementation 'com.simplemobiletools:commons:5.28.25' implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a' } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt index 0bb73e0d..977b0aa8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt @@ -4,76 +4,108 @@ import android.annotation.SuppressLint import android.content.Context import android.provider.CallLog.Calls import com.simplemobiletools.commons.extensions.* -import com.simplemobiletools.commons.helpers.PERMISSION_READ_CALL_LOG -import com.simplemobiletools.commons.helpers.ensureBackgroundThread -import com.simplemobiletools.commons.helpers.getQuestionMarks -import com.simplemobiletools.dialer.extensions.config +import com.simplemobiletools.commons.helpers.* +import com.simplemobiletools.commons.models.SimpleContact import com.simplemobiletools.dialer.extensions.getAvailableSIMCardLabels import com.simplemobiletools.dialer.models.RecentCall class RecentsHelper(private val context: Context) { + private val COMPARABLE_PHONE_NUMBER_LENGTH = 9 + @SuppressLint("MissingPermission") fun getRecentCalls(callback: (ArrayList) -> Unit) { + val privateCursor = context.getMyContactsContentProviderCursorLoader().loadInBackground() ensureBackgroundThread { - var recentCalls = ArrayList() if (!context.hasPermission(PERMISSION_READ_CALL_LOG)) { - callback(recentCalls) + callback(ArrayList()) return@ensureBackgroundThread } - val uri = Calls.CONTENT_URI - val projection = arrayOf( - Calls._ID, - Calls.NUMBER, - Calls.CACHED_NAME, - Calls.CACHED_PHOTO_URI, - Calls.DATE, - Calls.DURATION, - Calls.TYPE, - "phone_account_address" - ) - - val numberToSimIDMap = HashMap() - context.getAvailableSIMCardLabels().forEach { - numberToSimIDMap[it.phoneNumber] = it.id - } - - val sortOrder = "${Calls._ID} DESC LIMIT 100" - - var previousRecentCallFrom = "" - context.queryCursor(uri, projection, sortOrder = sortOrder, showErrors = true) { cursor -> - val id = cursor.getIntValue(Calls._ID) - val number = cursor.getStringValue(Calls.NUMBER) - var name = cursor.getStringValue(Calls.CACHED_NAME) - if (name == null || name.isEmpty()) { - name = number + SimpleContactsHelper(context).getAvailableContacts(false) { contacts -> + val privateContacts = MyContactsContentProvider.getSimpleContacts(context, privateCursor) + if (privateContacts.isNotEmpty()) { + contacts.addAll(privateContacts) } - val photoUri = cursor.getStringValue(Calls.CACHED_PHOTO_URI) ?: "" - val startTS = (cursor.getLongValue(Calls.DATE) / 1000L).toInt() - val duration = cursor.getIntValue(Calls.DURATION) - val type = cursor.getIntValue(Calls.TYPE) - val accountAddress = cursor.getStringValue("phone_account_address") - val simID = numberToSimIDMap[accountAddress] ?: 1 - val neighbourIDs = ArrayList() - val recentCall = RecentCall(id, number, name, photoUri, startTS, duration, type, neighbourIDs, simID) - - // if we have 3 missed calls from the same number, show it just once - if ("$number$name" != previousRecentCallFrom) { - recentCalls.add(recentCall) - } else { - recentCalls.lastOrNull()?.neighbourIDs?.add(id) - } - - previousRecentCallFrom = "$number$name" + getRecents(contacts, callback) } - - val blockedNumbers = context.getBlockedNumbers() - recentCalls = recentCalls.filter { !context.isNumberBlocked(it.phoneNumber, blockedNumbers) }.toMutableList() as ArrayList - callback(recentCalls) } } + private fun getRecents(contacts: ArrayList, callback: (ArrayList) -> Unit) { + var recentCalls = ArrayList() + val uri = Calls.CONTENT_URI + val projection = arrayOf( + Calls._ID, + Calls.NUMBER, + Calls.CACHED_NAME, + Calls.CACHED_PHOTO_URI, + Calls.DATE, + Calls.DURATION, + Calls.TYPE, + "phone_account_address" + ) + + val numberToSimIDMap = HashMap() + context.getAvailableSIMCardLabels().forEach { + numberToSimIDMap[it.phoneNumber] = it.id + } + + val sortOrder = "${Calls._ID} DESC LIMIT 100" + var previousRecentCallFrom = "" + val contactsNumbersMap = HashMap() + context.queryCursor(uri, projection, sortOrder = sortOrder, showErrors = true) { cursor -> + val id = cursor.getIntValue(Calls._ID) + val number = cursor.getStringValue(Calls.NUMBER) + var name = cursor.getStringValue(Calls.CACHED_NAME) + if (name == null || name.isEmpty()) { + name = number + } + + if (name == number) { + if (contactsNumbersMap.containsKey(number)) { + name = contactsNumbersMap[number]!! + } else { + val normalizedNumber = number.normalizePhoneNumber() + if (normalizedNumber!!.length >= COMPARABLE_PHONE_NUMBER_LENGTH) { + name = contacts.firstOrNull { contact -> + val curNumber = contact.phoneNumber.normalizePhoneNumber() + if (curNumber!!.length >= COMPARABLE_PHONE_NUMBER_LENGTH) { + if (curNumber.substring(curNumber.length - COMPARABLE_PHONE_NUMBER_LENGTH) == normalizedNumber.substring(normalizedNumber.length - COMPARABLE_PHONE_NUMBER_LENGTH)) { + contactsNumbersMap[number] = contact.name + return@firstOrNull true + } + } + false + }?.name ?: number + } + } + } + + val photoUri = cursor.getStringValue(Calls.CACHED_PHOTO_URI) ?: "" + val startTS = (cursor.getLongValue(Calls.DATE) / 1000L).toInt() + val duration = cursor.getIntValue(Calls.DURATION) + val type = cursor.getIntValue(Calls.TYPE) + val accountAddress = cursor.getStringValue("phone_account_address") + val simID = numberToSimIDMap[accountAddress] ?: 1 + val neighbourIDs = ArrayList() + val recentCall = RecentCall(id, number, name, photoUri, startTS, duration, type, neighbourIDs, simID) + + // if we have multiple missed calls from the same number, show it just once + if ("$number$name" != previousRecentCallFrom) { + recentCalls.add(recentCall) + } else { + recentCalls.lastOrNull()?.neighbourIDs?.add(id) + } + + previousRecentCallFrom = "$number$name" + } + + val blockedNumbers = context.getBlockedNumbers() + recentCalls = recentCalls.filter { !context.isNumberBlocked(it.phoneNumber, blockedNumbers) }.toMutableList() as ArrayList + callback(recentCalls) + } + @SuppressLint("MissingPermission") fun removeRecentCalls(ids: ArrayList, callback: () -> Unit) { ensureBackgroundThread { From 25af2ccd447df1bc6c4e797a77552be6da6da916 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 May 2020 23:12:19 +0200 Subject: [PATCH 03/11] adding a new string for grouping subsequent calls at the history --- app/src/main/res/values-de/strings.xml | 3 +++ app/src/main/res/values-el/strings.xml | 3 +++ app/src/main/res/values-nl/strings.xml | 3 +++ app/src/main/res/values-pt/strings.xml | 3 +++ app/src/main/res/values-sk/strings.xml | 3 +++ app/src/main/res/values-zh-rCN/strings.xml | 3 +++ app/src/main/res/values/strings.xml | 3 +++ 7 files changed, 21 insertions(+) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index bdbf1850..88a752dc 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -32,6 +32,9 @@ Kurzwahlnummern verwalten klicke auf eine Zahl um einen Kontakt zuzuweisen. Danach kannst du den Kontakt schnell durch langes drücken der entsprechenden Zahl anrufen + + Group subsequent calls with the same number at the call log + Schlichtes Telefon diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 80bfcc47..b166a3aa 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -32,6 +32,9 @@ Διαχείριση ταχείας κλήσης Κάντε κλικ σε έναν αριθμό για να αντιστοιχίσετε μια επαφή σε αυτόν. Στη συνέχεια, μπορείτε να καλέσετε γρήγορα τη δεδομένη επαφή πατώντας τον αριθμό αυτόν. + + Group subsequent calls with the same number at the call log + Απλή κλήση - Διαχειριστείτε εύκολα τις κλήσεις σας diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 20bd5036..35523de7 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -32,6 +32,9 @@ Snelkiezer bewerken Klik op een cijfer om er een contact aan te koppelen. Vervolgens kan deze persoon direct gebeld worden door in de kiezer lang op het gekoppelde cijfer te drukken. + + Group subsequent calls with the same number at the call log + Eenvoudige Telefoon - Beheer gesprekken met gemak diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index a9ddbcd8..07680bd9 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -32,6 +32,9 @@ Gerir ligações rápidas Clique no número para atribuir um contacto à ligação rápida. Posteriormente, poderá ligar diretamente ao contacto através da tecla de ligação rápida. + + Group subsequent calls with the same number at the call log + Simple Dialer - Gestão de chamadas diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 151bdd7e..59135b29 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -32,6 +32,9 @@ Spravovať rýchle vytáčanie Pre priradenie kontaktu kliknite na číslo. Následne viete daný kontakt rýchlo vytočiť dlhým podržaním čísla na číselníku. + + Zoskupiť susedné volania s rovnakým číslom v histórií volaní + Jednoduchý telefón - Spravujte hovory jednoducho diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 1b4e284d..437fd259 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -32,6 +32,9 @@ 管理快速拨号 点击一个数字来分配一个联系人。之后你可以在拨号盘长按指定的号码来快速呼叫指定的联系人。 + + Group subsequent calls with the same number at the call log + 简易拨号器 - 轻松管理你的手机通话 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d4c35a65..f359bbb4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,6 +32,9 @@ Manage speed dial Click on a number to assign a contact to it. You can then quickly call the given contact by long pressing the given number at the dialer. + + Group subsequent calls with the same number at the call log + Simple Dialer - Manage your phone calls easily From 05278f4771a8528a32f4a9b378a37b953ad73c1f Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 May 2020 23:13:53 +0200 Subject: [PATCH 04/11] renaming the new string key --- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-el/strings.xml | 2 +- app/src/main/res/values-nl/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 88a752dc..e30f38c9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -33,7 +33,7 @@ klicke auf eine Zahl um einen Kontakt zuzuweisen. Danach kannst du den Kontakt schnell durch langes drücken der entsprechenden Zahl anrufen - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index b166a3aa..f352e697 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -33,7 +33,7 @@ Κάντε κλικ σε έναν αριθμό για να αντιστοιχίσετε μια επαφή σε αυτόν. Στη συνέχεια, μπορείτε να καλέσετε γρήγορα τη δεδομένη επαφή πατώντας τον αριθμό αυτόν. - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 35523de7..9e64fb40 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -33,7 +33,7 @@ Klik op een cijfer om er een contact aan te koppelen. Vervolgens kan deze persoon direct gebeld worden door in de kiezer lang op het gekoppelde cijfer te drukken. - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 07680bd9..52c60d18 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -33,7 +33,7 @@ Clique no número para atribuir um contacto à ligação rápida. Posteriormente, poderá ligar diretamente ao contacto através da tecla de ligação rápida. - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 59135b29..9cb6589a 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -33,7 +33,7 @@ Pre priradenie kontaktu kliknite na číslo. Následne viete daný kontakt rýchlo vytočiť dlhým podržaním čísla na číselníku. - Zoskupiť susedné volania s rovnakým číslom v histórií volaní + Zoskupiť susedné volania s rovnakým číslom v histórií volaní diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 437fd259..d7ed565c 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -33,7 +33,7 @@ 点击一个数字来分配一个联系人。之后你可以在拨号盘长按指定的号码来快速呼叫指定的联系人。 - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f359bbb4..449b6ed8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -33,7 +33,7 @@ Click on a number to assign a contact to it. You can then quickly call the given contact by long pressing the given number at the dialer. - Group subsequent calls with the same number at the call log + Group subsequent calls with the same number at the call log From 56a4868051a279bcd182b88e143ba341840b117d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 30 May 2020 23:17:50 +0200 Subject: [PATCH 05/11] fix #21, make grouping subsequent entries at the call log optional --- .../dialer/activities/SettingsActivity.kt | 9 ++++++++ .../dialer/helpers/Config.kt | 4 ++++ .../dialer/helpers/Constants.kt | 1 + .../dialer/helpers/RecentsHelper.kt | 8 ++++--- app/src/main/res/layout/activity_settings.xml | 23 +++++++++++++++++++ 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt index 84b557a2..8db19782 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt @@ -35,6 +35,7 @@ class SettingsActivity : SimpleActivity() { setupChangeDateTimeFormat() setupFontSize() setupDefaultTab() + setupGroupSubsequentCalls() updateTextColors(settings_holder) invalidateOptionsMenu() } @@ -123,4 +124,12 @@ class SettingsActivity : SimpleActivity() { TAB_CALL_HISTORY -> R.string.call_history_tab else -> R.string.last_used_tab }) + + private fun setupGroupSubsequentCalls() { + settings_group_subsequent_calls.isChecked = config.groupSubsequentCalls + settings_group_subsequent_calls_holder.setOnClickListener { + settings_group_subsequent_calls.toggle() + config.groupSubsequentCalls = settings_group_subsequent_calls.isChecked + } + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Config.kt index 12042116..db34d935 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Config.kt @@ -35,4 +35,8 @@ class Config(context: Context) : BaseConfig(context) { } fun getCustomSIM(number: String) = prefs.getString(REMEMBER_SIM_PREFIX + number, "") + + var groupSubsequentCalls: Boolean + get() = prefs.getBoolean(GROUP_SUBSEQUENT_CALLS, true) + set(groupSubsequentCalls) = prefs.edit().putBoolean(GROUP_SUBSEQUENT_CALLS, groupSubsequentCalls).apply() } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Constants.kt index 16dcd003..63a42763 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/Constants.kt @@ -3,6 +3,7 @@ package com.simplemobiletools.dialer.helpers // shared prefs const val SPEED_DIAL = "speed_dial" const val REMEMBER_SIM_PREFIX = "remember_sim_" +const val GROUP_SUBSEQUENT_CALLS = "group_subsequent_calls" const val CONTACTS_TAB_MASK = 1 const val FAVORITES_TAB_MASK = 2 diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt index 977b0aa8..3b9b3575 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/helpers/RecentsHelper.kt @@ -6,6 +6,7 @@ import android.provider.CallLog.Calls import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.* import com.simplemobiletools.commons.models.SimpleContact +import com.simplemobiletools.dialer.extensions.config import com.simplemobiletools.dialer.extensions.getAvailableSIMCardLabels import com.simplemobiletools.dialer.models.RecentCall @@ -34,6 +35,9 @@ class RecentsHelper(private val context: Context) { private fun getRecents(contacts: ArrayList, callback: (ArrayList) -> Unit) { var recentCalls = ArrayList() + var previousRecentCallFrom = "" + val contactsNumbersMap = HashMap() + val groupSubsequentCalls = context.config.groupSubsequentCalls val uri = Calls.CONTENT_URI val projection = arrayOf( Calls._ID, @@ -52,8 +56,6 @@ class RecentsHelper(private val context: Context) { } val sortOrder = "${Calls._ID} DESC LIMIT 100" - var previousRecentCallFrom = "" - val contactsNumbersMap = HashMap() context.queryCursor(uri, projection, sortOrder = sortOrder, showErrors = true) { cursor -> val id = cursor.getIntValue(Calls._ID) val number = cursor.getStringValue(Calls.NUMBER) @@ -92,7 +94,7 @@ class RecentsHelper(private val context: Context) { val recentCall = RecentCall(id, number, name, photoUri, startTS, duration, type, neighbourIDs, simID) // if we have multiple missed calls from the same number, show it just once - if ("$number$name" != previousRecentCallFrom) { + if (!groupSubsequentCalls || "$number$name" != previousRecentCallFrom) { recentCalls.add(recentCall) } else { recentCalls.lastOrNull()?.neighbourIDs?.add(id) diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 2f27ec60..9c7f29b4 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -181,5 +181,28 @@ android:clickable="false" /> + + + + + + From 910f8a07a8414463098f7f3dd179d888f4a108ed Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sun, 31 May 2020 00:12:13 +0200 Subject: [PATCH 06/11] Dutch --- app/src/main/res/values-nl/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 9e64fb40..8a3f9b4f 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -33,7 +33,7 @@ Klik op een cijfer om er een contact aan te koppelen. Vervolgens kan deze persoon direct gebeld worden door in de kiezer lang op het gekoppelde cijfer te drukken. - Group subsequent calls with the same number at the call log + Oproepgeschiedenis: opeenvolgende items van hetzelfde nummer groeperen From 38e7ae863bbed1150eaf65e594de2450c393e135 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 31 May 2020 09:37:21 +0200 Subject: [PATCH 07/11] removing the margin between call button and dialpad --- app/src/main/res/layout/dialpad.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/res/layout/dialpad.xml b/app/src/main/res/layout/dialpad.xml index e6235d65..28561ddf 100644 --- a/app/src/main/res/layout/dialpad.xml +++ b/app/src/main/res/layout/dialpad.xml @@ -7,7 +7,6 @@ android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:focusableInTouchMode="true" - android:paddingBottom="@dimen/normal_margin" tools:ignore="HardcodedText"> Date: Sun, 31 May 2020 10:36:56 +0200 Subject: [PATCH 08/11] fix #18, adding a toggle for starting names with surname --- app/build.gradle | 2 +- .../dialer/activities/SettingsActivity.kt | 9 ++++++++ app/src/main/res/layout/activity_settings.xml | 23 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index c9654edf..e04f10aa 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -56,6 +56,6 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.28.25' + implementation 'com.simplemobiletools:commons:5.28.27' implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a' } diff --git a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt index 8db19782..a1c4d66a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/SettingsActivity.kt @@ -36,6 +36,7 @@ class SettingsActivity : SimpleActivity() { setupFontSize() setupDefaultTab() setupGroupSubsequentCalls() + setupStartNameWithSurname() updateTextColors(settings_holder) invalidateOptionsMenu() } @@ -132,4 +133,12 @@ class SettingsActivity : SimpleActivity() { config.groupSubsequentCalls = settings_group_subsequent_calls.isChecked } } + + private fun setupStartNameWithSurname() { + settings_start_with_surname.isChecked = config.startNameWithSurname + settings_start_with_surname_holder.setOnClickListener { + settings_start_with_surname.toggle() + config.startNameWithSurname = settings_start_with_surname.isChecked + } + } } diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 9c7f29b4..de32298f 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -204,5 +204,28 @@ app:switchPadding="@dimen/medium_margin" /> + + + + + + From e497df7a650c842825b7db71809ad09293ed67bf Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 31 May 2020 10:42:09 +0200 Subject: [PATCH 09/11] show the callers number at the call screen below name --- .../dialer/activities/CallActivity.kt | 5 +++++ app/src/main/res/layout/activity_call.xml | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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 08cac7ad..5989de58 100644 --- a/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/dialer/activities/CallActivity.kt @@ -190,6 +190,11 @@ class CallActivity : SimpleActivity() { } caller_name_label.text = if (callContact!!.name.isNotEmpty()) callContact!!.name else getString(R.string.unknown_caller) + if (callContact!!.number.isNotEmpty() && callContact!!.number != callContact!!.name) { + caller_number_label.text = callContact!!.number + } else { + caller_number_label.beGone() + } if (callContactAvatar != null) { caller_avatar.setImageBitmap(callContactAvatar) diff --git a/app/src/main/res/layout/activity_call.xml b/app/src/main/res/layout/activity_call.xml index 1b7cf4d1..6cd89d7b 100644 --- a/app/src/main/res/layout/activity_call.xml +++ b/app/src/main/res/layout/activity_call.xml @@ -30,6 +30,18 @@ app:layout_constraintTop_toBottomOf="@+id/caller_avatar" tools:text="Caller name" /> + + Date: Sun, 31 May 2020 10:52:31 +0200 Subject: [PATCH 10/11] update version to 5.3.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e04f10aa..fda2e39e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "com.simplemobiletools.dialer" minSdkVersion 23 targetSdkVersion 29 - versionCode 9 - versionName "5.2.2" + versionCode 10 + versionName "5.3.0" setProperty("archivesBaseName", "dialer") } From d04da50af6b32081785eb241f92141a44007f02d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 31 May 2020 10:52:37 +0200 Subject: [PATCH 11/11] updating changelog --- CHANGELOG.md | 9 +++++++++ fastlane/metadata/android/en-US/changelogs/10.txt | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 fastlane/metadata/android/en-US/changelogs/10.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index cf703665..146e6931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Changelog ========== +Version 5.3.0 *(2020-05-31)* +---------------------------- + + * Try harder at fetching names at the Call Log + * Make subsequent calls from the same number at the call log optional + * Allow toggling name start with surname + * Show the other ends number at the call screen + * Some other UI and translation improvements + Version 5.2.2 *(2020-05-23)* ---------------------------- diff --git a/fastlane/metadata/android/en-US/changelogs/10.txt b/fastlane/metadata/android/en-US/changelogs/10.txt new file mode 100644 index 00000000..62fb1182 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/10.txt @@ -0,0 +1,5 @@ + * Try harder at fetching names at the Call Log + * Make subsequent calls from the same number at the call log optional + * Allow toggling name start with surname + * Show the other ends number at the call screen + * Some other UI and translation improvements