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

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

Dialer: 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



Change-Id: I68bf9f4b80f58f64c1353ce81873d5c0d446bbd6
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent 47c7f6e6
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -176,10 +176,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 draw(@NonNull final Canvas canvas) {
    final Rect bounds = getBounds();
@@ -336,7 +332,8 @@ public class LetterTileDrawable extends Drawable {

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