From 0a150a9f82e60084ce6a8b4497781bcb9662b454 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 11:58:25 +0100 Subject: [PATCH 01/18] updating commons and ezvcard --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 556bf398..9eaaecef 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,10 +51,10 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.6.2' + implementation 'com.simplemobiletools:commons:5.6.3' 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' + implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.5' kapt "androidx.room:room-compiler:2.0.0" implementation "androidx.room:room-runtime:2.0.0" From ea520ab7a8e8be2f716f92c19900bfd895359103 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 17:27:11 +0100 Subject: [PATCH 02/18] remove everything related to Recents, due to Googles latest security rules --- app/src/main/AndroidManifest.xml | 12 -- .../contacts/pro/activities/MainActivity.kt | 68 +------- .../pro/adapters/RecentCallsAdapter.kt | 150 ------------------ .../contacts/pro/adapters/ViewPagerAdapter.kt | 9 +- .../pro/dialogs/ManageVisibleTabsDialog.kt | 6 +- .../pro/fragments/MyViewPagerFragment.kt | 15 +- .../contacts/pro/fragments/RecentsFragment.kt | 89 ----------- .../contacts/pro/helpers/Constants.kt | 13 +- .../contacts/pro/helpers/ContactsHelper.kt | 92 ----------- .../contacts/pro/models/RecentCall.kt | 3 - .../res/layout/dialog_manage_visible_tabs.xml | 8 - app/src/main/res/layout/fragment_recents.xml | 10 -- app/src/main/res/layout/item_recent_call.xml | 63 -------- app/src/main/res/menu/cab_recent_calls.xml | 24 --- app/src/main/res/values-az/strings.xml | 3 - app/src/main/res/values-de/strings.xml | 3 - app/src/main/res/values-el/strings.xml | 3 - app/src/main/res/values-eu/strings.xml | 3 - app/src/main/res/values-fr/strings.xml | 3 - app/src/main/res/values-hr/strings.xml | 3 - app/src/main/res/values-it/strings.xml | 3 - app/src/main/res/values-ja/strings.xml | 3 - app/src/main/res/values-ko-rKR/strings.xml | 3 - app/src/main/res/values-lt/strings.xml | 3 - app/src/main/res/values-pt/strings.xml | 3 - app/src/main/res/values-ru/strings.xml | 3 - app/src/main/res/values-sk/strings.xml | 3 - app/src/main/res/values-sv/strings.xml | 3 - app/src/main/res/values-tr/strings.xml | 3 - app/src/main/res/values-zh-rTW/strings.xml | 3 - app/src/main/res/values/strings.xml | 3 - 31 files changed, 22 insertions(+), 591 deletions(-) delete mode 100644 app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/RecentsFragment.kt delete mode 100644 app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/RecentCall.kt delete mode 100644 app/src/main/res/layout/fragment_recents.xml delete mode 100644 app/src/main/res/layout/item_recent_call.xml delete mode 100644 app/src/main/res/menu/cab_recent_calls.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c965a109..fd10164a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,10 +12,7 @@ - - - @@ -59,15 +56,6 @@ - - - - - - - - - R.drawable.ic_person LOCATION_FAVORITES_TAB -> R.drawable.ic_star_on - LOCATION_RECENTS_TAB -> R.drawable.ic_clock else -> R.drawable.ic_group } @@ -529,52 +509,16 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { favorites_fragment?.refreshContacts(contacts) } - if (refreshTabsMask and RECENTS_TAB_MASK != 0) { - recents_fragment?.refreshContacts(contacts) - } - if (refreshTabsMask and GROUPS_TAB_MASK != 0) { if (refreshTabsMask == GROUPS_TAB_MASK) { groups_fragment.skipHashComparing = true } groups_fragment?.refreshContacts(contacts) } - - if (refreshTabsMask and RECENTS_TAB_MASK != 0) { - ContactsHelper(this).getRecents { - it.filter { it.name == null }.forEach { - val namelessCall = it - val contact = contacts.firstOrNull { it.doesContainPhoneNumber(namelessCall.number) } - if (contact != null) { - it.name = contact.getNameToDisplay() - } - } - - runOnUiThread { - recents_fragment?.updateRecentCalls(it) - } - } - } } } - private fun getAllFragments() = arrayListOf(contacts_fragment, favorites_fragment, recents_fragment, groups_fragment) - - private fun getRecentsTabIndex(): Int { - var index = 0 - if (config.showTabs and RECENTS_TAB_MASK == 0) { - return index - } - - if (config.showTabs and CONTACTS_TAB_MASK != 0) { - index++ - } - - if (config.showTabs and FAVORITES_TAB_MASK != 0) { - index++ - } - return index - } + private fun getAllFragments() = arrayListOf(contacts_fragment, favorites_fragment, groups_fragment) private fun checkWhatsNewDialog() { arrayListOf().apply { 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 deleted file mode 100644 index 72a13c33..00000000 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/RecentCallsAdapter.kt +++ /dev/null @@ -1,150 +0,0 @@ -package com.simplemobiletools.contacts.pro.adapters - -import android.view.Menu -import android.view.View -import android.view.ViewGroup -import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter -import com.simplemobiletools.commons.dialogs.ConfirmationDialog -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.helpers.isNougatPlus -import com.simplemobiletools.commons.views.FastScroller -import com.simplemobiletools.commons.views.MyRecyclerView -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 -import com.simplemobiletools.contacts.pro.models.RecentCall -import kotlinx.android.synthetic.main.item_recent_call.view.* -import java.util.* - -class RecentCallsAdapter(activity: SimpleActivity, var recentCalls: ArrayList, val refreshListener: RefreshContactsListener?, recyclerView: MyRecyclerView, - fastScroller: FastScroller, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) { - private val showPhoneNumbers = activity.config.showPhoneNumbers - - init { - setupDragListener(true) - } - - override fun getActionMenuId() = R.menu.cab_recent_calls - - override fun prepareActionMode(menu: Menu) { - val selectedItems = getSelectedItems() - if (selectedItems.isEmpty()) { - return - } - - menu.apply { - findItem(R.id.cab_block_number).isVisible = isNougatPlus() - findItem(R.id.cab_block_number).title = activity.getString(if (isOneItemSelected()) R.string.block_number else R.string.block_numbers) - findItem(R.id.cab_call_number).isVisible = isOneItemSelected() && selectedItems.first().name == null - } - } - - override fun actionItemPressed(id: Int) { - if (selectedKeys.isEmpty()) { - return - } - - when (id) { - R.id.cab_call_number -> callNumber() - R.id.cab_select_all -> selectAll() - R.id.cab_delete -> askConfirmDelete() - R.id.cab_block_number -> blockNumber() - } - } - - override fun getSelectableItemCount() = recentCalls.size - - override fun getIsItemSelectable(position: Int) = true - - override fun getItemSelectionKey(position: Int) = recentCalls.getOrNull(position)?.id - - override fun getItemKeyPosition(key: Int) = recentCalls.indexOfFirst { it.id == key } - - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_recent_call, parent) - - override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) { - val recentCall = recentCalls[position] - holder.bindView(recentCall, true, true) { itemView, layoutPosition -> - setupView(itemView, recentCall) - } - bindViewHolder(holder) - } - - override fun getItemCount() = recentCalls.size - - fun updateItems(newItems: ArrayList) { - recentCalls = newItems - notifyDataSetChanged() - finishActMode() - fastScroller?.measureRecyclerView() - } - - private fun callNumber() { - (activity as SimpleActivity).startCallIntent(getSelectedItems().first().number) - } - - private fun askConfirmDelete() { - ConfirmationDialog(activity) { - deleteRecentCalls() - } - } - - private fun deleteRecentCalls() { - if (selectedKeys.isEmpty()) { - return - } - - val callsToRemove = getSelectedItems() - val positions = getSelectedItemPositions() - ContactsHelper(activity).removeRecentCalls(callsToRemove.map { it.id } as ArrayList) - recentCalls.removeAll(callsToRemove) - - if (recentCalls.isEmpty()) { - refreshListener?.refreshContacts(RECENTS_TAB_MASK) - finishActMode() - } else { - removeSelectedItems(positions) - } - } - - private fun blockNumber() { - Thread { - getSelectedItems().forEach { - activity.addBlockedNumber(it.number) - } - - refreshListener?.refreshContacts(RECENTS_TAB_MASK) - activity.runOnUiThread { - finishActMode() - } - }.start() - } - - private fun getSelectedItems() = recentCalls.filter { selectedKeys.contains(it.id) } as ArrayList - - private fun setupView(view: View, recentCall: RecentCall) { - view.apply { - recent_call_frame?.isSelected = selectedKeys.contains(recentCall.id) - recent_call_name.apply { - text = recentCall.name ?: recentCall.number - setTextColor(textColor) - } - - recent_call_number.apply { - beVisibleIf(showPhoneNumbers && recentCall.name != null) - text = recentCall.number - setTextColor(textColor) - } - - recent_call_date_time.apply { - text = recentCall.dateTime - setTextColor(textColor) - } - } - } -} diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ViewPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ViewPagerAdapter.kt index bbc91af0..12d0edb3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ViewPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ViewPagerAdapter.kt @@ -7,7 +7,10 @@ import com.simplemobiletools.contacts.pro.R import com.simplemobiletools.contacts.pro.activities.MainActivity import com.simplemobiletools.contacts.pro.extensions.config import com.simplemobiletools.contacts.pro.fragments.MyViewPagerFragment -import com.simplemobiletools.contacts.pro.helpers.* +import com.simplemobiletools.contacts.pro.helpers.CONTACTS_TAB_MASK +import com.simplemobiletools.contacts.pro.helpers.FAVORITES_TAB_MASK +import com.simplemobiletools.contacts.pro.helpers.GROUPS_TAB_MASK +import com.simplemobiletools.contacts.pro.helpers.tabsList class ViewPagerAdapter(val activity: MainActivity) : PagerAdapter() { private val showTabs = activity.config.showTabs @@ -42,10 +45,6 @@ class ViewPagerAdapter(val activity: MainActivity) : PagerAdapter() { fragments.add(R.layout.fragment_favorites) } - if (showTabs and RECENTS_TAB_MASK != 0) { - fragments.add(R.layout.fragment_recents) - } - if (showTabs and GROUPS_TAB_MASK != 0) { fragments.add(R.layout.fragment_groups) } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ManageVisibleTabsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ManageVisibleTabsDialog.kt index 076c1be7..0ecc7271 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ManageVisibleTabsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/dialogs/ManageVisibleTabsDialog.kt @@ -6,7 +6,10 @@ import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.views.MyAppCompatCheckbox import com.simplemobiletools.contacts.pro.R import com.simplemobiletools.contacts.pro.extensions.config -import com.simplemobiletools.contacts.pro.helpers.* +import com.simplemobiletools.contacts.pro.helpers.ALL_TABS_MASK +import com.simplemobiletools.contacts.pro.helpers.CONTACTS_TAB_MASK +import com.simplemobiletools.contacts.pro.helpers.FAVORITES_TAB_MASK +import com.simplemobiletools.contacts.pro.helpers.GROUPS_TAB_MASK class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) { private var view = activity.layoutInflater.inflate(R.layout.dialog_manage_visible_tabs, null) @@ -16,7 +19,6 @@ class ManageVisibleTabsDialog(val activity: BaseSimpleActivity) { tabs.apply { put(CONTACTS_TAB_MASK, R.id.manage_visible_tabs_contacts) put(FAVORITES_TAB_MASK, R.id.manage_visible_tabs_favorites) - put(RECENTS_TAB_MASK, R.id.manage_visible_tabs_recents) put(GROUPS_TAB_MASK, R.id.manage_visible_tabs_groups) } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt index 6421f519..675efa3e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt @@ -15,7 +15,6 @@ import com.simplemobiletools.contacts.pro.activities.MainActivity import com.simplemobiletools.contacts.pro.activities.SimpleActivity import com.simplemobiletools.contacts.pro.adapters.ContactsAdapter import com.simplemobiletools.contacts.pro.adapters.GroupsAdapter -import com.simplemobiletools.contacts.pro.adapters.RecentCallsAdapter import com.simplemobiletools.contacts.pro.extensions.config import com.simplemobiletools.contacts.pro.extensions.contactClicked import com.simplemobiletools.contacts.pro.extensions.getVisibleContactSources @@ -59,11 +58,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) fragment_placeholder.text = activity.getString(R.string.no_group_created) fragment_placeholder_2.text = activity.getString(R.string.create_group) } - this is RecentsFragment -> { - fragment_fab.beGone() - fragment_placeholder.text = activity.getString(R.string.no_recent_calls_found) - fragment_placeholder_2.text = activity.getString(R.string.request_the_required_permissions) - } } } } @@ -71,7 +65,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) fun textColorChanged(color: Int) { when { this is GroupsFragment -> (fragment_list.adapter as GroupsAdapter).updateTextColor(color) - this is RecentsFragment -> (fragment_list.adapter as RecentCallsAdapter).updateTextColor(color) else -> (fragment_list.adapter as ContactsAdapter).apply { updateTextColor(color) initDrawables() @@ -88,7 +81,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) } fun startNameWithSurnameChanged(startNameWithSurname: Boolean) { - if (this !is GroupsFragment && this !is RecentsFragment) { + if (this !is GroupsFragment) { (fragment_list.adapter as? ContactsAdapter)?.apply { config.sorting = if (startNameWithSurname) SORT_BY_SURNAME else SORT_BY_FIRST_NAME this@MyViewPagerFragment.activity!!.refreshContacts(CONTACTS_TAB_MASK or FAVORITES_TAB_MASK) @@ -99,7 +92,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) fun refreshContacts(contacts: ArrayList) { if ((config.showTabs and CONTACTS_TAB_MASK == 0 && this is ContactsFragment) || (config.showTabs and FAVORITES_TAB_MASK == 0 && this is FavoritesFragment) || - (config.showTabs and RECENTS_TAB_MASK == 0 && this is RecentsFragment) || (config.showTabs and GROUPS_TAB_MASK == 0 && this is GroupsFragment)) { return } @@ -114,7 +106,6 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) val filtered = when { this is GroupsFragment -> contacts this is FavoritesFragment -> contacts.filter { it.starred == 1 } as ArrayList - this is RecentsFragment -> ArrayList() else -> { val contactSources = activity!!.getVisibleContactSources() contacts.filter { contactSources.contains(it.source) } as ArrayList @@ -133,7 +124,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) private fun setupContacts(contacts: ArrayList) { if (this is GroupsFragment) { setupGroupsAdapter(contacts) - } else if (this !is RecentsFragment) { + } else { setupContactsFavoritesAdapter(contacts) } @@ -219,7 +210,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) showContactThumbnails = showThumbnails notifyDataSetChanged() } - } else if (this !is RecentsFragment) { + } else { (fragment_list.adapter as? ContactsAdapter)?.apply { showContactThumbnails = showThumbnails notifyDataSetChanged() diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/RecentsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/RecentsFragment.kt deleted file mode 100644 index a227c7e9..00000000 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/RecentsFragment.kt +++ /dev/null @@ -1,89 +0,0 @@ -package com.simplemobiletools.contacts.pro.fragments - -import android.annotation.TargetApi -import android.content.Context -import android.content.Intent -import android.os.Build -import android.telecom.TelecomManager -import android.util.AttributeSet -import com.simplemobiletools.commons.extensions.beVisibleIf -import com.simplemobiletools.commons.extensions.hasPermission -import com.simplemobiletools.commons.helpers.PERMISSION_READ_CALL_LOG -import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_CALL_LOG -import com.simplemobiletools.commons.helpers.isMarshmallowPlus -import com.simplemobiletools.contacts.pro.activities.InsertOrEditContactActivity -import com.simplemobiletools.contacts.pro.adapters.RecentCallsAdapter -import com.simplemobiletools.contacts.pro.extensions.contactClicked -import com.simplemobiletools.contacts.pro.extensions.isDefaultDialer -import com.simplemobiletools.contacts.pro.extensions.normalizeNumber -import com.simplemobiletools.contacts.pro.helpers.IS_FROM_SIMPLE_CONTACTS -import com.simplemobiletools.contacts.pro.helpers.KEY_PHONE -import com.simplemobiletools.contacts.pro.helpers.RECENTS_TAB_MASK -import com.simplemobiletools.contacts.pro.models.Contact -import com.simplemobiletools.contacts.pro.models.RecentCall -import kotlinx.android.synthetic.main.fragment_layout.view.* - -class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) { - override fun fabClicked() {} - - @TargetApi(Build.VERSION_CODES.M) - override fun placeholderClicked() { - if (!isMarshmallowPlus() || (isMarshmallowPlus() && context.isDefaultDialer())) { - activity!!.handlePermission(PERMISSION_WRITE_CALL_LOG) { - if (it) { - activity!!.handlePermission(PERMISSION_READ_CALL_LOG) { - activity?.refreshContacts(RECENTS_TAB_MASK) - } - } - } - } else { - val intent = Intent(TelecomManager.ACTION_CHANGE_DEFAULT_DIALER).putExtra(TelecomManager.EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME, context.packageName) - context.startActivity(intent) - } - } - - fun updateRecentCalls(recentCalls: ArrayList) { - if (activity == null || activity!!.isDestroyed) { - return - } - - fragment_placeholder.beVisibleIf(recentCalls.isEmpty()) - fragment_placeholder_2.beVisibleIf(recentCalls.isEmpty() && !activity!!.hasPermission(PERMISSION_WRITE_CALL_LOG)) - fragment_list.beVisibleIf(recentCalls.isNotEmpty()) - - val currAdapter = fragment_list.adapter - if (currAdapter == null) { - RecentCallsAdapter(activity!!, recentCalls, activity, fragment_list, fragment_fastscroller) { - val recentCall = (it as RecentCall).number.normalizeNumber() - var selectedContact: Contact? = null - for (contact in allContacts) { - if (contact.doesContainPhoneNumber(recentCall)) { - selectedContact = contact - break - } - } - - if (selectedContact != null) { - activity?.contactClicked(selectedContact) - } else { - Intent(context, InsertOrEditContactActivity::class.java).apply { - action = Intent.ACTION_INSERT_OR_EDIT - putExtra(KEY_PHONE, recentCall) - putExtra(IS_FROM_SIMPLE_CONTACTS, true) - context.startActivity(this) - } - } - }.apply { - addVerticalDividers(true) - fragment_list.adapter = this - } - - fragment_fastscroller.setViews(fragment_list) { - val item = (fragment_list.adapter as RecentCallsAdapter).recentCalls.getOrNull(it) - fragment_fastscroller.updateBubbleText(item?.name ?: item?.number ?: "") - } - } else { - (currAdapter as RecentCallsAdapter).updateItems(recentCalls) - } - } -} 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 1e2786de..9a59aaa4 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 @@ -35,21 +35,18 @@ const val KEY_NAME = "name" const val LOCATION_CONTACTS_TAB = 0 const val LOCATION_FAVORITES_TAB = 1 -const val LOCATION_RECENTS_TAB = 2 -const val LOCATION_GROUPS_TAB = 3 -const val LOCATION_GROUP_CONTACTS = 4 -const val LOCATION_DIALPAD = 5 -const val LOCATION_INSERT_OR_EDIT = 6 +const val LOCATION_GROUPS_TAB = 2 +const val LOCATION_GROUP_CONTACTS = 3 +const val LOCATION_DIALPAD = 4 +const val LOCATION_INSERT_OR_EDIT = 5 const val CONTACTS_TAB_MASK = 1 const val FAVORITES_TAB_MASK = 2 -const val RECENTS_TAB_MASK = 4 const val GROUPS_TAB_MASK = 8 -const val ALL_TABS_MASK = 15 +const val ALL_TABS_MASK = CONTACTS_TAB_MASK or FAVORITES_TAB_MASK or GROUPS_TAB_MASK val tabsList = arrayListOf(CONTACTS_TAB_MASK, FAVORITES_TAB_MASK, - RECENTS_TAB_MASK, GROUPS_TAB_MASK ) 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 a4e69bf3..b25544e4 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 @@ -2,14 +2,12 @@ package com.simplemobiletools.contacts.pro.helpers import android.accounts.Account import android.accounts.AccountManager -import android.annotation.SuppressLint import android.content.* import android.database.Cursor import android.graphics.Bitmap import android.net.Uri import android.os.Handler import android.os.Looper -import android.provider.CallLog import android.provider.ContactsContract import android.provider.ContactsContract.CommonDataKinds import android.provider.ContactsContract.CommonDataKinds.Nickname @@ -23,7 +21,6 @@ import com.simplemobiletools.contacts.pro.R import com.simplemobiletools.contacts.pro.extensions.* import com.simplemobiletools.contacts.pro.models.* import com.simplemobiletools.contacts.pro.overloads.times -import java.text.SimpleDateFormat import java.util.* import kotlin.collections.ArrayList @@ -1552,93 +1549,4 @@ class ContactsHelper(val context: Context) { context.showErrorToast(e) } } - - @SuppressLint("MissingPermission") - fun getRecents(callback: (ArrayList) -> Unit) { - Thread { - val calls = ArrayList() - if (!context.hasPermission(PERMISSION_WRITE_CALL_LOG) || !context.hasPermission(PERMISSION_READ_CALL_LOG)) { - callback(calls) - return@Thread - } - - val blockedNumbers = context.getBlockedNumbers() - val uri = CallLog.Calls.CONTENT_URI - val projection = arrayOf( - CallLog.Calls._ID, - CallLog.Calls.NUMBER, - CallLog.Calls.DATE, - CallLog.Calls.CACHED_NAME - ) - - val sorting = "${CallLog.Calls._ID} DESC LIMIT 100" - val currentDate = Date(System.currentTimeMillis()) - val currentYear = SimpleDateFormat("yyyy", Locale.getDefault()).format(currentDate) - val todayDate = SimpleDateFormat("dd MMM yyyy", Locale.getDefault()).format(currentDate) - val yesterdayDate = SimpleDateFormat("dd MMM yyyy", Locale.getDefault()).format(Date(System.currentTimeMillis() - DAY_SECONDS * 1000)) - val yesterday = context.getString(R.string.yesterday) - val timeFormat = if (context.config.use24HourFormat) "HH:mm" else "h:mm a" - var prevNumber = "" - - var cursor: Cursor? = null - try { - cursor = context.contentResolver.query(uri, projection, null, null, sorting) - if (cursor?.moveToFirst() == true) { - do { - val id = cursor.getIntValue(CallLog.Calls._ID) - val number = cursor.getStringValue(CallLog.Calls.NUMBER) - val date = cursor.getLongValue(CallLog.Calls.DATE) - val name = cursor.getStringValue(CallLog.Calls.CACHED_NAME) - if (number == prevNumber) { - continue - } - - if (blockedNumbers.any { it.number == number || it.normalizedNumber == number }) { - continue - } - - var formattedDate = SimpleDateFormat("dd MMM yyyy, $timeFormat", Locale.getDefault()).format(Date(date)) - val datePart = formattedDate.substring(0, 11) - when { - datePart == todayDate -> formattedDate = formattedDate.substring(12) - datePart == yesterdayDate -> formattedDate = yesterday + formattedDate.substring(11) - formattedDate.substring(7, 11) == currentYear -> formattedDate = formattedDate.substring(0, 6) + formattedDate.substring(11) - } - - prevNumber = number - val recentCall = RecentCall(id, number, formattedDate, name) - calls.add(recentCall) - } while (cursor.moveToNext()) - } - } finally { - cursor?.close() - } - callback(calls) - }.start() - } - - fun removeRecentCalls(ids: ArrayList) { - Thread { - try { - val operations = ArrayList() - val selection = "${CallLog.Calls._ID} = ?" - ids.forEach { - ContentProviderOperation.newDelete(CallLog.Calls.CONTENT_URI).apply { - val selectionArgs = arrayOf(it.toString()) - withSelection(selection, selectionArgs) - operations.add(build()) - } - - if (operations.size % BATCH_SIZE == 0) { - context.contentResolver.applyBatch(CallLog.AUTHORITY, operations) - operations.clear() - } - } - - context.contentResolver.applyBatch(CallLog.AUTHORITY, operations) - } catch (e: Exception) { - context.showErrorToast(e) - } - }.start() - } } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/RecentCall.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/RecentCall.kt deleted file mode 100644 index 536599e8..00000000 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/models/RecentCall.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.simplemobiletools.contacts.pro.models - -data class RecentCall(var id: Int, var number: String, var dateTime: String, var name: String?) diff --git a/app/src/main/res/layout/dialog_manage_visible_tabs.xml b/app/src/main/res/layout/dialog_manage_visible_tabs.xml index e690b1dc..65e8978c 100644 --- a/app/src/main/res/layout/dialog_manage_visible_tabs.xml +++ b/app/src/main/res/layout/dialog_manage_visible_tabs.xml @@ -30,14 +30,6 @@ android:paddingTop="@dimen/activity_margin" android:text="@string/favorites"/> - - - - - - - diff --git a/app/src/main/res/layout/item_recent_call.xml b/app/src/main/res/layout/item_recent_call.xml deleted file mode 100644 index da43a6ea..00000000 --- a/app/src/main/res/layout/item_recent_call.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/src/main/res/menu/cab_recent_calls.xml b/app/src/main/res/menu/cab_recent_calls.xml deleted file mode 100644 index d26f3097..00000000 --- a/app/src/main/res/menu/cab_recent_calls.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index acede989..be13ce8c 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found Yeni kontakt Redaktə et @@ -65,7 +63,6 @@ Göstərilən nişanları idarə et Kontaktlar Sevimlilər - Hazırki zənglər Zəngə başlamazdan əvvəl zəng təsdiq pəncərəsi göstər Show only contacts with phone numbers diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 33cc39a4..d7e3206d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -19,13 +19,11 @@ 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 Keine Kontakte mit E-Mailadressen gefunden Keine Kontakte mit Telefonnummern gefunden - Keine kürzlichen Anrufe gefunden Neuer Kontakt Kontakt bearbeiten @@ -65,7 +63,6 @@ Anzuzeigende Tabs festlegen Kontakte Favoriten - Anrufliste Bestätigungsdialog zeigen, bevor ein Anruf durchgeführt wird Nur Kontakte mit Telefonnummern anzeigen diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 2a858e7b..19e9a015 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -19,13 +19,11 @@ Προσθήκη σε μια υπάρχουσα Επαφή You have to make this app the default dialer app to make use of blocked numbers. Set to default - Call number No contacts found No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found Νέα επαφή Επεξεργασία επαφής @@ -65,7 +63,6 @@ Διαχείριση εμφανιζόμενων καρτελών Επαφές Αγαπημένες - Πρόσφατες Κλήσεις Εμφάνιση διαλόγου επιβεβαίωσης πριν από την έναρξη μιας κλήσης Show only contacts with phone numbers diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index a1953388..68fae2d6 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found Kontaktu berria Editatu taldea @@ -65,7 +63,6 @@ Kudeatu erakutsitako fitxak Kontaktuak Gogokoak - Azken deiak Erakutsi egiaztatze mezua dei bat hasi baino lehen Show only contacts with phone numbers diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 0c2046fc..467c73d3 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -19,13 +19,11 @@ 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é Aucun contact avec une adresse de courriel n\'a été trouvé Aucun contact avec un numéro de téléphone n\'a été trouvé - Aucun appel récent n\'a été trouvé Nouveau contact Modifier contact @@ -65,7 +63,6 @@ Gérer les onglets affichés Contacts Favoris - Appels récents Afficher une demande de confirmation avant de démarrer un appel Afficher uniquement les contacts avec un numéro de téléphone diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 56d48fa1..2853450c 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found Novi kontakt Uredi kontakt @@ -65,7 +63,6 @@ Upravljaj prikazanim karticama Kontakti Favoriti - Nedavni pozivi Pokažite dijaloški okvir za potvrdu poziva prije pokretanja poziva Show only contacts with phone numbers diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8e11b78e..74f1533b 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -19,13 +19,11 @@ Aggiungi a un contatto esistente È necessario impostare quest\'app come predefinita per utilizzare i numeri bloccati. Imposta come predefinita - Chiama numero Nessun contatto trovato Nessun contatto trovato con un\'email Nessun contatto trovato con un numero di telefono - Nessuna chiamata recente trovata Nuovo contatto Modifica contatto @@ -65,7 +63,6 @@ Gestisci le schede mostrate Contatti Preferiti - Chiamate recenti Mostra un messaggio di conferma prima di iniziare una chiamata Mostra solamente i contatti con almeno un numero telefonico diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index c8ba4496..8bff5251 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -19,13 +19,11 @@ 既存の連絡先に追加 You have to make this app the default dialer app to make use of blocked numbers. Set to default - Call number 連絡先が見つかりません メールアドレスが登録された連絡先が見つかりません 電話番号が登録された連絡先が見つかりません - 通話履歴はありません 新しい連絡先 連絡先を編集 @@ -65,7 +63,6 @@ 表示するタブを管理 連絡先 お気に入り - 通話履歴 発信する前に確認ダイアログを表示する 電話番号が登録された連絡先のみ表示する diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 8a52b90e..95e6b9c6 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found 새로운 연락처 연락처 수정 @@ -65,7 +63,6 @@ Manage shown tabs Contacts Favorites - Recent calls Show a call confirmation dialog before initiating a call Show only contacts with phone numbers diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 63c8ea85..017d7dd5 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found Naujas kontaktas Redaguoti kontaktą @@ -65,7 +63,6 @@ Manage shown tabs Contacts Favorites - Recent calls Show a call confirmation dialog before initiating a call Show only contacts with phone numbers diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c195c4f7..e0e2425e 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -19,13 +19,11 @@ 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 Não existem contactos com endereço de e-mail Não existem contactos com número de telefone - Não existem chamadas recentes Novo contacto Editar contacto @@ -65,7 +63,6 @@ Gerir separadores a exibir Contactos Favoritos - Chamadas recentes Mostrar diálogo para confirmar a chamada Mostrar apenas contactos com número de telefone diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 793cb16a..4c6d71a9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -19,13 +19,11 @@ Добавить к существующему контакту Вы должны сделать \"Simple Contacts\" приложением по умолчанию для набора номера для использования блокировки номеров. Сделать по умолчанию - Набрать номер Контакты не найдены Контакты с адресами электронной почты не найдены Контакты с номерами телефонов не найдены - Недавние вызовы не найдены Новый контакт Редактировать контакт @@ -65,7 +63,6 @@ Управление отображаемыми вкладками Контакты Избранное - Недавние вызовы Показывать диалог подтверждения вызова Показывать только контакты с номерами телефонов diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 8f3d6205..4359917a 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -19,13 +19,11 @@ 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 Nenašli sa žiadne kontakty s emailami Nenašli sa žiadne kontakty s telefónnymi číslami - Nenašli sa žiadne posledné hovory Nový kontakt Upraviť kontakt @@ -65,7 +63,6 @@ Spravovať zobrazené karty Kontakty Obľúbené - Predošlé hovory Zobraziť pred spustením hovoru okno na jeho potvrdenie Zobraziť iba kontakty s telefónnymi číslami diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 869498cd..e1395ac7 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -19,13 +19,11 @@ 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 Inga kontakter med e-postadresser hittades Inga kontakter med telefonnummer hittades - No recent calls found Ny kontakt Redigera kontakt @@ -65,7 +63,6 @@ Hantera visade flikar Kontakter Favoriter - Senaste samtal Visa en bekräftelsedialogruta före uppringning Visa bara kontakter med telefonnummer diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index f96f9a28..dab3779d 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -19,13 +19,11 @@ 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ı E-posta ile hiç bağlantı bulunamadı Telefon numaralarını içeren kişi bulunamadı - No recent calls found Yeni kişi Kişiyi düzenle @@ -65,7 +63,6 @@ Gösterilen sekmeleri yönet Kişiler Favoriler - Son aramalar Arama başlatmadan önce arama onayı penceresi göster Sadece telefon numaralarını içeren kişileri göster diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index d42a3f88..238140b1 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -19,13 +19,11 @@ 添加至已存在的聯絡人 你必須將這應用程式設為預設的撥號程式來使用黑名單。 設為預設 - 撥打號碼 未發現聯絡人 未發現含有電子信箱的聯絡人 未發現含有電話號碼的聯絡人 - 未發現通話紀錄 新聯絡人 編輯聯絡人 @@ -65,7 +63,6 @@ 管理顯示的頁面 聯絡人 我的最愛 - 通話紀錄 開始通話前顯示通話確認框 只顯示含有電話話碼的聯絡人 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a7ce2f58..563c53cc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,13 +19,11 @@ 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 No contacts with emails have been found No contacts with phone numbers have been found - No recent calls found New contact Edit contact @@ -65,7 +63,6 @@ Manage shown tabs Contacts Favorites - Recent calls Show a call confirmation dialog before initiating a call Show only contacts with phone numbers From b5a9e6a8b7a3b08430613170d6c400b57906881d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 17:39:40 +0100 Subject: [PATCH 03/18] changing DIRTY value at creating contact to an integer --- .../simplemobiletools/contacts/pro/helpers/ContactsHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b25544e4..89fe463d 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 @@ -1243,7 +1243,7 @@ class ContactsHelper(val context: Context) { ContentProviderOperation.newInsert(ContactsContract.RawContacts.CONTENT_URI).apply { withValue(ContactsContract.RawContacts.ACCOUNT_NAME, contact.source) withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, getContactSourceType(contact.source)) - withValue(ContactsContract.RawContacts.DIRTY, false) + withValue(ContactsContract.RawContacts.DIRTY, 1) operations.add(build()) } From 9adc9ff7bfead84118ca5084777926802af8ec88 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 18:21:56 +0100 Subject: [PATCH 04/18] adding a new string for showing letters on the dialpad --- app/src/main/res/values-az/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-eu/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-hr/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 1 + app/src/main/res/values-ko-rKR/strings.xml | 1 + app/src/main/res/values-lt/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ru/strings.xml | 1 + app/src/main/res/values-sk/strings.xml | 3 ++- app/src/main/res/values-sv/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 17 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index be13ce8c..bb898317 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -65,6 +65,7 @@ Sevimlilər Zəngə başlamazdan əvvəl zəng təsdiq pəncərəsi göstər Show only contacts with phone numbers + Show letters on the dialpad E-poçt diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d7e3206d..722bf81a 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -65,6 +65,7 @@ Favoriten Bestätigungsdialog zeigen, bevor ein Anruf durchgeführt wird Nur Kontakte mit Telefonnummern anzeigen + Show letters on the dialpad E-Mail diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 19e9a015..5438cf2d 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -65,6 +65,7 @@ Αγαπημένες Εμφάνιση διαλόγου επιβεβαίωσης πριν από την έναρξη μιας κλήσης Show only contacts with phone numbers + Show letters on the dialpad Email diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index 68fae2d6..120df8f9 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -65,6 +65,7 @@ Gogokoak Erakutsi egiaztatze mezua dei bat hasi baino lehen Show only contacts with phone numbers + Show letters on the dialpad Emaila diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 467c73d3..09ee4112 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -65,6 +65,7 @@ Favoris Afficher une demande de confirmation avant de démarrer un appel Afficher uniquement les contacts avec un numéro de téléphone + Show letters on the dialpad Adresse de courriel diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 2853450c..7f0d9749 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -65,6 +65,7 @@ Favoriti Pokažite dijaloški okvir za potvrdu poziva prije pokretanja poziva Show only contacts with phone numbers + Show letters on the dialpad E-pošta diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 74f1533b..bd5eaf2c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -65,6 +65,7 @@ Preferiti Mostra un messaggio di conferma prima di iniziare una chiamata Mostra solamente i contatti con almeno un numero telefonico + Show letters on the dialpad Email diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 8bff5251..6d2195dc 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -65,6 +65,7 @@ お気に入り 発信する前に確認ダイアログを表示する 電話番号が登録された連絡先のみ表示する + Show letters on the dialpad メール diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index 95e6b9c6..2761fc9c 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -65,6 +65,7 @@ Favorites Show a call confirmation dialog before initiating a call Show only contacts with phone numbers + Show letters on the dialpad 이메일 diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 017d7dd5..ba48795d 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -65,6 +65,7 @@ Favorites Show a call confirmation dialog before initiating a call Show only contacts with phone numbers + Show letters on the dialpad Elektroninis paštas diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index e0e2425e..113c0b58 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -65,6 +65,7 @@ Favoritos Mostrar diálogo para confirmar a chamada Mostrar apenas contactos com número de telefone + Show letters on the dialpad E-mail diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4c6d71a9..822976fc 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -65,6 +65,7 @@ Избранное Показывать диалог подтверждения вызова Показывать только контакты с номерами телефонов + Show letters on the dialpad Эл. почта diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 4359917a..c8f008e4 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -8,7 +8,7 @@ Úložisko mobilu (neviditeľné pre ostatné apky) Firma Pracovná pozícia - Website + Webstránka Poslať kontaktom SMS Poslať kontaktom email Poslať skupine SMS @@ -65,6 +65,7 @@ Obľúbené Zobraziť pred spustením hovoru okno na jeho potvrdenie Zobraziť iba kontakty s telefónnymi číslami + Zobraziť na číselníku písmená Email diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index e1395ac7..703e52d7 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -65,6 +65,7 @@ Favoriter Visa en bekräftelsedialogruta före uppringning Visa bara kontakter med telefonnummer + Show letters on the dialpad E-post diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index dab3779d..b254a9c3 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -65,6 +65,7 @@ Favoriler Arama başlatmadan önce arama onayı penceresi göster Sadece telefon numaralarını içeren kişileri göster + Show letters on the dialpad E-posta diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 238140b1..10da0ad2 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -65,6 +65,7 @@ 我的最愛 開始通話前顯示通話確認框 只顯示含有電話話碼的聯絡人 + Show letters on the dialpad 電子信箱 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 563c53cc..4c4c31dc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -65,6 +65,7 @@ Favorites Show a call confirmation dialog before initiating a call Show only contacts with phone numbers + Show letters on the dialpad Email From 8d12becafb4c93649750e9c94bfe3b4cd70d7880 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 19:50:48 +0100 Subject: [PATCH 05/18] fix #288, add an option to show letters at dialpad --- .../pro/activities/DialpadActivity.kt | 18 +++- .../pro/activities/SettingsActivity.kt | 9 ++ .../contacts/pro/helpers/Config.kt | 4 + .../contacts/pro/helpers/Constants.kt | 1 + app/src/main/res/layout/activity_dialpad.xml | 93 +++++++++++++++++++ app/src/main/res/layout/activity_settings.xml | 24 +++++ app/src/main/res/values/styles.xml | 8 +- 7 files changed, 155 insertions(+), 2 deletions(-) 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 ceedf0ff..92ddb569 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 @@ -7,6 +7,7 @@ import android.net.Uri import android.os.Build import android.os.Bundle import android.provider.Telephony.Sms.Intents.SECRET_CODE_ACTION +import android.telephony.PhoneNumberUtils import android.telephony.TelephonyManager import android.view.KeyEvent import android.view.Menu @@ -58,6 +59,11 @@ class DialpadActivity : SimpleActivity() { 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()) + + val showLetters = config.showDialpadLetters + arrayOf(dialpad_2_letters, dialpad_3_letters, dialpad_4_letters, dialpad_5_letters, dialpad_6_letters, dialpad_7_letters, dialpad_8_letters, dialpad_9_letters).forEach { + it.beVisibleIf(showLetters) + } } override fun onResume() { @@ -159,8 +165,18 @@ class DialpadActivity : SimpleActivity() { return } + val showLetters = config.showDialpadLetters (dialpad_list.adapter as? ContactsAdapter)?.finishActMode() - val filtered = contacts.filter { it.doesContainPhoneNumber(text) } as ArrayList + val filtered = contacts.filter { + val convertedName = PhoneNumberUtils.convertKeypadLettersToDigits(it.getNameToDisplay()) + it.doesContainPhoneNumber(text) || (showLetters && convertedName.contains(text, true)) + }.sortedWith(compareBy { + if (showLetters) { + !it.doesContainPhoneNumber(text) + } else { + true + } + }).toMutableList() as ArrayList ContactsAdapter(this, filtered, null, LOCATION_DIALPAD, null, dialpad_list, dialpad_fastscroller, text) { callContact(it as Contact) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt index db351714..1f38eb4f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt @@ -42,6 +42,7 @@ class SettingsActivity : SimpleActivity() { setupFilterDuplicates() setupShowCallConfirmation() setupShowDialpadButton() + setupShowDialpadLetters() setupOnContactClick() updateTextColors(settings_holder) } @@ -147,6 +148,14 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupShowDialpadLetters() { + settings_show_dialpad_letters.isChecked = config.showDialpadLetters + settings_show_dialpad_letters_holder.setOnClickListener { + settings_show_dialpad_letters.toggle() + config.showDialpadLetters = settings_show_dialpad_letters.isChecked + } + } + private fun setupOnContactClick() { settings_on_contact_click.text = getOnContactClickText() settings_on_contact_click_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt index 483ac685..2ebed933 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt @@ -64,4 +64,8 @@ class Config(context: Context) : BaseConfig(context) { var showDialpadButton: Boolean get() = prefs.getBoolean(SHOW_DIALPAD_BUTTON, true) set(showDialpadButton) = prefs.edit().putBoolean(SHOW_DIALPAD_BUTTON, showDialpadButton).apply() + + var showDialpadLetters: Boolean + get() = prefs.getBoolean(SHOW_DIALPAD_LETTERS, false) + set(showDialpadLetters) = prefs.edit().putBoolean(SHOW_DIALPAD_LETTERS, showDialpadLetters).apply() } 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 9a59aaa4..743ecfac 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 @@ -18,6 +18,7 @@ const val SHOW_TABS = "show_tabs" const val FILTER_DUPLICATES = "filter_duplicates" const val SHOW_CALL_CONFIRMATION = "show_call_confirmation" const val SHOW_DIALPAD_BUTTON = "show_dialpad_button" +const val SHOW_DIALPAD_LETTERS = "show_dialpad_letters" const val CONTACT_ID = "contact_id" const val SMT_PRIVATE = "smt_private" // used at the contact source of local contacts hidden from other apps diff --git a/app/src/main/res/layout/activity_dialpad.xml b/app/src/main/res/layout/activity_dialpad.xml index 6d06a8b4..721bab1f 100644 --- a/app/src/main/res/layout/activity_dialpad.xml +++ b/app/src/main/res/layout/activity_dialpad.xml @@ -90,6 +90,17 @@ app:layout_constraintHorizontal_bias="0.5" app:layout_constraintStart_toEndOf="@+id/dialpad_1"/> + + + + + + + + + + + + + + + + + + + + + + center - @dimen/medium_margin + @dimen/normal_margin @dimen/normal_margin @dimen/dialpad_text_size ?attr/selectableItemBackgroundBorderless + + From fd37c346e8c79f0638a5bddb88c2ffdbe77172ce Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Jan 2019 21:50:34 +0100 Subject: [PATCH 06/18] improve phone number highlighting when it contains a dash --- app/build.gradle | 2 +- .../simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9eaaecef..738fee73 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.6.3' + implementation 'com.simplemobiletools:commons:5.6.4' 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.5' diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt index 3ab8b592..87ab6341 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt @@ -267,7 +267,7 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList Date: Sun, 6 Jan 2019 10:52:14 +0100 Subject: [PATCH 07/18] removing the option for toggling 24 hours format --- .../pro/activities/SettingsActivity.kt | 9 ------- app/src/main/res/layout/activity_settings.xml | 24 ------------------- 2 files changed, 33 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt index 1f38eb4f..de068e3d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/activities/SettingsActivity.kt @@ -38,7 +38,6 @@ class SettingsActivity : SimpleActivity() { setupShowPhoneNumbers() setupShowContactsWithNumbers() setupStartNameWithSurname() - setupUse24HourTimeFormat() setupFilterDuplicates() setupShowCallConfirmation() setupShowDialpadButton() @@ -124,14 +123,6 @@ class SettingsActivity : SimpleActivity() { } } - private fun setupUse24HourTimeFormat() { - settings_use_24_hour_time_format.isChecked = config.use24HourFormat - settings_use_24_hour_time_format_holder.setOnClickListener { - settings_use_24_hour_time_format.toggle() - config.use24HourFormat = settings_use_24_hour_time_format.isChecked - } - } - private fun setupFilterDuplicates() { settings_filter_duplicates.isChecked = config.filterDuplicates settings_filter_duplicates_holder.setOnClickListener { diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 3b914302..61cdd164 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -244,30 +244,6 @@ - - - - - - Date: Sun, 6 Jan 2019 11:16:54 +0100 Subject: [PATCH 08/18] improve name highlighting from the dialpad --- .../contacts/pro/adapters/ContactsAdapter.kt | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt index 87ab6341..4b3de60a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/adapters/ContactsAdapter.kt @@ -1,6 +1,10 @@ package com.simplemobiletools.contacts.pro.adapters import android.graphics.drawable.Drawable +import android.telephony.PhoneNumberUtils +import android.text.Spannable +import android.text.SpannableString +import android.text.style.ForegroundColorSpan import android.view.Menu import android.view.View import android.view.ViewGroup @@ -255,7 +259,14 @@ class ContactsAdapter(activity: SimpleActivity, var contactItems: ArrayList Date: Sun, 6 Jan 2019 11:22:49 +0100 Subject: [PATCH 09/18] improve result sorting at searching --- .../contacts/pro/fragments/MyViewPagerFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt index 675efa3e..b2c1e422 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt @@ -242,7 +242,10 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) it.websites.any { it.contains(text, true) } } as ArrayList - filtered.sortBy { !getProperText(it.getNameToDisplay(), shouldNormalize).startsWith(text, true) } + filtered.sortBy { + val nameToDisplay = it.getNameToDisplay() + !getProperText(nameToDisplay, shouldNormalize).startsWith(text, true) && !nameToDisplay.contains(text, true) + } if (filtered.isEmpty() && this@MyViewPagerFragment is FavoritesFragment) { fragment_placeholder.text = activity.getString(R.string.no_items_found) From 4071ecbf16d0ff1cef1b30a62445c6122e93941a Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 11:29:24 +0100 Subject: [PATCH 10/18] convert letters to numbers at search only if we show letters at dialpad --- .../contacts/pro/activities/DialpadActivity.kt | 4 ++-- .../contacts/pro/fragments/MyViewPagerFragment.kt | 3 ++- .../com/simplemobiletools/contacts/pro/models/Contact.kt | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) 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 92ddb569..56ee61cd 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 @@ -169,10 +169,10 @@ class DialpadActivity : SimpleActivity() { (dialpad_list.adapter as? ContactsAdapter)?.finishActMode() val filtered = contacts.filter { val convertedName = PhoneNumberUtils.convertKeypadLettersToDigits(it.getNameToDisplay()) - it.doesContainPhoneNumber(text) || (showLetters && convertedName.contains(text, true)) + it.doesContainPhoneNumber(text, showLetters) || (showLetters && convertedName.contains(text, true)) }.sortedWith(compareBy { if (showLetters) { - !it.doesContainPhoneNumber(text) + !it.doesContainPhoneNumber(text, showLetters) } else { true } diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt index b2c1e422..27446be4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/fragments/MyViewPagerFragment.kt @@ -228,11 +228,12 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) fun onSearchQueryChanged(text: String) { val shouldNormalize = text.normalizeString() == text + val convertLetters = config.showDialpadLetters (fragment_list.adapter as? ContactsAdapter)?.apply { val filtered = contactsIgnoringSearch.filter { getProperText(it.getNameToDisplay(), shouldNormalize).contains(text, true) || getProperText(it.nickname, shouldNormalize).contains(text, true) || - it.doesContainPhoneNumber(text) || + it.doesContainPhoneNumber(text, convertLetters) || it.emails.any { it.value.contains(text, true) } || it.addresses.any { getProperText(it.value, shouldNormalize).contains(text, true) } || it.IMs.any { it.value.contains(text, true) } || 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 c3851d83..e602c289 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 @@ -127,9 +127,9 @@ data class Contact(var id: Int, var prefix: String, var firstName: String, var m fun isABusinessContact() = prefix.isEmpty() && firstName.isEmpty() && middleName.isEmpty() && surname.isEmpty() && suffix.isEmpty() && organization.isNotEmpty() - fun doesContainPhoneNumber(text: String): Boolean { + fun doesContainPhoneNumber(text: String, convertLetters: Boolean): Boolean { return if (text.isNotEmpty()) { - val normalizedText = text.normalizeNumber() + val normalizedText = if (convertLetters) text.normalizeNumber() else text phoneNumbers.any { PhoneNumberUtils.compare(it.normalizedNumber, normalizedText) || it.value.contains(text) || From d804ed58d59a51363c547e5ca758ff2a7f6aaeaf Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 11:40:30 +0100 Subject: [PATCH 11/18] renaming a function --- .../contacts/pro/dialogs/FilterContactSourcesDialog.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 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 3e1b7d4d..1090c7d3 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 @@ -30,7 +30,7 @@ class FilterContactSourcesDialog(val activity: SimpleActivity, private val callb view.filter_contact_sources_list.adapter = FilterContactSourcesAdapter(activity, it, selectedSources) dialog = AlertDialog.Builder(activity) - .setPositiveButton(R.string.ok) { dialogInterface, i -> confirmEventTypes() } + .setPositiveButton(R.string.ok) { dialogInterface, i -> confirmContactSources() } .setNegativeButton(R.string.cancel, null) .create().apply { activity.setupDialogStuff(view, this) @@ -39,7 +39,7 @@ class FilterContactSourcesDialog(val activity: SimpleActivity, private val callb } } - private fun confirmEventTypes() { + private fun confirmContactSources() { val selectedContactSources = (view.filter_contact_sources_list.adapter as FilterContactSourcesAdapter).getSelectedContactSources() val ignoredContactSources = contactSources.filter { !selectedContactSources.contains(it) }.map { if (it.type == SMT_PRIVATE) SMT_PRIVATE else it.getFullIdentifier() From 4dcb46c7abe8e991bc3ad8bcd670bbb1302be6d0 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 12:10:45 +0100 Subject: [PATCH 12/18] remove the notion of local account name and type --- .../contacts/pro/activities/MainActivity.kt | 20 ------------------- .../adapters/FilterContactSourcesAdapter.kt | 4 ---- .../pro/dialogs/CreateNewGroupDialog.kt | 6 ------ .../contacts/pro/extensions/Activity.kt | 4 ---- .../contacts/pro/extensions/Context.kt | 1 - .../contacts/pro/helpers/Config.kt | 8 -------- .../contacts/pro/helpers/Constants.kt | 1 - .../contacts/pro/helpers/ContactsHelper.kt | 4 ---- 8 files changed, 48 deletions(-) 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 521ab60f..05446eb3 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 @@ -73,12 +73,10 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { if (it) { handlePermission(PERMISSION_WRITE_CONTACTS) { handlePermission(PERMISSION_GET_ACCOUNTS) { - storeLocalAccountData() initFragments() } } } else { - storeLocalAccountData() initFragments() } } @@ -279,24 +277,6 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { } } - private fun storeLocalAccountData() { - if (config.localAccountType == "-1") { - ContactsHelper(this).getContactSources { sources -> - var localAccountType = "" - var localAccountName = "" - sources.forEach { - if (localAccountTypes.contains(it.type)) { - localAccountType = it.type - localAccountName = it.name - } - } - - config.localAccountType = localAccountType - config.localAccountName = localAccountName - } - } - } - private fun getInactiveTabIndexes(activeIndex: Int) = (0 until tabsList.size).filter { it != activeIndex } private fun initFragments() { 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 c125072d..44332eba 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 @@ -22,10 +22,6 @@ class FilterContactSourcesAdapter(val activity: SimpleActivity, private val cont selectedKeys.add(contactSource.hashCode()) } - if (contactSource.name == activity.config.localAccountName && contactSource.type == activity.config.localAccountType) { - contactSource.name = activity.getString(R.string.phone_storage) - } - if (contactSource.type == SMT_PRIVATE && displayContactSources.contains(SMT_PRIVATE)) { selectedKeys.add(contactSource.hashCode()) } 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 2126c3c5..a76f57f3 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 @@ -10,7 +10,6 @@ import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.extensions.value import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.contacts.pro.R -import com.simplemobiletools.contacts.pro.extensions.config import com.simplemobiletools.contacts.pro.helpers.ContactsHelper import com.simplemobiletools.contacts.pro.helpers.SMT_PRIVATE import com.simplemobiletools.contacts.pro.models.ContactSource @@ -35,11 +34,6 @@ class CreateNewGroupDialog(val activity: BaseSimpleActivity, val callback: (newG } val contactSources = ArrayList() - if (activity.config.localAccountName.isNotEmpty()) { - 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, it.name) } val phoneSecret = activity.getString(R.string.phone_storage_hidden) 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 8f416c21..ec023538 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 @@ -72,10 +72,6 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new sources.forEachIndexed { index, account -> var publicAccount = account - if (account == config.localAccountName) { - publicAccount = getString(R.string.phone_storage) - } - items.add(RadioItem(index, publicAccount)) if (currentSource == SMT_PRIVATE && account == getString(R.string.phone_storage_hidden)) { currentSourceIndex = index 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 7cd82aad..1b307d40 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 @@ -197,7 +197,6 @@ fun Context.hasContactPermissions() = hasPermission(PERMISSION_READ_CONTACTS) && fun Context.getPublicContactSource(source: String, callback: (String) -> Unit) { when (source) { - config.localAccountName -> callback(getString(R.string.phone_storage)) SMT_PRIVATE -> callback(getString(R.string.phone_storage_hidden)) else -> { Thread { diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt index 2ebed933..1dd4a759 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/Config.kt @@ -32,14 +32,6 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getString(LAST_USED_CONTACT_SOURCE, "") set(lastUsedContactSource) = prefs.edit().putString(LAST_USED_CONTACT_SOURCE, lastUsedContactSource).apply() - var localAccountName: String - get() = prefs.getString(LOCAL_ACCOUNT_NAME, "-1") - set(localAccountName) = prefs.edit().putString(LOCAL_ACCOUNT_NAME, localAccountName).apply() - - var localAccountType: String - get() = prefs.getString(LOCAL_ACCOUNT_TYPE, "-1") - set(localAccountType) = prefs.edit().putString(LOCAL_ACCOUNT_TYPE, localAccountType).apply() - var onContactClick: Int get() = prefs.getInt(ON_CONTACT_CLICK, ON_CLICK_VIEW_CONTACT) set(onContactClick) = prefs.edit().putInt(ON_CONTACT_CLICK, onContactClick).apply() 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 743ecfac..f4228e5d 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 @@ -10,7 +10,6 @@ const val SHOW_ONLY_CONTACTS_WITH_NUMBERS = "show_only_contacts_with_numbers" 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" const val LOCAL_ACCOUNT_TYPE = "local_account_type" const val ON_CONTACT_CLICK = "on_contact_click" const val SHOW_CONTACT_FIELDS = "show_contact_fields" 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 89fe463d..766f5a48 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 @@ -862,10 +862,6 @@ class ContactsHelper(val context: Context) { } sources.addAll(contentResolverAccounts) - if (sources.isEmpty() && context.config.localAccountName.isEmpty() && context.config.localAccountType.isEmpty()) { - sources.add(ContactSource("", "", "")) - } - return sources } From 50dc97e9c0180765522aa8e40f723280d1df6f90 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 14:55:45 +0100 Subject: [PATCH 13/18] minor code cleanup here and there --- app/build.gradle | 2 +- .../contacts/pro/extensions/Activity.kt | 3 +-- .../contacts/pro/helpers/Constants.kt | 19 +++---------------- .../contacts/pro/helpers/ContactsHelper.kt | 2 +- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 738fee73..4092cc7c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,7 +51,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.6.4' + implementation 'com.simplemobiletools:commons:5.6.5' 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.5' 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 ec023538..c032c720 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 @@ -71,8 +71,7 @@ fun SimpleActivity.showContactSourcePicker(currentSource: String, callback: (new sources = filteredSources.map { it.publicName } sources.forEachIndexed { index, account -> - var publicAccount = account - items.add(RadioItem(index, publicAccount)) + items.add(RadioItem(index, account)) if (currentSource == SMT_PRIVATE && account == getString(R.string.phone_storage_hidden)) { currentSourceIndex = index } 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 f4228e5d..0fa64cf7 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 @@ -10,7 +10,6 @@ const val SHOW_ONLY_CONTACTS_WITH_NUMBERS = "show_only_contacts_with_numbers" 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_TYPE = "local_account_type" const val ON_CONTACT_CLICK = "on_contact_click" const val SHOW_CONTACT_FIELDS = "show_contact_fields" const val SHOW_TABS = "show_tabs" @@ -35,10 +34,9 @@ const val KEY_NAME = "name" const val LOCATION_CONTACTS_TAB = 0 const val LOCATION_FAVORITES_TAB = 1 -const val LOCATION_GROUPS_TAB = 2 -const val LOCATION_GROUP_CONTACTS = 3 -const val LOCATION_DIALPAD = 4 -const val LOCATION_INSERT_OR_EDIT = 5 +const val LOCATION_GROUP_CONTACTS = 2 +const val LOCATION_DIALPAD = 3 +const val LOCATION_INSERT_OR_EDIT = 4 const val CONTACTS_TAB_MASK = 1 const val FAVORITES_TAB_MASK = 2 @@ -104,17 +102,6 @@ const val DEFAULT_ORGANIZATION_TYPE = CommonDataKinds.Organization.TYPE_WORK const val DEFAULT_WEBSITE_TYPE = CommonDataKinds.Website.TYPE_HOMEPAGE const val DEFAULT_IM_TYPE = CommonDataKinds.Im.PROTOCOL_SKYPE -// some manufacturer contact account types from https://stackoverflow.com/a/44802016/1967672 -val localAccountTypes = arrayListOf("vnd.sec.contact.phone", - "com.htc.android.pcsc", - "com.sonyericsson.localcontacts", - "com.lge.sync", - "com.lge.phone", - "vnd.tmobileus.contact.phone", - "com.android.huawei.phone", - "Local Phone Account" -) - // apps with special handling const val TELEGRAM_PACKAGE = "org.telegram.messenger" const val SIGNAL_PACKAGE = "org.thoughtcrime.securesms" 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 766f5a48..e07326b0 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 @@ -670,7 +670,7 @@ class ContactsHelper(val context: Context) { return groups } - fun getDeviceStoredGroups(): ArrayList { + private fun getDeviceStoredGroups(): ArrayList { val groups = ArrayList() if (!context.hasContactPermissions()) { return groups From 96f9d98facc414c100706109fe568f72224d1c1c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 15:19:23 +0100 Subject: [PATCH 14/18] updating Whats New --- .../simplemobiletools/contacts/pro/activities/MainActivity.kt | 1 + app/src/main/res/values/donottranslate.xml | 4 ++++ 2 files changed, 5 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 05446eb3..e2d67b20 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 @@ -511,6 +511,7 @@ class MainActivity : SimpleActivity(), RefreshContactsListener { add(Release(32, R.string.release_32)) add(Release(34, R.string.release_34)) add(Release(39, R.string.release_39)) + add(Release(40, R.string.release_40)) checkWhatsNew(this, BuildConfig.VERSION_CODE) } } diff --git a/app/src/main/res/values/donottranslate.xml b/app/src/main/res/values/donottranslate.xml index 309ad8d7..f54cf156 100644 --- a/app/src/main/res/values/donottranslate.xml +++ b/app/src/main/res/values/donottranslate.xml @@ -13,6 +13,10 @@ Telegram + + Removed the Recents tab due to Googles\' latest security policies being stricter than initiall thought\n + Allow showing letters on the dialpad + 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 097dc769e5d41fab69e73f0573727c125e294cd4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 18:25:08 +0100 Subject: [PATCH 15/18] update version to 6.2.0 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4092cc7c..6d2f8dba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,8 @@ android { applicationId "com.simplemobiletools.contacts.pro" minSdkVersion 21 targetSdkVersion 28 - versionCode 39 - versionName "6.1.2" + versionCode 40 + versionName "6.2.0" setProperty("archivesBaseName", "contacts") } From 597ca02d7010ddd687a6a4e286ebfd2a147fdb4c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 6 Jan 2019 18:25:13 +0100 Subject: [PATCH 16/18] updating changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a748cc..46dbed96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Changelog ========== +Version 6.2.0 *(2019-01-06)* +---------------------------- + + * Removed the Recents tab due to Googles' latest security policies + * Allow showing letters on the dialpad + * Fixed some contact filtering issues + * Couple other smaller improvements + Version 6.1.2 *(2018-12-28)* ---------------------------- From 892a6946d8d5b07454129ed7241a92669919d26c Mon Sep 17 00:00:00 2001 From: en2sv Date: Sun, 6 Jan 2019 20:28:42 +0100 Subject: [PATCH 17/18] Update Swedish translation --- app/src/main/res/values-sv/strings.xml | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 703e52d7..35b0b3fd 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -17,8 +17,8 @@ Begär de behörigheter som krävs Skapa ny kontakt 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 + Du måste ställa in den här appen som standardtelefonapp för att kunna använda blockerade nummer. + Ange som standard Inga kontakter hittades @@ -54,7 +54,7 @@ Visa efternamn först Visa telefonnummer i huvudvyn Visa kontaktminiatyrer - Show a dialpad button on the main screen + Visa en knappsatsknapp i huvudvyn Vid kontakttryckning Ring kontakt Visa kontaktuppgifter @@ -65,7 +65,7 @@ Favoriter Visa en bekräftelsedialogruta före uppringning Visa bara kontakter med telefonnummer - Show letters on the dialpad + Visa bokstäver på knappsatsen E-post @@ -111,14 +111,14 @@ Lägg till nummer i kontakt - Dialer - Calling - Incoming call - Incoming call from… - Ongoing call - Disconnected - Decline - Answer + Telefon + Ringer + Inkommande samtal + Inkommande samtal från… + Pågående samtal + Frånkopplad + Avvisa + Svara Välj vilka fält som ska visas @@ -136,12 +136,12 @@ Snabbmeddelanden (IM) - Manage blocked numbers - You are not blocking anyone. - Add a blocked number - Block number - Block numbers - Blocked numbers + Hantera blockerade nummer + Du blockerar inte någon. + Lägg till ett blockerat nummer + Blockera nummer + Blockera nummer + Blockerade nummer I want to change what fields are visible at contacts. Can I do it? @@ -149,7 +149,7 @@ - An app for managing your contacts without ads, respecting your privacy. + En app för att hantera dina kontakter utan reklam, respekterar din integritet. En enkel app för att skapa och hantera kontakter från olika källor. Kontakterna kan lagras bara på din enhet, men kan också synkroniseras med ditt Google-konto eller andra konton. Du kan visa dina favoritkontakter i en separat lista. From c624a165a25cf75c5dbf5810df3acec08d2e0658 Mon Sep 17 00:00:00 2001 From: dugi9991 Date: Sun, 6 Jan 2019 21:36:14 +0100 Subject: [PATCH 18/18] Update strings.xml Update newly added strings. --- app/src/main/res/values-hr/strings.xml | 54 +++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 7f0d9749..8cacf87d 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -15,15 +15,15 @@ Pošalji e-poštu grupi Nazovi %s Zatraži potrebna dopuštenja - Create new contact - Add to an existing contact - You have to make this app the default dialer app to make use of blocked numbers. - Set to default + Stvori novi kontakt + Dodaj postojećem kontaktu + Morate napraviti ovu aplikaciju zadanom aplikacijom za biranje da biste bili u mogućnosti koristiti blokirane brojeve. + Postavi na zadano - No contacts found - No contacts with emails have been found - No contacts with phone numbers have been found + Nisu pronađeni kontakti + Nije pronađen nijedan kontakt s e-poštom + Nisu pronađeni kontakti s telefonskim brojevima Novi kontakt Uredi kontakt @@ -32,7 +32,7 @@ Ime Srednje ime Prezime - Nickname + Nadimak Nema grupa @@ -64,8 +64,8 @@ Kontakti Favoriti Pokažite dijaloški okvir za potvrdu poziva prije pokretanja poziva - Show only contacts with phone numbers - Show letters on the dialpad + Prikaži samo kontakte s telefonskim brojevima + Prikaži slova na telefonskoj tipkovnici E-pošta @@ -107,18 +107,18 @@ Naziv datoteke (bez .vcf) - Dialpad - Add number to contact + Telefonska tipkovnica + Dodaj broj u kontakt - Dialer - Calling - Incoming call - Incoming call from… - Ongoing call - Disconnected - Decline - Answer + Birač broja + Pozivanje + Dolazni poziv + Dolazni poziv od... + Poziv u tijeku + Prekinuto + Odbij + Odgovori Odaberi polja za prikaz @@ -136,12 +136,12 @@ Brzo slanje poruka (IM) - Manage blocked numbers - You are not blocking anyone. - Add a blocked number - Block number - Block numbers - Blocked numbers + Upravljanje blokiranim brojevima + Ne blokirate nikoga. + Dodaj blokirani broj + Blokiraj broj + Blokiraj brojeve + Blokirani brojevi Želim promijeniti polja koja su vidljiva na kontaktima. Mogu li to napraviti? @@ -149,7 +149,7 @@ - An app for managing your contacts without ads, respecting your privacy. + Aplikacija za upravljanje kontaktima, bez oglasa, poštujući Vašu privatnost. Jednostavna aplikacija za izradu ili upravljanje kontaktima iz bilo kojeg izvora. Kontakti mogu biti pohranjeni samo na Vašem uređaju, ali i sinkronizirani putem Googlea ili drugih računa. Možete prikazati svoje omiljene kontakte na zasebnom popisu.