diff --git a/app/src/androidTest/java/com/todoroo/andlib/test/TranslationTests.java b/app/src/androidTest/java/com/todoroo/andlib/test/TranslationTests.java index 2c2b41639..5aaaa55b1 100644 --- a/app/src/androidTest/java/com/todoroo/andlib/test/TranslationTests.java +++ b/app/src/androidTest/java/com/todoroo/andlib/test/TranslationTests.java @@ -202,7 +202,7 @@ public class TranslationTests { /** the original string */ final String string; - public FormatStringData(String string) { + FormatStringData(String string) { this.string = string; int pos = -1; diff --git a/app/src/debug/java/org/tasks/BuildSetup.java b/app/src/debug/java/org/tasks/BuildSetup.java index 131379887..2016aab6d 100644 --- a/app/src/debug/java/org/tasks/BuildSetup.java +++ b/app/src/debug/java/org/tasks/BuildSetup.java @@ -18,13 +18,13 @@ import org.tasks.injection.ForApplication; import org.tasks.preferences.Preferences; import timber.log.Timber; -public class BuildSetup { +class BuildSetup { private final Context context; private final Preferences preferences; @Inject - public BuildSetup(@ForApplication Context context, Preferences preferences) { + BuildSetup(@ForApplication Context context, Preferences preferences) { this.context = context; this.preferences = preferences; } diff --git a/app/src/debug/java/org/tasks/FlipperHttpInterceptor.java b/app/src/debug/java/org/tasks/FlipperHttpInterceptor.java index c003e6094..2e110bae7 100644 --- a/app/src/debug/java/org/tasks/FlipperHttpInterceptor.java +++ b/app/src/debug/java/org/tasks/FlipperHttpInterceptor.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; import timber.log.Timber; -public class FlipperHttpInterceptor implements HttpExecuteInterceptor, HttpResponseInterceptor { +class FlipperHttpInterceptor implements HttpExecuteInterceptor, HttpResponseInterceptor { private final Class responseClass; private final String requestId = UUIDHelper.newUUID(); @@ -43,7 +43,7 @@ public class FlipperHttpInterceptor implements HttpExecuteInterceptor, HttpRe plugin.reportResponse(toResponseInfo(response, now())); } - public void report(HttpResponse response, long start, long end) throws IOException { + void report(HttpResponse response, long start, long end) throws IOException { plugin.reportRequest(toRequestInfo(response.getRequest(), start)); plugin.reportResponse(toResponseInfo(response, end)); } diff --git a/app/src/googleplay/java/org/tasks/billing/Security.java b/app/src/googleplay/java/org/tasks/billing/Security.java index 18c2b7d19..37424312b 100644 --- a/app/src/googleplay/java/org/tasks/billing/Security.java +++ b/app/src/googleplay/java/org/tasks/billing/Security.java @@ -33,7 +33,7 @@ import java.security.spec.X509EncodedKeySpec; * Security-related methods. For a secure implementation, all of this code should be implemented on * a server that communicates with the application on the device. */ -public class Security { +class Security { private static final String TAG = "IABUtil/Security"; private static final String KEY_FACTORY_ALGORITHM = "RSA"; @@ -47,7 +47,7 @@ public class Security { * @param signature the signature for the data, signed with the private key * @throws IOException if encoding algorithm is not supported or key specification is invalid */ - public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) + static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) throws IOException { if (TextUtils.isEmpty(signedData) || TextUtils.isEmpty(base64PublicKey) @@ -66,7 +66,7 @@ public class Security { * @param encodedPublicKey Base64-encoded public key * @throws IOException if encoding algorithm is not supported or key specification is invalid */ - public static PublicKey generatePublicKey(String encodedPublicKey) throws IOException { + private static PublicKey generatePublicKey(String encodedPublicKey) throws IOException { try { byte[] decodedKey = Base64.decode(encodedPublicKey, Base64.DEFAULT); KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM); @@ -90,7 +90,7 @@ public class Security { * @param signature server signature * @return true if the data and signature match */ - public static boolean verify(PublicKey publicKey, String signedData, String signature) { + private static boolean verify(PublicKey publicKey, String signedData, String signature) { byte[] signatureBytes; try { signatureBytes = Base64.decode(signature, Base64.DEFAULT); diff --git a/app/src/googleplay/java/org/tasks/billing/SignatureVerifier.java b/app/src/googleplay/java/org/tasks/billing/SignatureVerifier.java index 809f5e1b2..fa1e399ab 100644 --- a/app/src/googleplay/java/org/tasks/billing/SignatureVerifier.java +++ b/app/src/googleplay/java/org/tasks/billing/SignatureVerifier.java @@ -7,16 +7,16 @@ import org.tasks.R; import org.tasks.injection.ForApplication; import timber.log.Timber; -public class SignatureVerifier { +class SignatureVerifier { private final String billingKey; @Inject - public SignatureVerifier(@ForApplication Context context) { + SignatureVerifier(@ForApplication Context context) { billingKey = context.getString(R.string.gp_key); } - public boolean verifySignature(Purchase purchase) { + boolean verifySignature(Purchase purchase) { try { return Security.verifyPurchase( billingKey, purchase.getOriginalJson(), purchase.getSignature()); diff --git a/app/src/googleplay/java/org/tasks/gtasks/PlayServices.java b/app/src/googleplay/java/org/tasks/gtasks/PlayServices.java index 0257c7268..b3c354370 100644 --- a/app/src/googleplay/java/org/tasks/gtasks/PlayServices.java +++ b/app/src/googleplay/java/org/tasks/gtasks/PlayServices.java @@ -90,7 +90,7 @@ public class PlayServices { } } - public String getStatus() { + private String getStatus() { return GoogleApiAvailability.getInstance().getErrorString(getResult()); } diff --git a/app/src/googleplay/java/org/tasks/injection/LocationModule.java b/app/src/googleplay/java/org/tasks/injection/LocationModule.java index 7b709b999..715e6c87f 100644 --- a/app/src/googleplay/java/org/tasks/injection/LocationModule.java +++ b/app/src/googleplay/java/org/tasks/injection/LocationModule.java @@ -14,11 +14,11 @@ import org.tasks.location.PlaceSearchProvider; import org.tasks.preferences.Preferences; @Module -public class LocationModule { +class LocationModule { @Provides @ActivityScope - public PlaceSearchProvider getPlaceSearchProvider( + PlaceSearchProvider getPlaceSearchProvider( @ForApplication Context context, Preferences preferences, PlayServices playServices, @@ -32,7 +32,7 @@ public class LocationModule { @Provides @ActivityScope - public MapFragment getMapFragment(@ForApplication Context context, Preferences preferences) { + MapFragment getMapFragment(@ForApplication Context context, Preferences preferences) { return preferences.useGoogleMaps() ? new GoogleMapFragment(context) : new MapboxMapFragment(context); diff --git a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java index 6ded42630..ac9dd859b 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java +++ b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java @@ -104,7 +104,7 @@ public class MainActivity extends InjectingAppCompatActivity private Filter filter; private ActionMode actionMode = null; - TaskListActivityBinding binding; + private TaskListActivityBinding binding; /** @see android.app.Activity#onCreate(Bundle) */ @Override diff --git a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java index 866172d66..831526c23 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java +++ b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.java @@ -144,7 +144,7 @@ public final class TaskListFragment extends InjectingFragment private static final int SEARCH_DEBOUNCE_TIMEOUT = 300; private final RefreshReceiver refreshReceiver = new RefreshReceiver(); - protected CompositeDisposable disposables; + private CompositeDisposable disposables; @Inject SyncAdapters syncAdapters; @Inject TaskDeleter taskDeleter; @Inject @ForActivity Context context; @@ -536,7 +536,7 @@ public final class TaskListFragment extends InjectingFragment return makeSnackbar(getString(res, args)); } - public Snackbar makeSnackbar(String text) { + private Snackbar makeSnackbar(String text) { Snackbar snackbar = Snackbar.make(coordinatorLayout, text, 8000) .setTextColor(getColor(context, R.color.snackbar_text_color)) diff --git a/app/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java b/app/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java index 0ff8c9c04..665b026fa 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java +++ b/app/src/main/java/com/todoroo/astrid/adapter/FilterAdapter.java @@ -141,7 +141,7 @@ public class FilterAdapter extends BaseAdapter { return convertView; } - public ArrayList getItems() { + private ArrayList getItems() { assertMainThread(); return newArrayList(items); } diff --git a/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapter.java b/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapter.java index c9180c2f7..022f7d984 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapter.java +++ b/app/src/main/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapter.java @@ -9,8 +9,8 @@ import org.tasks.tasklist.ViewHolder; public class GoogleTaskManualSortAdapter extends TaskAdapter { - protected final TaskDao taskDao; - protected final GoogleTaskDao googleTaskDao; + final TaskDao taskDao; + final GoogleTaskDao googleTaskDao; GoogleTaskManualSortAdapter(TaskDao taskDao, GoogleTaskDao googleTaskDao) { this.taskDao = taskDao; diff --git a/app/src/main/java/com/todoroo/astrid/adapter/SubheaderViewHolder.java b/app/src/main/java/com/todoroo/astrid/adapter/SubheaderViewHolder.java index 7580a3560..b12068d9d 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/SubheaderViewHolder.java +++ b/app/src/main/java/com/todoroo/astrid/adapter/SubheaderViewHolder.java @@ -19,7 +19,7 @@ import org.tasks.preferences.Preferences; import org.tasks.preferences.SyncPreferences; import org.tasks.themes.DrawableUtil; -public class SubheaderViewHolder extends RecyclerView.ViewHolder { +class SubheaderViewHolder extends RecyclerView.ViewHolder { private final Preferences preferences; private final GoogleTaskDao googleTaskDao; diff --git a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java index ab9ef503d..bb4ef3584 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapter.java @@ -28,7 +28,7 @@ public class TaskAdapter { private final Set selected = new HashSet<>(); private TaskListRecyclerAdapter helper; - public int getCount() { + int getCount() { return helper.getItemCount(); } @@ -96,7 +96,7 @@ public class TaskAdapter { public void moved(int from, int to, int indent) {} - public TaskContainer getTask(int position) { + TaskContainer getTask(int position) { return helper.getItem(position); } diff --git a/app/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java b/app/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java index df2adfeab..33d44a19f 100644 --- a/app/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java +++ b/app/src/main/java/com/todoroo/astrid/core/CustomFilterActivity.java @@ -69,7 +69,7 @@ public class CustomFilterActivity extends ThemedInjectingAppCompatActivity @Inject FilterCriteriaProvider filterCriteriaProvider; @Inject Locale locale; - CustomFilterActivityBinding binding; + private CustomFilterActivityBinding binding; private ListView listView; private CustomFilterAdapter adapter; diff --git a/app/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java b/app/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java index 9b5aadeb1..94c4c2a5e 100644 --- a/app/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java +++ b/app/src/main/java/com/todoroo/astrid/core/CustomFilterAdapter.java @@ -61,7 +61,7 @@ class CustomFilterAdapter extends ArrayAdapter { // --- view event handling - public CustomFilterAdapter( + CustomFilterAdapter( CustomFilterActivity activity, DialogBuilder dialogBuilder, List objects, @@ -73,7 +73,7 @@ class CustomFilterAdapter extends ArrayAdapter { inflater = activity.getLayoutInflater(); } - public void onCreateContextMenu(ContextMenu menu, View v) { + void onCreateContextMenu(ContextMenu menu, View v) { // view holder ViewHolder viewHolder = (ViewHolder) v.getTag(); if (viewHolder == null || viewHolder.item.type == CriterionInstance.TYPE_UNIVERSE) { @@ -115,7 +115,7 @@ class CustomFilterAdapter extends ArrayAdapter { } /** Show options menu for the given criterioninstance */ - public void showOptionsFor(final CriterionInstance item, final Runnable onComplete) { + void showOptionsFor(final CriterionInstance item, final Runnable onComplete) { AlertDialogBuilder dialog = dialogBuilder.newDialog(item.criterion.name); if (item.criterion instanceof MultipleSelectCriterion) { diff --git a/app/src/main/java/com/todoroo/astrid/gtasks/api/HttpNotFoundException.java b/app/src/main/java/com/todoroo/astrid/gtasks/api/HttpNotFoundException.java index 5441772de..90b5967d3 100644 --- a/app/src/main/java/com/todoroo/astrid/gtasks/api/HttpNotFoundException.java +++ b/app/src/main/java/com/todoroo/astrid/gtasks/api/HttpNotFoundException.java @@ -5,7 +5,7 @@ import java.io.IOException; public class HttpNotFoundException extends IOException { - public HttpNotFoundException(HttpResponseException e) { + HttpNotFoundException(HttpResponseException e) { super(e.getMessage()); } } diff --git a/app/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java b/app/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java index 06c6ebe46..1b929ca65 100644 --- a/app/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java +++ b/app/src/main/java/com/todoroo/astrid/ui/ReminderControlSet.java @@ -138,7 +138,7 @@ public class ReminderControlSet extends TaskEditControlFragment { } } - void addAlarm(String selected) { + private void addAlarm(String selected) { if (selected.equals(getString(R.string.when_due))) { addDue(); } else if (selected.equals(getString(R.string.when_overdue))) { diff --git a/app/src/main/java/com/todoroo/astrid/voice/AACRecorder.java b/app/src/main/java/com/todoroo/astrid/voice/AACRecorder.java index 9db84b952..c9ae46a51 100644 --- a/app/src/main/java/com/todoroo/astrid/voice/AACRecorder.java +++ b/app/src/main/java/com/todoroo/astrid/voice/AACRecorder.java @@ -11,6 +11,7 @@ import org.tasks.preferences.Preferences; import org.tasks.time.DateTime; import timber.log.Timber; +@SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public class AACRecorder extends ViewModel { private MediaRecorder mediaRecorder; diff --git a/app/src/main/java/org/tasks/caldav/BaseCaldavAccountSettingsActivity.java b/app/src/main/java/org/tasks/caldav/BaseCaldavAccountSettingsActivity.java index 467a8eb57..d77bba3be 100644 --- a/app/src/main/java/org/tasks/caldav/BaseCaldavAccountSettingsActivity.java +++ b/app/src/main/java/org/tasks/caldav/BaseCaldavAccountSettingsActivity.java @@ -185,7 +185,7 @@ public abstract class BaseCaldavAccountSettingsActivity extends ThemedInjectingA return binding.user.getText().toString().trim(); } - protected boolean passwordChanged() { + boolean passwordChanged() { return caldavAccount == null || !PASSWORD_MASK.equals(binding.password.getText().toString().trim()); } diff --git a/app/src/main/java/org/tasks/caldav/CaldavAccountSettingsActivity.java b/app/src/main/java/org/tasks/caldav/CaldavAccountSettingsActivity.java index 060797827..f4e10183d 100644 --- a/app/src/main/java/org/tasks/caldav/CaldavAccountSettingsActivity.java +++ b/app/src/main/java/org/tasks/caldav/CaldavAccountSettingsActivity.java @@ -57,7 +57,7 @@ public class CaldavAccountSettingsActivity extends BaseCaldavAccountSettingsActi finish(); } - protected void updateAccount(String principal) { + private void updateAccount(String principal) { hideProgressIndicator(); caldavAccount.setName(getNewName()); diff --git a/app/src/main/java/org/tasks/caldav/ResponseList.java b/app/src/main/java/org/tasks/caldav/ResponseList.java index 0625fd141..ab3c093b8 100644 --- a/app/src/main/java/org/tasks/caldav/ResponseList.java +++ b/app/src/main/java/org/tasks/caldav/ResponseList.java @@ -6,16 +6,16 @@ import java.util.ArrayList; import kotlin.Unit; import kotlin.jvm.functions.Function2; -public class ResponseList extends ArrayList +class ResponseList extends ArrayList implements Function2 { private final HrefRelation filter; - public ResponseList() { + ResponseList() { this(null); } - public ResponseList(HrefRelation filter) { + ResponseList(HrefRelation filter) { this.filter = filter; } diff --git a/app/src/main/java/org/tasks/calendars/CalendarEventAttendeeProvider.java b/app/src/main/java/org/tasks/calendars/CalendarEventAttendeeProvider.java index 4dbe25012..414832cb4 100644 --- a/app/src/main/java/org/tasks/calendars/CalendarEventAttendeeProvider.java +++ b/app/src/main/java/org/tasks/calendars/CalendarEventAttendeeProvider.java @@ -12,7 +12,7 @@ import org.tasks.injection.ForApplication; import org.tasks.preferences.PermissionChecker; import timber.log.Timber; -public class CalendarEventAttendeeProvider { +class CalendarEventAttendeeProvider { private static final String[] COLUMNS = { CalendarContract.Attendees.ATTENDEE_NAME, CalendarContract.Attendees.ATTENDEE_EMAIL, diff --git a/app/src/main/java/org/tasks/data/CaldavAccount.java b/app/src/main/java/org/tasks/data/CaldavAccount.java index 540f5d9e5..957ad8156 100644 --- a/app/src/main/java/org/tasks/data/CaldavAccount.java +++ b/app/src/main/java/org/tasks/data/CaldavAccount.java @@ -14,7 +14,7 @@ import org.tasks.security.Encryption; @Entity(tableName = "caldav_accounts") public class CaldavAccount implements Parcelable { - public static final int TYPE_CALDAV = 0; + private static final int TYPE_CALDAV = 0; public static final int TYPE_ETESYNC = 1; public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { diff --git a/app/src/main/java/org/tasks/data/Geofence.java b/app/src/main/java/org/tasks/data/Geofence.java index 79c7bdaeb..cd9c3dbae 100644 --- a/app/src/main/java/org/tasks/data/Geofence.java +++ b/app/src/main/java/org/tasks/data/Geofence.java @@ -19,11 +19,11 @@ import org.tasks.preferences.Preferences; @Entity(tableName = TABLE_NAME, indices = @Index(name = "geo_task", value = "task")) public class Geofence implements Serializable, Parcelable { - public static final String TABLE_NAME = "geofences"; + static final String TABLE_NAME = "geofences"; public static final Table TABLE = new Table(TABLE_NAME); public static final LongProperty TASK = new LongProperty(TABLE, "task"); - public static final StringProperty PLACE = new StringProperty(TABLE, "place"); + static final StringProperty PLACE = new StringProperty(TABLE, "place"); public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { diff --git a/app/src/main/java/org/tasks/data/GoogleTaskDao.java b/app/src/main/java/org/tasks/data/GoogleTaskDao.java index 9c349af26..ca6111f70 100644 --- a/app/src/main/java/org/tasks/data/GoogleTaskDao.java +++ b/app/src/main/java/org/tasks/data/GoogleTaskDao.java @@ -76,7 +76,7 @@ public abstract class GoogleTaskDao { @Update public abstract void update(GoogleTask googleTask); - public void update(SubsetGoogleTask googleTask) { + private void update(SubsetGoogleTask googleTask) { update(googleTask.getId(), googleTask.getParent(), googleTask.getOrder()); } diff --git a/app/src/main/java/org/tasks/data/Location.java b/app/src/main/java/org/tasks/data/Location.java index d6f32221c..3b6ebd9ef 100644 --- a/app/src/main/java/org/tasks/data/Location.java +++ b/app/src/main/java/org/tasks/data/Location.java @@ -35,7 +35,7 @@ public class Location implements Serializable, Parcelable { } @Ignore - protected Location(Parcel in) { + private Location(Parcel in) { geofence = in.readParcelable(Geofence.class.getClassLoader()); place = in.readParcelable(Place.class.getClassLoader()); } diff --git a/app/src/main/java/org/tasks/data/Place.java b/app/src/main/java/org/tasks/data/Place.java index 458729564..817584391 100644 --- a/app/src/main/java/org/tasks/data/Place.java +++ b/app/src/main/java/org/tasks/data/Place.java @@ -36,7 +36,7 @@ import org.tasks.themes.CustomIcons; public class Place implements Serializable, Parcelable { public static final String KEY = "place"; - public static final String TABLE_NAME = "places"; + static final String TABLE_NAME = "places"; public static final Table TABLE = new Table(TABLE_NAME); public static final StringProperty UID = new StringProperty(TABLE, "uid"); diff --git a/app/src/main/java/org/tasks/db/DbUtils.java b/app/src/main/java/org/tasks/db/DbUtils.java index a81a6da50..9c9ceeecd 100644 --- a/app/src/main/java/org/tasks/db/DbUtils.java +++ b/app/src/main/java/org/tasks/db/DbUtils.java @@ -31,7 +31,7 @@ public class DbUtils { batch(items, MAX_SQLITE_ARGS, callback); } - public static void batch(List items, int size, Callback> callback) { + private static void batch(List items, int size, Callback> callback) { if (items.isEmpty()) { return; } diff --git a/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt b/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt index fa15055b7..829dc7e67 100644 --- a/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt +++ b/app/src/main/java/org/tasks/dialogs/ColorPalettePicker.kt @@ -73,7 +73,7 @@ class ColorPalettePicker : InjectingDialogFragment() { @BindView(R.id.icons) lateinit var recyclerView: RecyclerView private lateinit var colors: List - lateinit var palette: Palette + private lateinit var palette: Palette var callback: ColorPickedCallback? = null override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { diff --git a/app/src/main/java/org/tasks/dialogs/IconPickerAdapter.java b/app/src/main/java/org/tasks/dialogs/IconPickerAdapter.java index 3c77c6a80..6ee2a000e 100644 --- a/app/src/main/java/org/tasks/dialogs/IconPickerAdapter.java +++ b/app/src/main/java/org/tasks/dialogs/IconPickerAdapter.java @@ -14,14 +14,14 @@ import org.tasks.R; import org.tasks.billing.Inventory; import org.tasks.themes.CustomIcons; -public class IconPickerAdapter extends ListAdapter { +class IconPickerAdapter extends ListAdapter { private final Activity activity; private final Inventory inventory; private final int current; private final Callback onSelected; - public IconPickerAdapter( + IconPickerAdapter( Activity activity, Inventory inventory, int current, Callback onSelected) { super(new DiffCallback()); this.activity = activity; diff --git a/app/src/main/java/org/tasks/drive/DriveLoginActivity.java b/app/src/main/java/org/tasks/drive/DriveLoginActivity.java index 3d9d13429..d7096e0bf 100644 --- a/app/src/main/java/org/tasks/drive/DriveLoginActivity.java +++ b/app/src/main/java/org/tasks/drive/DriveLoginActivity.java @@ -27,7 +27,7 @@ import org.tasks.preferences.Preferences; */ public class DriveLoginActivity extends InjectingAppCompatActivity { - public static final String EXTRA_ERROR = "extra_error"; + private static final String EXTRA_ERROR = "extra_error"; private static final int RC_CHOOSE_ACCOUNT = 10988; @Inject DialogBuilder dialogBuilder; @Inject GoogleAccountManager googleAccountManager; diff --git a/app/src/main/java/org/tasks/etesync/CreateUserInfoViewModel.java b/app/src/main/java/org/tasks/etesync/CreateUserInfoViewModel.java index ea9dd89b3..d4f390b67 100644 --- a/app/src/main/java/org/tasks/etesync/CreateUserInfoViewModel.java +++ b/app/src/main/java/org/tasks/etesync/CreateUserInfoViewModel.java @@ -3,6 +3,7 @@ package org.tasks.etesync; import org.tasks.data.CaldavAccount; import org.tasks.ui.CompletableViewModel; +@SuppressWarnings("WeakerAccess") public class CreateUserInfoViewModel extends CompletableViewModel { void createUserInfo(EteSyncClient client, CaldavAccount caldavAccount, String derivedKey) { diff --git a/app/src/main/java/org/tasks/etesync/EncryptionSettingsActivity.java b/app/src/main/java/org/tasks/etesync/EncryptionSettingsActivity.java index 757f815c4..8b71652b7 100644 --- a/app/src/main/java/org/tasks/etesync/EncryptionSettingsActivity.java +++ b/app/src/main/java/org/tasks/etesync/EncryptionSettingsActivity.java @@ -42,10 +42,10 @@ public class EncryptionSettingsActivity extends ThemedInjectingAppCompatActivity @Inject EteSyncClient client; @Inject Encryption encryption; - ActivityEtesyncEncryptionSettingsBinding binding; + private ActivityEtesyncEncryptionSettingsBinding binding; private UserInfo userInfo; private CaldavAccount caldavAccount; - CreateUserInfoViewModel createUserInfoViewModel; + private CreateUserInfoViewModel createUserInfoViewModel; @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/java/org/tasks/filters/CaldavFilters.java b/app/src/main/java/org/tasks/filters/CaldavFilters.java index a0fb0d899..ca6da3fc1 100644 --- a/app/src/main/java/org/tasks/filters/CaldavFilters.java +++ b/app/src/main/java/org/tasks/filters/CaldavFilters.java @@ -8,7 +8,7 @@ public class CaldavFilters { @Embedded public CaldavCalendar caldavCalendar; public int count; - public CaldavFilter toCaldavFilter() { + CaldavFilter toCaldavFilter() { CaldavFilter filter = new CaldavFilter(caldavCalendar); filter.count = count; return filter; diff --git a/app/src/main/java/org/tasks/filters/GoogleTaskFilters.java b/app/src/main/java/org/tasks/filters/GoogleTaskFilters.java index 33d818aaa..72067828a 100644 --- a/app/src/main/java/org/tasks/filters/GoogleTaskFilters.java +++ b/app/src/main/java/org/tasks/filters/GoogleTaskFilters.java @@ -8,7 +8,7 @@ public class GoogleTaskFilters { @Embedded public GoogleTaskList googleTaskList; public int count; - public GtasksFilter toGtasksFilter() { + GtasksFilter toGtasksFilter() { GtasksFilter filter = new GtasksFilter(googleTaskList); filter.count = count; return filter; diff --git a/app/src/main/java/org/tasks/filters/LocationFilters.java b/app/src/main/java/org/tasks/filters/LocationFilters.java index 08cd286ae..dc68b1298 100644 --- a/app/src/main/java/org/tasks/filters/LocationFilters.java +++ b/app/src/main/java/org/tasks/filters/LocationFilters.java @@ -7,7 +7,7 @@ public class LocationFilters { @Embedded public Place place; public int count; - public PlaceFilter toLocationFilter() { + PlaceFilter toLocationFilter() { PlaceFilter filter = new PlaceFilter(place); filter.count = count; return filter; diff --git a/app/src/main/java/org/tasks/filters/TagFilters.java b/app/src/main/java/org/tasks/filters/TagFilters.java index 66c9f65d9..f440aaa42 100644 --- a/app/src/main/java/org/tasks/filters/TagFilters.java +++ b/app/src/main/java/org/tasks/filters/TagFilters.java @@ -8,7 +8,7 @@ public class TagFilters { @Embedded public TagData tagData; public int count; - public TagFilter toTagFilter() { + TagFilter toTagFilter() { TagFilter filter = new TagFilter(tagData); filter.count = count; return filter; diff --git a/app/src/main/java/org/tasks/injection/ActivityModule.java b/app/src/main/java/org/tasks/injection/ActivityModule.java index 3f707a811..b2318c0b4 100644 --- a/app/src/main/java/org/tasks/injection/ActivityModule.java +++ b/app/src/main/java/org/tasks/injection/ActivityModule.java @@ -13,7 +13,7 @@ import org.tasks.themes.ThemeBase; import org.tasks.themes.ThemeColor; @Module -public class ActivityModule { +class ActivityModule { private final Activity activity; @@ -28,13 +28,13 @@ public class ActivityModule { @Provides @ForActivity - public Context getActivityContext() { + Context getActivityContext() { return activity; } @Provides @ActivityScope - public ThemeBase getThemeBase(Preferences preferences, Inventory inventory) { + ThemeBase getThemeBase(Preferences preferences, Inventory inventory) { return ThemeBase.getThemeBase(preferences, inventory, activity.getIntent()); } @@ -46,7 +46,7 @@ public class ActivityModule { @Provides @ActivityScope - public ThemeAccent getThemeAccent(ColorProvider colorProvider, Preferences preferences) { + ThemeAccent getThemeAccent(ColorProvider colorProvider, Preferences preferences) { return colorProvider.getThemeAccent(preferences.getInt(R.string.p_theme_accent, 1)); } } diff --git a/app/src/main/java/org/tasks/injection/ApplicationModule.java b/app/src/main/java/org/tasks/injection/ApplicationModule.java index ab83eea2c..e2bfadb18 100644 --- a/app/src/main/java/org/tasks/injection/ApplicationModule.java +++ b/app/src/main/java/org/tasks/injection/ApplicationModule.java @@ -33,7 +33,7 @@ import org.tasks.security.KeyStoreEncryption; import org.tasks.security.NoEncryption; @Module -public class ApplicationModule { +class ApplicationModule { private final Context context; @@ -54,79 +54,79 @@ public class ApplicationModule { @Provides @ApplicationScope - public NotificationDao getNotificationDao(Database database) { + NotificationDao getNotificationDao(Database database) { return database.notificationDao(); } @Provides @ApplicationScope - public TagDataDao getTagDataDao(Database database) { + TagDataDao getTagDataDao(Database database) { return database.getTagDataDao(); } @Provides @ApplicationScope - public UserActivityDao getUserActivityDao(Database database) { + UserActivityDao getUserActivityDao(Database database) { return database.getUserActivityDao(); } @Provides @ApplicationScope - public TaskAttachmentDao getTaskAttachmentDao(Database database) { + TaskAttachmentDao getTaskAttachmentDao(Database database) { return database.getTaskAttachmentDao(); } @Provides @ApplicationScope - public TaskListMetadataDao getTaskListMetadataDao(Database database) { + TaskListMetadataDao getTaskListMetadataDao(Database database) { return database.getTaskListMetadataDao(); } @Provides @ApplicationScope - public GoogleTaskDao getGoogleTaskDao(Database database) { + GoogleTaskDao getGoogleTaskDao(Database database) { return database.getGoogleTaskDao(); } @Provides @ApplicationScope - public AlarmDao getAlarmDao(Database database) { + AlarmDao getAlarmDao(Database database) { return database.getAlarmDao(); } @Provides @ApplicationScope - public LocationDao getGeofenceDao(Database database) { + LocationDao getGeofenceDao(Database database) { return database.getLocationDao(); } @Provides @ApplicationScope - public TagDao getTagDao(Database database) { + TagDao getTagDao(Database database) { return database.getTagDao(); } @Provides @ApplicationScope - public FilterDao getFilterDao(Database database) { + FilterDao getFilterDao(Database database) { return database.getFilterDao(); } @Provides @ApplicationScope - public GoogleTaskListDao getGoogleTaskListDao(Database database) { + GoogleTaskListDao getGoogleTaskListDao(Database database) { return database.getGoogleTaskListDao(); } @Provides @ApplicationScope - public CaldavDao getCaldavDao(Database database) { + CaldavDao getCaldavDao(Database database) { return database.getCaldavDao(); } @Provides @ApplicationScope - public TaskDao getTaskDao(Database database, WorkManager workManager) { + TaskDao getTaskDao(Database database, WorkManager workManager) { TaskDao taskDao = database.getTaskDao(); taskDao.initialize(workManager); return taskDao; @@ -134,7 +134,7 @@ public class ApplicationModule { @Provides @ApplicationScope - public DeletionDao getDeletionDao(Database database) { + DeletionDao getDeletionDao(Database database) { return database.getDeletionDao(); } @@ -145,12 +145,12 @@ public class ApplicationModule { } @Provides - public BillingClient getBillingClient(Inventory inventory, Tracker tracker) { + BillingClient getBillingClient(Inventory inventory, Tracker tracker) { return new BillingClientImpl(context, inventory, tracker); } @Provides - public Geocoder getGeocoder(@ForApplication Context context) { + Geocoder getGeocoder(@ForApplication Context context) { return new MapboxGeocoder(context); } } diff --git a/app/src/main/java/org/tasks/injection/BroadcastModule.java b/app/src/main/java/org/tasks/injection/BroadcastModule.java index 96931bffb..88dad017a 100644 --- a/app/src/main/java/org/tasks/injection/BroadcastModule.java +++ b/app/src/main/java/org/tasks/injection/BroadcastModule.java @@ -3,4 +3,4 @@ package org.tasks.injection; import dagger.Module; @Module -public class BroadcastModule {} +class BroadcastModule {} diff --git a/app/src/main/java/org/tasks/injection/ContentProviderModule.java b/app/src/main/java/org/tasks/injection/ContentProviderModule.java index 20355a3e7..1c30b9e42 100644 --- a/app/src/main/java/org/tasks/injection/ContentProviderModule.java +++ b/app/src/main/java/org/tasks/injection/ContentProviderModule.java @@ -3,4 +3,4 @@ package org.tasks.injection; import dagger.Module; @Module(includes = ProductionModule.class) -public class ContentProviderModule {} +class ContentProviderModule {} diff --git a/app/src/main/java/org/tasks/injection/DialogFragmentModule.java b/app/src/main/java/org/tasks/injection/DialogFragmentModule.java index a609cb006..32765b946 100644 --- a/app/src/main/java/org/tasks/injection/DialogFragmentModule.java +++ b/app/src/main/java/org/tasks/injection/DialogFragmentModule.java @@ -6,11 +6,11 @@ import dagger.Module; import dagger.Provides; @Module -public class DialogFragmentModule { +class DialogFragmentModule { private final DialogFragment dialogFragment; - public DialogFragmentModule(DialogFragment dialogFragment) { + DialogFragmentModule(DialogFragment dialogFragment) { this.dialogFragment = dialogFragment; } diff --git a/app/src/main/java/org/tasks/injection/ProductionModule.java b/app/src/main/java/org/tasks/injection/ProductionModule.java index b299ff32f..bccaa58d6 100644 --- a/app/src/main/java/org/tasks/injection/ProductionModule.java +++ b/app/src/main/java/org/tasks/injection/ProductionModule.java @@ -9,10 +9,10 @@ import org.tasks.db.Migrations; import org.tasks.preferences.Preferences; @Module(includes = ApplicationModule.class) -public class ProductionModule { +class ProductionModule { @Provides @ApplicationScope - public Database getAppDatabase(@ForApplication Context context) { + Database getAppDatabase(@ForApplication Context context) { return Room.databaseBuilder(context, Database.class, Database.NAME) .allowMainThreadQueries() // TODO: remove me .addMigrations(Migrations.MIGRATIONS) @@ -20,7 +20,7 @@ public class ProductionModule { } @Provides - public Preferences getPreferences(@ForApplication Context context) { + Preferences getPreferences(@ForApplication Context context) { return new Preferences(context); } } diff --git a/app/src/main/java/org/tasks/injection/ServiceModule.java b/app/src/main/java/org/tasks/injection/ServiceModule.java index abbc6a28a..220c3e185 100644 --- a/app/src/main/java/org/tasks/injection/ServiceModule.java +++ b/app/src/main/java/org/tasks/injection/ServiceModule.java @@ -3,4 +3,4 @@ package org.tasks.injection; import dagger.Module; @Module -public class ServiceModule {} +class ServiceModule {} diff --git a/app/src/main/java/org/tasks/injection/WorkModule.java b/app/src/main/java/org/tasks/injection/WorkModule.java index 724f562b9..3c69da02b 100644 --- a/app/src/main/java/org/tasks/injection/WorkModule.java +++ b/app/src/main/java/org/tasks/injection/WorkModule.java @@ -3,4 +3,4 @@ package org.tasks.injection; import dagger.Module; @Module -public class WorkModule {} +class WorkModule {} diff --git a/app/src/main/java/org/tasks/jobs/BackupWork.java b/app/src/main/java/org/tasks/jobs/BackupWork.java index 4a485c765..6b2665b23 100644 --- a/app/src/main/java/org/tasks/jobs/BackupWork.java +++ b/app/src/main/java/org/tasks/jobs/BackupWork.java @@ -30,9 +30,9 @@ import timber.log.Timber; public class BackupWork extends RepeatingWorker { - public static final int DAYS_TO_KEEP_BACKUP = 7; + static final int DAYS_TO_KEEP_BACKUP = 7; static final String BACKUP_FILE_NAME_REGEX = "auto\\.[-\\d]+\\.json"; - static final Predicate FILENAME_FILTER = f -> f.matches(BACKUP_FILE_NAME_REGEX); + private static final Predicate FILENAME_FILTER = f -> f.matches(BACKUP_FILE_NAME_REGEX); static final FileFilter FILE_FILTER = f -> FILENAME_FILTER.apply(f.getName()); private static final Comparator BY_LAST_MODIFIED = (f1, f2) -> Long.compare(f2.lastModified(), f1.lastModified()); @@ -86,7 +86,7 @@ public class BackupWork extends RepeatingWorker { component.inject(this); } - void startBackup(Context context) { + private void startBackup(Context context) { try { deleteOldLocalBackups(); } catch (Exception e) { diff --git a/app/src/main/java/org/tasks/jobs/NotificationQueueEntry.java b/app/src/main/java/org/tasks/jobs/NotificationQueueEntry.java index 6660cbbcc..17bf9b444 100644 --- a/app/src/main/java/org/tasks/jobs/NotificationQueueEntry.java +++ b/app/src/main/java/org/tasks/jobs/NotificationQueueEntry.java @@ -2,7 +2,7 @@ package org.tasks.jobs; import org.tasks.notifications.Notification; -public interface NotificationQueueEntry { +interface NotificationQueueEntry { long getId(); diff --git a/app/src/main/java/org/tasks/jobs/RepeatingWorker.java b/app/src/main/java/org/tasks/jobs/RepeatingWorker.java index ed0d19c08..285d94c23 100644 --- a/app/src/main/java/org/tasks/jobs/RepeatingWorker.java +++ b/app/src/main/java/org/tasks/jobs/RepeatingWorker.java @@ -7,7 +7,7 @@ import org.tasks.injection.InjectingWorker; public abstract class RepeatingWorker extends InjectingWorker { - public RepeatingWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) { + RepeatingWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) { super(context, workerParams); } diff --git a/app/src/main/java/org/tasks/locale/receiver/TaskerTaskCreator.java b/app/src/main/java/org/tasks/locale/receiver/TaskerTaskCreator.java index 0e536e681..1f7882b52 100644 --- a/app/src/main/java/org/tasks/locale/receiver/TaskerTaskCreator.java +++ b/app/src/main/java/org/tasks/locale/receiver/TaskerTaskCreator.java @@ -15,7 +15,7 @@ import org.threeten.bp.LocalTime; import org.threeten.bp.format.DateTimeFormatter; import timber.log.Timber; -public class TaskerTaskCreator { +class TaskerTaskCreator { private static final DateTimeFormatter dateFormatter = DateTimeFormatter.ISO_LOCAL_DATE; private static final DateTimeFormatter timeFormatter = DateTimeFormatter.ISO_LOCAL_TIME; @@ -24,7 +24,7 @@ public class TaskerTaskCreator { private final TaskDao taskDao; @Inject - public TaskerTaskCreator(TaskCreator taskCreator, TaskDao taskDao) { + TaskerTaskCreator(TaskCreator taskCreator, TaskDao taskDao) { this.taskCreator = taskCreator; this.taskDao = taskDao; } diff --git a/app/src/main/java/org/tasks/locale/ui/activity/TaskerCreateTaskActivity.java b/app/src/main/java/org/tasks/locale/ui/activity/TaskerCreateTaskActivity.java index 2ec25a36f..13028552b 100755 --- a/app/src/main/java/org/tasks/locale/ui/activity/TaskerCreateTaskActivity.java +++ b/app/src/main/java/org/tasks/locale/ui/activity/TaskerCreateTaskActivity.java @@ -22,7 +22,7 @@ public final class TaskerCreateTaskActivity extends AbstractFragmentPluginAppCom @Inject Inventory inventory; @Inject LocalBroadcastManager localBroadcastManager; - ActivityTaskerCreateBinding binding; + private ActivityTaskerCreateBinding binding; private Bundle previousBundle; diff --git a/app/src/main/java/org/tasks/location/LocationPickerAdapter.java b/app/src/main/java/org/tasks/location/LocationPickerAdapter.java index 9aba7a07b..5116e8eba 100644 --- a/app/src/main/java/org/tasks/location/LocationPickerAdapter.java +++ b/app/src/main/java/org/tasks/location/LocationPickerAdapter.java @@ -106,7 +106,7 @@ public class LocationPickerAdapter extends ListAdapter onLocationPicked.settings(place)); } - public void bind(PlaceUsage placeUsage, int color, int icon) { + void bind(PlaceUsage placeUsage, int color, int icon) { place = placeUsage.place; String name = place.getDisplayName(); String address = place.getDisplayAddress(); @@ -124,7 +124,7 @@ public class LocationPickerAdapter extends ListAdapter { + static class DiffCallback extends ItemCallback { @Override public boolean areItemsTheSame(@NonNull PlaceUsage oldItem, @NonNull PlaceUsage newItem) { diff --git a/app/src/main/java/org/tasks/location/LocationSearchAdapter.java b/app/src/main/java/org/tasks/location/LocationSearchAdapter.java index cf447c1b4..0de5539bb 100644 --- a/app/src/main/java/org/tasks/location/LocationSearchAdapter.java +++ b/app/src/main/java/org/tasks/location/LocationSearchAdapter.java @@ -18,7 +18,7 @@ import com.google.common.base.Strings; import java.util.List; import org.tasks.R; -public class LocationSearchAdapter extends RecyclerView.Adapter +class LocationSearchAdapter extends RecyclerView.Adapter implements ListUpdateCallback { private final int attributionRes; @@ -98,7 +98,7 @@ public class LocationSearchAdapter extends RecyclerView.Adapter void picked(PlaceSearchResult prediction); } - public static class SearchViewHolder extends RecyclerView.ViewHolder { + static class SearchViewHolder extends RecyclerView.ViewHolder { private final TextView name; private final TextView address; private PlaceSearchResult prediction; @@ -111,7 +111,7 @@ public class LocationSearchAdapter extends RecyclerView.Adapter itemView.findViewById(R.id.place_icon).setVisibility(View.INVISIBLE); } - public void bind(PlaceSearchResult prediction) { + void bind(PlaceSearchResult prediction) { this.prediction = prediction; CharSequence name = prediction.getName(); CharSequence address = prediction.getAddress(); @@ -127,7 +127,7 @@ public class LocationSearchAdapter extends RecyclerView.Adapter } } - public static class FooterViewHolder extends RecyclerView.ViewHolder { + static class FooterViewHolder extends RecyclerView.ViewHolder { final View divider; @@ -143,7 +143,7 @@ public class LocationSearchAdapter extends RecyclerView.Adapter } } - public static class DiffCallback extends ItemCallback { + static class DiffCallback extends ItemCallback { @Override public boolean areItemsTheSame( diff --git a/app/src/main/java/org/tasks/location/MapPosition.java b/app/src/main/java/org/tasks/location/MapPosition.java index b2fcfe73b..ad155bd2c 100644 --- a/app/src/main/java/org/tasks/location/MapPosition.java +++ b/app/src/main/java/org/tasks/location/MapPosition.java @@ -31,7 +31,7 @@ public class MapPosition implements Parcelable { this.zoom = zoom; } - protected MapPosition(Parcel in) { + private MapPosition(Parcel in) { latitude = in.readDouble(); longitude = in.readDouble(); zoom = in.readFloat(); @@ -45,7 +45,7 @@ public class MapPosition implements Parcelable { return longitude; } - public float getZoom() { + float getZoom() { return zoom; } diff --git a/app/src/main/java/org/tasks/location/PlaceSearchResult.java b/app/src/main/java/org/tasks/location/PlaceSearchResult.java index 87259a142..7eb525c74 100644 --- a/app/src/main/java/org/tasks/location/PlaceSearchResult.java +++ b/app/src/main/java/org/tasks/location/PlaceSearchResult.java @@ -2,14 +2,13 @@ package org.tasks.location; import org.tasks.data.Place; -public class PlaceSearchResult { +class PlaceSearchResult { private final String id; private final String name; private final String address; private final Place place; - @SuppressWarnings("unused") PlaceSearchResult(String id, String name, String address) { this(id, name, address, null); } diff --git a/app/src/main/java/org/tasks/location/PlaceSearchViewModel.java b/app/src/main/java/org/tasks/location/PlaceSearchViewModel.java index eee885919..a2bce90d8 100644 --- a/app/src/main/java/org/tasks/location/PlaceSearchViewModel.java +++ b/app/src/main/java/org/tasks/location/PlaceSearchViewModel.java @@ -14,6 +14,7 @@ import java.util.List; import org.tasks.Event; import org.tasks.data.Place; +@SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public class PlaceSearchViewModel extends ViewModel { private PlaceSearchProvider searchProvider; diff --git a/app/src/main/java/org/tasks/notifications/Notification.java b/app/src/main/java/org/tasks/notifications/Notification.java index 4f0de9240..ff0c8ba58 100644 --- a/app/src/main/java/org/tasks/notifications/Notification.java +++ b/app/src/main/java/org/tasks/notifications/Notification.java @@ -12,7 +12,7 @@ import com.todoroo.andlib.data.Table; indices = {@Index(value = "task", unique = true)}) public class Notification { - public static final String TABLE_NAME = "notification"; + static final String TABLE_NAME = "notification"; public static final Table TABLE = new Table(TABLE_NAME); public static final LongProperty TASK = new LongProperty(TABLE, "task"); diff --git a/app/src/main/java/org/tasks/preferences/AttributionActivity.java b/app/src/main/java/org/tasks/preferences/AttributionActivity.java index 5efbb8026..57a35975e 100644 --- a/app/src/main/java/org/tasks/preferences/AttributionActivity.java +++ b/app/src/main/java/org/tasks/preferences/AttributionActivity.java @@ -80,7 +80,7 @@ public class AttributionActivity extends ThemedInjectingAppCompatActivity { component.inject(this); } - public static class AttributionList { + static class AttributionList { List libraries; } @@ -103,6 +103,7 @@ public class AttributionActivity extends ThemedInjectingAppCompatActivity { } } + @SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public static class ViewModel extends androidx.lifecycle.ViewModel { private final MutableLiveData> attributions = new MutableLiveData<>(); private final CompositeDisposable disposables = new CompositeDisposable(); diff --git a/app/src/main/java/org/tasks/preferences/AttributionSection.java b/app/src/main/java/org/tasks/preferences/AttributionSection.java index db97d9212..b2307b75a 100644 --- a/app/src/main/java/org/tasks/preferences/AttributionSection.java +++ b/app/src/main/java/org/tasks/preferences/AttributionSection.java @@ -23,7 +23,7 @@ import java.util.Map.Entry; import org.tasks.R; import org.tasks.preferences.AttributionActivity.LibraryAttribution; -public class AttributionSection extends StatelessSection { +class AttributionSection extends StatelessSection { private final String license; private final List> attributions; @@ -102,7 +102,7 @@ public class AttributionSection extends StatelessSection { ButterKnife.bind(this, itemView); } - public void bind(String copyrightHolder, String libraries) { + void bind(String copyrightHolder, String libraries) { this.copyrightHolder.setText(copyrightHolder); this.libraries.setText(libraries); } diff --git a/app/src/main/java/org/tasks/preferences/PermissionChecker.java b/app/src/main/java/org/tasks/preferences/PermissionChecker.java index 49c741bbc..4695dcc40 100644 --- a/app/src/main/java/org/tasks/preferences/PermissionChecker.java +++ b/app/src/main/java/org/tasks/preferences/PermissionChecker.java @@ -16,7 +16,7 @@ public class PermissionChecker { private final Context context; @Inject - public PermissionChecker(@ForApplication Context context) { + PermissionChecker(@ForApplication Context context) { this.context = context; } diff --git a/app/src/main/java/org/tasks/tags/TagDiffCallback.java b/app/src/main/java/org/tasks/tags/TagDiffCallback.java index 11085c588..4558f21d2 100644 --- a/app/src/main/java/org/tasks/tags/TagDiffCallback.java +++ b/app/src/main/java/org/tasks/tags/TagDiffCallback.java @@ -5,7 +5,7 @@ import androidx.recyclerview.widget.DiffUtil; import com.google.common.base.Objects; import org.tasks.data.TagData; -public class TagDiffCallback extends DiffUtil.ItemCallback { +class TagDiffCallback extends DiffUtil.ItemCallback { @Override public boolean areItemsTheSame(@NonNull TagData oldItem, @NonNull TagData newItem) { diff --git a/app/src/main/java/org/tasks/tags/TagPickerViewModel.java b/app/src/main/java/org/tasks/tags/TagPickerViewModel.java index e89605373..b9a148e40 100644 --- a/app/src/main/java/org/tasks/tags/TagPickerViewModel.java +++ b/app/src/main/java/org/tasks/tags/TagPickerViewModel.java @@ -22,6 +22,7 @@ import org.tasks.data.TagData; import org.tasks.data.TagDataDao; import org.tasks.tags.CheckBoxTriStates.State; +@SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public class TagPickerViewModel extends ViewModel { private final MutableLiveData> tags = new MutableLiveData<>(); @@ -48,7 +49,7 @@ public class TagPickerViewModel extends ViewModel { return newArrayList(selected); } - public ArrayList getPartiallySelected() { + ArrayList getPartiallySelected() { return newArrayList(partiallySelected); } @@ -84,7 +85,7 @@ public class TagPickerViewModel extends ViewModel { return selected.contains(tagData); } - public State getState(TagData tagData) { + State getState(TagData tagData) { if (partiallySelected.contains(tagData)) { return State.PARTIALLY_CHECKED; } diff --git a/app/src/main/java/org/tasks/tags/TagRecyclerAdapter.java b/app/src/main/java/org/tasks/tags/TagRecyclerAdapter.java index 6e2b3b78a..26a63c43d 100644 --- a/app/src/main/java/org/tasks/tags/TagRecyclerAdapter.java +++ b/app/src/main/java/org/tasks/tags/TagRecyclerAdapter.java @@ -19,7 +19,7 @@ import org.tasks.themes.ColorProvider; import org.tasks.themes.CustomIcons; import org.tasks.themes.ThemeColor; -public class TagRecyclerAdapter extends RecyclerView.Adapter { +class TagRecyclerAdapter extends RecyclerView.Adapter { private final AsyncListDiffer differ; private final Context context; diff --git a/app/src/main/java/org/tasks/tasklist/ItemCallback.java b/app/src/main/java/org/tasks/tasklist/ItemCallback.java index 03297217a..5cc90fe75 100644 --- a/app/src/main/java/org/tasks/tasklist/ItemCallback.java +++ b/app/src/main/java/org/tasks/tasklist/ItemCallback.java @@ -4,7 +4,7 @@ import androidx.annotation.NonNull; import androidx.recyclerview.widget.DiffUtil; import org.tasks.data.TaskContainer; -public class ItemCallback extends DiffUtil.ItemCallback { +class ItemCallback extends DiffUtil.ItemCallback { @Override public boolean areItemsTheSame(@NonNull TaskContainer oldItem, @NonNull TaskContainer newItem) { diff --git a/app/src/main/java/org/tasks/tasklist/SubtaskViewHolder.java b/app/src/main/java/org/tasks/tasklist/SubtaskViewHolder.java index 7f33ffe80..fc372a981 100644 --- a/app/src/main/java/org/tasks/tasklist/SubtaskViewHolder.java +++ b/app/src/main/java/org/tasks/tasklist/SubtaskViewHolder.java @@ -29,7 +29,7 @@ public class SubtaskViewHolder extends RecyclerView.ViewHolder { private final ChipProvider chipProvider; private final CheckBoxProvider checkBoxProvider; - public TaskContainer task; + private TaskContainer task; @BindView(R.id.rowBody) ViewGroup rowBody; @@ -128,8 +128,7 @@ public class SubtaskViewHolder extends RecyclerView.ViewHolder { return indent; } - @SuppressLint("NewApi") - public void setIndent(int indent) { + private void setIndent(int indent) { this.indent = indent; int indentSize = getIndentSize(indent); if (atLeastLollipop()) { diff --git a/app/src/main/java/org/tasks/tasklist/SubtasksRecyclerAdapter.java b/app/src/main/java/org/tasks/tasklist/SubtasksRecyclerAdapter.java index a33fba9ef..dd73827b0 100644 --- a/app/src/main/java/org/tasks/tasklist/SubtasksRecyclerAdapter.java +++ b/app/src/main/java/org/tasks/tasklist/SubtasksRecyclerAdapter.java @@ -54,17 +54,13 @@ public class SubtasksRecyclerAdapter extends RecyclerView.Adapter list) { differ.submitList(list); } diff --git a/app/src/main/java/org/tasks/themes/ColorUtil.java b/app/src/main/java/org/tasks/themes/ColorUtil.java index b5146ce23..1b554bc90 100644 --- a/app/src/main/java/org/tasks/themes/ColorUtil.java +++ b/app/src/main/java/org/tasks/themes/ColorUtil.java @@ -2,7 +2,7 @@ package org.tasks.themes; import android.graphics.Color; -public class ColorUtil { +class ColorUtil { /** * https://stackoverflow.com/a/40964456 diff --git a/app/src/main/java/org/tasks/themes/Theme.java b/app/src/main/java/org/tasks/themes/Theme.java index ed1e0e33a..44b790cfd 100644 --- a/app/src/main/java/org/tasks/themes/Theme.java +++ b/app/src/main/java/org/tasks/themes/Theme.java @@ -60,7 +60,7 @@ public class Theme { themeAccent.applyStyle(theme); } - public Context wrap(Context context) { + private Context wrap(Context context) { ContextThemeWrapper wrapper = themeBase.wrap(context); applyToContext(wrapper); return wrapper; diff --git a/app/src/main/java/org/tasks/time/DateTime.java b/app/src/main/java/org/tasks/time/DateTime.java index 8b678b668..a5c4822a5 100644 --- a/app/src/main/java/org/tasks/time/DateTime.java +++ b/app/src/main/java/org/tasks/time/DateTime.java @@ -270,7 +270,7 @@ public class DateTime { return isAfter(dateTime.getMillis()); } - public boolean isAfter(long timestamp) { + private boolean isAfter(long timestamp) { return this.timestamp > timestamp; } diff --git a/app/src/main/java/org/tasks/ui/ActionViewModel.java b/app/src/main/java/org/tasks/ui/ActionViewModel.java index 01b2b7cb4..4d5216da4 100644 --- a/app/src/main/java/org/tasks/ui/ActionViewModel.java +++ b/app/src/main/java/org/tasks/ui/ActionViewModel.java @@ -12,6 +12,7 @@ import io.reactivex.disposables.CompositeDisposable; import io.reactivex.functions.Action; import io.reactivex.schedulers.Schedulers; +@SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public class ActionViewModel extends ViewModel { private final MutableLiveData completed = new MutableLiveData<>(); private final MutableLiveData error = new MutableLiveData<>(); diff --git a/app/src/main/java/org/tasks/ui/ChipListCache.java b/app/src/main/java/org/tasks/ui/ChipListCache.java index ed4a2edde..86fe472c6 100644 --- a/app/src/main/java/org/tasks/ui/ChipListCache.java +++ b/app/src/main/java/org/tasks/ui/ChipListCache.java @@ -18,7 +18,7 @@ import org.tasks.data.TagDataDao; import org.tasks.injection.ApplicationScope; @ApplicationScope -public class ChipListCache { +class ChipListCache { private final Map googleTaskLists = new HashMap<>(); private final Map caldavCalendars = new HashMap<>(); @@ -26,7 +26,7 @@ public class ChipListCache { private final LocalBroadcastManager localBroadcastManager; @Inject - public ChipListCache( + ChipListCache( GoogleTaskListDao googleTaskListDao, CaldavDao caldavDao, TagDataDao tagDataDao, diff --git a/app/src/main/java/org/tasks/ui/HiddenTopArrayAdapter.java b/app/src/main/java/org/tasks/ui/HiddenTopArrayAdapter.java index 7b162691c..b8ee0b00b 100644 --- a/app/src/main/java/org/tasks/ui/HiddenTopArrayAdapter.java +++ b/app/src/main/java/org/tasks/ui/HiddenTopArrayAdapter.java @@ -7,21 +7,13 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import androidx.annotation.NonNull; -import java.util.ArrayList; import java.util.List; import org.tasks.R; public class HiddenTopArrayAdapter extends ArrayAdapter { - private final List hints; - - public HiddenTopArrayAdapter(Context context, int resources, List objects) { - this(context, resources, objects, new ArrayList<>()); - } - - public HiddenTopArrayAdapter(Context context, int resource, List objects, List hints) { - super(context, resource, objects); - this.hints = hints; + protected HiddenTopArrayAdapter(Context context, int resources, List objects) { + super(context, resources, objects); } @Override @@ -40,9 +32,6 @@ public class HiddenTopArrayAdapter extends ArrayAdapter { LayoutInflater.from(getContext()) .inflate(R.layout.simple_spinner_dropdown_item, parent, false); ((TextView) vg.findViewById(R.id.text1)).setText(getItem(position).toString()); - if (position < hints.size()) { - ((TextView) vg.findViewById(R.id.text2)).setText(hints.get(position)); - } v = vg; } diff --git a/app/src/main/java/org/tasks/ui/TaskListViewModel.java b/app/src/main/java/org/tasks/ui/TaskListViewModel.java index ad54a7edc..8bea54c87 100644 --- a/app/src/main/java/org/tasks/ui/TaskListViewModel.java +++ b/app/src/main/java/org/tasks/ui/TaskListViewModel.java @@ -30,6 +30,7 @@ import org.tasks.data.TaskContainer; import org.tasks.preferences.Preferences; import timber.log.Timber; +@SuppressWarnings({"WeakerAccess", "RedundantSuppression"}) public class TaskListViewModel extends ViewModel implements Observer> { private static final PagedList.Config PAGED_LIST_CONFIG =