mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
975 B
Java
31 lines
975 B
Java
package org.tasks.sync;
|
|
|
|
import com.todoroo.astrid.gtasks.GtasksPreferenceService;
|
|
import com.todoroo.astrid.sync.SyncResultCallback;
|
|
|
|
import org.tasks.LocalBroadcastManager;
|
|
|
|
public class RecordSyncStatusCallback implements SyncResultCallback {
|
|
|
|
private final GtasksPreferenceService gtasksPreferenceService;
|
|
private final LocalBroadcastManager localBroadcastManager;
|
|
|
|
public RecordSyncStatusCallback(GtasksPreferenceService gtasksPreferenceService,
|
|
LocalBroadcastManager localBroadcastManager) {
|
|
this.gtasksPreferenceService = gtasksPreferenceService;
|
|
this.localBroadcastManager = localBroadcastManager;
|
|
}
|
|
|
|
@Override
|
|
public void started() {
|
|
gtasksPreferenceService.recordSyncStart();
|
|
localBroadcastManager.broadcastRefresh();
|
|
}
|
|
|
|
@Override
|
|
public void finished() {
|
|
gtasksPreferenceService.stopOngoing();
|
|
localBroadcastManager.broadcastRefresh();
|
|
}
|
|
}
|