diff options
Diffstat (limited to 'org.fox.ttcomics/src/main/java')
3 files changed, 16 insertions, 3 deletions
diff --git a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/CommonActivity.java b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/CommonActivity.java index caf1761..2400d2e 100755 --- a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/CommonActivity.java +++ b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/CommonActivity.java @@ -79,6 +79,8 @@ public class CommonActivity extends AppCompatActivity { }
protected void initSyncClient() {
+ Log.d(TAG, "initSynClient");
+
if (isSyncEnabled()) {
String googleAccount = getGoogleAccount(this);
diff --git a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/PreferencesFragment.java b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/PreferencesFragment.java index aa6174b..da7887d 100644 --- a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/PreferencesFragment.java +++ b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/PreferencesFragment.java @@ -10,7 +10,6 @@ import android.content.SharedPreferences; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
@@ -99,8 +98,11 @@ public class PreferencesFragment extends PreferenceFragment { if (googleAccount != null) {
m_syncClient.setOwner(googleAccount);
} else {
- if (Build.HARDWARE.equals("goldfish")) {
+ if (BuildConfig.DEBUG) {
m_syncClient.setOwner("TEST-ACCOUNT");
+
+ //Toast toast = Toast.makeText(getActivity(), R.string.sync_running_in_test_mode, Toast.LENGTH_SHORT);
+ //toast.show();
} else {
m_syncClient.setOwner(null);
diff --git a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/ViewComicActivity.java b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/ViewComicActivity.java index d08dbd5..5699943 100755 --- a/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/ViewComicActivity.java +++ b/org.fox.ttcomics/src/main/java/org/fox/ttcomics2/ViewComicActivity.java @@ -80,6 +80,8 @@ public class ViewComicActivity extends CommonActivity { getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ initSyncClient();
+
setTitle(new File(m_fileName).getName());
}
@@ -103,8 +105,15 @@ public class ViewComicActivity extends CommonActivity { @Override
public void onComicSelected(String fileName, int position) {
super.onComicSelected(fileName, position);
+
+ Log.d(TAG, "onComicSelected: " + fileName + " " + position);
+
+ if ((position + 1) % 10 == 0 && m_prefs.getBoolean("use_position_sync", false) && m_syncClient.hasOwner()) {
+ m_syncClient.setPosition(sha1(new File(fileName).getName()), m_databaseHelper.getLastPosition(fileName));
+ }
}
-
+
+ @Override
public void onPause() {
super.onPause();
|