parent
9b20aeaedd
commit
f022ddaf8f
|
@ -572,10 +572,29 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
|
|||
Feed feed = navDrawerData.feeds.get(position - navAdapter.getSubscriptionOffset());
|
||||
switch(item.getItemId()) {
|
||||
case R.id.mark_all_seen_item:
|
||||
ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(this,
|
||||
R.string.mark_all_seen_label,
|
||||
R.string.mark_all_seen_confirmation_msg) {
|
||||
@Override
|
||||
public void onConfirmButtonPressed(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
DBWriter.markFeedSeen(feed.getId());
|
||||
}
|
||||
};
|
||||
markAllSeenConfirmationDialog.createNewDialog().show();
|
||||
return true;
|
||||
case R.id.mark_all_read_item:
|
||||
ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(this,
|
||||
R.string.mark_all_read_label,
|
||||
R.string.mark_all_read_confirmation_msg) {
|
||||
|
||||
@Override
|
||||
public void onConfirmButtonPressed(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
DBWriter.markFeedRead(feed.getId());
|
||||
}
|
||||
};
|
||||
markAllReadConfirmationDialog.createNewDialog().show();
|
||||
return true;
|
||||
case R.id.rename_item:
|
||||
new RenameFeedDialog(this, feed).show();
|
||||
|
|
|
@ -152,18 +152,39 @@ public class SubscriptionFragment extends Fragment {
|
|||
Feed feed = (Feed)selectedObject;
|
||||
switch(item.getItemId()) {
|
||||
case R.id.mark_all_seen_item:
|
||||
ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(getActivity(),
|
||||
R.string.mark_all_seen_label,
|
||||
R.string.mark_all_seen_confirmation_msg) {
|
||||
|
||||
@Override
|
||||
public void onConfirmButtonPressed(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
|
||||
Observable.fromCallable(() -> DBWriter.markFeedSeen(feed.getId()))
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(result -> loadSubscriptions(),
|
||||
error -> Log.e(TAG, Log.getStackTraceString(error)));
|
||||
}
|
||||
};
|
||||
markAllSeenConfirmationDialog.createNewDialog().show();
|
||||
return true;
|
||||
case R.id.mark_all_read_item:
|
||||
ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(getActivity(),
|
||||
R.string.mark_all_read_label,
|
||||
R.string.mark_all_read_confirmation_msg) {
|
||||
|
||||
@Override
|
||||
public void onConfirmButtonPressed(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
Observable.fromCallable(() -> DBWriter.markFeedRead(feed.getId()))
|
||||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(result -> loadSubscriptions(),
|
||||
error -> Log.e(TAG, Log.getStackTraceString(error)));
|
||||
}
|
||||
};
|
||||
markAllReadConfirmationDialog.createNewDialog().show();
|
||||
return true;
|
||||
case R.id.rename_item:
|
||||
new RenameFeedDialog(getActivity(), feed).show();
|
||||
|
|
Loading…
Reference in New Issue