mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
introduced SyncOperations class
This commit is contained in:
parent
8f0379cd8e
commit
c8daf85889
4 changed files with 50 additions and 23 deletions
|
@ -50,7 +50,7 @@ import org.geometerplus.android.fbreader.FBReader;
|
|||
import org.geometerplus.android.fbreader.libraryService.BookCollectionShadow;
|
||||
import org.geometerplus.android.fbreader.network.auth.ActivityNetworkContext;
|
||||
import org.geometerplus.android.fbreader.preferences.fileChooser.FileChooserCollection;
|
||||
import org.geometerplus.android.fbreader.sync.SyncService;
|
||||
import org.geometerplus.android.fbreader.sync.SyncOperations;
|
||||
|
||||
import org.geometerplus.android.util.UIUtil;
|
||||
import org.geometerplus.android.util.DeviceType;
|
||||
|
@ -158,8 +158,8 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
}
|
||||
}
|
||||
|
||||
private void enableSyncService() {
|
||||
SyncService.enableSync(PreferenceActivity.this, syncOptions.Enabled.getValue());
|
||||
private void enableSynchronisation() {
|
||||
SyncOperations.enableSync(PreferenceActivity.this, syncOptions.Enabled.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -171,7 +171,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
|
||||
if (!isChecked()) {
|
||||
syncOptions.Enabled.setValue(false);
|
||||
enableSyncService();
|
||||
enableSynchronisation();
|
||||
syncPreferences.run();
|
||||
return;
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
public void processResponse(Object response) {
|
||||
final String account = (String)((Map)response).get("user");
|
||||
syncOptions.Enabled.setValue(account != null);
|
||||
enableSyncService();
|
||||
enableSynchronisation();
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
setOnSummary(account);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue