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

Commit ed0daa93 authored by Igor Viarheichyk's avatar Igor Viarheichyk Committed by Elliott Hughes
Browse files

Use constants instead of resources for ellipsis.

All supported locales use only U+2025 and U+2026 to represent
ellipses, and it will unlikely change in future. Given translated
resources are inconsistent and often use three dots it is safer
to use constants instead of resources.

Change-Id: I51a6cb903f62f739fbadd6b78e5765c0028d641a
parent c1ce74ca
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ import java.util.regex.Pattern;

public class TextUtils {
    private static final String TAG = "TextUtils";
    private static final String ELLIPSIS = new String(Layout.ELLIPSIS_NORMAL);
    private static final String ELLIPSIS_TWO_DOTS = new String(Layout.ELLIPSIS_TWO_DOTS);


    private TextUtils() { /* cannot be instantiated */ }
@@ -1068,14 +1070,9 @@ public class TextUtils {
                                         float avail, TruncateAt where,
                                         boolean preserveLength,
                                         EllipsizeCallback callback) {

        final String ellipsis = (where == TruncateAt.END_SMALL) ?
                Resources.getSystem().getString(R.string.ellipsis_two_dots) :
                Resources.getSystem().getString(R.string.ellipsis);

        return ellipsize(text, paint, avail, where, preserveLength, callback,
                TextDirectionHeuristics.FIRSTSTRONG_LTR,
                ellipsis);
                (where == TruncateAt.END_SMALL) ? ELLIPSIS_TWO_DOTS : ELLIPSIS);
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -40,14 +40,6 @@
         for a note with no name. -->
    <string name="untitled">&lt;Untitled&gt;</string>

    <!-- Used to replace a range of characters in text that is too wide
         for the space allocated to it (three dots). -->
    <string name="ellipsis">\u2026</string>

    <!-- Used to replace a range of characters in text that is too wide
         for the space allocated to it (two dots). -->
    <string name="ellipsis_two_dots">\u2025</string>

    <!-- How to display the lack of a phone number -->
    <string name="emptyPhoneNumber">(No phone number)</string>