Skip to content

Commit

Permalink
updated deps, fixed lint, bumped version
Browse files Browse the repository at this point in the history
  • Loading branch information
KirkBushman committed Aug 20, 2022
1 parent d3a88d2 commit aeae071
Show file tree
Hide file tree
Showing 50 changed files with 68 additions and 366 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[*.{kt,kts}]
# allow wild cards input
disabled_rules=no-wildcard-imports,import-ordering
ktlint_disabled_rules=no-wildcard-imports,import-ordering,spacing-between-declarations-with-annotations,no-empty-first-line-in-method-block
40 changes: 20 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,52 @@
buildscript {

ext {
android_gradle_ver = '7.1.1'
android_gradle_ver = '7.2.2'

compile_sdk_ver = 31
build_tools_ver = '31.0.0'
compile_sdk_ver = 33
build_tools_ver = '33.0.0'

min_sdk_ver = 21
compile_sdk_ver = 31
compile_sdk_ver = 33

version_code = 7
version_name = "1.1.0-beta02"
version_code = 8
version_name = "1.1.0-beta03"

java_target = JavaVersion.VERSION_11
jvm_target = '11'

kotlin_ver = '1.6.10'
coroutines_ver = '1.6.0'
kotlin_ver = '1.7.10'
coroutines_ver = '1.6.4'

ksp_ver = '1.6.10-1.0.2'
ksp_ver = "$kotlin_ver-1.0.6"

hilt_ver = "2.40.5"
hilt_ver = "2.43.2"
ax_hilt_ver = "1.0.0"

ax_core_ver = '1.7.0'
ax_appcompat_ver = '1.4.1'
ax_activity_ver = '1.4.0'
ax_annot_ver = '1.3.0'
ax_core_ver = '1.8.0'
ax_appcompat_ver = '1.5.0'
ax_activity_ver = '1.5.1'
ax_annot_ver = '1.4.0'
ax_browser_ver = '1.4.0'

constr_ver = '2.1.3'
constr_ver = '2.1.4'

retrofit_ver = '2.9.0'
moshi_ver = '1.13.0'
okhttp_ver = '4.9.3'
mdc_ver = '1.5.0'
okhttp_ver = '4.10.0'
mdc_ver = '1.6.1'
epoxy_ver = '4.6.4'

oauth2_ver = 'a364454d6f' // '1.2.2'

ktlint_ver = '0.42.1'
ktlint_ver = '0.47.0'
detekt_ver = '1.19.0'

test_ver = '1.4.0'
espresso_ver = '3.4.0'
junit_ver = '1.1.3'
leakcanary_ver = '2.8.1'
mockito_ver = '4.3.1'
leakcanary_ver = '2.9.1'
mockito_ver = '4.7.0'
arch_core_ver = '2.1.0'
orchestrator_ver = '1.3.0'

Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ org.gradle.vfs.watch=true

android.useAndroidX=true

kapt.use.worker.api=true
kapt.incremental.apt=true

kotlin.code.style=official
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3 changes: 1 addition & 2 deletions lib/src/main/java/com/kirkbushman/araw/RedditClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class RedditClient @JvmOverloads constructor(

@Volatile
private var retrofit: Retrofit? = null

@Volatile
private var api: RedditApi? = null

@Synchronized
fun getRetrofit(logging: Boolean = false): Retrofit {
return synchronized(this) {

if (retrofit == null) {
retrofit = buildRetrofit(logging)
}
Expand All @@ -43,7 +43,6 @@ class RedditClient @JvmOverloads constructor(
@Synchronized
fun getApi(logging: Boolean = false): RedditApi {
return synchronized(this) {

if (api == null) {
api = getRetrofit(logging).create(RedditApi::class.java)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class PolyJsonAdapterFactory<T>(
) : JsonAdapter.Factory {

override fun create(type: Type, annotations: Set<Annotation?>, moshi: Moshi): JsonAdapter<Any>? {

if (Types.getRawType(type) != baseType || annotations.isNotEmpty()) {
return null
}
Expand Down
21 changes: 0 additions & 21 deletions lib/src/main/java/com/kirkbushman/araw/clients/AccountsClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class AccountsClient(
private var currentUser: Me? = null

fun getCurrentUser(): Me? {

if (currentUser == null) {
currentUser = me()
}
Expand All @@ -35,7 +34,6 @@ class AccountsClient(

@WorkerThread
fun me(): Me? {

val authMap = getHeaderMap()
val req = api.me(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -55,7 +53,6 @@ class AccountsClient(
// todo check why it is not working
@WorkerThread
fun myBlocked(): Any? {

val authMap = getHeaderMap()
val req = api.myBlocked(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -72,7 +69,6 @@ class AccountsClient(

@WorkerThread
fun myFriends(): List<Friend>? {

val authMap = getHeaderMap()
val req = api.myFriends(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -89,7 +85,6 @@ class AccountsClient(

@WorkerThread
fun myKarma(): List<Karma>? {

val authMap = getHeaderMap()
val req = api.myKarma(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -106,7 +101,6 @@ class AccountsClient(

@WorkerThread
fun myPrefs(): Prefs? {

val authMap = getHeaderMap()
val req = api.myPrefs(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -123,7 +117,6 @@ class AccountsClient(

@WorkerThread
fun myTrophies(): List<Trophy>? {

val authMap = getHeaderMap()
val req = api.myTrophies(
rawJson = (if (disableLegacyEncoding) 1 else null),
Expand All @@ -147,7 +140,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_OVERVIEW,
limit = limit,
Expand All @@ -165,7 +157,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_SUBMITTED,
limit = limit,
Expand All @@ -183,7 +174,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_COMMENTS,
limit = limit,
Expand All @@ -201,7 +191,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_SAVED,
limit = limit,
Expand All @@ -219,7 +208,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_HIDDEN,
limit = limit,
Expand All @@ -237,7 +225,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_UPVOTED,
limit = limit,
Expand All @@ -255,7 +242,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_DOWNVOTED,
limit = limit,
Expand All @@ -273,7 +259,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return createContributionsFetcher(
where = ContributionsFetcher.USER_CONTRIB_GILDED,
limit = limit,
Expand All @@ -293,7 +278,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): ContributionsFetcher {

return ContributionsFetcher(
api = api,
getUsername = { getCurrentUser()!!.fullname },
Expand All @@ -312,7 +296,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): SubredditsFetcher {

return createSubredditsFetcher(
where = SubredditsFetcher.SUBREDDITS_MINE_SUBSCRIBER,
limit = limit
Expand All @@ -325,7 +308,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): SubredditsFetcher {

return createSubredditsFetcher(
where = SubredditsFetcher.SUBREDDITS_MINE_CONTRIBUTOR,
limit = limit
Expand All @@ -338,7 +320,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): SubredditsFetcher {

return createSubredditsFetcher(
where = SubredditsFetcher.SUBREDDITS_MINE_MODERATOR,
limit = limit
Expand All @@ -351,7 +332,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): SubredditsFetcher {

return createSubredditsFetcher(
where = SubredditsFetcher.SUBREDDITS_MINE_STREAMS,
limit = limit
Expand All @@ -366,7 +346,6 @@ class AccountsClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): SubredditsFetcher {

return SubredditsFetcher(
api = api,
where = where,
Expand Down
13 changes: 0 additions & 13 deletions lib/src/main/java/com/kirkbushman/araw/clients/MessagesClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_UNREAD,
limit = limit
Expand All @@ -48,7 +47,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_MESSAGES,
limit = limit
Expand All @@ -61,7 +59,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_SENT,
limit = limit
Expand All @@ -74,7 +71,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_COMMENTS,
limit = limit
Expand All @@ -87,7 +83,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_SELF_REPLY,
limit = limit
Expand All @@ -100,7 +95,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return createInboxFetcher(
where = InboxFetcher.MESSAGES_MENTIONS,
limit = limit
Expand All @@ -115,7 +109,6 @@ class MessagesClient(
limit: Long = Fetcher.DEFAULT_LIMIT

): InboxFetcher {

return InboxFetcher(
api = api,
where = where,
Expand All @@ -132,7 +125,6 @@ class MessagesClient(

@WorkerThread
fun deleteMessage(fullname: String): Any? {

val authMap = getHeaderMap()
val req = api.deleteMessage(
id = fullname,
Expand All @@ -155,7 +147,6 @@ class MessagesClient(

@WorkerThread
fun markAsRead(read: Boolean, fullname: String): Any? {

val authMap = getHeaderMap()
val req = if (read) {
api.readMessage(
Expand Down Expand Up @@ -186,7 +177,6 @@ class MessagesClient(

@WorkerThread
fun vote(vote: Vote, fullname: String): Any? {

val authMap = getHeaderMap()
val req = api.vote(
id = fullname,
Expand All @@ -205,19 +195,16 @@ class MessagesClient(

@WorkerThread
fun markAllAsRead(filters: Array<Message>?): Any? {

return markAllAsRead(filters?.joinToString(separator = ",") { it.fullname })
}

@WorkerThread
fun markAllAsRead(filters: List<Message>?): Any? {

return markAllAsRead(filters?.joinToString(separator = ",") { it.fullname })
}

@WorkerThread
fun markAllAsRead(filters: String?): Any? {

val authMap = getHeaderMap()
val req = api.readAllMessages(
filters = filters ?: "",
Expand Down
Loading

0 comments on commit aeae071

Please sign in to comment.