Skip to content

Commit da87950

Browse files
committed
deprecate the Content Loader abstract classes
We should be using ViewModels, LiveData, & Coroutines to load data for UIs
1 parent 43ea516 commit da87950

15 files changed

+84
-24
lines changed

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/app/SimpleLoaderCallbacks.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import androidx.loader.app.LoaderManager;
77
import androidx.loader.content.Loader;
88

9+
/**
10+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
11+
*/
12+
@Deprecated
913
public abstract class SimpleLoaderCallbacks<D> implements LoaderManager.LoaderCallbacks<D> {
1014
@Override
1115
public void onLoaderReset(@NonNull final Loader<D> loader) {

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/AsyncTaskBroadcastReceiverLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import androidx.annotation.NonNull;
77
import androidx.annotation.Nullable;
88

9+
/**
10+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
11+
*/
12+
@Deprecated
913
public abstract class AsyncTaskBroadcastReceiverLoader<D> extends CachingAsyncTaskLoader<D>
1014
implements BroadcastReceiverLoaderHelper.Interface {
1115
private final BroadcastReceiverLoaderHelper mHelper;

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/AsyncTaskSharedPreferencesChangeLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
import androidx.annotation.NonNull;
66
import androidx.annotation.Nullable;
77

8+
/**
9+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
10+
*/
11+
@Deprecated
812
public abstract class AsyncTaskSharedPreferencesChangeLoader<D> extends CachingAsyncTaskLoader<D>
913
implements SharedPreferencesChangeLoaderHelper.Interface {
1014
private final SharedPreferencesChangeLoaderHelper mHelper;

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/BroadcastReceiverLoaderHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
import java.util.ArrayList;
1111

12+
/**
13+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
14+
*/
15+
@Deprecated
1216
public final class BroadcastReceiverLoaderHelper {
1317
public interface Interface {
1418
void addIntentFilter(@NonNull IntentFilter filter);

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/CachingAsyncTaskLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import androidx.annotation.Nullable;
77
import androidx.loader.content.AsyncTaskLoader;
88

9+
/**
10+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
11+
*/
12+
@Deprecated
913
public abstract class CachingAsyncTaskLoader<D> extends AsyncTaskLoader<D> {
1014
@Nullable
1115
private D mData;

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/CursorBroadcastReceiverLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import androidx.annotation.NonNull;
77
import androidx.annotation.Nullable;
88

9+
/**
10+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
11+
*/
12+
@Deprecated
913
public abstract class CursorBroadcastReceiverLoader extends SimpleCursorLoader
1014
implements BroadcastReceiverLoaderHelper.Interface {
1115
@NonNull

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/LoaderBroadcastReceiver.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import androidx.annotation.NonNull;
77
import androidx.loader.content.Loader;
88

9+
/**
10+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
11+
*/
12+
@Deprecated
913
public class LoaderBroadcastReceiver extends BroadcastReceiver {
1014
@NonNull
1115
private final Loader mLoader;

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/SharedPreferencesChangeLoaderHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import java.util.HashSet;
99
import java.util.Set;
1010

11+
/**
12+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
13+
*/
14+
@Deprecated
1115
public final class SharedPreferencesChangeLoaderHelper {
1216
public interface Interface {
1317
void addPreferenceKey(@Nullable String key);

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/SimpleCursorLoader.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
import androidx.annotation.WorkerThread;
88
import androidx.loader.content.CursorLoader;
99

10+
/**
11+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
12+
*/
13+
@Deprecated
1014
public abstract class SimpleCursorLoader extends CursorLoader {
1115
public SimpleCursorLoader(@NonNull final Context context) {
1216
super(context);

gto-support-core/src/main/java/org/ccci/gto/android/common/support/v4/content/SwipeRefreshLayoutBroadcastReceiverHelper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
import java.util.Arrays;
1212
import java.util.List;
1313

14+
/**
15+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
16+
*/
17+
@Deprecated
1418
public class SwipeRefreshLayoutBroadcastReceiverHelper {
1519
SwipeRefreshLayout mRefreshLayout = null;
1620

gto-support-db/src/main/java/org/ccci/gto/android/common/db/support/v4/content/DaoCursorBroadcastReceiverLoader.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
package org.ccci.gto.android.common.db.support.v4.content;
22

3+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_WHERE;
4+
35
import android.content.BroadcastReceiver;
46
import android.content.Context;
57
import android.content.IntentFilter;
68
import android.os.Bundle;
79

8-
import org.ccci.gto.android.common.db.AbstractDao;
9-
import org.ccci.gto.android.common.db.Table;
10-
import org.ccci.gto.android.common.support.v4.content.BroadcastReceiverLoaderHelper;
11-
1210
import androidx.annotation.NonNull;
1311
import androidx.annotation.Nullable;
1412

15-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_WHERE;
13+
import org.ccci.gto.android.common.db.AbstractDao;
14+
import org.ccci.gto.android.common.db.Table;
15+
import org.ccci.gto.android.common.support.v4.content.BroadcastReceiverLoaderHelper;
1616

17+
/**
18+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
19+
*/
20+
@Deprecated
1721
public class DaoCursorBroadcastReceiverLoader<T> extends DaoCursorLoader<T>
1822
implements BroadcastReceiverLoaderHelper.Interface {
1923
@NonNull

gto-support-db/src/main/java/org/ccci/gto/android/common/db/support/v4/content/DaoCursorLoader.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
package org.ccci.gto.android.common.db.support.v4.content;
22

3+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_DISTINCT;
4+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_JOINS;
5+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_ORDER_BY;
6+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_PROJECTION;
7+
import static org.ccci.gto.android.common.db.AbstractDao.ARG_WHERE;
8+
39
import android.content.Context;
410
import android.database.Cursor;
511
import android.os.Bundle;
612

13+
import androidx.annotation.NonNull;
14+
import androidx.annotation.Nullable;
15+
import androidx.annotation.WorkerThread;
16+
717
import org.ccci.gto.android.common.db.AbstractDao;
818
import org.ccci.gto.android.common.db.Expression;
919
import org.ccci.gto.android.common.db.Expression.Field;
@@ -13,16 +23,10 @@
1323
import org.ccci.gto.android.common.support.v4.content.SimpleCursorLoader;
1424
import org.ccci.gto.android.common.util.os.BundleUtils;
1525

16-
import androidx.annotation.NonNull;
17-
import androidx.annotation.Nullable;
18-
import androidx.annotation.WorkerThread;
19-
20-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_DISTINCT;
21-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_JOINS;
22-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_ORDER_BY;
23-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_PROJECTION;
24-
import static org.ccci.gto.android.common.db.AbstractDao.ARG_WHERE;
25-
26+
/**
27+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
28+
*/
29+
@Deprecated
2630
public class DaoCursorLoader<T> extends SimpleCursorLoader {
2731
@NonNull
2832
protected final AbstractDao mDao;

gto-support-eventbus/src/main/java/org/ccci/gto/android/common/eventbus/content/CachingAsyncTaskEventBusLoader.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
import android.content.Context;
44

5-
import org.ccci.gto.android.common.support.v4.content.CachingAsyncTaskLoader;
6-
import org.greenrobot.eventbus.EventBus;
7-
85
import androidx.annotation.MainThread;
96
import androidx.annotation.NonNull;
107
import androidx.annotation.Nullable;
118

9+
import org.ccci.gto.android.common.support.v4.content.CachingAsyncTaskLoader;
10+
import org.greenrobot.eventbus.EventBus;
11+
12+
/**
13+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
14+
*/
15+
@Deprecated
1216
public abstract class CachingAsyncTaskEventBusLoader<D> extends CachingAsyncTaskLoader<D>
1317
implements EventBusLoaderHelper.Interface {
1418
@NonNull

gto-support-eventbus/src/main/java/org/ccci/gto/android/common/eventbus/content/CursorEventBusLoader.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
import android.content.Context;
44

5-
import org.ccci.gto.android.common.support.v4.content.SimpleCursorLoader;
6-
import org.greenrobot.eventbus.EventBus;
7-
85
import androidx.annotation.MainThread;
96
import androidx.annotation.NonNull;
107
import androidx.annotation.Nullable;
118

9+
import org.ccci.gto.android.common.support.v4.content.SimpleCursorLoader;
10+
import org.greenrobot.eventbus.EventBus;
11+
12+
/**
13+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
14+
*/
15+
@Deprecated
1216
public abstract class CursorEventBusLoader extends SimpleCursorLoader implements EventBusLoaderHelper.Interface {
1317
@NonNull
1418
private final EventBusLoaderHelper mHelper;

gto-support-eventbus/src/main/java/org/ccci/gto/android/common/eventbus/content/DaoCursorEventBusLoader.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
import android.content.Context;
44
import android.os.Bundle;
55

6+
import androidx.annotation.NonNull;
7+
import androidx.annotation.Nullable;
8+
69
import org.ccci.gto.android.common.db.AbstractDao;
710
import org.ccci.gto.android.common.db.Table;
811
import org.ccci.gto.android.common.db.support.v4.content.DaoCursorLoader;
912
import org.greenrobot.eventbus.EventBus;
1013

11-
import androidx.annotation.NonNull;
12-
import androidx.annotation.Nullable;
13-
14+
/**
15+
* @deprecated Since v3.9.0, use LiveData & coroutines to asynchronously load data for a UI.
16+
*/
17+
@Deprecated
1418
public class DaoCursorEventBusLoader<T> extends DaoCursorLoader<T> implements EventBusLoaderHelper.Interface {
1519
private final EventBusLoaderHelper mHelper;
1620

0 commit comments

Comments
 (0)