Fix backup job, fix unit tests, update deps

pull/574/head
Alex Baker 7 years ago
parent 8726855985
commit c573d03ca4

@ -11,7 +11,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta1'
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
}
}
@ -92,12 +92,11 @@ configurations {
}
final DAGGER_VERSION = '2.9'
final BUTTERKNIFE_VERSION = '8.8.0'
final GPS_VERSION = '11.0.4'
final BUTTERKNIFE_VERSION = '8.8.1'
final GPS_VERSION = '11.2.0'
final SUPPORT_VERSION = '26.0.1'
final SUPPORT_ANNOTATIONS_VERSION = '26.0.0-alpha1'
final STETHO_VERSION = '1.4.2'
final TESTING_SUPPORT_VERSION = '0.5'
final STETHO_VERSION = '1.5.0'
final TESTING_SUPPORT_VERSION = '1.0.0'
dependencies {
annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}"
@ -110,12 +109,12 @@ dependencies {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}
debugCompile "com.facebook.stetho:stetho-timber:${STETHO_VERSION}@aar"
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
//noinspection GradleCompatible
debugCompile 'com.android.support:multidex:1.0.2'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.nononsenseapps:filepicker:4.0.0'
compile 'com.nononsenseapps:filepicker:4.1.0'
compile "com.android.support:design:${SUPPORT_VERSION}"
compile "com.android.support:support-annotations:${SUPPORT_VERSION}"
compile "com.android.support:support-v13:${SUPPORT_VERSION}"
@ -124,7 +123,7 @@ dependencies {
compile 'com.jakewharton.threetenabp:threetenabp:1.0.5'
//noinspection GradleDependency
compile 'com.google.guava:guava:20.0'
compile 'com.jakewharton:process-phoenix:1.1.1'
compile 'com.jakewharton:process-phoenix:2.0.0'
compile 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
compile 'com.twofortyfouram:android-plugin-api-for-locale:1.0.2'
compile 'com.bignerdranch.android:recyclerview-multiselect:0.2'
@ -134,7 +133,7 @@ dependencies {
compile ('org.scala-saddle:google-rfc-2445:20110304') {
transitive = false
}
compile ('com.wdullaer:materialdatetimepicker:3.1.3') {
compile ('com.wdullaer:materialdatetimepicker:3.2.3') {
exclude group: 'com.android.support', module: 'support-v4'
}
@ -142,7 +141,7 @@ dependencies {
googleplayCompile "com.google.android.gms:play-services-analytics:${GPS_VERSION}"
googleplayCompile "com.google.android.gms:play-services-auth:${GPS_VERSION}"
googleplayCompile "com.google.android.gms:play-services-places:${GPS_VERSION}"
googleplayCompile 'com.google.apis:google-api-services-tasks:v1-rev46-1.22.0'
googleplayCompile 'com.google.apis:google-api-services-tasks:v1-rev47-1.22.0'
googleplayCompile 'com.google.api-client:google-api-client-android:1.22.0'
amazonCompile "com.google.android.gms:play-services-analytics:${GPS_VERSION}"
@ -153,5 +152,5 @@ dependencies {
androidTestCompile 'com.natpryce:make-it-easy:4.0.1'
androidTestCompile "com.android.support.test:runner:${TESTING_SUPPORT_VERSION}"
androidTestCompile "com.android.support.test:rules:${TESTING_SUPPORT_VERSION}"
androidTestCompile "com.android.support:support-annotations:${SUPPORT_ANNOTATIONS_VERSION}"
androidTestCompile "com.android.support:support-annotations:${SUPPORT_VERSION}"
}

@ -24,7 +24,7 @@ public class PreferenceTests {
@Before
public void setUp() {
preferences = new Preferences(getTargetContext(), null);
preferences = new Preferences(getTargetContext(), null, null);
preferences.clear();
preferences.setBoolean(R.string.p_rmd_enable_quiet, true);
}

@ -38,7 +38,7 @@ public class GtasksMetadataServiceTest extends DatabaseTestCase {
private final GtasksTestPreferenceService service;
public GtasksMetadataServiceTestModule(Context context) {
service = new GtasksTestPreferenceService(new Preferences(context, null));
service = new GtasksTestPreferenceService(new Preferences(context, null, null));
}
@Provides

@ -56,10 +56,4 @@ public class ApplicationModule {
public WidgetCheckBoxes getWidgetCheckBoxes(CheckBoxes checkBoxes) {
return newWidgetCheckBoxes(checkBoxes);
}
@Provides
@ApplicationScope
public ThemeCache getThemeCache() {
return new ThemeCache(context);
}
}

@ -52,13 +52,13 @@ public class JobManager {
public void scheduleMidnightRefresh() {
long time = nextMidnight();
Timber.d("%s: %s", MidnightRefreshJob.TAG, printTimestamp(time));
alarmManager.noWakeup(adjust(time), getPendingBroadcast(MidnightRefreshJob.class));
alarmManager.noWakeup(adjust(time), getPendingBroadcast(MidnightRefreshJob.Broadcast.class));
}
public void scheduleMidnightBackup() {
long time = nextMidnight();
Timber.d("%s: %s", BackupJob.TAG, printTimestamp(time));
alarmManager.noWakeup(adjust(time), getPendingBroadcast(BackupJob.class));
alarmManager.noWakeup(adjust(time), getPendingBroadcast(BackupJob.Broadcast.class));
}
public void cancel(String tag) {

@ -7,12 +7,17 @@ import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import org.tasks.R;
import org.tasks.injection.ApplicationScope;
import org.tasks.injection.ForApplication;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import static android.support.v4.content.ContextCompat.getColor;
@ApplicationScope
public class ThemeCache {
private final List<ThemeBase> themes = new ArrayList<>();
@ -22,7 +27,8 @@ public class ThemeCache {
private final List<LEDColor> led = new ArrayList<>();
private final ThemeColor untaggedColor;
public ThemeCache(Context context) {
@Inject
public ThemeCache(@ForApplication Context context) {
Resources resources = context.getResources();
themes.add(new ThemeBase(context.getString(R.string.theme_light), 0, getColor(context, R.color.grey_50), AppCompatDelegate.MODE_NIGHT_NO));

Loading…
Cancel
Save