mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 04:28:35 +00:00
Surround phone numbers with LTR unicode mark.
This also removes the previous TextView LTR flag that I had initially added for a one-off.
This commit is contained in:
@@ -79,7 +79,7 @@ public class PhoneNumberFormatter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static @NonNull String prettyPrint(@NonNull String e164) {
|
public static @NonNull String prettyPrint(@NonNull String e164) {
|
||||||
return get(ApplicationDependencies.getApplication()).prettyPrintFormat(e164);
|
return StringUtil.forceLtr(get(ApplicationDependencies.getApplication()).prettyPrintFormat(e164));
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull String prettyPrintFormat(@NonNull String e164) {
|
public @NonNull String prettyPrintFormat(@NonNull String e164) {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
android:textColor="@color/signal_colorOnSurfaceVariant"
|
android:textColor="@color/signal_colorOnSurfaceVariant"
|
||||||
android:textDirection="ltr"
|
|
||||||
tools:text="+1 (999) 555-1234" />
|
tools:text="+1 (999) 555-1234" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -322,4 +322,8 @@ public final class StringUtil {
|
|||||||
iterator.setText(text);
|
iterator.setText(text);
|
||||||
return iterator.countBreaks();
|
return iterator.countBreaks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String forceLtr(@NonNull CharSequence text) {
|
||||||
|
return "\u202a" + text + "\u202c";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user