mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-02-05 13:08:12 +01:00
Issue #2680: Display time left in queue info bar
This commit is contained in:
parent
36ac93e031
commit
5fe060506a
@ -534,14 +534,15 @@ public class QueueFragment extends Fragment {
|
|||||||
private void refreshInfoBar() {
|
private void refreshInfoBar() {
|
||||||
String info = queue.size() + getString(R.string.episodes_suffix);
|
String info = queue.size() + getString(R.string.episodes_suffix);
|
||||||
if(queue.size() > 0) {
|
if(queue.size() > 0) {
|
||||||
long duration = 0;
|
long timeLeft = 0;
|
||||||
for(FeedItem item : queue) {
|
for(FeedItem item : queue) {
|
||||||
if(item.getMedia() != null) {
|
if(item.getMedia() != null) {
|
||||||
duration += item.getMedia().getDuration();
|
timeLeft += item.getMedia().getDuration() - item.getMedia().getPosition();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info += " \u2022 ";
|
info += " \u2022 ";
|
||||||
info += Converter.getDurationStringLocalized(getActivity(), duration);
|
info += getString(R.string.time_left_label);
|
||||||
|
info += Converter.getDurationStringLocalized(getActivity(), timeLeft);
|
||||||
}
|
}
|
||||||
infoBar.setText(info);
|
infoBar.setText(info);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user