Replace shortNumber() with formatNumber() (#3519)

formatNumber() was existing code to show numbers with suffixes like K, M, etc, so re-use that code and delete shortNumber().

Update the tests to (a) test formatNumber(), and (b) be parameterised.
This commit is contained in:
Nik Clayton 2023-06-10 16:29:26 +02:00 committed by GitHub
commit 071e00774e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 78 deletions

View file

@ -114,11 +114,11 @@ public class StatusViewHolder extends StatusBaseViewHolder {
}
protected void setReblogsCount(int reblogsCount) {
reblogsCountLabel.setText(NumberUtils.shortNumber(reblogsCount));
reblogsCountLabel.setText(NumberUtils.formatNumber(reblogsCount, 1000));
}
protected void setFavouritedCount(int favouritedCount) {
favouritedCountLabel.setText(NumberUtils.shortNumber(favouritedCount));
favouritedCountLabel.setText(NumberUtils.formatNumber(favouritedCount, 1000));
}
protected void hideStatusInfo() {