Added a refreshAllFeeds method without callback
This commit is contained in:
parent
aa25ab5ff4
commit
9ce48bd86b
@ -224,7 +224,7 @@ public class AllEpisodesFragment extends Fragment {
|
|||||||
case R.id.refresh_item:
|
case R.id.refresh_item:
|
||||||
List<Feed> feeds = ((MainActivity) getActivity()).getFeeds();
|
List<Feed> feeds = ((MainActivity) getActivity()).getFeeds();
|
||||||
if (feeds != null) {
|
if (feeds != null) {
|
||||||
DBTasks.refreshAllFeeds(getActivity(), feeds, null);
|
DBTasks.refreshAllFeeds(getActivity(), feeds);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case R.id.mark_all_read_item:
|
case R.id.mark_all_read_item:
|
||||||
|
@ -285,7 +285,7 @@ public class QueueFragment extends Fragment {
|
|||||||
case R.id.refresh_item:
|
case R.id.refresh_item:
|
||||||
List<Feed> feeds = ((MainActivity) getActivity()).getFeeds();
|
List<Feed> feeds = ((MainActivity) getActivity()).getFeeds();
|
||||||
if (feeds != null) {
|
if (feeds != null) {
|
||||||
DBTasks.refreshAllFeeds(getActivity(), feeds, null);
|
DBTasks.refreshAllFeeds(getActivity(), feeds);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case R.id.clear_queue:
|
case R.id.clear_queue:
|
||||||
|
@ -151,6 +151,17 @@ public final class DBTasks {
|
|||||||
|
|
||||||
private static final AtomicBoolean isRefreshing = new AtomicBoolean(false);
|
private static final AtomicBoolean isRefreshing = new AtomicBoolean(false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still
|
||||||
|
* enqueuing Feeds for download from a previous call
|
||||||
|
*
|
||||||
|
* @param context Might be used for accessing the database
|
||||||
|
* @param feeds List of Feeds that should be refreshed.
|
||||||
|
*/
|
||||||
|
public static void refreshAllFeeds(final Context context, final List<Feed> feeds) {
|
||||||
|
refreshAllFeeds(context, feeds, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still
|
* Refreshes a given list of Feeds in a separate Thread. This method might ignore subsequent calls if it is still
|
||||||
* enqueuing Feeds for download from a previous call
|
* enqueuing Feeds for download from a previous call
|
||||||
@ -348,7 +359,7 @@ public final class DBTasks {
|
|||||||
Log.d(TAG, "last refresh: " + Converter.getDurationStringLocalized(context,
|
Log.d(TAG, "last refresh: " + Converter.getDurationStringLocalized(context,
|
||||||
System.currentTimeMillis() - lastRefresh) + " ago");
|
System.currentTimeMillis() - lastRefresh) + " ago");
|
||||||
if(lastRefresh <= System.currentTimeMillis() - interval) {
|
if(lastRefresh <= System.currentTimeMillis() - interval) {
|
||||||
DBTasks.refreshAllFeeds(context, null, null);
|
DBTasks.refreshAllFeeds(context, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user