Downgrade OkHttp

I didn't get the memo
pull/795/head
Alex Baker 6 years ago
parent 8941642d98
commit 7ae3309c52

@ -136,13 +136,13 @@ dependencies {
exclude group: 'com.google.code.findbugs', module: 'jsr305' exclude group: 'com.google.code.findbugs', module: 'jsr305'
} }
debugImplementation "com.facebook.stetho:stetho-timber:${STETHO_VERSION}@aar" debugImplementation "com.facebook.stetho:stetho-timber:${STETHO_VERSION}@aar"
//noinspection GradleDependency
debugImplementation "com.squareup.leakcanary:leakcanary-android:${LEAKCANARY_VERSION}" debugImplementation "com.squareup.leakcanary:leakcanary-android:${LEAKCANARY_VERSION}"
debugImplementation "com.squareup.leakcanary:leakcanary-support-fragment:${LEAKCANARY_VERSION}" debugImplementation "com.squareup.leakcanary:leakcanary-support-fragment:${LEAKCANARY_VERSION}"
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'me.saket:better-link-movement-method:2.2.0' implementation 'me.saket:better-link-movement-method:2.2.0'
implementation 'com.squareup.okhttp3:okhttp:3.13.1' //noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.2' // 3.13 minSdk is 21
implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.rey5137:material:1.2.5' implementation 'com.github.rey5137:material:1.2.5'
implementation 'com.nononsenseapps:filepicker:4.2.1' implementation 'com.nononsenseapps:filepicker:4.2.1'

