Skip to content

Commit 28f0bc2

Browse files
authored
Merge pull request #932 from CruGlobal/cleanup
cleanup
2 parents 9f1cd86 + da87950 commit 28f0bc2

File tree

29 files changed

+103
-86
lines changed

29 files changed

+103
-86
lines changed

build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,8 @@ configure(subprojects.findAll { it.path.contains("gto-support") }) {
115115
targetSdkVersion 30
116116

117117
consumerProguardFiles "$rootProject.projectDir/proguard-consumer-jetbrains.pro"
118-
119-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
120118
}
121119

122-
adbOptions {
123-
timeOutInMs 600000
124-
}
125120
compileOptions {
126121
sourceCompatibility JavaVersion.VERSION_1_8
127122
targetCompatibility JavaVersion.VERSION_1_8

gto-support-androidx-room/src/main/java/org/ccci/gto/android/common/androidx/room/converter/LocaleConverter.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package org.ccci.gto.android.common.androidx.room.converter
22

33
import androidx.room.TypeConverter
44
import java.util.Locale
5-
import org.ccci.gto.android.common.compat.util.LocaleCompat
65

76
object LocaleConverter {
87
@JvmStatic
98
@TypeConverter
10-
fun toLocale(tag: String?) = tag?.let { LocaleCompat.forLanguageTag(it) }
9+
fun toLocale(tag: String?) = tag?.let { Locale.forLanguageTag(it) }
1110

1211
@JvmStatic
1312
@TypeConverter
14-
fun toString(locale: Locale?) = locale?.let { LocaleCompat.toLanguageTag(it) }
13+
fun toString(locale: Locale?) = locale?.toLanguageTag()
1514
}

gto-support-api-retrofit2/src/main/java/org/ccci/gto/android/common/api/retrofit2/converter/LocaleConverters.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import androidx.annotation.Nullable;
44

5-
import org.ccci.gto.android.common.compat.util.LocaleCompat;
6-
75
import java.io.IOException;
86
import java.util.Locale;
97

@@ -15,7 +13,7 @@ static final class LocaleStringConverter implements Converter<Locale, String> {
1513

1614
@Override
1715
public String convert(@Nullable final Locale locale) throws IOException {
18-
return locale != null ? LocaleCompat.toLanguageTag(locale) : null;
16+
return locale != null ? locale.toLanguageTag() : null;
1917
}
2018
}
2119
}

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-stream/src/main/java/org/ccci/gto/android/common/db/StreamDao.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,5 @@ import com.annimon.stream.Stream
66
* Stream DAO interface relying on backwards compatible Lightweight Stream API.
77
*/
88
interface StreamDao : Dao {
9-
@JvmDefault
109
fun <T : Any> streamCompat(query: Query<T>): Stream<T> = Stream.of(get(query))
11-
12-
object StreamHelper {
13-
@JvmStatic
14-
@Deprecated("Since v3.4.0, use default implementation of streamCompat instead.")
15-
fun <T : Any> stream(dao: Dao, query: Query<T>): Stream<T> = Stream.of(dao.get(query))
16-
}
1710
}

gto-support-db/src/main/java/org/ccci/gto/android/common/db/AbstractDao.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import androidx.collection.SimpleArrayMap
1111
import java.util.Date
1212
import java.util.Locale
1313
import java.util.concurrent.Executor
14-
import org.ccci.gto.android.common.compat.util.LocaleCompat
1514
import org.ccci.gto.android.common.db.CommonTables.LastSyncTable
1615
import org.ccci.gto.android.common.util.ArrayUtils
1716
import org.ccci.gto.android.common.util.database.getLong
@@ -33,7 +32,7 @@ abstract class AbstractDao(private val helper: SQLiteOpenHelper) : Dao {
3332
is String -> it
3433
is Boolean -> if (it) "1" else "0"
3534
is Date -> it.time.toString()
36-
is Locale -> LocaleCompat.toLanguageTag(it)
35+
is Locale -> it.toLanguageTag()
3736
else -> it.toString()
3837
}
3938
}.toTypedArray()

gto-support-db/src/main/java/org/ccci/gto/android/common/db/AbstractMapper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import androidx.annotation.NonNull;
77
import androidx.annotation.Nullable;
88

