mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch '1373-format-numbers' into 'master'
Format numbers in locale as well (not all languages use the same) See merge request briar/briar!943
This commit is contained in:
@@ -10,6 +10,8 @@ import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.contact.BaseContactListAdapter.OnContactClickListener;
|
||||
import org.briarproject.briar.android.util.UiUtils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static android.support.v4.view.ViewCompat.setTransitionName;
|
||||
@@ -36,7 +38,7 @@ class ContactListItemViewHolder extends ContactItemViewHolder<ContactListItem> {
|
||||
// unread count
|
||||
int unreadCount = item.getUnreadCount();
|
||||
if (unreadCount > 0) {
|
||||
unread.setText(String.valueOf(unreadCount));
|
||||
unread.setText(String.format(Locale.getDefault(), "%d", unreadCount));
|
||||
unread.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
unread.setVisibility(View.INVISIBLE);
|
||||
|
||||
@@ -8,6 +8,8 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.threaded.ThreadItemAdapter.ThreadItemListener;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
@@ -45,7 +47,8 @@ public class ThreadPostViewHolder<I extends ThreadItem>
|
||||
}
|
||||
if (item.getLevel() > 5) {
|
||||
lvlText.setVisibility(VISIBLE);
|
||||
lvlText.setText(String.valueOf(item.getLevel()));
|
||||
lvlText.setText(
|
||||
String.format(Locale.getDefault(), "%d", item.getLevel()));
|
||||
} else {
|
||||
lvlText.setVisibility(GONE);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import android.widget.TextView;
|
||||
|
||||
import org.briarproject.briar.R;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.hdodenhof.circleimageview.CircleImageView;
|
||||
@@ -44,7 +46,7 @@ public class TextAvatarView extends FrameLayout {
|
||||
|
||||
public void setUnreadCount(int count) {
|
||||
if (count > 0) {
|
||||
badge.setText(String.valueOf(count));
|
||||
badge.setText(String.format(Locale.getDefault(), "%d", count));
|
||||
badge.setVisibility(VISIBLE);
|
||||
} else {
|
||||
badge.setVisibility(INVISIBLE);
|
||||
|
||||
@@ -12,6 +12,8 @@ import android.widget.TextView;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.briar.R;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@UiThread
|
||||
@@ -69,7 +71,7 @@ public class UnreadMessageButton extends FrameLayout {
|
||||
} else {
|
||||
fab.show();
|
||||
unread.setVisibility(VISIBLE);
|
||||
unread.setText(String.valueOf(count));
|
||||
unread.setText(String.format(Locale.getDefault(), "%d", count));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user