diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-07-19 02:07:50 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-07-19 02:07:50 +0200 |
commit | 35dcabd10398482fb5b06b72d81d3395d035fe70 (patch) | |
tree | 91711dc6e18873ec75e4015a1bb80641ad6a556f /app | |
parent | c779e78ee8fd6d222d951c34cf7c322a3b778ee2 (diff) | |
download | AntennaPod-35dcabd10398482fb5b06b72d81d3395d035fe70.zip |
Minor improvements
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java | 24 | ||||
-rw-r--r-- | app/src/main/res/layout/queue_fragment.xml | 4 |
2 files changed, 13 insertions, 15 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 8e3313db4..3a5e66cfe 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -66,7 +66,7 @@ public class QueueFragment extends Fragment { EventDistributor.DOWNLOAD_QUEUED | EventDistributor.PLAYER_STATUS_UPDATE; - private TextView statusBar; + private TextView infoBar; private DragSortListView listView; private QueueListAdapter listAdapter; private TextView txtvEmpty; @@ -364,7 +364,7 @@ public class QueueFragment extends Fragment { ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.queue_label); View root = inflater.inflate(R.layout.queue_fragment, container, false); - statusBar = (TextView) root.findViewById(R.id.status_bar); + infoBar = (TextView) root.findViewById(R.id.info_bar); listView = (DragSortListView) root.findViewById(android.R.id.list); txtvEmpty = (TextView) root.findViewById(android.R.id.empty); progLoading = (ProgressBar) root.findViewById(R.id.progLoading); @@ -472,7 +472,8 @@ public class QueueFragment extends Fragment { // needs data that may have just been loaded. getActivity().supportInvalidateOptionsMenu(); - // refresh status bar + // refresh information bar + String info = queue.size() + getString(R.string.episodes_suffix); if(queue.size() > 0) { int durationSec = 0; for(FeedItem item : queue) { @@ -480,18 +481,15 @@ public class QueueFragment extends Fragment { durationSec += item.getMedia().getDuration() / 1000; } } - String duration = ""; - if(durationSec > 3600) { - duration += durationSec / 3600 + " " + getString(R.string.time_unit_hours) + " " - + (durationSec % 3600) / 60 + " " + getString(R.string.time_unit_minutes); - } else { - duration = durationSec / 60 + " " + getString(R.string.time_unit_minutes); + int hours = durationSec / 3600; + int minutes = (durationSec % 3600) / 60; + info += " \u2022 "; + if (hours > 0) { + info += hours + " " + getString(R.string.time_unit_hours) + " "; } - statusBar.setText(queue.size() + getString(R.string.episodes_suffix) + " \u2022 " + duration); - } else { - statusBar.setText("0" + getString(R.string.episodes_suffix)); + info += minutes + " " + getString(R.string.time_unit_minutes); } - + infoBar.setText(info); } private DownloadObserver.Callback downloadObserverCallback = new DownloadObserver.Callback() { diff --git a/app/src/main/res/layout/queue_fragment.xml b/app/src/main/res/layout/queue_fragment.xml index 7e2c64d03..2068fc04c 100644 --- a/app/src/main/res/layout/queue_fragment.xml +++ b/app/src/main/res/layout/queue_fragment.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent"> <TextView - android:id="@+id/status_bar" + android:id="@+id/info_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" @@ -17,7 +17,7 @@ android:id="@+id/divider" android:layout_width="match_parent" android:layout_height="1dp" - android:layout_below="@id/status_bar" + android:layout_below="@id/info_bar" android:background="?android:attr/listDivider"/> <com.mobeta.android.dslv.DragSortListView |