mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
fix #537, properly handle non UTF characters at letters scrollbar
This commit is contained in:
@ -110,8 +110,8 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
||||
|
||||
fun refreshContacts(contacts: ArrayList<Contact>) {
|
||||
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("")
|
||||
|
Reference in New Issue
Block a user