|
|
|
@ -4,8 +4,13 @@ import android.support.v4.app.FragmentActivity;
|
|
|
|
|
|
|
|
|
|
import com.todoroo.astrid.sync.SyncResultCallback;
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
public class IndeterminateProgressBarSyncResultCallback implements SyncResultCallback {
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(IndeterminateProgressBarSyncResultCallback.class);
|
|
|
|
|
|
|
|
|
|
private final FragmentActivity activity;
|
|
|
|
|
private Runnable onFinished;
|
|
|
|
|
|
|
|
|
@ -19,8 +24,12 @@ public class IndeterminateProgressBarSyncResultCallback implements SyncResultCal
|
|
|
|
|
activity.runOnUiThread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
activity.setProgressBarIndeterminateVisibility(false);
|
|
|
|
|
onFinished.run();
|
|
|
|
|
} catch (IllegalStateException e) {
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -30,7 +39,11 @@ public class IndeterminateProgressBarSyncResultCallback implements SyncResultCal
|
|
|
|
|
activity.runOnUiThread(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
try {
|
|
|
|
|
activity.setProgressBarIndeterminateVisibility(true);
|
|
|
|
|
} catch (IllegalStateException e) {
|
|
|
|
|
log.error(e.getMessage(), e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|