Reformat code

pull/795/head
Alex Baker 5 years ago
parent 011d47024d
commit 35525a4957

@ -1,15 +1,10 @@
package org.tasks.gtasks;
import android.app.Activity;
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;
import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity;
import javax.inject.Inject;
import org.tasks.drive.DriveLoginActivity;
import org.tasks.play.AuthResultHandler;
import javax.inject.Inject;
public class PlayServices {
@Inject

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.test;
import static androidx.test.InstrumentationRegistry.getTargetContext;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.utility;
import static androidx.test.InstrumentationRegistry.getTargetContext;
@ -19,8 +20,8 @@ import static org.tasks.date.DateTimeUtils.newDate;
import static org.tasks.date.DateTimeUtils.newDateTime;
import android.content.res.Configuration;
import androidx.test.runner.AndroidJUnit4;
import android.util.DisplayMetrics;
import androidx.test.runner.AndroidJUnit4;
import java.util.Locale;
import org.junit.After;
import org.junit.Before;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.dao;
import static junit.framework.Assert.assertEquals;

@ -1,29 +1,5 @@
package com.todoroo.astrid.reminders;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.tasks.R;
import org.tasks.Snippet;
import org.tasks.injection.InjectingTestCase;
import org.tasks.injection.TestComponent;
import org.tasks.jobs.NotificationQueue;
import org.tasks.jobs.ReminderEntry;
import org.tasks.jobs.WorkManager;
import org.tasks.preferences.Preferences;
import org.tasks.reminders.Random;
import org.tasks.time.DateTime;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import androidx.test.runner.AndroidJUnit4;
import static com.natpryce.makeiteasy.MakeItEasy.with;
import static com.todoroo.andlib.utility.DateUtilities.ONE_HOUR;
import static com.todoroo.andlib.utility.DateUtilities.ONE_WEEK;
@ -48,6 +24,26 @@ import static org.tasks.makers.TaskMaker.REMINDER_LAST;
import static org.tasks.makers.TaskMaker.SNOOZE_TIME;
import static org.tasks.makers.TaskMaker.newTask;
import androidx.test.runner.AndroidJUnit4;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InOrder;
import org.tasks.R;
import org.tasks.Snippet;
import org.tasks.injection.InjectingTestCase;
import org.tasks.injection.TestComponent;
import org.tasks.jobs.NotificationQueue;
import org.tasks.jobs.ReminderEntry;
import org.tasks.jobs.WorkManager;
import org.tasks.preferences.Preferences;
import org.tasks.reminders.Random;
import org.tasks.time.DateTime;
@RunWith(AndroidJUnit4.class)
public class ReminderServiceTest extends InjectingTestCase {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.repeats;
import static junit.framework.Assert.assertEquals;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import static junit.framework.Assert.assertEquals;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import static junit.framework.Assert.assertEquals;

@ -1,17 +1,15 @@
package org.tasks.caldav;
import static junit.framework.Assert.assertTrue;
import static org.tasks.TestUtilities.vtodo;
import androidx.test.runner.AndroidJUnit4;
import java.util.TimeZone;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.TimeZone;
import androidx.test.runner.AndroidJUnit4;
import static junit.framework.Assert.assertTrue;
import static org.tasks.TestUtilities.vtodo;
@RunWith(AndroidJUnit4.class)
public class SynologyTests {

@ -1,12 +1,11 @@
package org.tasks.injection;
import org.junit.Before;
import timber.log.Timber;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static org.tasks.TestUtilities.initializeMockito;
import org.junit.Before;
import timber.log.Timber;
public abstract class InjectingTestCase {
@Before

@ -1,7 +1,7 @@
package org.tasks.injection;
import androidx.room.Room;
import android.content.Context;
import androidx.room.Room;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.dao.TaskDao;
import dagger.Module;

@ -3,14 +3,14 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package org.tasks.jobs;
import android.net.Uri;
package org.tasks.jobs;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;
import android.net.Uri;
import androidx.test.runner.AndroidJUnit4;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;

@ -1,20 +1,17 @@
package org.tasks.preferences;
import android.annotation.SuppressLint;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static junit.framework.Assert.assertEquals;
import android.annotation.SuppressLint;
import androidx.test.runner.AndroidJUnit4;
import java.util.concurrent.TimeUnit;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.tasks.R;
import org.tasks.time.DateTime;
import java.util.concurrent.TimeUnit;
import androidx.test.runner.AndroidJUnit4;
import static androidx.test.InstrumentationRegistry.getTargetContext;
import static junit.framework.Assert.assertEquals;
@RunWith(AndroidJUnit4.class)
public class PreferenceTests {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static junit.framework.Assert.assertNotNull;

@ -1,9 +1,23 @@
package com.todoroo.astrid.gtasks;
import static com.natpryce.makeiteasy.MakeItEasy.with;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static org.tasks.makers.GtaskListMaker.ID;
import static org.tasks.makers.GtaskListMaker.LAST_SYNC;
import static org.tasks.makers.GtaskListMaker.NAME;
import static org.tasks.makers.GtaskListMaker.REMOTE_ID;
import static org.tasks.makers.GtaskListMaker.newGtaskList;
import static org.tasks.makers.RemoteGtaskListMaker.newRemoteList;
import static org.tasks.time.DateTimeUtils.currentTimeMillis;
import androidx.test.runner.AndroidJUnit4;
import com.google.api.client.util.DateTime;
import com.google.api.services.tasks.model.TaskList;
import com.todoroo.astrid.service.TaskDeleter;
import javax.inject.Inject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.tasks.LocalBroadcastManager;
@ -15,23 +29,6 @@ import org.tasks.injection.TestComponent;
import org.tasks.jobs.WorkManager;
import org.tasks.makers.RemoteGtaskListMaker;
import javax.inject.Inject;
import androidx.test.runner.AndroidJUnit4;
import static com.natpryce.makeiteasy.MakeItEasy.with;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
import static org.tasks.makers.GtaskListMaker.ID;
import static org.tasks.makers.GtaskListMaker.LAST_SYNC;
import static org.tasks.makers.GtaskListMaker.NAME;
import static org.tasks.makers.GtaskListMaker.REMOTE_ID;
import static org.tasks.makers.GtaskListMaker.newGtaskList;
import static org.tasks.makers.RemoteGtaskListMaker.newRemoteList;
import static org.tasks.time.DateTimeUtils.currentTimeMillis;
@RunWith(AndroidJUnit4.class)
public class GtasksListServiceTest extends InjectingTestCase {
@ -47,8 +44,7 @@ public class GtasksListServiceTest extends InjectingTestCase {
super.setUp();
workManager.init();
gtasksListService =
new GtasksListService(
googleTaskListDao, taskDeleter, localBroadcastManager);
new GtasksListService(googleTaskListDao, taskDeleter, localBroadcastManager);
}
@Override

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static junit.framework.Assert.assertNotNull;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static junit.framework.Assert.assertEquals;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static junit.framework.Assert.assertEquals;

@ -1,14 +1,11 @@
package org.tasks.gtasks;
import android.app.Activity;
import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity;
import javax.inject.Inject;
import org.tasks.drive.DriveLoginActivity;
import org.tasks.play.AuthResultHandler;
import javax.inject.Inject;
public class PlayServices {
@Inject

@ -4,7 +4,6 @@ import android.accounts.Account;
import android.app.Activity;
import android.content.Context;
import android.widget.Toast;
import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.UserRecoverableAuthException;
@ -13,16 +12,12 @@ import com.google.android.gms.common.GoogleApiAvailability;
import com.google.api.services.drive.DriveScopes;
import com.google.api.services.tasks.TasksScopes;
import com.todoroo.astrid.gtasks.auth.GtasksLoginActivity;
import java.io.IOException;
import javax.inject.Inject;
import org.tasks.R;
import org.tasks.injection.ForApplication;
import org.tasks.play.AuthResultHandler;
import org.tasks.preferences.Preferences;
import java.io.IOException;
import javax.inject.Inject;
import timber.log.Timber;
public class PlayServices {
@ -92,26 +87,27 @@ public class PlayServices {
getToken(DriveScopes.DRIVE_FILE, activity, accountName, handler);
}
private void getToken(String scope, Activity activity, String accountName, AuthResultHandler handler) {
private void getToken(
String scope, Activity activity, String accountName, AuthResultHandler handler) {
final Account account = accountManager.getAccount(accountName);
if (account == null) {
handler.authenticationFailed(
activity.getString(R.string.gtasks_error_accountNotFound, accountName));
} else {
new Thread(
() -> {
try {
GoogleAuthUtil.getToken(activity, account, "oauth2:" + scope, null);
handler.authenticationSuccessful(accountName);
} catch (UserRecoverableAuthException e) {
Timber.e(e);
activity.startActivityForResult(
e.getIntent(), GtasksLoginActivity.RC_REQUEST_OAUTH);
} catch (GoogleAuthException | IOException e) {
Timber.e(e);
handler.authenticationFailed(activity.getString(R.string.gtasks_GLA_errorIOAuth));
}
})
() -> {
try {
GoogleAuthUtil.getToken(activity, account, "oauth2:" + scope, null);
handler.authenticationSuccessful(accountName);
} catch (UserRecoverableAuthException e) {
Timber.e(e);
activity.startActivityForResult(
e.getIntent(), GtasksLoginActivity.RC_REQUEST_OAUTH);
} catch (GoogleAuthException | IOException e) {
Timber.e(e);
handler.authenticationFailed(activity.getString(R.string.gtasks_GLA_errorIOAuth));
}
})
.start();
}
}

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.mdimension.jchronic;
import com.mdimension.jchronic.handlers.Handler;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.data;
import android.text.TextUtils;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.data;
import com.todoroo.andlib.sql.SqlTable;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.AND;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.AS;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.COMMA;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
public final class Functions {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.AND;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
public enum JoinType {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
public final class Operator {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.SPACE;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
public enum OrderType {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.ALL;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.COMMA;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
final class SqlConstants {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
public class SqlTable extends DBObject<SqlTable> {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.sql;
import static com.todoroo.andlib.sql.SqlConstants.SPACE;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.utility;
import android.app.Activity;
@ -15,11 +16,9 @@ import android.util.DisplayMetrics;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import timber.log.Timber;
/**

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.utility;
import static org.tasks.date.DateTimeUtils.newDateTime;
@ -196,8 +197,7 @@ public class DateUtilities {
return context.getString(abbreviated ? R.string.yest : R.string.yesterday);
}
if (today + abbreviationLimit >= input
&& today - abbreviationLimit <= input) {
if (today + abbreviationLimit >= input && today - abbreviationLimit <= input) {
return abbreviated
? DateUtilities.getWeekdayShort(newDateTime(date))
: DateUtilities.getWeekday(newDateTime(date));

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.andlib.utility;
import android.app.Activity;

@ -3,17 +3,18 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.activity;
import static java.util.Arrays.asList;
import android.content.Context;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuItem;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.google.common.base.Strings;
@ -90,7 +91,8 @@ public class BeastModePreferences extends ThemedInjectingAppCompatActivity
setContentView(R.layout.beast_mode_pref_activity);
ButterKnife.bind(this);
toolbar.setNavigationIcon(ContextCompat.getDrawable(this, R.drawable.ic_outline_arrow_back_24px));
toolbar.setNavigationIcon(
ContextCompat.getDrawable(this, R.drawable.ic_outline_arrow_back_24px));
toolbar.setNavigationOnClickListener(v -> finish());
toolbar.inflateMenu(R.menu.beast_mode);
toolbar.setOnMenuItemClickListener(this);

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.activity;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop;
@ -11,18 +12,18 @@ import static org.tasks.tasklist.ActionUtils.applySupportActionModeColor;
import static org.tasks.ui.NavigationDrawerFragment.OnFilterItemClickedListener;
import android.annotation.SuppressLint;
import androidx.lifecycle.ViewModelProviders;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.appcompat.view.ActionMode;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.appcompat.view.ActionMode;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.ViewModelProviders;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.todoroo.astrid.api.CaldavFilter;

@ -1,26 +1,21 @@
package com.todoroo.astrid.activity;
import static com.google.common.collect.Lists.newArrayList;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastMarshmallow;
import static org.tasks.intents.TaskIntents.getEditTaskStack;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.TaskCreator;
import java.util.ArrayList;
import javax.inject.Inject;
import org.tasks.data.TaskAttachment;
import org.tasks.injection.ActivityComponent;
import org.tasks.injection.InjectingAppCompatActivity;
import java.util.ArrayList;
import javax.inject.Inject;
import timber.log.Timber;
import static com.google.common.collect.Lists.newArrayList;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastMarshmallow;
import static org.tasks.intents.TaskIntents.getEditTaskStack;
/**
* @author joshuagross
* <p>Create a new task based on incoming links from the "share" menu

@ -3,8 +3,12 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.activity;
import static org.tasks.date.DateTimeUtils.newDateTime;
import static org.tasks.files.FileHelper.copyToUri;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
@ -15,7 +19,12 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.dao.TaskDao;
@ -26,7 +35,8 @@ import com.todoroo.astrid.service.TaskDeleter;
import com.todoroo.astrid.timers.TimerPlugin;
import com.todoroo.astrid.ui.EditTitleControlSet;
import com.todoroo.astrid.utility.Flags;
import java.util.List;
import javax.inject.Inject;
import org.tasks.LocalBroadcastManager;
import org.tasks.R;
import org.tasks.analytics.Tracker;
@ -42,20 +52,6 @@ import org.tasks.preferences.Preferences;
import org.tasks.ui.MenuColorizer;
import org.tasks.ui.TaskEditControlFragment;
import java.util.List;
import javax.inject.Inject;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import butterknife.BindView;
import butterknife.ButterKnife;
import static org.tasks.date.DateTimeUtils.newDateTime;
import static org.tasks.files.FileHelper.copyToUri;
public final class TaskEditFragment extends InjectingFragment
implements Toolbar.OnMenuItemClickListener {
@ -118,7 +114,10 @@ public final class TaskEditFragment extends InjectingFragment
final boolean backButtonSavesTask = preferences.backButtonSavesTask();
toolbar.setNavigationIcon(
ContextCompat.getDrawable(
context, backButtonSavesTask ? R.drawable.ic_outline_clear_24px : R.drawable.ic_outline_save_24px));
context,
backButtonSavesTask
? R.drawable.ic_outline_clear_24px
: R.drawable.ic_outline_save_24px));
toolbar.setNavigationOnClickListener(
v -> {
if (backButtonSavesTask) {

@ -3,36 +3,37 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.activity;
import static android.app.Activity.RESULT_OK;
import static androidx.core.content.ContextCompat.getColor;
import android.app.Activity;
import androidx.lifecycle.ViewModelProviders;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import com.google.android.material.snackbar.Snackbar;
import androidx.core.view.MenuItemCompat;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.google.android.material.snackbar.Snackbar;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.QueryTemplate;
@ -49,8 +50,8 @@ import com.todoroo.astrid.service.TaskMover;
import com.todoroo.astrid.timers.TimerPlugin;
import io.reactivex.disposables.Disposable;
import io.reactivex.subjects.PublishSubject;
import java.util.concurrent.TimeUnit;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import org.tasks.LocalBroadcastManager;
import org.tasks.R;
@ -132,7 +133,7 @@ public class TaskListFragment extends InjectingFragment
private PublishSubject<String> searchSubject = PublishSubject.create();
private Disposable searchDisposable;
/*
/*
* ======================================================================
* ======================================================= initialization
* ======================================================================
@ -463,7 +464,7 @@ public class TaskListFragment extends InjectingFragment
}
}
/**
/**
* Called by the RefreshReceiver when the task list receives a refresh broadcast. Subclasses
* should override this.
*/

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.adapter;
import static androidx.core.content.ContextCompat.getColor;
@ -17,11 +18,6 @@ import android.content.Intent;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -29,6 +25,11 @@ import android.widget.ArrayAdapter;
import android.widget.CheckedTextView;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.util.Pair;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.CustomFilterActivity;
@ -151,7 +152,8 @@ public class FilterAdapter extends ArrayAdapter<FilterListItem> {
activity.getResources(), android.R.color.transparent, null),
theme.getThemeAccent().getAccentColor()
});
Drawable original = ContextCompat.getDrawable(activity, R.drawable.ic_outline_done_24px);
Drawable original =
ContextCompat.getDrawable(activity, R.drawable.ic_outline_done_24px);
Drawable wrapped = DrawableCompat.wrap(original.mutate());
DrawableCompat.setTintList(wrapped, tintList);
viewHolder.name.setCheckMarkDrawable(wrapped);

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.adapter;
import static com.google.common.collect.Lists.newArrayList;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.alarms;
import java.util.LinkedHashSet;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
/**

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import android.graphics.Bitmap;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import android.os.Parcel;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import android.content.Intent;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import android.graphics.Bitmap;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import static org.tasks.date.DateTimeUtils.newDateTime;

@ -2,7 +2,6 @@ package com.todoroo.astrid.api;
import android.os.Parcel;
import android.os.Parcelable;
import com.todoroo.andlib.sql.QueryTemplate;
public class SearchFilter extends Filter {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.api;
import android.graphics.Bitmap;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.backup;
/**

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.backup;
import android.app.Activity;
@ -11,11 +12,13 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Handler;
import android.text.TextUtils;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.inject.Inject;
import org.tasks.LocalBroadcastManager;
import org.tasks.R;
import org.tasks.backup.XmlReader;
@ -35,13 +38,6 @@ import org.tasks.dialogs.DialogBuilder;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.inject.Inject;
import timber.log.Timber;
public class TasksXmlImporter {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import android.content.Context;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import static android.text.TextUtils.isEmpty;
@ -12,8 +13,6 @@ import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.widget.Toolbar;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.MenuItem;
@ -21,6 +20,8 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ListView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.todoroo.andlib.data.Property.CountProperty;

@ -3,10 +3,10 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import android.content.DialogInterface;
import androidx.annotation.NonNull;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -17,6 +17,7 @@ import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.todoroo.astrid.api.MultipleSelectCriterion;
import com.todoroo.astrid.api.TextInputCriterion;
import com.todoroo.astrid.core.CustomFilterActivity.CriterionInstance;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import static com.google.common.collect.Lists.newArrayList;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import static org.tasks.PermissionUtil.verifyPermissions;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import android.os.Bundle;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.core;
import static com.todoroo.astrid.dao.TaskDao.TaskCriteria.isVisible;
@ -22,16 +23,14 @@ import org.tasks.preferences.Preferences;
*/
public class SortHelper {
private static final String ADJUSTED_DUE_DATE =
"(CASE WHEN (dueDate / 1000) % 60 > 0 THEN dueDate ELSE (dueDate + 43140000) END)";
public static final int SORT_AUTO = 0;
public static final int SORT_ALPHA = 1;
public static final int SORT_DUE = 2;
public static final int SORT_IMPORTANCE = 3;
public static final int SORT_MODIFIED = 4;
public static final int SORT_WIDGET = 5;
private static final String ADJUSTED_DUE_DATE =
"(CASE WHEN (dueDate / 1000) % 60 > 0 THEN dueDate ELSE (dueDate + 43140000) END)";
private static final Order ORDER_TITLE = Order.asc(Functions.upper(Task.TITLE));
/** Takes a SQL query, and if there isn't already an order, creates an order. */
@ -79,7 +78,9 @@ public class SortHelper {
case SORT_DUE:
order =
Order.asc(
"(CASE WHEN (dueDate=0) THEN (strftime('%s','now')*1000)*2 ELSE " + ADJUSTED_DUE_DATE + " END)+importance");
"(CASE WHEN (dueDate=0) THEN (strftime('%s','now')*1000)*2 ELSE "
+ ADJUSTED_DUE_DATE
+ " END)+importance");
break;
case SORT_IMPORTANCE:
order =

@ -3,11 +3,12 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.dao;
import androidx.sqlite.db.SupportSQLiteDatabase;
import androidx.room.RoomDatabase;
import android.database.Cursor;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
import com.todoroo.astrid.data.Task;
import java.io.IOException;
import org.tasks.analytics.Tracker;

@ -3,10 +3,15 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.dao;
import android.database.Cursor;
import static com.todoroo.andlib.utility.DateUtilities.now;
import android.database.Cursor;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Update;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.sql.Criterion;
import com.todoroo.andlib.sql.Functions;
@ -15,20 +20,12 @@ import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.PermaSql;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.helper.UUIDHelper;
import org.tasks.BuildConfig;
import org.tasks.jobs.WorkManager;
import java.util.ArrayList;
import java.util.List;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Update;
import org.tasks.BuildConfig;
import org.tasks.jobs.WorkManager;
import timber.log.Timber;
import static com.todoroo.andlib.utility.DateUtilities.now;
@Dao
public abstract class TaskDao {
@ -60,8 +57,7 @@ public abstract class TaskDao {
@androidx.room.Query("SELECT * FROM tasks WHERE _id IN (:taskIds)")
public abstract List<Task> fetch(List<Long> taskIds);
@androidx.room.Query(
"SELECT COUNT(1) FROM tasks WHERE timerStart > 0 AND deleted = 0")
@androidx.room.Query("SELECT COUNT(1) FROM tasks WHERE timerStart > 0 AND deleted = 0")
public abstract int activeTimers();
@androidx.room.Query(
@ -74,8 +70,7 @@ public abstract class TaskDao {
@androidx.room.Query("SELECT * FROM tasks WHERE completed = 0 AND deleted = 0")
abstract List<Task> getActiveTasks();
@androidx.room.Query(
"SELECT * FROM tasks WHERE hideUntil < (strftime('%s','now')*1000)")
@androidx.room.Query("SELECT * FROM tasks WHERE hideUntil < (strftime('%s','now')*1000)")
abstract List<Task> getVisibleTasks();
@androidx.room.Query(
@ -87,8 +82,7 @@ public abstract class TaskDao {
"UPDATE tasks SET completed = :completionDate " + "WHERE remoteId = :remoteId")
public abstract void setCompletionDate(String remoteId, long completionDate);
@androidx.room.Query(
"UPDATE tasks SET snoozeTime = :millis WHERE _id in (:taskIds)")
@androidx.room.Query("UPDATE tasks SET snoozeTime = :millis WHERE _id in (:taskIds)")
public abstract void snooze(List<Long> taskIds, long millis);
@androidx.room.Query(

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.data;
public class SyncFlags {

@ -3,22 +3,23 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.data;
import static java.lang.annotation.RetentionPolicy.SOURCE;
import static org.tasks.date.DateTimeUtils.newDateTime;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import android.content.ContentValues;
import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.IntDef;
import android.text.TextUtils;
import androidx.annotation.IntDef;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import com.google.common.base.Strings;
import com.google.ical.values.RRule;
import com.todoroo.andlib.data.Property;

@ -3,8 +3,18 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.files;
import static android.app.Activity.RESULT_OK;
import static org.tasks.data.TaskAttachment.createNewAttachment;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_AUDIO;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_CAMERA;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_GALLERY;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_STORAGE;
import static org.tasks.dialogs.AddAttachmentDialog.newAddAttachmentDialog;
import static org.tasks.files.FileHelper.copyToUri;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
@ -15,9 +25,12 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import com.todoroo.astrid.data.Task;
import java.util.ArrayList;
import javax.inject.Inject;
import org.tasks.R;
import org.tasks.data.TaskAttachment;
import org.tasks.data.TaskAttachmentDao;
@ -28,23 +41,6 @@ import org.tasks.injection.FragmentComponent;
import org.tasks.preferences.Preferences;
import org.tasks.ui.TaskEditControlFragment;
import java.util.ArrayList;
import javax.inject.Inject;
import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import static android.app.Activity.RESULT_OK;
import static org.tasks.data.TaskAttachment.createNewAttachment;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_AUDIO;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_CAMERA;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_GALLERY;
import static org.tasks.dialogs.AddAttachmentDialog.REQUEST_STORAGE;
import static org.tasks.dialogs.AddAttachmentDialog.newAddAttachmentDialog;
import static org.tasks.files.FileHelper.copyToUri;
public class FilesControlSet extends TaskEditControlFragment {
public static final int TAG = R.string.TEA_ctrl_files_pref;
@ -90,8 +86,7 @@ public class FilesControlSet extends TaskEditControlFragment {
@OnClick(R.id.add_attachment)
void addAttachment(View view) {
newAddAttachmentDialog(this)
.show(getFragmentManager(), FRAG_TAG_ADD_ATTACHMENT_DIALOG);
newAddAttachmentDialog(this).show(getFragmentManager(), FRAG_TAG_ADD_ATTACHMENT_DIALOG);
}
@Override

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gcal;
import android.content.ContentResolver;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static com.google.common.collect.Lists.newArrayList;

@ -3,27 +3,24 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import static com.google.common.collect.Lists.newArrayList;
import static org.tasks.time.DateTimeUtils.printTimestamp;
import com.google.api.services.tasks.model.TaskList;
import com.todoroo.astrid.service.TaskDeleter;
import org.tasks.LocalBroadcastManager;
import org.tasks.data.GoogleTaskAccount;
import org.tasks.data.GoogleTaskList;
import org.tasks.data.GoogleTaskListDao;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import org.tasks.LocalBroadcastManager;
import org.tasks.data.GoogleTaskAccount;
import org.tasks.data.GoogleTaskList;
import org.tasks.data.GoogleTaskListDao;
import timber.log.Timber;
import static com.google.common.collect.Lists.newArrayList;
import static org.tasks.time.DateTimeUtils.printTimestamp;
public class GtasksListService {
private final GoogleTaskListDao googleTaskListDao;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import android.app.Activity;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import com.todoroo.astrid.api.Filter;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks;
import android.text.TextUtils;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks.api;
import com.google.api.client.util.DateTime;

@ -1,7 +1,6 @@
package com.todoroo.astrid.gtasks.api;
import android.content.Context;
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpResponse;
@ -15,12 +14,9 @@ import com.google.api.services.tasks.TasksScopes;
import com.google.api.services.tasks.model.Task;
import com.google.api.services.tasks.model.TaskList;
import com.google.api.services.tasks.model.TaskLists;
import org.tasks.BuildConfig;
import java.io.IOException;
import java.util.Collections;
import org.tasks.BuildConfig;
import timber.log.Timber;
/**
@ -34,9 +30,10 @@ public class GtasksInvoker {
private final Tasks service;
public GtasksInvoker(Context context, String account) {
GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(context, Collections.singletonList(TasksScopes.TASKS))
.setBackOff(new ExponentialBackOff.Builder().build())
.setSelectedAccountName(account);
GoogleAccountCredential credential =
GoogleAccountCredential.usingOAuth2(context, Collections.singletonList(TasksScopes.TASKS))
.setBackOff(new ExponentialBackOff.Builder().build())
.setSelectedAccountName(account);
service =
new Tasks.Builder(new NetHttpTransport(), new JacksonFactory(), credential)
.setApplicationName(String.format("Tasks/%s", BuildConfig.VERSION_NAME))

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks.api;
import com.google.api.services.tasks.model.Task;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks.auth;
import android.app.ProgressDialog;

@ -3,11 +3,11 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks.sync;
import android.content.Context;
import android.text.TextUtils;
import com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.dao.TaskDao;
@ -15,7 +15,13 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gtasks.GtasksTaskListUpdater;
import com.todoroo.astrid.gtasks.api.GtasksInvoker;
import com.todoroo.astrid.gtasks.api.MoveRequest;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import org.tasks.analytics.Tracker;
import org.tasks.data.GoogleTask;
import org.tasks.data.GoogleTaskDao;
@ -25,16 +31,6 @@ import org.tasks.gtasks.GtaskSyncAdapterHelper;
import org.tasks.injection.ApplicationScope;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.Preferences;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import timber.log.Timber;
@ApplicationScope

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.gtasks.sync;
import static org.tasks.gtasks.GoogleTaskSynchronizer.mergeDates;

@ -3,8 +3,12 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.notes;
import static androidx.core.content.ContextCompat.getColor;
import static org.tasks.files.ImageHelper.sampleBitmap;
import android.app.Activity;
import android.graphics.Color;
import android.net.Uri;
@ -15,23 +19,16 @@ import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.data.Task;
import java.util.ArrayList;
import javax.inject.Inject;
import org.tasks.R;
import org.tasks.data.UserActivity;
import org.tasks.data.UserActivityDao;
import org.tasks.files.FileHelper;
import org.tasks.preferences.Preferences;
import java.util.ArrayList;
import javax.inject.Inject;
import static androidx.core.content.ContextCompat.getColor;
import static org.tasks.files.ImageHelper.sampleBitmap;
public class CommentsController {
private final UserActivityDao userActivityDao;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.provider;
import android.content.ContentValues;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.reminders;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastMarshmallow;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.reminders;
import com.todoroo.andlib.utility.DateUtilities;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.repeats;
import static androidx.core.content.ContextCompat.getColor;
@ -14,10 +15,6 @@ import static org.tasks.time.DateTimeUtils.currentTimeMillis;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@ -26,6 +23,10 @@ import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import butterknife.BindView;
import butterknife.OnClick;
import butterknife.OnItemSelected;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.repeats;
import static org.tasks.date.DateTimeUtils.newDate;

@ -3,11 +3,13 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import static com.google.common.base.Strings.isNullOrEmpty;
import android.content.Context;
import android.os.Environment;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
@ -16,7 +18,9 @@ import com.google.common.collect.Multimaps;
import com.todoroo.astrid.api.GtasksFilter;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.tags.TagService;
import java.io.File;
import java.util.List;
import javax.inject.Inject;
import org.tasks.BuildConfig;
import org.tasks.LocalBroadcastManager;
import org.tasks.R;
@ -39,16 +43,8 @@ import org.tasks.injection.ForApplication;
import org.tasks.preferences.DefaultFilterProvider;
import org.tasks.preferences.Preferences;
import org.tasks.scheduling.BackgroundScheduler;
import java.io.File;
import java.util.List;
import javax.inject.Inject;
import timber.log.Timber;
import static com.google.common.base.Strings.isNullOrEmpty;
public class StartupService {
private static final int V4_8_0 = 380;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import com.todoroo.astrid.gtasks.sync.GtasksSyncService;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.subtasks;
import android.app.Activity;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.subtasks;
import android.app.Activity;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.sync;
public interface SyncResultCallback {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.tags;
import com.google.common.base.Strings;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.tags;
import static com.google.common.collect.Lists.newArrayList;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.tags;
import static com.google.common.base.Predicates.notNull;
@ -72,20 +73,23 @@ public final class TagsControlSet extends TaskEditControlFragment {
private static final String EXTRA_NEW_TAGS = "extra_new_tags";
private static final String EXTRA_ORIGINAL_TAGS = "extra_original_tags";
private static final String EXTRA_SELECTED_TAGS = "extra_selected_tags";
private final Ordering<TagData> orderByName =
new Ordering<TagData>() {
@Override
public int compare(TagData left, TagData right) {
return left.getName().compareTo(right.getName());
}
};
@Inject TagDao tagDao;
@Inject TagDataDao tagDataDao;
@Inject TagService tagService;
@Inject DialogBuilder dialogBuilder;
@Inject ThemeCache themeCache;
@Inject ChipProvider chipProvider;
@BindView(R.id.no_tags)
TextView tagsDisplay;
@BindView(R.id.chip_group)
ChipGroup chipGroup;
private LinearLayout newTagLayout;
private ListView tagListView;
private View dialogView;
@ -93,13 +97,6 @@ public final class TagsControlSet extends TaskEditControlFragment {
private List<TagData> allTags;
private ArrayList<TagData> originalTags;
private ArrayList<TagData> selectedTags;
private final Ordering<TagData> orderByName =
new Ordering<TagData>() {
@Override
public int compare(TagData left, TagData right) {
return left.getName().compareTo(right.getName());
}
};
@Nullable
@Override
@ -136,7 +133,8 @@ public final class TagsControlSet extends TaskEditControlFragment {
ThemeColor themeColor =
themeCache.getThemeColor(tagData.getColor() >= 0 ? tagData.getColor() : 19);
view.setText(tagData.getName());
Drawable original = ContextCompat.getDrawable(getContext(), R.drawable.ic_outline_label_24px);
Drawable original =
ContextCompat.getDrawable(getContext(), R.drawable.ic_outline_label_24px);
Drawable wrapped = DrawableCompat.wrap(original.mutate());
DrawableCompat.setTint(wrapped, themeColor.getPrimaryColor());
if (atLeastJellybeanMR1()) {

@ -3,14 +3,13 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.timers;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.text.format.DateUtils;
@ -20,6 +19,8 @@ import android.view.ViewGroup;
import android.widget.Chronometer;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
import butterknife.BindView;
import butterknife.OnClick;
import com.todoroo.andlib.utility.DateUtilities;
@ -205,7 +206,7 @@ public class TimerControlSet extends TaskEditControlFragment {
private void updateChronometer() {
timerButton.setImageResource(
timerActive() ? R.drawable.ic_outline_pause_24px: R.drawable.ic_outline_play_arrow_24px);
timerActive() ? R.drawable.ic_outline_pause_24px : R.drawable.ic_outline_play_arrow_24px);
long elapsed = this.elapsed.getTimeDurationInSeconds() * 1000L;
if (timerActive()) {

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.timers;
import static com.google.common.collect.Lists.newArrayList;

@ -3,6 +3,7 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.timers;
import static org.tasks.time.DateTimeUtils.currentTimeMillis;

@ -3,13 +3,14 @@
*
* <p>See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.ui;
import android.content.Context;
import androidx.appcompat.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.view.ViewDebug;
import android.widget.Checkable;
import androidx.appcompat.widget.AppCompatImageView;
public class CheckableImageView extends AppCompatImageView implements Checkable {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save