Change stop to pause in download queue view

This commit is contained in:
Kevin Richter 2016-02-09 16:25:36 +01:00
parent 6c069ad87b
commit 4be0b2502e
9 changed files with 10 additions and 10 deletions

View file

@ -29,7 +29,7 @@ public class DownloadFragment extends BaseRxFragment<DownloadPresenter> {
private DownloadAdapter adapter;
private MenuItem startButton;
private MenuItem stopButton;
private MenuItem pauseButton;
private Subscription queueStatusSubscription;
private boolean isRunning;
@ -64,11 +64,11 @@ public class DownloadFragment extends BaseRxFragment<DownloadPresenter> {
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.download_queue, menu);
startButton = menu.findItem(R.id.start_queue);
stopButton = menu.findItem(R.id.stop_queue);
pauseButton = menu.findItem(R.id.pause_queue);
// Menu seems to be inflated after onResume in fragments, so we initialize them here
startButton.setVisible(!isRunning && !getPresenter().downloadManager.getQueue().isEmpty());
stopButton.setVisible(isRunning);
pauseButton.setVisible(isRunning);
}
@Override
@ -77,7 +77,7 @@ public class DownloadFragment extends BaseRxFragment<DownloadPresenter> {
case R.id.start_queue:
DownloadService.start(getActivity());
break;
case R.id.stop_queue:
case R.id.pause_queue:
DownloadService.stop(getActivity());
break;
}
@ -101,8 +101,8 @@ public class DownloadFragment extends BaseRxFragment<DownloadPresenter> {
isRunning = running;
if (startButton != null)
startButton.setVisible(!running && !getPresenter().downloadManager.getQueue().isEmpty());
if (stopButton != null)
stopButton.setVisible(running);
if (pauseButton != null)
pauseButton.setVisible(running);
}
private void createAdapter() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

View file

@ -8,9 +8,9 @@
android:visible="false"
app:showAsAction="ifRoom"/>
<item android:title="@string/action_stop"
android:id="@+id/stop_queue"
android:icon="@drawable/ic_stop"
<item android:title="@string/action_pause"
android:id="@+id/pause_queue"
android:icon="@drawable/ic_pause"
android:visible="false"
app:showAsAction="ifRoom"/>

View file

@ -35,12 +35,12 @@
<string name="action_next_unread">Next unread</string>
<string name="action_start">Start</string>
<string name="action_stop">Stop</string>
<string name="action_pause">Pause</string>
<string name="action_previous_chapter">Previous chapter</string>
<string name="action_next_chapter">Next chapter</string>
<string name="action_retry">Retry</string>
<string name="action_display_mode">Change display mode</string>
<!-- Buttons -->
<string name="button_ok">OK</string>
<string name="button_cancel">Cancel</string>