mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fix story sync status indication. (#644)
This commit is contained in:
parent
d5d15e9c17
commit
d8d091d1c7
4 changed files with 14 additions and 8 deletions
|
@ -132,7 +132,7 @@ public abstract class ItemsList extends NbActivity implements StateChangedListen
|
|||
}
|
||||
|
||||
private void updateStatusIndicators() {
|
||||
boolean isLoading = NBSyncService.isFeedSetSyncing(this.fs);
|
||||
boolean isLoading = NBSyncService.isFeedSetSyncing(this.fs, this);
|
||||
setProgressBarIndeterminateVisibility(isLoading);
|
||||
|
||||
if (overlayStatusText != null) {
|
||||
|
|
|
@ -318,7 +318,7 @@ public abstract class Reading extends NbActivity implements OnPageChangeListener
|
|||
|
||||
@Override
|
||||
protected void handleUpdate(boolean freshData) {
|
||||
enableMainProgress(NBSyncService.isFeedSetSyncing(this.fs));
|
||||
enableMainProgress(NBSyncService.isFeedSetSyncing(this.fs, this));
|
||||
updateOverlayNav();
|
||||
if (freshData) updateCursor();
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ public abstract class ItemListFragment extends NbFragment implements OnScrollLis
|
|||
}
|
||||
TextView emptyView = (TextView) itemList.getEmptyView();
|
||||
|
||||
boolean isLoading = NBSyncService.isFeedSetSyncing(getFeedSet());
|
||||
boolean isLoading = NBSyncService.isFeedSetSyncing(getFeedSet(), activity);
|
||||
if (isLoading || (!cursorSeenYet)) {
|
||||
emptyView.setText(R.string.empty_list_view_loading);
|
||||
} else {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.newsblur.service;
|
|||
import android.app.Service;
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
import android.os.IBinder;
|
||||
|
@ -564,15 +565,20 @@ public class NBSyncService extends Service {
|
|||
}
|
||||
}
|
||||
|
||||
boolean stopSync() {
|
||||
static boolean stopSync(Context context) {
|
||||
if (HaltNow) {
|
||||
if (AppConstants.VERBOSE_LOG) Log.d(this.getClass().getName(), "stopping sync, soft interrupt set.");
|
||||
if (AppConstants.VERBOSE_LOG) Log.d(NBSyncService.class.getName(), "stopping sync, soft interrupt set.");
|
||||
return true;
|
||||
}
|
||||
if (!NetworkUtils.isOnline(this)) return true;
|
||||
if (context == null) return false;
|
||||
if (!NetworkUtils.isOnline(context)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean stopSync() {
|
||||
return stopSync(this);
|
||||
}
|
||||
|
||||
public void onTrimMemory (int level) {
|
||||
if (level > ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) {
|
||||
isMemoryLow = true;
|
||||
|
@ -595,8 +601,8 @@ public class NBSyncService extends Service {
|
|||
/**
|
||||
* Is there a sync for a given FeedSet running?
|
||||
*/
|
||||
public static boolean isFeedSetSyncing(FeedSet fs) {
|
||||
return (fs.equals(PendingFeed));
|
||||
public static boolean isFeedSetSyncing(FeedSet fs, Context context) {
|
||||
return (fs.equals(PendingFeed) && (!stopSync(context)));
|
||||
}
|
||||
|
||||
public static String getSyncStatusMessage() {
|
||||
|
|
Loading…
Add table
Reference in a new issue