From 9df550a8aa8e6ed17d7bc93199dbf5d113a56e59 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 28 Apr 2020 09:55:49 +0200 Subject: [PATCH] fix #537, properly handle non UTF characters at letters scrollbar --- .../contacts/pro/fragments/MyViewPagerFragment.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 b58b43df..d92e6b8d 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 @@ -110,8 +110,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) fun refreshContacts(contacts: ArrayList) { if ((config.showTabs and CONTACTS_TAB_MASK == 0 && this is ContactsFragment && activity !is InsertOrEditContactActivity) || - (config.showTabs and FAVORITES_TAB_MASK == 0 && this is FavoritesFragment) || - (config.showTabs and GROUPS_TAB_MASK == 0 && this is GroupsFragment)) { + (config.showTabs and FAVORITES_TAB_MASK == 0 && this is FavoritesFragment) || + (config.showTabs and GROUPS_TAB_MASK == 0 && this is GroupsFragment)) { return } @@ -261,11 +261,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet) name = contact.getNameToDisplay() } - var character = if (name.isNotEmpty()) name.substring(0, 1) else "" - if (!character.areLettersOnly()) { - character = "#" - } - + val character = if (name.isNotEmpty()) name.substring(0, 1) else "" FastScrollItemIndicator.Text(character.toUpperCase(Locale.getDefault())) } catch (e: Exception) { FastScrollItemIndicator.Text("")