Skip to content

Commit 3deacb4

Browse files
author
Mario Bodemann
committed
fix: Updating to newest CDA
1 parent 9243027 commit 3deacb4

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

core/src/main/java/com/contentful/vault/SyncRunnable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import com.contentful.java.cda.CDAType;
2929
import com.contentful.java.cda.LocalizedResource;
3030
import com.contentful.java.cda.SynchronizedSpace;
31-
import com.squareup.okhttp.HttpUrl;
31+
import okhttp3.HttpUrl;
3232
import java.io.IOException;
3333
import java.io.Serializable;
3434
import java.util.Collections;

core/src/main/java/com/contentful/vault/Vault.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
import android.content.Context;
2020
import android.database.sqlite.SQLiteDatabase;
21+
import android.os.Handler;
22+
import android.os.Looper;
23+
2124
import com.contentful.java.cda.CDAClient;
2225
import java.util.HashMap;
2326
import java.util.LinkedHashMap;
@@ -26,7 +29,6 @@
2629
import java.util.concurrent.Executor;
2730
import java.util.concurrent.ExecutorService;
2831
import java.util.concurrent.Executors;
29-
import retrofit.android.MainThreadExecutor;
3032
import rx.Observable;
3133
import rx.subjects.PublishSubject;
3234
import rx.subjects.SerializedSubject;
@@ -44,7 +46,12 @@ public class Vault {
4446
static final ExecutorService EXECUTOR_SYNC = Executors.newSingleThreadExecutor(
4547
new VaultThreadFactory());
4648

47-
static final Executor EXECUTOR_CALLBACK = new MainThreadExecutor();
49+
static final Executor EXECUTOR_CALLBACK = new Executor() {
50+
Handler handler = new Handler(Looper.getMainLooper());
51+
@Override public void execute(Runnable command) {
52+
handler.post(command);
53+
}
54+
};
4855

4956
static final Map<String, CallbackBundle> CALLBACKS = new HashMap<>();
5057

@@ -166,7 +173,9 @@ private static SpaceHelper createSpaceHelper(Class<?> space) {
166173
return (SpaceHelper) clazz.newInstance();
167174
} catch (ClassNotFoundException e) {
168175
throw new RuntimeException("Cannot find generated class for space: " + space.getName(), e);
169-
} catch (IllegalAccessException | InstantiationException e) {
176+
} catch (IllegalAccessException e) {
177+
throw new RuntimeException(e);
178+
} catch (InstantiationException e) {
170179
throw new RuntimeException(e);
171180
}
172181
}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
<android.platform>17</android.platform>
5151
<android.version>4.1.1.4</android.version>
52-
<cda.version>5.0.1</cda.version>
52+
<cda.version>7.0.0</cda.version>
5353
<commons-codec.version>1.10</commons-codec.version>
5454
<commons-io.version>2.4</commons-io.version>
5555
<commons-lang3.version>3.4</commons-lang3.version>
@@ -200,4 +200,4 @@
200200
</plugins>
201201
</pluginManagement>
202202
</build>
203-
</project>
203+
</project>

0 commit comments

Comments
 (0)