From b91e937d6f4199d8f84fa634ccfbdd973330b054 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 5 Dec 2018 10:20:46 +0100 Subject: [PATCH 01/22] updating some french strings --- app/src/main/res/values-fr/strings.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 093f665a..2cf25c2c 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -139,10 +139,10 @@ Manage blocked numbers You are not blocking anyone. - Add a blocked number - Block number - Block numbers - Blocked numbers + Ajouter un numéro bloqué + Numéro bloquer + Numéros bloquer + Numéros bloquer Je veux modifier les champs affichés sur les fiches de mes contacts. Puis-je le faire ? @@ -152,12 +152,12 @@ Une application répertoire pour gérer vos contacts sans publicité. - Un outil simple pour créer et gérer vos contacts depuis n\'importe quelle source. Les contacts peuvent être stockés sur votre appareil mais aussi synchronisés via votre compte Google ou d\'autres comptes. Vous pouvez afficher vos contacts favoris dans une liste séparée. - - Vous pouvez l\'utiliser pour gérer les adresses de courriels et les événements de vos contacts. Cet outil permet de trier/filtrer à l\'aide de multiples paramètres, par exemple : afficher le surnom en premier. - - L\'application ne contient ni publicité, ni autorisation inutile. Elle est totalement opensource et est également fournie avec des couleurs personnalisables. - + Un outil simple pour créer et gérer vos contacts depuis n\'importe quelle source. Les contacts peuvent être stockés sur votre appareil mais aussi synchronisés via votre compte Google ou d\'autres comptes. Vous pouvez afficher vos contacts favoris dans une liste séparée. + + Vous pouvez l\'utiliser pour gérer les adresses de courriels et les événements de vos contacts. Cet outil permet de trier/filtrer à l\'aide de multiples paramètres, par exemple : afficher le surnom en premier. + + L\'application ne contient ni publicité, ni autorisation inutile. Elle est totalement opensource et est également fournie avec des couleurs personnalisables. + Cette application fait partie d\'une plus grande suite. Vous pouvez trouver les autres applications sur https://www.simplemobiletools.com From 841f89d6d1002fb62ce99c72b419e37664c7b453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Marques?= Date: Fri, 7 Dec 2018 13:36:54 +0000 Subject: [PATCH 02/22] Update strings.xml --- app/src/main/res/values-pt/strings.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index d185d0fd..385302cf 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -17,8 +17,8 @@ Pedir a permissão necessária Criar novo contacto Adicionar a contacto existente - You have to make this app the default dialer app to make use of blocked numbers. - Set to default + Tem que tornar esta a aplicação padrão para poder bloquear números. + Definir como padrão Não existem contactos @@ -104,7 +104,7 @@ Importar contactos de um ficheiro .vcf Exportar contactos para um ficheiro .vcf Destino da origem do contacto - Incluir fontes dos contactos + Incluir fonte dos contactos Nome do ficheiro (sem .vcf) @@ -137,12 +137,12 @@ Mensagem instantânea (IM) - Manage blocked numbers - You are not blocking anyone. - Add a blocked number - Block number - Block numbers - Blocked numbers + Gerir números bloqueados + Não existem números bloqueados + Adicionar um número a bloquear + Bloquear número + Bloquear números + Números bloqueados I want to change what fields are visible at contacts. Can I do it? From d08e63ca48c4e3fb571f2ea0df2825a90fc48a64 Mon Sep 17 00:00:00 2001 From: kniddl <10777535+kniddl@users.noreply.github.com> Date: Mon, 10 Dec 2018 15:19:51 +0100 Subject: [PATCH 03/22] Update German strings --- app/src/main/res/values-de/strings.xml | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d031d5b3..dfa6cc28 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -17,14 +17,14 @@ Benötigte Berechtigungen anfordern Neuen Kontakt erstellen Zu einem existierenden Kontakt hinzufügen - You have to make this app the default dialer app to make use of blocked numbers. - Set to default + Du musst diese App als Standardtelefonie-App einstellen, um Nummern blockieren zu können. + Als Standard auswählen Keine Kontakte gefunden Keine Kontakte mit E-Mailadressen gefunden Keine Kontakte mit Telefonnummern gefunden - No recent calls found + Keine kürzlichen Anrufe gefunden Neuer Kontakt Kontakt bearbeiten @@ -55,7 +55,7 @@ Namen mit Nachnamen beginnen Telefonnummern im Hauptmenü zeigen Vorschaubilder der Kontakte zeigen - Show a dialpad button on the main screen + Eine Wählfehldschaltfläche auf dem Hauptbildschirm anzeigen Beim Klicken auf den Kontakt Kontakt anrufen Kontaktdetails anzeigen @@ -113,13 +113,13 @@ Dialer - Calling - Incoming call - Incoming call from… - Ongoing call - Disconnected - Decline - Answer + Anrufaufbau + Eingehender Anruf + Eingehender Anruf von… + Laufender Anruf + Getrennt + Ablehnen + Antworten Sichtbare Felder auswählen @@ -137,12 +137,12 @@ Instant messaging (IM) - Manage blocked numbers - You are not blocking anyone. - Add a blocked number - Block number - Block numbers - Blocked numbers + Blockierte Nummern verwalten + Du blockierst niemanden. + Eine blockierte Nummer hinzufügen + Nummer blockieren + Nummern blockieren + Blockierte Nummern Ich möchte die sichtbaren Kontaktfelder ändern. Kann ich das machen? From 9dffb0aea9d8a78a1640fc2ea997f81c4c36ce40 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Dec 2018 17:48:19 +0100 Subject: [PATCH 04/22] adding an Android OS version check at isDefaultDialer --- .../com/simplemobiletools/contacts/pro/extensions/Context.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt index 0b42a0aa..718bc412 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt @@ -15,6 +15,7 @@ import androidx.core.content.FileProvider import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_CONTACTS +import com.simplemobiletools.commons.helpers.isMarshmallowPlus import com.simplemobiletools.commons.helpers.isNougatPlus import com.simplemobiletools.contacts.pro.BuildConfig import com.simplemobiletools.contacts.pro.R @@ -344,4 +345,4 @@ fun Context.deleteBlockedNumber(number: String) { } @TargetApi(Build.VERSION_CODES.M) -fun Context.isDefaultDialer() = telecomManager.defaultDialerPackage == packageName +fun Context.isDefaultDialer() = isMarshmallowPlus() && telecomManager.defaultDialerPackage == packageName From 0af341ecc036d4f5a04f3d1a29c46bd51f20e991 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Dec 2018 17:55:38 +0100 Subject: [PATCH 05/22] update commons to 5.5.16 --- app/build.gradle | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5d27b633..d359dd5b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.5.1' + implementation 'com.simplemobiletools:commons:5.5.16' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.4' diff --git a/build.gradle b/build.gradle index 85c5b5af..266ccd46 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.10' + ext.kotlin_version = '1.3.11' repositories { google() From c9ad8a85c781fe01a723ec6a6296e3e5f078accf Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Dec 2018 17:57:52 +0100 Subject: [PATCH 06/22] update version to 6.1.1 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d359dd5b..13b4566e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.contacts.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 37 - versionName "6.1.0" + versionCode 38 + versionName "6.1.1" setProperty("archivesBaseName", "contacts") } From 4984639c9f55ea0a9f6aab2163c90950adfdbce3 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Dec 2018 17:57:57 +0100 Subject: [PATCH 07/22] updating changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ace45ce..d664f5a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ Changelog ========== +Version 6.1.1 *(2018-12-12)* +---------------------------- + + * Fixing a crash on Android Lollipop + * Added some translation improvements + Version 6.1.0 *(2018-11-30)* ---------------------------- From c1f08472777cfb98e07d34fe40258072b95e89f8 Mon Sep 17 00:00:00 2001 From: Emanuele Petriglia Date: Sat, 22 Dec 2018 10:51:55 +0000 Subject: [PATCH 08/22] Improve italian translations --- app/src/main/res/values-it/strings.xml | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 49dde94e..ad9f08af 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -1,12 +1,12 @@ - Simple Contacts + Semplice Contatti Contatti Indirizzo Inserimento in corso… Aggiornamento in corso… Memoria del telefono Memoria del telefono (non visibile alle altre applicazioni) - Compagnia + Società Posizione lavorativa Sito web Invia un SMS ai contatti @@ -16,7 +16,7 @@ Chiama %s Richiedi le permissioni necessarie Crea un nuovo contatto - Aggiungi ad un contatto esistente + Aggiungi a un contatto esistente È necessario impostare quest\'app come predefinita per utilizzare i numeri bloccati. Imposta come predefinita @@ -47,25 +47,25 @@ Crea un gruppo con un account - Scatta un foto + Scatta una foto Scegli una foto - Rimuovi foto + Rimuovi la foto Prima il nome poi il cognome Mostra i numeri di telefono nella schermata principale Mostra le anteprime dei contatti - Mostra il pulante per la tastiera nello schermo principale - Al click sul contatto + Mostra il pulante per il tastierino nello schermo principale + Alla pressione sul contatto Chiama contatto Visualizza i dettagli del contatto Gestisci i campi mostrati - Prova a filtrare i contatti duplicati + Unisci i contatti duplicati Gestisci le schede mostrate Contatti Preferiti Chiamate recenti - Mostra un dialogo di conferma prima di iniziare una chiamata + Mostra un messaggio di conferma prima di iniziare una chiamata Mostra solamente i contatti con almeno un numero telefonico @@ -88,11 +88,11 @@ Anniversario - Sembra che ancora non si ha nessun contatto preferito. + Non si ha ancora nessun contatto preferito. Aggiungi preferito Aggiungi ai preferiti Rimuovi dai preferiti - Devi stare nella schermata di modifica per modificare un contatto + Si deve stare nella schermata di modifica per modificare un contatto Cerca contatti @@ -138,7 +138,7 @@ Gestisci i numeri bloccati - Non si sta blocccando alcun numero. + Nessun numero bloccato. Aggiungi un numero da bloccare Blocca numero Blocca numeri @@ -146,19 +146,19 @@ Voglio cambiare i campi visibili ai contatti. Come posso fare? - Puoi farlo andando in Impostazioni -> Gestisci i campi mostrati. Qui puoi selezionare i campi che saranno visibili. Alcuni sono anche disabilitati in maniera predefinita, quindi potresti trovare qualche nuovo campo. + Si può farlo andando in Impostazioni -> Gestisci i campi mostrati. Qui si possono selezionare i campi che saranno visibili, alcuni sono disabilitati in maniera predefinita, quindi si possono trovare campi aggiuntivi. Un\'applicazioni contatti per gestire i propri contatti senza pubblicità. - Una semplice applicazione per creare o gestire i propri contatti da qualsiasi provenienza. I contatti saranno salvati solamente nel dispositivo, ma possono essere sincronizzati con Google, o con altri servizi. Si possono visualizzare i contatti preferiti in una list separata. + Una semplice applicazione per creare o gestire i propri contatti di qualsiasi tipo. I contatti saranno salvati nel dispositivo, ma possono essere eventualmente sincronizzati con Google o con altri servizi. Si possono visualizzare i contatti preferiti in una lista separata. - Si può utilizzare l\'applicazione anche per gestire le email e gli eventi. Può ordinare e filtrare per parametri multipli, ed opzionalmente visualizzare il cognome come nome + Si può utilizzare l\'applicazione anche per gestire l\'email e gli eventi. Si possono ordinare e filtrare per diversi criteri, opzionalmente si può visualizzare il cognome come nome. - Non contiene pubblicità nè chiede permessi non necessari. È completamente open source ed offre colori personalizzabili. + L\'applicazione non contiene pubblicità o permessi non necessari; è completamente opensource e la si può personalizzare con i propri colori preferiti. - Quest\'app fa parte di una serie più grande. Puoi trovare le altre su https://www.simplemobiletools.com + Questa è solamente una delle tante applicazioni della serie Simple Mobile Tools. Si possono trovare le altre su http://www.simplemobiletools.com No contacts found diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index dfa6cc28..38dd24d5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -19,6 +19,7 @@ Zu einem existierenden Kontakt hinzufügen Du musst diese App als Standardtelefonie-App einstellen, um Nummern blockieren zu können. Als Standard auswählen + Call number Keine Kontakte gefunden diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index b18b448e..f60781f4 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -19,6 +19,7 @@ Προσθήκη σε μια υπάρχουσα Επαφή You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index da6af990..60459584 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -19,6 +19,7 @@ Add to an existing contact You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2cf25c2c..ffc399f6 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -19,6 +19,7 @@ Ajouter à un contact existant You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number Aucun contact n\'a été trouvé diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 22a6d639..e2c6801b 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -19,6 +19,7 @@ Add to an existing contact You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index caa7caee..38778643 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -19,6 +19,7 @@ Aggiungi a un contatto esistente È necessario impostare quest\'app come predefinita per utilizzare i numeri bloccati. Imposta come predefinita + Call number Nessun contatto trovato diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index fec96b80..34da1c9c 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -19,6 +19,7 @@ 既存の連絡先に追加 You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number 連絡先が見つかりません diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 38dc1ab2..d2359f17 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -19,6 +19,7 @@ Add to an existing contact You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 471adfb6..f0796ff2 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -19,6 +19,7 @@ Add to an existing contact You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 385302cf..9c101b23 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,6 +19,7 @@ Adicionar a contacto existente Tem que tornar esta a aplicação padrão para poder bloquear números. Definir como padrão + Call number Não existem contactos diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2bbceacf..aec2596e 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,6 +19,7 @@ Добавить к существующему контакту Вы должны сделать \"Simple Contacts\" приложением по умолчанию для набора номера для использования блокировки номеров. Сделать по умолчанию + Call number Контакты не найдены diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 614febb0..45688330 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -19,6 +19,7 @@ Pridať k existujúcemu kontaktu Pre použitie blokovania čísel musíte nastaviť aplikáciu ako predvolenú pre správu hovorov. Nastaviť ako predvolenú + Zavolať číslo Nenašli sa žiadne kontakty diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 43dba3f3..d8962334 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -19,6 +19,7 @@ Lägg till i en befintlig kontakt You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number Inga kontakter hittades diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 15d9bf3d..346cea74 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -19,6 +19,7 @@ Mevcut bir kişiye ekle You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number Kişi bulunamadı diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 9be3d686..83e143a7 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -19,6 +19,7 @@ 添加至已存在的聯絡人 你必須將這應用程式設為預設的撥號程式來使用黑名單。 設為預設 + Call number 未發現聯絡人 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index af52d0b9..b4d12bc0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,6 +19,7 @@ Add to an existing contact You have to make this app the default dialer app to make use of blocked numbers. Set to default + Call number No contacts found From 14478e77ed7f1f849272c8ced2136d9dbd232dc7 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 27 Dec 2018 21:33:04 +0100 Subject: [PATCH 14/22] fix #335, add a menu item for calling unknown numbers from Recents --- app/build.gradle | 2 +- .../contacts/pro/activities/DialpadActivity.kt | 2 +- .../contacts/pro/adapters/RecentCallsAdapter.kt | 12 ++++++++++++ app/src/main/res/drawable-hdpi/ic_phone.png | Bin 0 -> 316 bytes .../{ic_phone_big.png => ic_phone_huge.png} | Bin app/src/main/res/drawable-xhdpi/ic_phone.png | Bin 0 -> 406 bytes .../{ic_phone_big.png => ic_phone_huge.png} | Bin app/src/main/res/drawable-xxhdpi/ic_phone.png | Bin 0 -> 566 bytes .../{ic_phone_big.png => ic_phone_huge.png} | Bin app/src/main/res/drawable-xxxhdpi/ic_phone.png | Bin 0 -> 716 bytes .../{ic_phone_big.png => ic_phone_huge.png} | Bin app/src/main/res/layout/activity_dialpad.xml | 2 +- app/src/main/res/layout/activity_edit_contact.xml | 4 ++-- app/src/main/res/layout/activity_view_contact.xml | 4 ++-- .../main/res/layout/dialog_call_confirmation.xml | 2 +- app/src/main/res/menu/cab_recent_calls.xml | 11 ++++++++--- 16 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_phone.png rename app/src/main/res/drawable-hdpi/{ic_phone_big.png => ic_phone_huge.png} (100%) create mode 100644 app/src/main/res/drawable-xhdpi/ic_phone.png rename app/src/main/res/drawable-xhdpi/{ic_phone_big.png => ic_phone_huge.png} (100%) create mode 100644 app/src/main/res/drawable-xxhdpi/ic_phone.png rename app/src/main/res/drawable-xxhdpi/{ic_phone_big.png => ic_phone_huge.png} (100%) create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_phone.png rename app/src/main/res/drawable-xxxhdpi/{ic_phone_big.png => ic_phone_huge.png} (100%) diff --git a/app/build.gradle b/app/build.gradle index 0c17f012..d358af40 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.6.1' + implementation 'com.simplemobiletools:commons:5.6.2' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.4' diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialpadActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialpadActivity.kt index f6250e0d..ceedf0ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialpadActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/DialpadActivity.kt @@ -55,7 +55,7 @@ class DialpadActivity : SimpleActivity() { ContactsHelper(this).getContacts { gotContacts(it) } disableKeyboardPopping() - val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_big, if (isBlackAndWhiteTheme()) Color.BLACK else Color.WHITE) + val callIcon = resources.getColoredDrawableWithColor(R.drawable.ic_phone_huge, if (isBlackAndWhiteTheme()) Color.BLACK else Color.WHITE) dialpad_call_button.setImageDrawable(callIcon) dialpad_call_button.background.applyColorFilter(getAdjustedPrimaryColor()) } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt index 41b24af4..72a13c33 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt @@ -13,6 +13,7 @@ import com.simplemobiletools.contacts.pro.R import com.simplemobiletools.contacts.pro.activities.SimpleActivity import com.simplemobiletools.contacts.pro.extensions.addBlockedNumber import com.simplemobiletools.contacts.pro.extensions.config +import com.simplemobiletools.contacts.pro.extensions.startCallIntent import com.simplemobiletools.contacts.pro.helpers.ContactsHelper import com.simplemobiletools.contacts.pro.helpers.RECENTS_TAB_MASK import com.simplemobiletools.contacts.pro.interfaces.RefreshContactsListener @@ -31,9 +32,15 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList callNumber() R.id.cab_select_all -> selectAll() R.id.cab_delete -> askConfirmDelete() R.id.cab_block_number -> blockNumber() @@ -76,6 +84,10 @@ class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayListD@BC zcklYXv;XQW|7dE26}x}8r8DxFlRAhzHl-dSk5#Fc$YV*W8hMN$H5fVcNU-Gak;kH1H`*eP4qpJSv_(E=fGd?KVG=M9r96V`C}kWl8>Jk9cYRStw|DTYBgz={ z4KAXTHNctnsG-GS4yGL<6CeewPKIlo?M2p_DPlKC?q971Iv9sWl(@bQv;b$%fTvYQPVUsrFawFCVP{ O0000Nd$pf1NVIu$vLRtmQVu6GLk|Gr-9%*Z)~FS`BZ~z^(K#D=95-ykOk}dnHxz%IifryH z)*Xv{rW9AA4bK2?j71BMC~ig@76GfqqXpyE0nhcK1-BG;qXpZ&Qp`pR4)_gNH5Dy5 zulVd>ROvgcpRtLbwWHyJHSozJ*UdU)S8R@XMdwBgaZU&S`Kr02;IVyWZcYaYubPWG z#SfSCBAnK#Lu{5AD+-oe^_P@DVZVWjgg{}Zdo~&c3X@(o3KV*#J=HY|6ei63+9*&M zGv|T#MlDAsdrZ4*!J;J}{qp+XfH|3}U=)l30R78aHRyDl;Q#;t07*qoM6N<$g0~!} AW&i*H literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_phone_big.png b/app/src/main/res/drawable-xhdpi/ic_phone_huge.png similarity index 100% rename from app/src/main/res/drawable-xhdpi/ic_phone_big.png rename to app/src/main/res/drawable-xhdpi/ic_phone_huge.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_phone.png b/app/src/main/res/drawable-xxhdpi/ic_phone.png new file mode 100644 index 0000000000000000000000000000000000000000..61d59bd472a6143e571679dffb46189ac517bfd0 GIT binary patch literal 566 zcmV-60?GY}P)Gx6~8e8ySEe*e-WJ{*gYnb z_=~i>!tM%5#b4CnGj>-Y6bOzFlMBzvpgxhqYhs;@v$sKZpXUo{_AQ{DhsGd2N{o&dj`GnJJ+FA2S zqOgoV^IpP(YP`X12kC$2EZ~nxxKM_V;dtOFYl>JkRsI zApF8Ct`L(e%;Fc(iElWIjdOe}8Ziu8BSa(4VC$@C#6#@8FZyr=dtZt^9LL^Iq7S>U z_n+v)8ti2heVC8E3Zf5_u-97jp+ELUi9Xc9-d@p%oY)KTsc6F=L?W~3!vpNK6Mfi@ zy$zxdlhFd?fl%9Xpr!Uo_%x%lUCdD-Q5H z*N7{6(T14aAdzUs??lBoKe=efa-wtFn6DGn2zHk=;sQSBKH(maQCz|3fce?Q9VEmw zUEIPfOo_xLq{OsP+`>{!Im9Jo$Fz(0#U-rA)Ja@IBAyrlA<~OW=#A+lpNTv8g!7mt zh)XC&xO(Ce=3#nFI&lX-a~abGz7uzlgD6bf-1?b25pF5(iz|4S)r6bGyKespFpzh| z6=dTf;l@Pv7I>cwG$Q|7`GY7(h;TFbKr9iLQvkq27SVttX8vnNRe~(x3$Z`~u3@^( z3c6CAEd0(p^7_$|AP4v_^7(J+DvZ7axk+~W`EU6uj6MVj(Uf;A=4-eLqcy=c6VGD4 zhO02D6Gf0mbl^jI21%{w8|3w(6psjYh+@yozX@6b4CLV!(b+&6W4?+21OKp#=*{9L zXbUj#5d*QHE5JZ`?zt9VAU-=>3o!5w)wt+dfPpXQ&Lh_X4E)P%_W}&0W}bTi2GX*? z$p9l_J|Wiv4E#njcDWZ|AQ9a-Ph`%BF1$m0YB7St*cmQb@dHKZ#saPqy>omc`tcKa yXwFzxvz2`u=K?o*%w=Ztvv{88d7kHa0iFVp^xjFRk^X4_0000 diff --git a/app/src/main/res/layout/activity_edit_contact.xml b/app/src/main/res/layout/activity_edit_contact.xml index 304a7a52..c98394fd 100644 --- a/app/src/main/res/layout/activity_edit_contact.xml +++ b/app/src/main/res/layout/activity_edit_contact.xml @@ -64,7 +64,7 @@ android:paddingLeft="@dimen/activity_margin" android:paddingRight="@dimen/activity_margin" android:scaleType="center" - android:src="@drawable/ic_phone"/> + android:src="@drawable/ic_phone_big"/> + android:src="@drawable/ic_phone_big"/> + android:src="@drawable/ic_phone_big"/> + android:src="@drawable/ic_phone_big"/> + android:src="@drawable/ic_phone_huge"/> diff --git a/app/src/main/res/menu/cab_recent_calls.xml b/app/src/main/res/menu/cab_recent_calls.xml index f5e7c4ba..d26f3097 100644 --- a/app/src/main/res/menu/cab_recent_calls.xml +++ b/app/src/main/res/menu/cab_recent_calls.xml @@ -2,9 +2,9 @@ + From dcc2490f865bbb68ae14bc755cf79b7b8b68a6cd Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 15:30:22 +0100 Subject: [PATCH 15/22] change the way contacts are fetched, use type blacklist instead of whitelist --- .../contacts/pro/helpers/ContactsHelper.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index 8a14f930..b861565c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -125,10 +125,12 @@ class ContactsHelper(val context: Context) { return } + val ignoredSources = context.config.ignoredContactSources val uri = ContactsContract.Data.CONTENT_URI val projection = getContactProjection() - val selection = getSourcesSelection(true) - val selectionArgs = getSourcesSelectionArgs(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE) + + val selection = "${ContactsContract.Data.MIMETYPE} = ?" + val selectionArgs = arrayOf(CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE) val sortOrder = getSortString() var cursor: Cursor? = null @@ -136,6 +138,11 @@ class ContactsHelper(val context: Context) { cursor = context.contentResolver.query(uri, projection, selection, selectionArgs, sortOrder) if (cursor?.moveToFirst() == true) { do { + val accountName = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) ?: "" + if (ignoredSources.contains(accountName)) { + continue + } + val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID) val prefix = cursor.getStringValue(CommonDataKinds.StructuredName.PREFIX) ?: "" val firstName = cursor.getStringValue(CommonDataKinds.StructuredName.GIVEN_NAME) ?: "" @@ -148,7 +155,6 @@ class ContactsHelper(val context: Context) { val emails = ArrayList() val addresses = ArrayList
() val events = ArrayList() - val accountName = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) ?: "" val starred = cursor.getIntValue(CommonDataKinds.StructuredName.STARRED) val contactId = cursor.getIntValue(ContactsContract.Data.CONTACT_ID) val thumbnailUri = cursor.getStringValue(CommonDataKinds.StructuredName.PHOTO_THUMBNAIL_URI) ?: "" @@ -839,9 +845,6 @@ class ContactsHelper(val context: Context) { accounts.forEach { if (ContentResolver.getIsSyncable(it, ContactsContract.AUTHORITY) == 1) { val contactSource = ContactSource(it.name, it.type) - if (it.type == TELEGRAM_PACKAGE) { - contactSource.name += " (${context.getString(R.string.telegram)})" - } sources.add(contactSource) } } From cb7e2810513a73edbca75136027162b800eaeb70 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 15:51:26 +0100 Subject: [PATCH 16/22] add a new field to ContactSource, publicName --- .../pro/activities/EditContactActivity.kt | 12 +++++++++--- .../pro/activities/ViewContactActivity.kt | 7 ++++--- .../adapters/FilterContactSourcesAdapter.kt | 2 +- .../pro/dialogs/CreateNewGroupDialog.kt | 8 +++++--- .../pro/dialogs/ImportContactsDialog.kt | 9 +++++++-- .../contacts/pro/extensions/Context.kt | 8 +++++--- .../contacts/pro/helpers/ContactsHelper.kt | 18 ++++++++++++++---- .../contacts/pro/models/Contact.kt | 2 +- .../contacts/pro/models/ContactSource.kt | 2 +- 9 files changed, 47 insertions(+), 21 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt index f882d3c3..a25b59d1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/EditContactActivity.kt @@ -568,15 +568,19 @@ class EditContactActivity : ContactActivity() { } private fun setupContactSource() { - contact_source.text = getPublicContactSource(contact!!.source) originalContactSource = contact!!.source + getPublicContactSource(contact!!.source) { + contact_source.text = it + } } private fun setupNewContact() { supportActionBar?.title = resources.getString(R.string.new_contact) originalContactSource = if (hasContactPermissions()) config.lastUsedContactSource else SMT_PRIVATE contact = getEmptyContact() - contact_source.text = getPublicContactSource(contact!!.source) + getPublicContactSource(contact!!.source) { + contact_source.text = it + } } private fun setupTypePickers() { @@ -831,7 +835,9 @@ class EditContactActivity : ContactActivity() { private fun showSelectContactSourceDialog() { showContactSourcePicker(contact!!.source) { contact!!.source = if (it == getString(R.string.phone_storage_hidden)) SMT_PRIVATE else it - contact_source.text = getPublicContactSource(it) + getPublicContactSource(it) { + contact_source.text = it + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt index b1ef1744..84fe9fea 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/ViewContactActivity.kt @@ -446,11 +446,12 @@ class ViewContactActivity : ContactActivity() { private fun setupContactSource() { if (showFields and SHOW_CONTACT_SOURCE_FIELD != 0) { - val contactSourceValue = getPublicContactSource(contact!!.source) - contact_source.text = contactSourceValue + getPublicContactSource(contact!!.source) { + contact_source.text = it + contact_source.copyOnLongClick(it) + } contact_source_image.beVisible() contact_source.beVisible() - contact_source.copyOnLongClick(contactSourceValue) } else { contact_source_image.beGone() contact_source.beGone() diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/FilterContactSourcesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/FilterContactSourcesAdapter.kt index 9af1c7e7..c125072d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/FilterContactSourcesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/FilterContactSourcesAdapter.kt @@ -62,7 +62,7 @@ class FilterContactSourcesAdapter(val activity: SimpleActivity, private val cont itemView.apply { filter_contact_source_checkbox.isChecked = isSelected filter_contact_source_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor) - filter_contact_source_checkbox.text = contactSource.name + filter_contact_source_checkbox.text = contactSource.publicName filter_contact_source_holder.setOnClickListener { viewClicked(!isSelected, contactSource) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/CreateNewGroupDialog.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/CreateNewGroupDialog.kt index a0e0e9e8..2126c3c5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/CreateNewGroupDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/CreateNewGroupDialog.kt @@ -36,12 +36,14 @@ class CreateNewGroupDialog(val activity: BaseSimpleActivity, val callback: (newG val contactSources = ArrayList() if (activity.config.localAccountName.isNotEmpty()) { - contactSources.add(ContactSource(activity.config.localAccountName, activity.config.localAccountType)) + val localAccountName = activity.config.localAccountName + contactSources.add(ContactSource(localAccountName, activity.config.localAccountType, localAccountName)) } ContactsHelper(activity).getContactSources { - it.filter { it.type.contains("google", true) }.mapTo(contactSources, { ContactSource(it.name, it.type) }) - contactSources.add(ContactSource(activity.getString(R.string.phone_storage_hidden), SMT_PRIVATE)) + it.filter { it.type.contains("google", true) }.mapTo(contactSources) { ContactSource(it.name, it.type, it.name) } + val phoneSecret = activity.getString(R.string.phone_storage_hidden) + contactSources.add(ContactSource(phoneSecret, SMT_PRIVATE, phoneSecret)) val items = ArrayList() contactSources.forEachIndexed { index, contactSource -> diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ImportContactsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ImportContactsDialog.kt index 6ece8edb..131070d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ImportContactsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ImportContactsDialog.kt @@ -20,11 +20,16 @@ class ImportContactsDialog(val activity: SimpleActivity, val path: String, priva init { val view = (activity.layoutInflater.inflate(R.layout.dialog_import_contacts, null) as ViewGroup).apply { targetContactSource = activity.config.lastUsedContactSource - import_contacts_title.text = activity.getPublicContactSource(targetContactSource) + activity.getPublicContactSource(targetContactSource) { + import_contacts_title.text = it + } + import_contacts_title.setOnClickListener { activity.showContactSourcePicker(targetContactSource) { targetContactSource = if (it == activity.getString(R.string.phone_storage_hidden)) SMT_PRIVATE else it - import_contacts_title.text = activity.getPublicContactSource(it) + activity.getPublicContactSource(it) { + import_contacts_title.text = it + } } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt index 7e1a768a..1b99392e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt @@ -193,12 +193,13 @@ fun Context.getPhotoThumbnailSize(): Int { fun Context.hasContactPermissions() = hasPermission(PERMISSION_READ_CONTACTS) && hasPermission(PERMISSION_WRITE_CONTACTS) -fun Context.getPublicContactSource(source: String): String { - return when (source) { +fun Context.getPublicContactSource(source: String, callback: (String) -> Unit) { + val newSource = when (source) { config.localAccountName -> getString(R.string.phone_storage) SMT_PRIVATE -> getString(R.string.phone_storage_hidden) else -> source } + callback(newSource) } fun Context.sendSMSToContacts(contacts: ArrayList) { @@ -289,7 +290,8 @@ fun Context.getContactPublicUri(contact: Contact): Uri { fun Context.getVisibleContactSources(): ArrayList { val sources = ContactsHelper(this).getDeviceContactSources() - sources.add(ContactSource(getString(R.string.phone_storage_hidden), SMT_PRIVATE)) + val phoneSecret = getString(R.string.phone_storage_hidden) + sources.add(ContactSource(phoneSecret, SMT_PRIVATE, phoneSecret)) val sourceNames = ArrayList(sources).map { if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.name }.toMutableList() as ArrayList sourceNames.removeAll(config.ignoredContactSources) return sourceNames diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index b861565c..1382b6e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -108,7 +108,12 @@ class ContactsHelper(val context: Context) { do { val name = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) ?: "" val type = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_TYPE) ?: "" - val source = ContactSource(name, type) + var publicName = name + if (type == TELEGRAM_PACKAGE) { + publicName += " (${context.getString(R.string.telegram)})" + } + + val source = ContactSource(name, type, publicName) sources.add(source) } while (cursor.moveToNext()) } @@ -831,7 +836,8 @@ class ContactsHelper(val context: Context) { private fun getContactSourcesSync(): ArrayList { val sources = getDeviceContactSources() - sources.add(ContactSource(context.getString(R.string.phone_storage_hidden), SMT_PRIVATE)) + val phoneSecret = context.getString(R.string.phone_storage_hidden) + sources.add(ContactSource(phoneSecret, SMT_PRIVATE, phoneSecret)) return ArrayList(sources) } @@ -844,7 +850,11 @@ class ContactsHelper(val context: Context) { val accounts = AccountManager.get(context).accounts accounts.forEach { if (ContentResolver.getIsSyncable(it, ContactsContract.AUTHORITY) == 1) { - val contactSource = ContactSource(it.name, it.type) + var publicName = it.name + if (it.type == TELEGRAM_PACKAGE) { + publicName += " (${context.getString(R.string.telegram)})" + } + val contactSource = ContactSource(it.name, it.type, publicName) sources.add(contactSource) } } @@ -855,7 +865,7 @@ class ContactsHelper(val context: Context) { sources.addAll(contentResolverAccounts) if (sources.isEmpty() && context.config.localAccountName.isEmpty() && context.config.localAccountType.isEmpty()) { - sources.add(ContactSource("", "")) + sources.add(ContactSource("", "", "")) } return sources diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt index 7eb0d57e..c3851d83 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/Contact.kt @@ -119,7 +119,7 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m fun getHashToCompare() = getStringToCompare().hashCode() - fun getFullCompany(): String { + private fun getFullCompany(): String { var fullOrganization = if (organization.company.isEmpty()) "" else "${organization.company}, " fullOrganization += organization.jobPosition return fullOrganization.trim().trimEnd(',') diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt index f1a4ba0b..4cd64377 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt @@ -1,3 +1,3 @@ package com.simplemobiletools.contacts.pro.models -data class ContactSource(var name: String, var type: String) +data class ContactSource(var name: String, var type: String, var publicName: String) From cfa9bdaf7a6de7e38009415b360224b631142097 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 16:06:40 +0100 Subject: [PATCH 17/22] properly handle transforming contact source names to public names --- .../contacts/pro/extensions/Activity.kt | 13 +++++----- .../contacts/pro/extensions/Context.kt | 26 +++++++++++++++---- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Activity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Activity.kt index cda4b77a..8f416c21 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Activity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Activity.kt @@ -65,8 +65,11 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new ) val items = ArrayList() - val sources = it.filter { !ignoredTypes.contains(it.type) }.map { it.name } - var currentSourceIndex = -1 + val filteredSources = it.filter { !ignoredTypes.contains(it.type) } + var sources = filteredSources.map { it.name } + var currentSourceIndex = sources.indexOfFirst { it == currentSource } + sources = filteredSources.map { it.publicName } + sources.forEachIndexed { index, account -> var publicAccount = account if (account == config.localAccountName) { @@ -74,16 +77,14 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new } items.add(RadioItem(index, publicAccount)) - if (account == currentSource) { - currentSourceIndex = index - } else if (currentSource == SMT_PRIVATE && account == getString(R.string.phone_storage_hidden)) { + if (currentSource == SMT_PRIVATE && account == getString(R.string.phone_storage_hidden)) { currentSourceIndex = index } } runOnUiThread { RadioGroupDialog(this, items, currentSourceIndex) { - callback(sources[it as Int]) + callback(filteredSources[it as Int].name) } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt index 1b99392e..2d57f5b2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt @@ -7,6 +7,8 @@ import android.content.Intent import android.database.Cursor import android.net.Uri import android.os.Build +import android.os.Handler +import android.os.Looper import android.provider.BlockedNumberContract import android.provider.BlockedNumberContract.BlockedNumbers import android.provider.ContactsContract @@ -194,12 +196,26 @@ fun Context.getPhotoThumbnailSize(): Int { fun Context.hasContactPermissions() = hasPermission(PERMISSION_READ_CONTACTS) && hasPermission(PERMISSION_WRITE_CONTACTS) fun Context.getPublicContactSource(source: String, callback: (String) -> Unit) { - val newSource = when (source) { - config.localAccountName -> getString(R.string.phone_storage) - SMT_PRIVATE -> getString(R.string.phone_storage_hidden) - else -> source + when (source) { + config.localAccountName -> callback(getString(R.string.phone_storage)) + SMT_PRIVATE -> callback(getString(R.string.phone_storage_hidden)) + else -> { + Thread { + ContactsHelper(this).getContactSources { + var newSource = source + for (contactSource in it) { + if (contactSource.name == source && contactSource.type == TELEGRAM_PACKAGE) { + newSource += " (${getString(R.string.telegram)})" + break + } + } + Handler(Looper.getMainLooper()).post { + callback(newSource) + } + } + }.start() + } } - callback(newSource) } fun Context.sendSMSToContacts(contacts: ArrayList) { From aeed7e2456920980943a77179a87a6ffe90024c8 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 17:44:14 +0100 Subject: [PATCH 18/22] fix #235, rely on both account name and type at filtering --- .../pro/dialogs/FilterContactSourcesDialog.kt | 8 ++++---- .../contacts/pro/extensions/Context.kt | 5 +++-- .../contacts/pro/helpers/ContactsHelper.kt | 6 ++++-- .../contacts/pro/models/ContactSource.kt | 12 +++++++++++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/FilterContactSourcesDialog.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/FilterContactSourcesDialog.kt index 6fe2413f..3e1b7d4d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/FilterContactSourcesDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/FilterContactSourcesDialog.kt @@ -41,12 +41,12 @@ class FilterContactSourcesDialog(val activity: SimpleActivity, private val callb private fun confirmEventTypes() { val selectedContactSources = (view.filter_contact_sources_list.adapter as FilterContactSourcesAdapter).getSelectedContactSources() - val ignoredContactSourceNames = contactSources.filter { !selectedContactSources.contains(it) }.map { - if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.name + val ignoredContactSources = contactSources.filter { !selectedContactSources.contains(it) }.map { + if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.getFullIdentifier() }.toHashSet() - if (activity.getVisibleContactSources() != ignoredContactSourceNames) { - activity.config.ignoredContactSources = ignoredContactSourceNames + if (activity.getVisibleContactSources() != ignoredContactSources) { + activity.config.ignoredContactSources = ignoredContactSources callback() } dialog?.dismiss() diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt index 2d57f5b2..7cd82aad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/extensions/Context.kt @@ -308,8 +308,9 @@ fun Context.getVisibleContactSources(): ArrayList { val sources = ContactsHelper(this).getDeviceContactSources() val phoneSecret = getString(R.string.phone_storage_hidden) sources.add(ContactSource(phoneSecret, SMT_PRIVATE, phoneSecret)) - val sourceNames = ArrayList(sources).map { if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.name }.toMutableList() as ArrayList - sourceNames.removeAll(config.ignoredContactSources) + val ignoredContactSources = config.ignoredContactSources + val sourceNames = ArrayList(sources).filter { !ignoredContactSources.contains(it.getFullIdentifier()) } + .map { if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.name }.toMutableList() as ArrayList return sourceNames } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index 1382b6e9..a4e69bf3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -144,7 +144,8 @@ class ContactsHelper(val context: Context) { if (cursor?.moveToFirst() == true) { do { val accountName = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_NAME) ?: "" - if (ignoredSources.contains(accountName)) { + val accountType = cursor.getStringValue(ContactsContract.RawContacts.ACCOUNT_TYPE) ?: "" + if (ignoredSources.contains("$accountName:$accountType")) { continue } @@ -884,7 +885,8 @@ class ContactsHelper(val context: Context) { CommonDataKinds.StructuredName.PHOTO_URI, CommonDataKinds.StructuredName.PHOTO_THUMBNAIL_URI, CommonDataKinds.StructuredName.STARRED, - ContactsContract.RawContacts.ACCOUNT_NAME + ContactsContract.RawContacts.ACCOUNT_NAME, + ContactsContract.RawContacts.ACCOUNT_TYPE ) private fun getSortString(): String { diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt index 4cd64377..a5f55e30 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/ContactSource.kt @@ -1,3 +1,13 @@ package com.simplemobiletools.contacts.pro.models -data class ContactSource(var name: String, var type: String, var publicName: String) +import com.simplemobiletools.contacts.pro.helpers.SMT_PRIVATE + +data class ContactSource(var name: String, var type: String, var publicName: String) { + fun getFullIdentifier(): String { + return if (type == SMT_PRIVATE) { + type + } else { + "$name:$type" + } + } +} From 40d0916276bfeb5c385be5a550195243866519f6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 17:49:05 +0100 Subject: [PATCH 19/22] reset stored ignored contact sources --- .../com/simplemobiletools/contacts/pro/helpers/Constants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt index 8826a543..1e2786de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Constants.kt @@ -7,7 +7,7 @@ import com.simplemobiletools.contacts.pro.models.LocalContact const val SHOW_CONTACT_THUMBNAILS = "show_contact_thumbnails" const val SHOW_PHONE_NUMBERS = "show_phone_numbers" const val SHOW_ONLY_CONTACTS_WITH_NUMBERS = "show_only_contacts_with_numbers" -const val IGNORED_CONTACT_SOURCES = "ignored_contact_sources" +const val IGNORED_CONTACT_SOURCES = "ignored_contact_sources_2" const val START_NAME_WITH_SURNAME = "start_name_with_surname" const val LAST_USED_CONTACT_SOURCE = "last_used_contact_source" const val LOCAL_ACCOUNT_NAME = "local_account_name" From bdd31230f79bf41e4e94dad0234f78caf763149d Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 18:02:13 +0100 Subject: [PATCH 20/22] add the contact fetching change in release notes --- .../simplemobiletools/contacts/pro/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt index a2025c20..9740e609 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/MainActivity.kt @@ -586,6 +586,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { add(Release(31, R.string.release_31)) add(Release(32, R.string.release_32)) add(Release(34, R.string.release_34)) + add(Release(39, R.string.release_39)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 7cc00924..309ad8d7 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -13,6 +13,7 @@ Telegram + Changed the way contacts are fetched, please reset your filters. Added new options for toggling 24 hour time format and showing only contacts with phone numbers Added a simple dialpad, dialer will come soon From bd82894d3a33810a36b3024498405c6f3b26b343 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 18:08:13 +0100 Subject: [PATCH 21/22] update version to 6.1.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d358af40..556bf398 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.contacts.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 38 - versionName "6.1.1" + versionCode 39 + versionName "6.1.2" setProperty("archivesBaseName", "contacts") } From 8e9a59bd9570901b8e585767b00ebccb43b60060 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 28 Dec 2018 18:10:10 +0100 Subject: [PATCH 22/22] updating changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d664f5a5..60a748cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========== +Version 6.1.2 *(2018-12-28)* +---------------------------- + + * Improve the way contacts are fetched, more contacts should show up + * Improve contact filtering to fix some glitches + * Added a Call menu button for calling not stored numbers from Recents + * Some stability improvements + Version 6.1.1 *(2018-12-12)* ----------------------------