Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7547318 authored by Pranav Vashi's avatar Pranav Vashi Committed by Michael Bestas
Browse files

Contacts: Fix LetterTileDrawable for all languages

* Currently alphabet tile is rendered only for english language.
  However, Google Dialer / Googler Contacts do support rendering
  for all languages. Let's do same here!
* Also, following Google, we do not want to handle numbers.
* Fixes: https://github.com/crdroidandroid/android_packages_apps_Dialer/issues/9



Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
Change-Id: I3df3ca135cfa4db9121648ddaef4b56cfc13b573
parent de2d59bc
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -205,10 +205,6 @@ public class LetterTileDrawable extends Drawable {
        }
    }

    private static boolean isEnglishLetter(final char c) {
        return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
    }

    @Override
    public void setAlpha(final int alpha) {
        mPaint.setAlpha(alpha);
@@ -265,8 +261,8 @@ public class LetterTileDrawable extends Drawable {

    public LetterTileDrawable setLetterAndColorFromContactDetails(final String displayName,
            final String identifier) {
        if (displayName != null && displayName.length() > 0
                && isEnglishLetter(displayName.charAt(0))) {
        if (displayName != null && !TextUtils.isEmpty(displayName)
                && Character.isLetter(displayName.charAt(0))) {
            mLetter = Character.toUpperCase(displayName.charAt(0));
        } else {
            mLetter = null;