Prevent deletion of currently playing item
Was already prevented in the download list but not on the details fragment. Added alpha to make disabled state clear. Closes #2285
This commit is contained in:
parent
e16a111a12
commit
1628360c4b
|
@ -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