kopia lustrzana https://github.com/ryukoposting/Signal-Android
Surround phone numbers with LTR unicode mark.
This also removes the previous TextView LTR flag that I had initially added for a one-off.main
rodzic
3a78031a71
commit
3d14c05114
|
@ -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";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue