diff --git a/app/src/androidTest/java/com/murrayc/galaxyzoo/app/provider/test/ZooniverseClientTest.java b/app/src/androidTest/java/com/murrayc/galaxyzoo/app/provider/test/ZooniverseClientTest.java index d24b34f5..9e565fb2 100644 --- a/app/src/androidTest/java/com/murrayc/galaxyzoo/app/provider/test/ZooniverseClientTest.java +++ b/app/src/androidTest/java/com/murrayc/galaxyzoo/app/provider/test/ZooniverseClientTest.java @@ -71,8 +71,8 @@ public void testMoreItems() throws IOException, InterruptedException { final ZooniverseClient.Subject subject = subjects.get(0); assertNotNull(subject); - assertNotNull(subject.mId); - assertEquals(subject.mId, "504e6b5dc499611ea6020689"); + assertNotNull(subject.mSubjectId); + assertEquals(subject.mSubjectId, "504e6b5dc499611ea6020689"); assertNotNull(subject.mZooniverseId); assertEquals(subject.mZooniverseId, "AGZ0002ufd"); assertNotNull(subject.mLocationStandard); diff --git a/app/src/main/java/com/murrayc/galaxyzoo/app/BaseActivity.java b/app/src/main/java/com/murrayc/galaxyzoo/app/BaseActivity.java index 3114585b..dcd39aa0 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/BaseActivity.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/BaseActivity.java @@ -24,6 +24,7 @@ import android.content.Intent; import android.os.Bundle; //import android.os.StrictMode; +import android.os.StrictMode; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.text.TextUtils; @@ -39,7 +40,6 @@ class BaseActivity extends FragmentActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - /* Uncomment this to get some helpful exceptions. StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() @@ -50,7 +50,6 @@ protected void onCreate(Bundle savedInstanceState) { .penaltyLog() .penaltyDeath() .build()); - */ //This lets us know what MIME Type to mention in the intent filter in the manifest file, diff --git a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/ItemsContentProvider.java b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/ItemsContentProvider.java index cfbd4b8c..79e4afd9 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/ItemsContentProvider.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/ItemsContentProvider.java @@ -1417,7 +1417,7 @@ private SQLiteDatabase getDb() { * @param asyncFileDownloads Get the image data asynchronously if this is true. */ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDownloads) { - if (subjectIsInDatabase(item.mId)) { + if (subjectIsInDatabase(item.mSubjectId)) { //It is already in the database. //TODO: Update the row? return; @@ -1426,7 +1426,7 @@ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDo final SQLiteDatabase db = getDb(); final ContentValues values = new ContentValues(); - values.put(DatabaseHelper.ItemsDbColumns.SUBJECT_ID, item.mId); + values.put(DatabaseHelper.ItemsDbColumns.SUBJECT_ID, item.mSubjectId); values.put(DatabaseHelper.ItemsDbColumns.ZOONIVERSE_ID, item.mZooniverseId); values.put(DatabaseHelper.ItemsDbColumns.LOCATION_STANDARD_URI_REMOTE, item.mLocationStandard); @@ -1434,7 +1434,7 @@ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDo values.put(DatabaseHelper.ItemsDbColumns.LOCATION_INVERTED_URI_REMOTE, item.mLocationInverted); //Get (our) local content URIs of cache files instead of the remote URIs for the images: - final List listFiles = createFileUrisForImages(values, item.mId, item.mLocationStandard, item.mLocationThumbnail, item.mLocationInverted); + final List listFiles = createFileUrisForImages(values, item.mSubjectId, item.mLocationStandard, item.mLocationThumbnail, item.mLocationInverted); final long rowId = db.insert(DatabaseHelper.TABLE_NAME_ITEMS, DatabaseHelper.ItemsDbColumns._ID, values); @@ -1443,7 +1443,7 @@ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDo "content values: " + values); } - cacheUrisToFiles(item.mId, listFiles, asyncFileDownloads); + cacheUrisToFiles(item.mSubjectId, listFiles, asyncFileDownloads); notifyRowChangeById(rowId); } diff --git a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/MoreItemsJsonParser.java b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/MoreItemsJsonParser.java index 9e063342..7deb4de3 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/MoreItemsJsonParser.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/MoreItemsJsonParser.java @@ -60,7 +60,7 @@ private static ZooniverseClient.Subject parseMoreItemsJsonObjectSubject(final Js final String name = reader.nextName(); switch (name) { case "id": - result.mId = reader.nextString(); + result.mSubjectId = reader.nextString(); break; case "zooniverse_id": result.mZooniverseId = reader.nextString(); diff --git a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/ZooniverseClient.java b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/ZooniverseClient.java index 0456dbdc..35a9bf7d 100644 --- a/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/ZooniverseClient.java +++ b/app/src/main/java/com/murrayc/galaxyzoo/app/provider/client/ZooniverseClient.java @@ -277,7 +277,7 @@ public boolean uploadClassificationSync(final String authName, final String auth } public static class Subject { - public String mId; + public String mSubjectId; public String mZooniverseId; public String mLocationStandard; public String mLocationThumbnail;