From bd5a0254e6c88fb34028f44f24ba7a466a8799b7 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:33:22 -0500 Subject: [PATCH 1/6] Update gradle wrapper --- gradle/wrapper/gradle-wrapper.jar | Bin 58694 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 3 +-- gradlew | 2 ++ gradlew.bat | 22 ++++------------------ 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 490fda8577df6c95960ba7077c43220e5bb2c0d9..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f 100644 GIT binary patch delta 6763 zcmY*d1yoeux`&}Vq&vkKkdST|x*Texk(LmoVTd`>NXyV2GNg!rf(VL8i*$EN2vQ>@ z;N#D`_q}`1+H37!e0#5N@4e1G>wMk)I9~^G>X1a_WjI_~vbb1S(*#&p%2+6`3073w z_+8Wx5fspSazTIgyF^r`bS;8?ttUY=Y16txqx|`pNOoTEXlylV?ZsN$4tQ-aeaKtq;EDcj#ufS~X5l)PmBL0VS*h=y3Li+qdct?J z?FcClysNWmO;%pTGK&0{S_(f?(9-*~A4I!CEfl8GR%`}qg?-86`CE5zW!0SOyaivY zkiRhoaHaER6Q_#*#;TWTrMbR`wnw-+IwyT}G_Z5l`tjySt-xO`<&)UUZwX2Ld8F2m zJ}lBiid@DLwV|>iW$We*nVYK+pYM|g16_-dViOg5hU z12mN~ZOI~wq~?bH6`?&%QPx%Oem!8RCQF5u9v+db?p1llbB#50c|OX|hdmiW_zca5{dg}^%gRxH=Km$u-rHFt@BQoXyPF};v=|*+6LX_Q1Y@ANn^PO4 z8{Xd0jfmXY$+tS+ht-;FSvu*NayB}Le*;qjG0~GLdCcZt9hQ=Dcqm541h&P^*D7i2 zjQ1ZvD?d3pgWVZdWc#a84*b5Ug{Xb{ik?j8PLoKC_(~YEpM62*aJ zZB#?v!EsJzb+SY~8IZPc8i~QVIN*M`%-1ETmPh0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&WI!M<_080ldy13ke}1s>@L2zo`n%=_x={QZyaPl`34khC{wrsuo`W(T z-pGMR4}sJf3c&m)11O*4uf+%?|9l3rF}VDyYAh{xatrHx5}jTw0mnbE(J3ZTPK09LaMpfK|r ztHF}_#>%&&AoE5Hz?lzUrQFW=K{pcX@E3bfu%WJP_io^ zHZKM0`>Wi+0L20Y&@j&c((?E#>4BYjbr8NUfQe@U3>M@-DSkIN96){(oLpc4o%!Eb zWQ(F8*-wA*F<`$a2;vUD!M4R0pyAMe@fJWHK?+DNaf3P{Zmd61jKK6F1yHxd0HTe( zu@09sK>cxlQ5Mj^QUCyk0d$yhQ{hi%1b$(-LBG>)4VCp}iW`JiKDgO5h-Coz zSN*jf0mQ2Ups7w^znc>NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell From 94202097b7c133823ea2b3fb9d45f4b8f67eb796 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:35:41 -0500 Subject: [PATCH 2/6] Reorganize and remove unused libraries --- app/build.gradle | 171 ++++++++++++------ .../subreddit/FetchSubredditData.java | 7 +- build.gradle | 2 +- 3 files changed, 117 insertions(+), 63 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' - 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' - 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' - 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" - implementation 'com.libRG:customtextview:2.4' - 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' - 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' - 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' - 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' +/** 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' } - testImplementation 'junit:junit:4.13.1' - androidTestImplementation 'androidx.test:runner:1.3.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' +/** 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' + + // 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.github.santalu:aspect-ratio-imageview:1.0.9' + 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' + + // 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' + + // FlowLayout (auto-spacing) + implementation 'com.nex3z:flow-layout:1.3.0' + + // RecyclerView fast scrolling + implementation 'me.zhanghai.android.fastscroll:library:1.1.2' + + // Crash screen + implementation 'com.melegy.redscreenofdeath:red-screen-of-death:0.1.2' + + +/**** 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 headers = accessToken != null ? APIUtils.getOAuthHeader(accessToken) : ImmutableMap.of(); + Map map = new HashMap<>(); + Map headers = accessToken != null ? APIUtils.getOAuthHeader(accessToken) : Collections.unmodifiableMap(map); Call subredditDataCall = api.searchSubreddits(query, after, sortType, nsfw ? 1 : 0, headers); subredditDataCall.enqueue(new Callback() { @Override diff --git a/build.gradle b/build.gradle index ea77b473..2c7d3efd 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:4.1.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From 90df8e42bb9f885dbc408bc0c674c2e7e814b0e9 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:35:56 -0500 Subject: [PATCH 3/6] Correct existing ViewPager2 implementations --- .../activities/AccountSavedThingActivity.java | 8 ++++---- .../infinityforreddit/activities/MainActivity.java | 8 ++++---- .../activities/SearchResultActivity.java | 8 ++++---- .../activities/ViewSubredditDetailActivity.java | 8 ++++---- .../activities/ViewUserDetailActivity.java | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java index c33104ac..a87c10d0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/AccountSavedThingActivity.java @@ -15,8 +15,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.lifecycle.Lifecycle; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; @@ -199,7 +199,7 @@ public class AccountSavedThingActivity extends BaseActivity implements ActivityT } private void initializeViewPager() { - sectionsPagerAdapter = new SectionsPagerAdapter(fragmentManager, getLifecycle()); + sectionsPagerAdapter = new SectionsPagerAdapter(this); viewPager2.setAdapter(sectionsPagerAdapter); viewPager2.setOffscreenPageLimit(2); viewPager2.setUserInputEnabled(!mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_SWIPING_BETWEEN_TABS, false)); @@ -345,8 +345,8 @@ public class AccountSavedThingActivity extends BaseActivity implements ActivityT private class SectionsPagerAdapter extends FragmentStateAdapter { - SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) { - super(fm, lifecycle); + SectionsPagerAdapter(FragmentActivity fa) { + super(fa); } @NonNull diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 2d139293..b621b583 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -30,8 +30,8 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.lifecycle.Lifecycle; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -772,7 +772,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb int tabCount = mMainActivityTabsSharedPreferences.getInt((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_TAB_COUNT, 3); mShowFavoriteSubscribedSubreddits = mMainActivityTabsSharedPreferences.getBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_SHOW_FAVORITE_SUBSCRIBED_SUBREDDITS, false); mShowSubscribedSubreddits = mMainActivityTabsSharedPreferences.getBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.MAIN_PAGE_SHOW_SUBSCRIBED_SUBREDDITS, false); - sectionsPagerAdapter = new SectionsPagerAdapter(fragmentManager, getLifecycle(), tabCount, + sectionsPagerAdapter = new SectionsPagerAdapter(this, tabCount, mShowFavoriteSubscribedSubreddits, mShowSubscribedSubreddits); viewPager2.setAdapter(sectionsPagerAdapter); viewPager2.setOffscreenPageLimit(1); @@ -1313,8 +1313,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb List favoriteSubscribedSubreddits; List subscribedSubreddits; - SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle, int tabCount, boolean showFavoriteSubscribedSubreddits, boolean showSubscribedSubreddits) { - super(fm, lifecycle); + SectionsPagerAdapter(FragmentActivity fa, int tabCount, boolean showFavoriteSubscribedSubreddits, boolean showSubscribedSubreddits) { + super(fa); this.tabCount = tabCount; favoriteSubscribedSubreddits = new ArrayList<>(); subscribedSubreddits = new ArrayList<>(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java index b605aedb..a3ca8889 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SearchResultActivity.java @@ -16,8 +16,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.lifecycle.Lifecycle; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; @@ -221,7 +221,7 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect } private void initializeViewPager() { - sectionsPagerAdapter = new SectionsPagerAdapter(fragmentManager, getLifecycle()); + sectionsPagerAdapter = new SectionsPagerAdapter(this); viewPager2.setAdapter(sectionsPagerAdapter); viewPager2.setOffscreenPageLimit(3); viewPager2.setUserInputEnabled(!mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_SWIPING_BETWEEN_TABS, false)); @@ -381,8 +381,8 @@ public class SearchResultActivity extends BaseActivity implements SortTypeSelect private class SectionsPagerAdapter extends FragmentStateAdapter { - public SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) { - super(fm, lifecycle); + public SectionsPagerAdapter(FragmentActivity fa) { + super(fa); } @NonNull diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java index 1771b8dc..4852c32d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewSubredditDetailActivity.java @@ -28,8 +28,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.lifecycle.Lifecycle; import androidx.lifecycle.ViewModelProvider; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; @@ -842,7 +842,7 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp } }).execute(); - sectionsPagerAdapter = new SectionsPagerAdapter(fragmentManager, getLifecycle()); + sectionsPagerAdapter = new SectionsPagerAdapter(this); viewPager2.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override public void onPageSelected(int position) { @@ -1233,8 +1233,8 @@ public class ViewSubredditDetailActivity extends BaseActivity implements SortTyp private class SectionsPagerAdapter extends FragmentStateAdapter { - SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) { - super(fm, lifecycle); + SectionsPagerAdapter(FragmentActivity fa) { + super(fa); } @NonNull diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java index 3ddf99f5..9c77e0a9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java @@ -31,8 +31,8 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; -import androidx.lifecycle.Lifecycle; import androidx.lifecycle.ViewModelProvider; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; @@ -604,7 +604,7 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele } private void initializeViewPager() { - sectionsPagerAdapter = new SectionsPagerAdapter(fragmentManager, getLifecycle()); + sectionsPagerAdapter = new SectionsPagerAdapter(this); viewPager2.setAdapter(sectionsPagerAdapter); viewPager2.setOffscreenPageLimit(2); viewPager2.setUserInputEnabled(!mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_SWIPING_BETWEEN_TABS, false)); @@ -1308,8 +1308,8 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele private class SectionsPagerAdapter extends FragmentStateAdapter { - SectionsPagerAdapter(FragmentManager fm, Lifecycle lifecycle) { - super(fm, lifecycle); + SectionsPagerAdapter(FragmentActivity fa) { + super(fa); } @NonNull From 4528b3d749fcd5b978d570159ebba13c5400284d Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:36:09 -0500 Subject: [PATCH 4/6] Fix an ExoPlayer deprecation --- .../infinityforreddit/activities/PostVideoActivity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java index b2b28948..b9562b46 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java @@ -27,7 +27,7 @@ import com.bumptech.glide.request.RequestOptions; import com.google.android.exoplayer2.ExoPlayerFactory; import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.SimpleExoPlayer; -import com.google.android.exoplayer2.source.ExtractorMediaSource; +import com.google.android.exoplayer2.source.ProgressiveMediaSource; import com.google.android.exoplayer2.ui.PlayerView; import com.google.android.exoplayer2.upstream.DataSource; import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; @@ -424,7 +424,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF constraintLayout.setVisibility(View.GONE); selectAgainTextView.setVisibility(View.VISIBLE); videoPlayerView.setVisibility(View.VISIBLE); - player.prepare(new ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(videoUri)); + player.prepare(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(videoUri)); player.setPlayWhenReady(true); wasPlaying = true; } From 6247868949e0469c4916ff859f1c7b87c7bc20b9 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 17:36:22 -0500 Subject: [PATCH 5/6] Update some libraries --- app/build.gradle | 21 ++++++++++--------- .../activities/LinkResolverActivity.java | 13 +++++++----- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 172186f1..47c3b0d8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,7 +38,7 @@ 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.browser:browser:1.3.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' def lifecycleVersion = "2.2.0" @@ -47,7 +47,7 @@ dependencies { annotationProcessor "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion" implementation 'androidx.paging:paging-runtime:2.1.2' implementation 'androidx.preference:preference:1.1.1' - def roomVersion = "2.2.5" + def roomVersion = "2.2.6" implementation "androidx.room:room-runtime:$roomVersion" annotationProcessor "androidx.room:room-compiler:$roomVersion" implementation 'androidx.work:work-runtime:2.4.0' @@ -73,13 +73,14 @@ dependencies { implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxjava:2.2.20' - // HTTP client + // HTTP clients def retrofitVersion = "2.9.0" implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" implementation "com.squareup.retrofit2:converter-scalars:$retrofitVersion" + implementation 'com.squareup.okhttp3:okhttp:4.2.2' // Dependency injection - def daggerVersion = "2.29.1" + def daggerVersion = "2.30.1" implementation "com.google.dagger:dagger:$daggerVersion" annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion" @@ -95,7 +96,7 @@ dependencies { annotationProcessor "org.greenrobot:eventbus-annotation-processor:$eventbusVersion" // TransactionTooLargeException avoidance - implementation 'com.github.livefront:bridge:v1.2.1' + implementation 'com.github.livefront:bridge:v1.3.0' // Bundle-saving without boilerplate // NOTE: Deprecated @@ -114,16 +115,16 @@ dependencies { 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 'jp.wasabeef:glide-transformations:4.3.0' implementation 'com.github.santalu:aspect-ratio-imageview:1.0.9' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21' - def bivVersion = "1.6.5" + def bivVersion = "1.7.0" 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" + def markwonVersion = "4.6.0" implementation "io.noties.markwon:core:$markwonVersion" implementation "io.noties.markwon:ext-strikethrough:$markwonVersion" implementation "io.noties.markwon:linkify:$markwonVersion" @@ -151,10 +152,10 @@ dependencies { implementation 'com.github.Deishelon:RoundedBottomSheet:1.0.1' // FlowLayout (auto-spacing) - implementation 'com.nex3z:flow-layout:1.3.0' + implementation 'com.nex3z:flow-layout:1.3.3' // RecyclerView fast scrolling - implementation 'me.zhanghai.android.fastscroll:library:1.1.2' + implementation 'me.zhanghai.android.fastscroll:library:1.1.5' // Crash screen implementation 'com.melegy.redscreenofdeath:red-screen-of-death:0.1.2' diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index bac8f3da..27fa8298 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -10,7 +10,9 @@ import android.os.Bundle; import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; +import androidx.browser.customtabs.CustomTabColorSchemeParams; import androidx.browser.customtabs.CustomTabsIntent; +import androidx.browser.customtabs.CustomTabsService; import java.util.ArrayList; import java.util.List; @@ -23,8 +25,6 @@ import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION; - public class LinkResolverActivity extends AppCompatActivity { public static final String EXTRA_MESSAGE_FULLNAME = "ENF"; @@ -276,7 +276,7 @@ public class LinkResolverActivity extends AppCompatActivity { ArrayList packagesSupportingCustomTabs = new ArrayList<>(); for (ResolveInfo info : resolvedActivityList) { Intent serviceIntent = new Intent(); - serviceIntent.setAction(ACTION_CUSTOM_TABS_CONNECTION); + serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION); serviceIntent.setPackage(info.activityInfo.packageName); // Check if this package also resolves the Custom Tabs service. if (pm.resolveService(serviceIntent, 0) != null) { @@ -291,8 +291,11 @@ public class LinkResolverActivity extends AppCompatActivity { if (!resolveInfos.isEmpty()) { CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); // add share action to menu list - builder.addDefaultShareMenuItem(); - builder.setToolbarColor(mCustomThemeWrapper.getColorPrimary()); + builder.setShareState(CustomTabsIntent.SHARE_STATE_ON); + builder.setDefaultColorSchemeParams( + new CustomTabColorSchemeParams.Builder() + .setToolbarColor(mCustomThemeWrapper.getColorPrimary()) + .build()); CustomTabsIntent customTabsIntent = builder.build(); customTabsIntent.intent.setPackage(resolveInfos.get(0).activityInfo.packageName); if (uri.getScheme() == null) { From b98291c05ddf81f0eae410127e7d125fd8139d7a Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Wed, 23 Dec 2020 19:10:49 -0500 Subject: [PATCH 6/6] Use some Compat classes --- .../CustomThemeListingActivity.java | 3 ++- .../activities/MainActivity.java | 3 ++- .../activities/PostImageActivity.java | 7 ++----- .../activities/PostLinkActivity.java | 3 ++- .../activities/PostTextActivity.java | 3 ++- .../activities/PostVideoActivity.java | 7 ++----- .../activities/SettingsActivity.java | 3 ++- .../activities/SubmitCrosspostActivity.java | 3 ++- .../activities/ViewImageOrGifActivity.java | 8 ++------ .../activities/ViewVideoActivity.java | 19 +++++-------------- .../SetAsWallpaperBottomSheetFragment.java | 3 ++- .../customviews/LollipopBugFixedWebView.java | 3 ++- .../fragments/ViewImgurImageFragment.java | 8 ++------ .../fragments/ViewImgurVideoFragment.java | 8 ++------ .../ViewRedditGalleryImageOrGifFragment.java | 8 ++------ .../ViewRedditGalleryVideoFragment.java | 8 ++------ .../services/DownloadMediaService.java | 4 ++-- .../services/DownloadRedditVideoService.java | 4 ++-- .../settings/FontPreferenceFragment.java | 5 +++-- .../settings/ThemePreferenceFragment.java | 3 ++- .../utils/NotificationUtils.java | 5 +++-- .../infinityforreddit/utils/Utils.java | 11 ++++------- 22 files changed, 51 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java index c30cc188..03f6ae9e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/CustomThemeListingActivity.java @@ -14,6 +14,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.app.ActivityCompat; import androidx.lifecycle.ViewModelProvider; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -248,7 +249,7 @@ public class CustomThemeListingActivity extends BaseActivity implements @Subscribe public void onRecreateActivityEvent(RecreateActivityEvent recreateActivityEvent) { - recreate(); + ActivityCompat.recreate(this); } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index b621b583..fe9da437 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -27,6 +27,7 @@ import androidx.appcompat.app.ActionBarDrawerToggle; import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.app.ActivityCompat; import androidx.core.view.GravityCompat; import androidx.drawerlayout.widget.DrawerLayout; import androidx.fragment.app.Fragment; @@ -1144,7 +1145,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb @Subscribe public void onRecreateActivityEvent(RecreateActivityEvent recreateActivityEvent) { - recreate(); + ActivityCompat.recreate(this); } @Subscribe diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java index a8517925..85601581 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostImageActivity.java @@ -22,6 +22,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; import com.bumptech.glide.Glide; @@ -528,11 +529,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF } intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForegroundService(intent); - } else { - startService(intent); - } + ContextCompat.startForegroundService(this, intent); return true; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java index 2f76cd9d..c53d43c5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostLinkActivity.java @@ -17,6 +17,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import com.bumptech.glide.Glide; import com.bumptech.glide.RequestManager; @@ -449,7 +450,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK); - startService(intent); + ContextCompat.startForegroundService(this, intent); return true; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java index 31814057..7d04e456 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostTextActivity.java @@ -17,6 +17,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; @@ -466,7 +467,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TEXT_OR_LINK); - startService(intent); + ContextCompat.startForegroundService(this, intent); return true; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java index b9562b46..6d8e8f26 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/PostVideoActivity.java @@ -20,6 +20,7 @@ import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import com.bumptech.glide.Glide; import com.bumptech.glide.RequestManager; @@ -528,11 +529,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_VIDEO); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForegroundService(intent); - } else { - startService(intent); - } + ContextCompat.startForegroundService(this, intent); return true; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java index 699946a5..df889ed7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java @@ -7,6 +7,7 @@ import android.view.MenuItem; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; +import androidx.core.app.ActivityCompat; import androidx.fragment.app.Fragment; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; @@ -192,6 +193,6 @@ public class SettingsActivity extends BaseActivity implements @Subscribe public void onRecreateActivityEvent(RecreateActivityEvent recreateActivityEvent) { - recreate(); + ActivityCompat.recreate(this); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java index 04c70dc4..fb7e5a0b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubmitCrosspostActivity.java @@ -21,6 +21,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.coordinatorlayout.widget.CoordinatorLayout; +import androidx.core.content.ContextCompat; import com.bumptech.glide.Glide; import com.bumptech.glide.RequestManager; @@ -520,7 +521,7 @@ public class SubmitCrosspostActivity extends BaseActivity implements FlairBottom intent.putExtra(SubmitPostService.EXTRA_IS_SPOILER, isSpoiler); intent.putExtra(SubmitPostService.EXTRA_IS_NSFW, isNSFW); intent.putExtra(SubmitPostService.EXTRA_POST_TYPE, SubmitPostService.EXTRA_POST_TYPE_CROSSPOST); - startService(intent); + ContextCompat.startForegroundService(this, intent); return true; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java index f336f94f..a86e2c86 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewImageOrGifActivity.java @@ -283,7 +283,7 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -341,11 +341,7 @@ public class ViewImageOrGifActivity extends AppCompatActivity implements SetAsWa intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, isGif ? DownloadMediaService.EXTRA_MEDIA_TYPE_GIF : DownloadMediaService.EXTRA_MEDIA_TYPE_IMAGE); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, mImageFileName); intent.putExtra(DownloadMediaService.EXTRA_SUBREDDIT_NAME, mSubredditName); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForegroundService(intent); - } else { - startService(intent); - } + ContextCompat.startForegroundService(this, intent); Toast.makeText(this, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java index df48ab26..417d8de7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java @@ -419,7 +419,7 @@ public class ViewVideoActivity extends AppCompatActivity { } isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -472,29 +472,20 @@ public class ViewVideoActivity extends AppCompatActivity { private void download() { isDownloading = false; + Intent intent; if (videoType != VIDEO_TYPE_NORMAL) { - Intent intent = new Intent(this, DownloadMediaService.class); + intent = new Intent(this, DownloadMediaService.class); intent.putExtra(DownloadMediaService.EXTRA_URL, videoDownloadUrl); intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, DownloadMediaService.EXTRA_MEDIA_TYPE_VIDEO); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, videoFileName); intent.putExtra(DownloadMediaService.EXTRA_SUBREDDIT_NAME, subredditName); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForegroundService(intent); - } else { - startService(intent); - } } else { - Intent intent = new Intent(this, DownloadRedditVideoService.class); + intent = new Intent(this, DownloadRedditVideoService.class); intent.putExtra(DownloadRedditVideoService.EXTRA_VIDEO_URL, videoDownloadUrl); intent.putExtra(DownloadRedditVideoService.EXTRA_POST_ID, id); intent.putExtra(DownloadRedditVideoService.EXTRA_SUBREDDIT, subredditName); - - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - startForegroundService(intent); - } else { - startService(intent); - } } + ContextCompat.startForegroundService(this, intent); Toast.makeText(this, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SetAsWallpaperBottomSheetFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SetAsWallpaperBottomSheetFragment.java index 05d31cf3..1dd45fe2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SetAsWallpaperBottomSheetFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/bottomsheetfragments/SetAsWallpaperBottomSheetFragment.java @@ -2,6 +2,7 @@ package ml.docilealligator.infinityforreddit.bottomsheetfragments; import android.app.Activity; import android.content.Context; +import android.os.Build; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -49,7 +50,7 @@ public class SetAsWallpaperBottomSheetFragment extends RoundedBottomSheetDialogF dismiss(); }); - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { homeScreenTextvView.setVisibility(View.VISIBLE); lockScreenTextView.setVisibility(View.VISIBLE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LollipopBugFixedWebView.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LollipopBugFixedWebView.java index 6392902d..71387a2f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LollipopBugFixedWebView.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/LollipopBugFixedWebView.java @@ -21,7 +21,8 @@ public class LollipopBugFixedWebView extends WebView{ // To fix Android Lollipop WebView problem create a new configuration on that Android version only private static Context getFixedContext(Context context) { - if (Build.VERSION.SDK_INT == 21 || Build.VERSION.SDK_INT == 22) // Android Lollipop 5.0 & 5.1 + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP + || Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1) // Android Lollipop 5.0 & 5.1 return context.createConfigurationContext(new Configuration()); return context; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java index d97fedd4..51bfeb6c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurImageFragment.java @@ -157,7 +157,7 @@ public class ViewImgurImageFragment extends Fragment { isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -238,11 +238,7 @@ public class ViewImgurImageFragment extends Fragment { intent.putExtra(DownloadMediaService.EXTRA_URL, imgurMedia.getLink()); intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, DownloadMediaService.EXTRA_MEDIA_TYPE_IMAGE); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, imgurMedia.getFileName()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - activity.startForegroundService(intent); - } else { - activity.startService(intent); - } + ContextCompat.startForegroundService(activity, intent); Toast.makeText(activity, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java index 3af97f85..01961e17 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewImgurVideoFragment.java @@ -149,7 +149,7 @@ public class ViewImgurVideoFragment extends Fragment { public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == R.id.action_download_view_imgur_video_fragment) { isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -189,11 +189,7 @@ public class ViewImgurVideoFragment extends Fragment { intent.putExtra(DownloadMediaService.EXTRA_URL, imgurMedia.getLink()); intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, DownloadMediaService.EXTRA_MEDIA_TYPE_VIDEO); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, imgurMedia.getFileName()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - activity.startForegroundService(intent); - } else { - activity.startService(intent); - } + ContextCompat.startForegroundService(activity, intent); Toast.makeText(activity, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java index 12e4a884..585730d5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryImageOrGifFragment.java @@ -223,7 +223,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -272,11 +272,7 @@ public class ViewRedditGalleryImageOrGifFragment extends Fragment { intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, media.mediaType == Post.Gallery.TYPE_GIF ? DownloadMediaService.EXTRA_MEDIA_TYPE_GIF: DownloadMediaService.EXTRA_MEDIA_TYPE_IMAGE); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, media.fileName); intent.putExtra(DownloadMediaService.EXTRA_SUBREDDIT_NAME, subredditName); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - activity.startForegroundService(intent); - } else { - activity.startService(intent); - } + ContextCompat.startForegroundService(activity, intent); Toast.makeText(activity, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java index 9530823d..a1258ce2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewRedditGalleryVideoFragment.java @@ -152,7 +152,7 @@ public class ViewRedditGalleryVideoFragment extends Fragment { public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (item.getItemId() == R.id.action_download_view_reddit_gallery_video_fragment) { isDownloading = true; - if (Build.VERSION.SDK_INT >= 23) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (ContextCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { @@ -193,11 +193,7 @@ public class ViewRedditGalleryVideoFragment extends Fragment { intent.putExtra(DownloadMediaService.EXTRA_MEDIA_TYPE, DownloadMediaService.EXTRA_MEDIA_TYPE_VIDEO); intent.putExtra(DownloadMediaService.EXTRA_FILE_NAME, galleryVideo.fileName); intent.putExtra(DownloadMediaService.EXTRA_SUBREDDIT_NAME, subredditName); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - activity.startForegroundService(intent); - } else { - activity.startService(intent); - } + ContextCompat.startForegroundService(activity, intent); Toast.makeText(activity, R.string.download_started, Toast.LENGTH_SHORT).show(); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java index 1246634a..a326d81f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadMediaService.java @@ -142,7 +142,7 @@ public class DownloadMediaService extends Service { if (response.isSuccessful() && response.body() != null) { String destinationFileDirectory = getDownloadLocation(mediaType); if (destinationFileDirectory.equals("")) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { File directory = getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); if (directory != null) { String directoryPath = separateDownloadFolder && subredditName != null && !subredditName.equals("") ? directory.getAbsolutePath() + "/Infinity/" + subredditName + "/" : directory.getAbsolutePath() + "/Infinity/"; @@ -235,7 +235,7 @@ public class DownloadMediaService extends Service { int mediaType) throws IOException { ContentResolver contentResolver = getContentResolver(); if (isDefaultDestination) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { InputStream inputStream = body.byteStream(); OutputStream outputStream = new FileOutputStream(destinationFileUriString); byte[] fileReader = new byte[4096]; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java index c4f37aca..73839464 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/services/DownloadRedditVideoService.java @@ -146,7 +146,7 @@ public class DownloadRedditVideoService extends Service { String destinationFileUriString; boolean isDefaultDestination; if (destinationFileDirectory.equals("")) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { File destinationDirectory = getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); if (destinationDirectory != null) { String destinationDirectoryPath = separateDownloadFolder ? destinationDirectory.getAbsolutePath() + "/Infinity/" + subredditName + "/" : destinationDirectory.getAbsolutePath() + "/Infinity/"; @@ -396,7 +396,7 @@ public class DownloadRedditVideoService extends Service { boolean isDefaultDestination) throws IOException { ContentResolver contentResolver = getContentResolver(); if (isDefaultDestination) { - if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { InputStream in = new FileInputStream(srcPath); OutputStream out = new FileOutputStream(destinationFileUriString); byte[] buf = new byte[1024]; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/FontPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/FontPreferenceFragment.java index 2d608ca5..0d43e619 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/FontPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/FontPreferenceFragment.java @@ -5,6 +5,7 @@ import android.content.Context; import android.os.Bundle; import androidx.annotation.NonNull; +import androidx.core.app.ActivityCompat; import androidx.preference.ListPreference; import androidx.preference.PreferenceFragmentCompat; @@ -30,7 +31,7 @@ public class FontPreferenceFragment extends PreferenceFragmentCompat { if (fontFamilyPreference != null) { fontFamilyPreference.setOnPreferenceChangeListener((preference, newValue) -> { EventBus.getDefault().post(new RecreateActivityEvent()); - activity.recreate(); + ActivityCompat.recreate(activity); return true; }); } @@ -52,7 +53,7 @@ public class FontPreferenceFragment extends PreferenceFragmentCompat { if (fontSizePreference != null) { fontSizePreference.setOnPreferenceChangeListener((preference, newValue) -> { EventBus.getDefault().post(new RecreateActivityEvent()); - activity.recreate(); + ActivityCompat.recreate(activity); return true; }); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java index e28cd52f..fba59d25 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/ThemePreferenceFragment.java @@ -9,6 +9,7 @@ import android.os.Bundle; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; +import androidx.core.app.ActivityCompat; import androidx.fragment.app.Fragment; import androidx.lifecycle.ViewModelProvider; import androidx.preference.ListPreference; @@ -109,7 +110,7 @@ public class ThemePreferenceFragment extends PreferenceFragmentCompat { amoledDarkSwitch.setOnPreferenceChangeListener((preference, newValue) -> { if ((getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) != Configuration.UI_MODE_NIGHT_NO) { EventBus.getDefault().post(new RecreateActivityEvent()); - activity.recreate(); + ActivityCompat.recreate(activity); } return true; }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java index 75cc004a..3c3255de 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/NotificationUtils.java @@ -3,6 +3,7 @@ package ml.docilealligator.infinityforreddit.utils; import android.app.NotificationChannel; import android.app.NotificationManager; import android.content.Context; +import android.os.Build; import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationManagerCompat; @@ -36,7 +37,7 @@ public class NotificationUtils { Context context, String title, String content, String summary, String channelId, String channelName, String group, int color) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_DEFAULT); notificationManager.createNotificationChannel(channel); } @@ -56,7 +57,7 @@ public class NotificationUtils { public static NotificationCompat.Builder buildSummaryNotification(Context context, NotificationManagerCompat notificationManager, String title, String content, String channelId, String channelName, String group, int color) { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_DEFAULT); notificationManager.createNotificationChannel(channel); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java index 8d51256d..2a59f2a5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/Utils.java @@ -8,7 +8,6 @@ import android.net.Network; import android.net.NetworkCapabilities; import android.net.NetworkInfo; import android.os.Build; -import android.text.Html; import android.text.Spannable; import android.util.DisplayMetrics; import android.view.inputmethod.InputMethodManager; @@ -17,6 +16,7 @@ import android.widget.TextView; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.core.graphics.drawable.DrawableCompat; +import androidx.core.text.HtmlCompat; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -135,13 +135,10 @@ public class Utils { } public static void setHTMLWithImageToTextView(TextView textView, String content, boolean enlargeImage) { - Spannable html; GlideImageGetter glideImageGetter = new GlideImageGetter(textView, enlargeImage); - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { - html = (Spannable) Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY, glideImageGetter, null); - } else { - html = (Spannable) Html.fromHtml(content, glideImageGetter, null); - } + Spannable html = (Spannable) HtmlCompat.fromHtml( + content, HtmlCompat.FROM_HTML_MODE_LEGACY, glideImageGetter, null); + textView.setText(html); }