mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Resource-ify sync status messages.
This commit is contained in:
parent
d8d091d1c7
commit
9de7c75fe6
4 changed files with 20 additions and 11 deletions
|
@ -250,4 +250,13 @@
|
|||
<item>dark</item>
|
||||
</string-array>
|
||||
<string name="default_theme_value">light</string>
|
||||
|
||||
<string name="sync_status_housekeeping">Tidying up...</string>
|
||||
<string name="sync_status_actions">Catching up reading actions...</string>
|
||||
<string name="sync_status_ffsync">On its way...</string>
|
||||
<string name="sync_status_cleanup">Cleaning up...</string>
|
||||
<string name="sync_status_stories">Fetching fresh stories...</string>
|
||||
<string name="sync_status_unreads">Storing%sunread stories...</string>
|
||||
<string name="sync_status_text">Storing text for %s stories...</string>
|
||||
<string name="sync_status_images">Storing %s images...</string>
|
||||
</resources>
|
||||
|
|
|
@ -136,7 +136,7 @@ public abstract class ItemsList extends NbActivity implements StateChangedListen
|
|||
setProgressBarIndeterminateVisibility(isLoading);
|
||||
|
||||
if (overlayStatusText != null) {
|
||||
String syncStatus = NBSyncService.getSyncStatusMessage();
|
||||
String syncStatus = NBSyncService.getSyncStatusMessage(this);
|
||||
if (syncStatus != null) {
|
||||
overlayStatusText.setText(syncStatus);
|
||||
overlayStatusText.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -175,7 +175,7 @@ public class Main extends NbActivity implements StateChangedListener, SwipeRefre
|
|||
}
|
||||
|
||||
if (overlayStatusText != null) {
|
||||
String syncStatus = NBSyncService.getSyncStatusMessage();
|
||||
String syncStatus = NBSyncService.getSyncStatusMessage(this);
|
||||
if (syncStatus != null) {
|
||||
overlayStatusText.setText(syncStatus);
|
||||
overlayStatusText.setVisibility(View.VISIBLE);
|
||||
|
|
|
@ -605,15 +605,15 @@ public class NBSyncService extends Service {
|
|||
return (fs.equals(PendingFeed) && (!stopSync(context)));
|
||||
}
|
||||
|
||||
public static String getSyncStatusMessage() {
|
||||
if (HousekeepingRunning) return "Tidying up...";
|
||||
if (ActionsRunning) return "Syncing reading actions...";
|
||||
if (FFSyncRunning) return "On its way...";
|
||||
if (CleanupRunning) return "Cleaning up...";
|
||||
if (StorySyncRunning) return "Fetching fresh stories...";
|
||||
if (UnreadsService.running()) return "Storing" + UnreadsService.getPendingCount() + "unread stories...";
|
||||
if (OriginalTextService.running()) return "Storing text for " + OriginalTextService.getPendingCount() + " stories...";
|
||||
if (ImagePrefetchService.running()) return "Storing " + ImagePrefetchService.getPendingCount() + " images...";
|
||||
public static String getSyncStatusMessage(Context context) {
|
||||
if (HousekeepingRunning) return context.getResources().getString(R.string.sync_status_housekeeping);
|
||||
if (ActionsRunning) return context.getResources().getString(R.string.sync_status_actions);
|
||||
if (FFSyncRunning) return context.getResources().getString(R.string.sync_status_ffsync);
|
||||
if (CleanupRunning) return context.getResources().getString(R.string.sync_status_cleanup);
|
||||
if (StorySyncRunning) return context.getResources().getString(R.string.sync_status_stories);
|
||||
if (UnreadsService.running()) return String.format(context.getResources().getString(R.string.sync_status_unreads), UnreadsService.getPendingCount());
|
||||
if (OriginalTextService.running()) return String.format(context.getResources().getString(R.string.sync_status_text), OriginalTextService.getPendingCount());
|
||||
if (ImagePrefetchService.running()) return String.format(context.getResources().getString(R.string.sync_status_images), ImagePrefetchService.getPendingCount());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue