Skip to content

Commit

Permalink
Use locale digits on more places
Browse files Browse the repository at this point in the history
  • Loading branch information
ebraminio committed Apr 8, 2020
1 parent 0bb8a9a commit bcb529e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Expand Up @@ -37,6 +37,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

/**
* BaseAdapter for the navigation drawer
Expand Down Expand Up @@ -246,19 +247,19 @@ private View getNavView(String title, int position, View convertView, ViewGroup
if (tag.equals(QueueFragment.TAG)) {
int queueSize = itemAccess.getQueueSize();
if (queueSize > 0) {
holder.count.setText(String.valueOf(queueSize));
holder.count.setText(String.format(Locale.getDefault(), "%d", queueSize));
holder.count.setVisibility(View.VISIBLE);
}
} else if (tag.equals(EpisodesFragment.TAG)) {
int unreadItems = itemAccess.getNumberOfNewItems();
if (unreadItems > 0) {
holder.count.setText(String.valueOf(unreadItems));
holder.count.setText(String.format(Locale.getDefault(), "%d", unreadItems));
holder.count.setVisibility(View.VISIBLE);
}
} else if (tag.equals(SubscriptionFragment.TAG)) {
int sum = itemAccess.getFeedCounterSum();
if (sum > 0) {
holder.count.setText(String.valueOf(sum));
holder.count.setText(String.format(Locale.getDefault(), "%d", sum));
holder.count.setVisibility(View.VISIBLE);
}
} else if(tag.equals(DownloadsFragment.TAG) && UserPreferences.isEnableAutodownload()) {
Expand Down Expand Up @@ -351,7 +352,7 @@ private View getFeedView(int position, View convertView, ViewGroup parent) {
int counter = itemAccess.getFeedCounter(feed.getId());
if(counter > 0) {
holder.count.setVisibility(View.VISIBLE);
holder.count.setText(String.valueOf(counter));
holder.count.setText(String.format(Locale.getDefault(), "%d", counter));
} else {
holder.count.setVisibility(View.GONE);
}
Expand Down
Expand Up @@ -13,6 +13,7 @@
import com.bumptech.glide.Glide;

import java.lang.ref.WeakReference;
import java.util.Locale;

import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
Expand Down Expand Up @@ -88,7 +89,7 @@ public View getView(int position, View convertView, ViewGroup parent) {
holder.feedTitle.setVisibility(View.VISIBLE);
int count = itemAccess.getFeedCounter(feed.getId());
if(count > 0) {
holder.count.setPrimaryText(String.valueOf(itemAccess.getFeedCounter(feed.getId())));
holder.count.setPrimaryText(String.format(Locale.getDefault(), "%d", itemAccess.getFeedCounter(feed.getId())));
holder.count.setVisibility(View.VISIBLE);
} else {
holder.count.setVisibility(View.GONE);
Expand Down
Expand Up @@ -3,6 +3,9 @@
import android.content.Context;
import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;

import java.util.Locale;

import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;

Expand Down Expand Up @@ -45,7 +48,7 @@ public static void showSkipPreference(Context context, SkipDirection direction,
UserPreferences.setRewindSecs(seconds);
}
if (textView != null) {
textView.setText(String.valueOf(seconds));
textView.setText(String.format(Locale.getDefault(), "%d", seconds));
}
}
});
Expand Down

0 comments on commit bcb529e

Please sign in to comment.