Permalink
Browse files

Mass-update libraries

  • Loading branch information...
1 parent 918bc57 commit 2c6b0f352a51509543d5d76c5cc117564fa770ee @yukuku committed Jul 5, 2016
Showing with 135 additions and 132 deletions.
  1. +1 −1 Afw/build.gradle
  2. +18 −22 Alkitab/build.gradle
  3. +4 −4 Alkitab/src/debug/java/yuku/stethoshim/StethoShim.java
  4. +23 −19 Alkitab/src/main/java/yuku/alkitab/base/App.java
  5. +1 −1 Alkitab/src/main/java/yuku/alkitab/base/ac/AboutActivity.java
  6. +1 −1 Alkitab/src/main/java/yuku/alkitab/base/ac/NoteActivity.java
  7. +1 −1 Alkitab/src/main/java/yuku/alkitab/base/ac/SearchActivity.java
  8. +9 −9 Alkitab/src/main/java/yuku/alkitab/base/ac/SecretSyncDebugActivity.java
  9. +1 −1 Alkitab/src/main/java/yuku/alkitab/base/ac/SongListActivity.java
  10. +1 −1 Alkitab/src/main/java/yuku/alkitab/base/ac/VersionsActivity.java
  11. +2 −2 Alkitab/src/main/java/yuku/alkitab/base/sv/DownloadService.java
  12. +9 −9 Alkitab/src/main/java/yuku/alkitab/base/sync/Sync.java
  13. +11 −11 Alkitab/src/main/java/yuku/alkitab/base/sync/SyncAdapter.java
  14. +7 −6 Alkitab/src/main/java/yuku/alkitab/base/util/Announce.java
  15. +8 −8 Alkitab/src/main/java/yuku/alkitab/base/util/ShareUrl.java
  16. +2 −2 Alkitab/src/main/java/yuku/alkitab/base/util/SongBookUtil.java
  17. +2 −2 Alkitab/src/release/java/yuku/stethoshim/StethoShim.java
  18. +3 −5 AlkitabFeedback/build.gradle
  19. +5 −5 AlkitabFeedback/src/main/java/yuku/alkitabfeedback/FeedbackSender.java
  20. +5 −5 AlkitabFeedback/src/main/java/yuku/kirimfidbek/CrashReporter.java
  21. +1 −1 AlkitabModel/build.gradle
  22. +2 −4 AmbilWarna/build.gradle
  23. +1 −1 DragSortListView/build.gradle
  24. +14 −8 build.gradle
  25. +1 −1 extensions/example-imagesharer/app/build.gradle
  26. +2 −2 gradle.properties
