confirm if necessary catching up feed from context menu
This commit is contained in:
parent
e01bec4815
commit
9da4f1e5f7
@ -200,4 +200,5 @@
|
|||||||
<string name="author_formatted">by %1$s</string>
|
<string name="author_formatted">by %1$s</string>
|
||||||
<string name="n_unread_articles">%1$d unread articles</string>
|
<string name="n_unread_articles">%1$d unread articles</string>
|
||||||
<string name="pref_headline_font_size">Headline text size</string>
|
<string name="pref_headline_font_size">Headline text size</string>
|
||||||
|
<string name="context_confirm_catchup">Mark all articles in %1$s as read?</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -13,7 +13,10 @@ import org.fox.ttrss.types.FeedCategoryList;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -125,9 +128,36 @@ public class FeedCategoriesFragment extends Fragment implements OnItemClickListe
|
|||||||
return true;
|
return true;
|
||||||
case R.id.catchup_category:
|
case R.id.catchup_category:
|
||||||
if (true) {
|
if (true) {
|
||||||
FeedCategory cat = getCategoryAtPosition(info.position);
|
final FeedCategory cat = getCategoryAtPosition(info.position);
|
||||||
if (cat != null) {
|
if (cat != null) {
|
||||||
m_activity.catchupFeed(new Feed(cat.id, cat.title, true));
|
|
||||||
|
if (m_prefs.getBoolean("confirm_headlines_catchup", true)) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||||
|
m_activity)
|
||||||
|
.setMessage(getString(R.string.context_confirm_catchup, cat.title))
|
||||||
|
.setPositiveButton(R.string.catchup,
|
||||||
|
new Dialog.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int which) {
|
||||||
|
|
||||||
|
m_activity.catchupFeed(new Feed(cat.id, cat.title, true));
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.dialog_cancel,
|
||||||
|
new Dialog.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog dlg = builder.create();
|
||||||
|
dlg.show();
|
||||||
|
} else {
|
||||||
|
m_activity.catchupFeed(new Feed(cat.id, cat.title, true));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -19,7 +19,10 @@ import org.fox.ttrss.types.FeedList;
|
|||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
@ -156,9 +159,35 @@ public class FeedsFragment extends Fragment implements OnItemClickListener, OnSh
|
|||||||
return true;
|
return true;
|
||||||
case R.id.catchup_feed:
|
case R.id.catchup_feed:
|
||||||
if (true) {
|
if (true) {
|
||||||
Feed feed = getFeedAtPosition(info.position);
|
final Feed feed = getFeedAtPosition(info.position);
|
||||||
|
|
||||||
if (feed != null) {
|
if (feed != null) {
|
||||||
m_activity.catchupFeed(feed);
|
if (m_prefs.getBoolean("confirm_headlines_catchup", true)) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||||
|
m_activity)
|
||||||
|
.setMessage(getString(R.string.context_confirm_catchup, feed.title))
|
||||||
|
.setPositiveButton(R.string.catchup,
|
||||||
|
new Dialog.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int which) {
|
||||||
|
|
||||||
|
m_activity.catchupFeed(feed);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(R.string.dialog_cancel,
|
||||||
|
new Dialog.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog dlg = builder.create();
|
||||||
|
dlg.show();
|
||||||
|
} else {
|
||||||
|
m_activity.catchupFeed(feed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user