@ -2,7 +2,6 @@ package org.tasks.location;
import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Lists.transform; import static com.google.common.collect.Lists.transform;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop;
import static com.todoroo.andlib.utility.AndroidUtilities.hideKeyboard; import static com.todoroo.andlib.utility.AndroidUtilities.hideKeyboard;
import static org.tasks.PermissionUtil.verifyPermissions; import static org.tasks.PermissionUtil.verifyPermissions;
import static org.tasks.data.Place.newPlace; import static org.tasks.data.Place.newPlace;
@ -151,10 +150,6 @@ public class LocationPickerActivity extends InjectingAppCompatActivity
} }
} }
private boolean canSearch() {
return atLeastLollipop() || inventory.hasPro();
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -187,16 +182,12 @@ public class LocationPickerActivity extends InjectingAppCompatActivity
toolbar.setNavigationIcon(R.drawable.ic_outline_arrow_back_24px); toolbar.setNavigationIcon(R.drawable.ic_outline_arrow_back_24px);
toolbar.setNavigationOnClickListener(v -> collapseToolbar()); toolbar.setNavigationOnClickListener(v -> collapseToolbar());
if (canSearch()) {
toolbar.inflateMenu(R.menu.menu_location_picker); toolbar.inflateMenu(R.menu.menu_location_picker);
Menu menu = toolbar.getMenu(); Menu menu = toolbar.getMenu();
search = menu.findItem(R.id.menu_search); search = menu.findItem(R.id.menu_search);
search.setOnActionExpandListener(this); search.setOnActionExpandListener(this);
((SearchView) search.getActionView()).setOnQueryTextListener(this); ((SearchView) search.getActionView()).setOnQueryTextListener(this);
toolbar.setOnMenuItemClickListener(this); toolbar.setOnMenuItemClickListener(this);
} else {
searchView.setVisibility(View.GONE);
}
MenuColorizer.colorToolbar(this, toolbar); MenuColorizer.colorToolbar(this, toolbar);
ThemeColor themeColor = theme.getThemeColor(); ThemeColor themeColor = theme.getThemeColor();

@ -2,7 +2,6 @@ package org.tasks.preferences;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastJellybeanMR1; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastJellybeanMR1;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop;
import static com.todoroo.andlib.utility.AndroidUtilities.preLollipop;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static org.tasks.dialogs.ExportTasksDialog.newExportTasksDialog; import static org.tasks.dialogs.ExportTasksDialog.newExportTasksDialog;
import static org.tasks.dialogs.ImportTasksDialog.newImportTasksDialog; import static org.tasks.dialogs.ImportTasksDialog.newImportTasksDialog;
@ -268,13 +267,7 @@ public class BasicPreferences extends InjectingPreferenceActivity
singleCheckedArrayAdapter, singleCheckedArrayAdapter,
getMapProvider(), getMapProvider(),
(dialog, which) -> { (dialog, which) -> {
if (which == 0) { if (which == 1) {
if (preLollipop()) {
toaster.longToast(R.string.requires_android_version, 5.0);
dialog.dismiss();
return;
}
} else if (which == 1) {
if (!playServices.refreshAndCheck()) { if (!playServices.refreshAndCheck()) {
playServices.resolve(this); playServices.resolve(this);
dialog.dismiss(); dialog.dismiss();
@ -302,13 +295,7 @@ public class BasicPreferences extends InjectingPreferenceActivity
singleCheckedArrayAdapter, singleCheckedArrayAdapter,
getPlaceProvider(), getPlaceProvider(),
(dialog, which) -> { (dialog, which) -> {
if (which == 0) { if (which == 1) {
if (preLollipop()) {
toaster.longToast(R.string.requires_android_version, 5.0);
dialog.dismiss();
return;
}
} else if (which == 1) {
if (!playServices.refreshAndCheck()) { if (!playServices.refreshAndCheck()) {
playServices.resolve(this); playServices.resolve(this);
dialog.dismiss(); dialog.dismiss();
@ -329,28 +316,19 @@ public class BasicPreferences extends InjectingPreferenceActivity
return false; return false;
}); });
int placeProvider = getPlaceProvider(); int placeProvider = getPlaceProvider();
placeProviderPreference.setSummary( placeProviderPreference.setSummary(choices.get(placeProvider));
placeProvider == -1 ? getString(R.string.none) : choices.get(placeProvider));
} }
private int getPlaceProvider() { private int getPlaceProvider() {
if (playServices.isPlayServicesAvailable()) { return playServices.isPlayServicesAvailable() && inventory.hasPro()
if (preLollipop()) { ? preferences.getInt(R.string.p_place_provider, 0)
return inventory.hasPro() ? 1 : -1; : 0;
} else {
return inventory.hasPro() ? preferences.getInt(R.string.p_place_provider, 0) : 0;
}
} else {
return atLeastLollipop() ? 0 : -1;
}
} }
private int getMapProvider() { private int getMapProvider() {
if (playServices.isPlayServicesAvailable()) { return playServices.isPlayServicesAvailable()
return preLollipop() ? 1 : preferences.getInt(R.string.p_map_provider, 0); ? preferences.getInt(R.string.p_map_provider, 0)
} else { : 0;
return preLollipop() ? -1 : 0;
}
} }
private void requestLogin() { private void requestLogin() {

@ -4,7 +4,6 @@ import static android.content.SharedPreferences.Editor;
import static com.google.common.collect.Iterables.transform; import static com.google.common.collect.Iterables.transform;
import static com.google.common.collect.Sets.newHashSet; import static com.google.common.collect.Sets.newHashSet;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastKitKat; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastKitKat;
import static com.todoroo.andlib.utility.AndroidUtilities.preLollipop;
import static java.util.Collections.emptySet; import static java.util.Collections.emptySet;
import android.content.ContentResolver; import android.content.ContentResolver;
@ -482,10 +481,10 @@ public class Preferences {
} }
public boolean useGoogleMaps() { public boolean useGoogleMaps() {
return preLollipop() || getInt(R.string.p_map_provider, 0) == 1; return getInt(R.string.p_map_provider, 0) == 1;
} }
public boolean useGooglePlaces() { public boolean useGooglePlaces() {
return preLollipop() || getInt(R.string.p_place_provider, 0) == 1; return getInt(R.string.p_place_provider, 0) == 1;
} }
} }

@ -877,7 +877,6 @@ File %1$s contained %2$s.\n\n
<string name="or_choose_a_location">Or choose a location</string> <string name="or_choose_a_location">Or choose a location</string>
<string name="map_provider">Map provider</string> <string name="map_provider">Map provider</string>
<string name="map_search_provider">Search provider</string> <string name="map_search_provider">Search provider</string>
<string name="requires_android_version">Requires Android %s</string>
<string name="missing_permissions">Missing permissions</string> <string name="missing_permissions">Missing permissions</string>
<string name="location_permission_required_geofence">Location permissions are needed for location reminders</string> <string name="location_permission_required_geofence">Location permissions are needed for location reminders</string>
<string name="location_permission_required_location">Location permissions are needed to find your current location</string> <string name="location_permission_required_location">Location permissions are needed to find your current location</string>

Loading…
Cancel
Save