mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Add polish to usernames UX.
This commit is contained in:
committed by
Nicholas Tinsley
parent
ec96b4e3aa
commit
38d5d3ad1b
@@ -149,7 +149,7 @@ public final class SpanUtil {
|
||||
|
||||
public static void appendBottomImageSpan(@NonNull SpannableStringBuilder builder, @NonNull Drawable drawable, int width, int height) {
|
||||
drawable.setBounds(0, 0, ViewUtil.dpToPx(width), ViewUtil.dpToPx(height));
|
||||
builder.append(" ").append(SpanUtil.buildImageSpan(drawable, DynamicDrawableSpan.ALIGN_BOTTOM));
|
||||
builder.append(SpanUtil.buildImageSpan(drawable, DynamicDrawableSpan.ALIGN_BOTTOM));
|
||||
}
|
||||
|
||||
public static CharSequence learnMore(@NonNull Context context,
|
||||
|
||||
@@ -64,6 +64,12 @@ object UsernameUtil {
|
||||
value == null -> {
|
||||
null
|
||||
}
|
||||
value == "00" -> {
|
||||
InvalidReason.INVALID_NUMBER
|
||||
}
|
||||
value.startsWith("00") -> {
|
||||
InvalidReason.INVALID_NUMBER_PREFIX
|
||||
}
|
||||
value.length < MIN_DISCRIMINATOR_LENGTH -> {
|
||||
InvalidReason.TOO_SHORT
|
||||
}
|
||||
@@ -83,6 +89,8 @@ object UsernameUtil {
|
||||
TOO_SHORT,
|
||||
TOO_LONG,
|
||||
INVALID_CHARACTERS,
|
||||
STARTS_WITH_NUMBER
|
||||
STARTS_WITH_NUMBER,
|
||||
INVALID_NUMBER,
|
||||
INVALID_NUMBER_PREFIX
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user