9-
import org.ccci.gto.android.common.compat.util.LocaleCompat;
109
import org.ccci.gto.android.common.db.util.CursorUtils;
1110
import org.ccci.gto.android.common.util.database.CursorKt;
1211
import org.json.JSONArray;
@@ -95,7 +94,7 @@ protected final Long serialize(@Nullable final Date date) {
9594

9695
@Nullable
9796
protected final String serialize(@Nullable final Locale locale) {
98-
return locale != null ? LocaleCompat.toLanguageTag(locale) : null;
97+
return locale != null ? locale.toLanguageTag() : null;
9998
}
10099

101100
/**

gto-support-db/src/main/java/org/ccci/gto/android/common/db/Dao.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ interface Dao {
2222
@WorkerThread
2323
fun <T : Any> get(query: Query<T>): List<T>
2424

25-
@JvmDefault
2625
@WorkerThread
2726
fun getCursor(clazz: Class<*>) = getCursor(Query.select(clazz))
2827

29-
@JvmDefault
3028
@WorkerThread
3129
fun getCursor(clazz: Class<*>, whereClause: String?, whereBindValues: Array<String>?, orderBy: String?) =
3230
getCursor(Query.select(clazz).where(whereClause, *whereBindValues.orEmpty()).orderBy(orderBy))
@@ -36,14 +34,12 @@ interface Dao {
3634
// endregion Read-Only
3735

3836
// region Read-Write
39-
@JvmDefault
4037
@WorkerThread
4138
fun <T : Any> insert(obj: T) = insert(obj, SQLiteDatabase.CONFLICT_NONE)
4239

4340
@WorkerThread
4441
fun <T : Any> insert(obj: T, conflictAlgorithm: Int): Long
4542

46-
@JvmDefault
4743
@WorkerThread
4844
fun <T : Any> update(obj: T, where: Expression?, vararg projection: String): Int =
4945
update(obj, where, SQLiteDatabase.CONFLICT_NONE, *projection)
@@ -66,7 +62,6 @@ interface Dao {
6662
@WorkerThread
6763
fun <T : Any> update(obj: T, where: Expression?, conflictAlgorithm: Int, vararg projection: String): Int
6864

69-
@JvmDefault
7065
@WorkerThread
7166
fun updateOrInsert(obj: Any, vararg projection: String) =
7267
updateOrInsert(obj, SQLiteDatabase.CONFLICT_NONE, *projection)

gto-support-db/src/main/java/org/ccci/gto/android/common/db/Join.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package org.ccci.gto.android.common.db
33
import android.annotation.SuppressLint
44
import android.os.Parcelable
55
import androidx.annotation.RestrictTo
6-
import kotlinx.android.parcel.IgnoredOnParcel
7-
import kotlinx.android.parcel.Parcelize
6+
import kotlinx.parcelize.IgnoredOnParcel
7+
import kotlinx.parcelize.Parcelize
88

99
@Parcelize
1010
@SuppressLint("SupportAnnotationUsage")
@@ -18,10 +18,6 @@ data class Join<S : Any, T : Any> private constructor(
1818
@JvmField
1919
val NO_JOINS = emptyArray<Join<*, *>>()
2020

21-
@JvmStatic
22-
@Deprecated("Since v3.3.0, use source.join() instead", ReplaceWith("source.join(target)"))
23-
fun <S : Any, T : Any> create(source: Table<S>, target: Table<T>) = source.join(target)
24-
2521
@JvmStatic
2622
fun <S : Any, T : Any> create(target: Table<T>) = Join<S, T>(target = target)
2723
}

gto-support-db/src/main/java/org/ccci/gto/android/common/db/Table.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package org.ccci.gto.android.common.db
33
import android.annotation.SuppressLint
44
import android.os.Parcelable
55
import androidx.annotation.RestrictTo
6-
import kotlinx.android.parcel.IgnoredOnParcel
7-
import kotlinx.android.parcel.Parcelize
6+
import kotlinx.parcelize.IgnoredOnParcel
7+
import kotlinx.parcelize.Parcelize
88

99
@Parcelize
1010
@SuppressLint("SupportAnnotationUsage")

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;

0 commit comments

Comments
 (0)