View
@@ -26,5 +26,5 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:support-annotations:23.1.1'
+ compile "com.android.support:support-annotations:$supportLibVersion"
}
View
@@ -30,7 +30,7 @@ android {
}
}
dexOptions {
- javaMaxHeapSize "4g"
+ javaMaxHeapSize "2g"
// Skip pre-dexing when running on Travis CI
preDexLibraries = !travisBuild
}
@@ -81,28 +81,24 @@ dependencies {
compile project(':AmbilWarna')
compile project(':ATree')
compile project(':ImportedDesktopVerseUtil')
- compile('com.afollestad.material-dialogs:core:0.8.5.2@aar') {
- transitive = true
- }
- compile('com.afollestad.material-dialogs:commons:0.8.5.2@aar') {
- transitive = true
- }
+ compile "com.afollestad.material-dialogs:core:$materialDialogsVersion"
+ compile "com.afollestad.material-dialogs:commons:$materialDialogsVersion"
testCompile 'junit:junit:4.12'
- debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
- releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
- debugCompile 'com.facebook.stetho:stetho:1.2.0'
- debugCompile 'com.facebook.stetho:stetho-okhttp:1.2.0'
- compile 'com.android.support:support-v4:23.1.1'
- compile 'com.squareup.picasso:picasso:2.5.2'
- compile 'com.squareup.okhttp:okhttp:2.5.0'
- compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
+ debugCompile "com.squareup.leakcanary:leakcanary-android:$leakcanaryVersion"
+ releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:$leakcanaryVersion"
+ debugCompile "com.facebook.stetho:stetho:$stethoVersion"
+ debugCompile "com.facebook.stetho:stetho-okhttp3:$stethoVersion"
+ compile "com.android.support:support-v4:$supportLibVersion"
+ compile "com.squareup.picasso:picasso:$picassoVersion"
+ compile "com.squareup.okhttp3:okhttp:$okhttpVersion"
+ compile "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
compile 'net.sf.trove4j:trove4j:3.0.3'
- compile 'com.google.code.gson:gson:2.4'
- compile 'com.google.android.gms:play-services-analytics:8.3.0'
- compile 'com.google.android.gms:play-services-gcm:8.3.0'
- compile 'com.android.support:appcompat-v7:23.1.1'
+ compile "com.google.code.gson:gson:$gsonVersion"
+ compile "com.google.android.gms:play-services-analytics:$playServicesVersion"
+ compile "com.google.android.gms:play-services-gcm:$playServicesVersion"
+ compile "com.android.support:appcompat-v7:$supportLibVersion"
compile 'com.android.support:multidex:1.0.1'
- compile 'com.android.support:design:23.1.1'
- compile 'com.android.support:percent:23.1.1'
- compile 'com.android.support:preference-v14:23.1.1'
+ compile "com.android.support:design:$supportLibVersion"
+ compile "com.android.support:percent:$supportLibVersion"
+ compile "com.android.support:preference-v14:$supportLibVersion"
}
@@ -2,15 +2,15 @@
import android.app.Application;
import com.facebook.stetho.Stetho;
-import com.facebook.stetho.okhttp.StethoInterceptor;
-import com.squareup.okhttp.OkHttpClient;
+import com.facebook.stetho.okhttp3.StethoInterceptor;
+import okhttp3.OkHttpClient;
public class StethoShim {
public static void initializeWithDefaults(final Application application) {
Stetho.initializeWithDefaults(application);
}
- public static void addNetworkInterceptor(final OkHttpClient client) {
- client.networkInterceptors().add(new StethoInterceptor());
+ public static void addNetworkInterceptor(final OkHttpClient.Builder builder) {
+ builder.addNetworkInterceptor(new StethoInterceptor());
}
}
@@ -13,11 +13,11 @@
import com.google.android.gms.analytics.Tracker;
import com.google.gson.Gson;
import com.squareup.leakcanary.LeakCanary;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.Interceptor;
-import com.squareup.okhttp.OkHttpClient;
-import com.squareup.okhttp.Request;
-import com.squareup.okhttp.internal.Version;
+import okhttp3.Call;
+import okhttp3.Interceptor;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.internal.Version;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.model.SyncShadow;
import yuku.alkitab.base.model.VersionImpl;
@@ -47,8 +47,8 @@
enum OkHttpClientWrapper {
INSTANCE;
- OkHttpClient defaultClient = new OkHttpClient();
- OkHttpClient longTimeoutClient = new OkHttpClient();
+ final OkHttpClient defaultClient;
+ final OkHttpClient longTimeoutClient;
{
final Interceptor userAgent = chain -> {
@@ -60,19 +60,23 @@
return chain.proceed(requestWithUserAgent);
};
- defaultClient.networkInterceptors().add(userAgent);
- longTimeoutClient.networkInterceptors().add(userAgent);
- }
-
- { // init longTimeoutClient
- longTimeoutClient.setConnectTimeout(300, TimeUnit.SECONDS);
- longTimeoutClient.setReadTimeout(300, TimeUnit.SECONDS);
- longTimeoutClient.setWriteTimeout(600, TimeUnit.SECONDS);
- }
+ {
+ final OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder.addNetworkInterceptor(userAgent);
+ StethoShim.addNetworkInterceptor(builder);
+ defaultClient = builder.build();
+ }
- { // init stetho interceptor
- StethoShim.addNetworkInterceptor(defaultClient);
- StethoShim.addNetworkInterceptor(longTimeoutClient);
+ {
+ final OkHttpClient.Builder builder = new OkHttpClient.Builder();
+ builder
+ .addNetworkInterceptor(userAgent)
+ .connectTimeout(300, TimeUnit.SECONDS)
+ .readTimeout(300, TimeUnit.SECONDS)
+ .writeTimeout(600, TimeUnit.SECONDS);
+ StethoShim.addNetworkInterceptor(builder);
+ longTimeoutClient = builder.build();
+ }
}
}
@@ -109,7 +109,7 @@ public void onLoaderReset(final Loader<long[]> loader) {
final Toolbar toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar); // must be done first before below lines
toolbar.setTitle(null);
- toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
toolbar.setNavigationOnClickListener(v -> navigateUp());
root = V.get(this, R.id.root);
@@ -102,7 +102,7 @@ protected void onCreate(final Bundle savedInstanceState) {
final Toolbar toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar); // must be done first before below lines
- toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
toolbar.setNavigationOnClickListener(v -> navigateUp());
if (marker != null) {
@@ -287,7 +287,7 @@ public static Intent createIntent(int openedBookId) {
final Toolbar toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar); // must be done first before below lines
- toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
toolbar.setNavigationOnClickListener(v -> navigateUp());
bVersion = V.get(this, R.id.bVersion);
@@ -14,12 +14,12 @@
import com.afollestad.materialdialogs.AlertDialogWrapper;
import com.afollestad.materialdialogs.MaterialDialog;
import com.google.gson.reflect.TypeToken;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.Callback;
-import com.squareup.okhttp.FormEncodingBuilder;
-import com.squareup.okhttp.Request;
-import com.squareup.okhttp.RequestBody;
-import com.squareup.okhttp.Response;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.FormBody;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
import yuku.afw.V;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.App;
@@ -359,7 +359,7 @@ private String randomString(final String prefix, final int word_count, final int
final Sync.ClientState<Sync_Mabel.Content> clientState = pair.clientState;
final List<Sync.Entity<Sync_Mabel.Content>> entitiesBeforeSync = pair.currentEntities;
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("simpleToken", simpleToken)
.add("syncSetName", SyncShadow.SYNC_SET_MABEL)
.add("installation_id", U.getInstallationId())
@@ -398,15 +398,15 @@ private String randomString(final String prefix, final int word_count, final int
call.enqueue(new Callback() {
@Override
- public void onFailure(final Request request, final IOException e) {
+ public void onFailure(final Call call, final IOException e) {
runOnUiThread(() -> new AlertDialogWrapper.Builder(SecretSyncDebugActivity.this)
.setMessage("Error: " + e.getMessage())
.setPositiveButton(R.string.ok, null)
.show());
}
@Override
- public void onResponse(final Response response) throws IOException {
+ public void onResponse(final Call call, final Response response) throws IOException {
final Sync.SyncResponseJson<Sync_Mabel.Content> debugSyncResponse = App.getDefaultGson().fromJson(response.body().charStream(), new TypeToken<Sync.SyncResponseJson<Sync_Mabel.Content>>() {}.getType());
runOnUiThread(() -> {
if (debugSyncResponse.success) {
@@ -135,7 +135,7 @@ public static Result obtainResult(Intent data) {
final Toolbar toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar); // must be done first before below lines
- toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
toolbar.setNavigationOnClickListener(v -> navigateUp());
setSupportProgressBarIndeterminate(true);
@@ -121,7 +121,7 @@ protected void onCreate(Bundle savedInstanceState) {
final Toolbar toolbar = V.get(this, R.id.toolbar);
setSupportActionBar(toolbar); // must be done first before below lines
- toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ toolbar.setNavigationIcon(R.drawable.abc_ic_ab_back_material);
toolbar.setNavigationOnClickListener(v -> navigateUp());
// Create the adapter that will return a fragment for each of the three
@@ -8,8 +8,8 @@
import android.os.Message;
import android.util.Log;
import android.util.Pair;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.ResponseBody;
+import okhttp3.Call;
+import okhttp3.ResponseBody;
import yuku.alkitab.base.App;
import yuku.alkitab.debug.R;
@@ -9,10 +9,10 @@
import android.util.Log;
import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.FormEncodingBuilder;
-import com.squareup.okhttp.Request;
-import com.squareup.okhttp.RequestBody;
+import okhttp3.Call;
+import okhttp3.FormBody;
+import okhttp3.Request;
+import okhttp3.RequestBody;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.App;
import yuku.alkitab.base.U;
@@ -305,7 +305,7 @@ public static void notifyNewGcmRegistrationId(final String newRegistrationId) {
}
public static boolean sendGcmRegistrationId(final String simpleToken, final String registration_id) {
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("simpleToken", simpleToken)
.add("sender_id", Gcm.SENDER_ID) // not really needed, but for logging on server
.add("registration_id", registration_id)
@@ -372,7 +372,7 @@ public NotOkException(final String msg) {
* Must be called from a background thread.
*/
@NonNull public static LoginResponseJson register(@NonNull final RegisterForm form) throws NotOkException {
- final FormEncodingBuilder b = new FormEncodingBuilder();
+ final FormBody.Builder b = new FormBody.Builder();
if (form.church != null) b.add("church", form.church);
if (form.city != null) b.add("city", form.city);
if (form.religion != null) b.add("religion", form.religion);
@@ -411,7 +411,7 @@ public NotOkException(final String msg) {
* Must be called from a background thread.
*/
@NonNull public static LoginResponseJson login(@NonNull final String email, @NonNull final String password) throws NotOkException {
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("email", email)
.add("password", password)
.add("installation_info", U.getInstallationInfoJson())
@@ -445,7 +445,7 @@ public NotOkException(final String msg) {
* Must be called from a background thread.
*/
public static void forgotPassword(@NonNull final String email) throws NotOkException {
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("email", email)
.build();
@@ -475,7 +475,7 @@ public static void forgotPassword(@NonNull final String email) throws NotOkExcep
* Must be called from a background thread.
*/
public static void changePassword(@NonNull final String email, @NonNull final String password_old, @NonNull final String password_new) throws NotOkException {
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("email", email)
.add("password_old", password_old)
.add("password_new", password_new)
@@ -12,11 +12,11 @@
import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
-import com.squareup.okhttp.Call;
-import com.squareup.okhttp.FormEncodingBuilder;
-import com.squareup.okhttp.MultipartBuilder;
-import com.squareup.okhttp.Request;
-import com.squareup.okhttp.RequestBody;
+import okhttp3.Call;
+import okhttp3.FormBody;
+import okhttp3.MultipartBody;
+import okhttp3.Request;
+import okhttp3.RequestBody;
import yuku.afw.storage.Preferences;
import yuku.alkitab.base.App;
import yuku.alkitab.base.IsiActivity;
@@ -107,7 +107,7 @@ def patchNoConflict(entities, operations):
break;
case add:
case mod:
- entities_map.put(Pair.create(o.gid, o.kind), new Sync.Entity<C>(o.kind, o.gid, o.content));
+ entities_map.put(Pair.create(o.gid, o.kind), new Sync.Entity<>(o.kind, o.gid, o.content));
break;
}
}
@@ -276,8 +276,8 @@ void syncMabel(final SyncResult sr) {
final String serverPrefix = Sync.getEffectiveServerPrefix();
Log.d(TAG, "@@syncMabel step 20: building http request. Server prefix: " + serverPrefix);
- final RequestBody requestBody = new MultipartBuilder()
- .type(MultipartBuilder.FORM)
+ final RequestBody requestBody = new MultipartBody.Builder()
+ .setType(MultipartBody.FORM)
.addFormDataPart("simpleToken", simpleToken)
.addFormDataPart("syncSetName", syncSetName)
.addFormDataPart("installation_id", U.getInstallationId())
@@ -378,7 +378,7 @@ void syncHistory(final SyncResult sr) {
final String serverPrefix = Sync.getEffectiveServerPrefix();
Log.d(TAG, "@@syncHistory step 20: building http request. Server prefix: " + serverPrefix);
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("simpleToken", simpleToken)
.add("syncSetName", syncSetName)
.add("installation_id", U.getInstallationId())
@@ -471,7 +471,7 @@ void syncPins(final SyncResult sr) {
final String serverPrefix = Sync.getEffectiveServerPrefix();
Log.d(TAG, "@@syncPins step 20: building http request. Server prefix: " + serverPrefix);
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("simpleToken", simpleToken)
.add("syncSetName", syncSetName)
.add("installation_id", U.getInstallationId())
@@ -566,7 +566,7 @@ void syncRp(final SyncResult sr) {
final String serverPrefix = Sync.getEffectiveServerPrefix();
Log.d(TAG, "@@syncRp step 20: building http request. Server prefix: " + serverPrefix);
- final RequestBody requestBody = new FormEncodingBuilder()
+ final RequestBody requestBody = new FormBody.Builder()
.add("simpleToken", simpleToken)
.add("syncSetName", syncSetName)
.add("installation_id", U.getInstallationId())
Oops, something went wrong.

0 comments on commit 2c6b0f3

Please sign in to comment.