Merge pull request #2674 from ByteHamster/delete-while-playing
Prevent deletion of currently playing item
This commit is contained in:
commit
e04e537829
|
@ -100,8 +100,10 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
|
|||
FeedItem.State state = item.getState();
|
||||
if (state == FeedItem.State.PLAYING) {
|
||||
holder.butSecondary.setEnabled(false);
|
||||
holder.butSecondary.setAlpha(0.5f);
|
||||
} else {
|
||||
holder.butSecondary.setEnabled(true);
|
||||
holder.butSecondary.setAlpha(1.0f);
|
||||
}
|
||||
holder.butSecondary.setFocusable(false);
|
||||
holder.butSecondary.setTag(item);
|
||||
|
|
|
@ -432,6 +432,16 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
|
|||
butAction1Text = R.string.download_label;
|
||||
}
|
||||
}
|
||||
|
||||
FeedItem.State state = item.getState();
|
||||
if (butAction2Text == R.string.delete_label && state == FeedItem.State.PLAYING) {
|
||||
butAction2.setEnabled(false);
|
||||
butAction2.setAlpha(0.5f);
|
||||
} else {
|
||||
butAction2.setEnabled(true);
|
||||
butAction2.setAlpha(1.0f);
|
||||
}
|
||||
|
||||
if(butAction1Icon != null && butAction1Text != 0) {
|
||||
butAction1.setText(butAction1Icon +"\u0020\u0020" + getActivity().getString(butAction1Text));
|
||||
Iconify.addIcons(butAction1);
|
||||
|
|
Loading…
Reference in New Issue