fix #537, properly handle non UTF characters at letters scrollbar
This commit is contained in:
parent
bee5d768b9
commit
9df550a8aa
1 changed files with 3 additions and 7 deletions
|
|
@ -261,11 +261,7 @@ abstract class MyViewPagerFragment(context: Context, attributeSet: AttributeSet)
|
||||||
name = contact.getNameToDisplay()
|
name = contact.getNameToDisplay()
|
||||||
}
|
}
|
||||||
|
|
||||||
var character = if (name.isNotEmpty()) name.substring(0, 1) else ""
|
val character = if (name.isNotEmpty()) name.substring(0, 1) else ""
|
||||||
if (!character.areLettersOnly()) {
|
|
||||||
character = "#"
|
|
||||||
}
|
|
||||||
|
|
||||||
FastScrollItemIndicator.Text(character.toUpperCase(Locale.getDefault()))
|
FastScrollItemIndicator.Text(character.toUpperCase(Locale.getDefault()))
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
FastScrollItemIndicator.Text("")
|
FastScrollItemIndicator.Text("")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue