diff options
author | TacoTheDank <SkytkRSfan3895@gmail.com> | 2020-12-23 22:35:41 +0000 |
---|---|---|
committer | TacoTheDank <SkytkRSfan3895@gmail.com> | 2020-12-23 22:35:41 +0000 |
commit | 94202097b7c133823ea2b3fb9d45f4b8f67eb796 (patch) | |
tree | 8a449ca590c3a327b791f474dd5c3a1f97e8a42e /app | |
parent | bd5a0254e6c88fb34028f44f24ba7a466a8799b7 (diff) | |
download | infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar.gz infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar.bz2 infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar.lz infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar.xz infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.tar.zst infinity-for-reddit-94202097b7c133823ea2b3fb9d45f4b8f67eb796.zip |
Reorganize and remove unused libraries
Diffstat (limited to 'app')
-rw-r--r-- | app/build.gradle | 153 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/FetchSubredditData.java | 7 |
2 files changed, 107 insertions, 53 deletions
diff --git a/app/build.gradle b/app/build.gradle index 4b24f2d0..172186f1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { annotationProcessorOptions { - arguments = [ eventBusIndex : 'ml.docilealligator.infinityforreddit.EventBusIndex' ] + arguments = [eventBusIndex: 'ml.docilealligator.infinityforreddit.EventBusIndex'] } } } @@ -35,79 +35,132 @@ android { } dependencies { +/** AndroidX **/ implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.biometric:biometric:1.1.0-rc01' implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - // Lifecycle components - def lifecycleVersion = '2.2.0' - implementation "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion" - implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' - implementation 'androidx.legacy:legacy-support-v4:1.0.0' + def lifecycleVersion = "2.2.0" + implementation "androidx.lifecycle:lifecycle-livedata:$lifecycleVersion" + implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycleVersion" annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion" implementation 'androidx.paging:paging-runtime:2.1.2' implementation 'androidx.preference:preference:1.1.1' - // Room components - def roomVersion = '2.2.5' + def roomVersion = "2.2.5" implementation "androidx.room:room-runtime:$roomVersion" annotationProcessor "androidx.room:room-compiler:$roomVersion" implementation 'androidx.work:work-runtime:2.4.0' implementation 'com.google.android.material:material:1.3.0-alpha04' - implementation 'com.google.android.exoplayer:exoplayer-core:2.10.8' - implementation 'com.google.android.exoplayer:exoplayer-hls:2.10.8' - implementation 'com.google.android.exoplayer:exoplayer-dash:2.10.8' - implementation 'com.google.android.exoplayer:exoplayer-ui:2.10.8' - implementation 'com.alexvasilkov:gesture-views:2.6.0' - implementation 'com.github.bumptech.glide:glide:4.11.0' - annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' +/** ExoPlayer **/ + def exoplayerVersion = "2.10.8" + implementation "com.google.android.exoplayer:exoplayer-core:$exoplayerVersion" + implementation "com.google.android.exoplayer:exoplayer-dash:$exoplayerVersion" + implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayerVersion" + implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayerVersion" + def toroVersion = "3.7.0.2010003" + implementation "im.ene.toro3:toro:$toroVersion" + implementation("im.ene.toro3:toro-ext-exoplayer:$toroVersion") { + exclude module: 'extension-ima' + } + +/** Third-party **/ + +/**** Backend logic ****/ + + // Reactive stuff for event and async related implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxjava:2.2.20' - implementation 'com.squareup.retrofit2:retrofit:2.9.0' - implementation 'com.squareup.retrofit2:converter-scalars:2.9.0' + + // HTTP client + def retrofitVersion = "2.9.0" + implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" + implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + + // Dependency injection + def daggerVersion = "2.29.1" + implementation "com.google.dagger:dagger:$daggerVersion" + annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" + + // Binding + // NOTE: Deprecated in favor of viewbinding + def butterknifeVersion = "10.2.3" + implementation "com.jakewharton:butterknife:$butterknifeVersion" + annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion" + + // Events + def eventbusVersion = "3.2.0" + implementation "org.greenrobot:eventbus:$eventbusVersion" + annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion" + + // TransactionTooLargeException avoidance + implementation 'com.github.livefront:bridge:v1.2.1' + + // Bundle-saving without boilerplate + // NOTE: Deprecated + def stateVersion = "1.4.1" + implementation "com.evernote:android-state:$stateVersion" + annotationProcessor "com.evernote:android-state-processor:$stateVersion" + + // Object to JSON + // NOTE: Replace with Squareup's Moshi? + implementation 'com.google.code.gson:gson:2.8.6' + + +/**** User Interface (frontend) ****/ + + //Image loading + def glideVersion = "4.11.0" + implementation "com.github.bumptech.glide:glide:$glideVersion" + annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion" implementation 'jp.wasabeef:glide-transformations:4.1.0' - implementation 'com.google.dagger:dagger:2.29.1' - annotationProcessor 'com.google.dagger:dagger-compiler:2.29.1' - implementation 'com.jakewharton:butterknife:10.2.3' - annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3' implementation 'com.github.santalu:aspect-ratio-imageview:1.0.9' - implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE' - implementation 'io.noties.markwon:core:4.5.0' - implementation 'io.noties.markwon:linkify:4.5.0' - implementation 'io.noties.markwon:ext-strikethrough:4.5.0' - implementation 'io.noties.markwon:simple-ext:4.5.0' - implementation 'io.noties.markwon:recycler-table:4.5.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21' + def bivVersion = "1.6.5" + implementation "com.github.Piasy.BigImageViewer:BigImageViewer:$bivVersion" + implementation "com.github.Piasy.BigImageViewer:GlideImageLoader:$bivVersion" + implementation "com.github.Piasy.BigImageViewer:GlideImageViewFactory:$bivVersion" + + // Markdown + def markwonVersion = "4.5.0" + implementation "io.noties.markwon:core:$markwonVersion" + implementation "io.noties.markwon:ext-strikethrough:$markwonVersion" + implementation "io.noties.markwon:linkify:$markwonVersion" + implementation "io.noties.markwon:recycler-table:$markwonVersion" + implementation "io.noties.markwon:simple-ext:$markwonVersion" + implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.14.0' + + // Animations + implementation 'com.airbnb.android:lottie:3.4.4' + + // Loading ProgressBar + implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE' + + // SearchView implementation 'com.github.Ferfalk:SimpleSearchView:0.1.4' - def eventbusVersion = '3.2.0' - implementation "org.greenrobot:eventbus:$eventbusVersion" - annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion" + // Customizable TextView implementation 'com.libRG:customtextview:2.4' + + // Dismiss gesturing + implementation 'com.r0adkll:slidableactivity:2.1.0' + implementation 'com.thefuntasty.hauler:core:3.1.0' + + // Bottom sheet with rounded corners implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1' - implementation 'com.github.livefront:bridge:v1.2.1' - implementation 'com.evernote:android-state:1.4.1' - annotationProcessor 'com.evernote:android-state-processor:1.4.1' + + // FlowLayout (auto-spacing) implementation 'com.nex3z:flow-layout:1.3.0' - implementation 'com.r0adkll:slidableactivity:2.1.0' - implementation 'com.atlassian.commonmark:commonmark:0.14.0' - implementation 'com.google.code.gson:gson:2.8.6' + + // RecyclerView fast scrolling implementation 'me.zhanghai.android.fastscroll:library:1.1.2' - implementation "com.thefuntasty.hauler:core:3.1.0" - implementation 'com.github.Piasy:BigImageViewer:1.6.5' - implementation 'androidx.biometric:biometric:1.1.0-rc01' - implementation 'com.airbnb.android:lottie:3.4.4' + + // Crash screen implementation 'com.melegy.redscreenofdeath:red-screen-of-death:0.1.2' - // debugImplementation because LeakCanary should only run in debug builds. - debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' - def toroVersion = '3.7.0.2010003' - implementation "im.ene.toro3:toro:$toroVersion" - implementation("im.ene.toro3:toro-ext-exoplayer:$toroVersion") { - exclude module: 'extension-ima' - } - testImplementation 'junit:junit:4.13.1' - androidTestImplementation 'androidx.test:runner:1.3.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +/**** Builds and flavors ****/ + // debugImplementation because LeakCanary should only run in debug builds. + debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5' } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/FetchSubredditData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/FetchSubredditData.java index a7a9eb21..37587ede 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/FetchSubredditData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/FetchSubredditData.java @@ -2,9 +2,9 @@ package ml.docilealligator.infinityforreddit.subreddit; import androidx.annotation.NonNull; -import com.facebook.common.internal.ImmutableMap; - import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.Map; import ml.docilealligator.infinityforreddit.apis.RedditAPI; @@ -50,7 +50,8 @@ public class FetchSubredditData { boolean nsfw, final FetchSubredditListingDataListener fetchSubredditListingDataListener) { RedditAPI api = retrofit.create(RedditAPI.class); - Map<String, String> headers = accessToken != null ? APIUtils.getOAuthHeader(accessToken) : ImmutableMap.of(); + Map<String, String> map = new HashMap<>(); + Map<String, String> headers = accessToken != null ? APIUtils.getOAuthHeader(accessToken) : Collections.unmodifiableMap(map); Call<String> subredditDataCall = api.searchSubreddits(query, after, sortType, nsfw ? 1 : 0, headers); subredditDataCall.enqueue(new Callback<String>() { @Override |