From ee15a72e4fd6fc8669c97ed1db4561eb191033d3 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:03:08 +0200
Subject: [PATCH 1/8] Fix build failing locally due to outdated kotlin version
---
build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index 6d19a6f8a..4b0863f89 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.9.10'
+ ext.kotlin_version = '1.9.25'
repositories {
google()
mavenCentral()
From 8106ba68b5cde95f67eb91736f54d2de19f9e5f1 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 20:57:21 +0200
Subject: [PATCH 2/8] CI: Use Java 21
---
.github/workflows/ci.yml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9ae3a77c2..54415858e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -47,10 +47,10 @@ jobs:
BRANCH: ${{ github.head_ref }}
run: git checkout -B "$BRANCH"
- - name: set up JDK 17
+ - name: set up JDK
uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
@@ -88,10 +88,10 @@ jobs:
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- - name: set up JDK 17
+ - name: set up JDK
uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
@@ -121,10 +121,10 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- - name: Set up JDK 17
+ - name: Set up JDK
uses: actions/setup-java@v4
with:
- java-version: 17
+ java-version: 21
distribution: "temurin"
cache: 'gradle'
From d80b6a759c249983f472861e606821817b0c150f Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:03:33 +0200
Subject: [PATCH 3/8] Use working Extractor version The tag can't be resolved
by Jitpack so use the commit-hash instead
---
app/build.gradle | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index 081bc2766..ba7ad3a4f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -198,7 +198,8 @@ dependencies {
// name and the commit hash with the commit hash of the (pushed) commit you want to test
// This works thanks to JitPack: https://jitpack.io/
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
- implementation 'com.github.TeamNewPipe:NewPipeExtractor:v0.24.2'
+ // WORKAROUND: v0.24.2 can't be resolved by jitpack -> use git commit hash instead
+ implementation 'com.github.TeamNewPipe:NewPipeExtractor:176da72cb4c3ec4679211339b0e59f6b01bf2f52'
implementation 'com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'
/** Checkstyle **/
From ea0da5fdbd26527a17f5d53a9a80cb12710b4472 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:18:06 +0200
Subject: [PATCH 4/8] Delete symlink
---
app/src/main/res/layout-land/list_stream_card_item.xml | 1 -
1 file changed, 1 deletion(-)
delete mode 120000 app/src/main/res/layout-land/list_stream_card_item.xml
diff --git a/app/src/main/res/layout-land/list_stream_card_item.xml b/app/src/main/res/layout-land/list_stream_card_item.xml
deleted file mode 120000
index 70228ee1d..000000000
--- a/app/src/main/res/layout-land/list_stream_card_item.xml
+++ /dev/null
@@ -1 +0,0 @@
-../layout/list_stream_item.xml
\ No newline at end of file
From b1d4b66aa6c21cc9899b1b9ccbb293e297f49a43 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:18:34 +0200
Subject: [PATCH 5/8] Replace symlink with original
Co-Authored-By: Thompson3142 <115718208+thompson3142@users.noreply.github.com>
---
.../res/layout-land/list_stream_card_item.xml | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 app/src/main/res/layout-land/list_stream_card_item.xml
diff --git a/app/src/main/res/layout-land/list_stream_card_item.xml b/app/src/main/res/layout-land/list_stream_card_item.xml
new file mode 100644
index 000000000..793942568
--- /dev/null
+++ b/app/src/main/res/layout-land/list_stream_card_item.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 93843650612d1f54fdc7c757d96b5f88423459f0 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:39:44 +0200
Subject: [PATCH 6/8] Update Gradle to latest version
---
build.gradle | 2 +-
gradle/wrapper/gradle-wrapper.properties | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/build.gradle b/build.gradle
index 4b0863f89..d93abc4c0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:8.2.0'
+ classpath 'com.android.tools.build:gradle:8.7.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index d022615ff..4ea536e77 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionSha256Sum=38f66cd6eef217b4c35855bb11ea4e9fbc53594ccccb5fb82dfd317ef8c2c5a3
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
+distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
From 2482615460a23bfaeefe28f7d9c7fc9e4788e0b2 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Tue, 22 Oct 2024 21:40:16 +0200
Subject: [PATCH 7/8] Fix Android Gradle plugin warning
---
app/build.gradle | 1 +
gradle.properties | 1 -
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/build.gradle b/app/build.gradle
index ba7ad3a4f..b92df2d4c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -92,6 +92,7 @@ android {
buildFeatures {
viewBinding true
+ buildConfig true
}
packagingOptions {
diff --git a/gradle.properties b/gradle.properties
index 0ca913222..ed32303da 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,4 +1,3 @@
-android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=false
android.nonFinalResIds=false
android.nonTransitiveRClass=true
From 2e96b65fda3ea6d3681617c16246683abee96155 Mon Sep 17 00:00:00 2001
From: litetex <40789489+litetex@users.noreply.github.com>
Date: Wed, 23 Oct 2024 21:28:07 +0200
Subject: [PATCH 8/8] Replaced ``Icepick`` with ``Bridge`` and
``Android-State``
* IcePick fails on Java 21 (default in Android Studio 2024.2)
* Bridge is the most modern alternative that is currently available. It is backed by ``Android-State`` and can be configured with various frameworks
* In the long term this should be replaced with something better
---
app/build.gradle | 7 ++-
app/proguard-rules.pro | 9 ---
app/src/main/java/org/schabi/newpipe/App.java | 6 +-
.../java/org/schabi/newpipe/BaseFragment.java | 9 +--
.../org/schabi/newpipe/RouterActivity.java | 9 +--
.../org/schabi/newpipe/about/AboutActivity.kt | 8 ++-
.../newpipe/download/DownloadDialog.java | 12 ++--
.../newpipe/fragments/BaseStateFragment.java | 5 +-
.../fragments/detail/DescriptionFragment.java | 6 +-
.../fragments/detail/VideoDetailFragment.java | 2 +-
.../fragments/list/BaseListInfoFragment.java | 5 +-
.../list/channel/ChannelAboutFragment.java | 6 +-
.../list/channel/ChannelFragment.java | 16 ++---
.../list/channel/ChannelTabFragment.java | 6 +-
.../list/comments/CommentRepliesFragment.java | 3 +-
.../fragments/list/kiosk/KioskFragment.java | 3 +-
.../fragments/list/search/SearchFragment.java | 7 ++-
.../local/bookmark/BookmarkFragment.java | 7 ++-
.../schabi/newpipe/local/feed/FeedFragment.kt | 2 +-
.../history/StatisticsPlaylistFragment.java | 3 +-
.../local/playlist/LocalPlaylistFragment.java | 8 ++-
.../ImportConfirmationDialog.java | 14 ++---
.../subscription/SubscriptionFragment.kt | 2 +-
.../SubscriptionsImportFragment.java | 4 +-
.../subscription/dialog/FeedGroupDialog.kt | 8 +--
.../dialog/FeedGroupReorderDialog.kt | 12 ++--
.../helper/PlaybackParameterDialog.java | 10 +--
.../newpipe/settings/SettingsActivity.java | 9 ++-
.../util/BridgeStateSaverInitializer.java | 61 +++++++++++++++++++
.../schabi/newpipe/views/CollapsibleView.java | 16 ++---
30 files changed, 171 insertions(+), 104 deletions(-)
create mode 100644 app/src/main/java/org/schabi/newpipe/util/BridgeStateSaverInitializer.java
diff --git a/app/build.gradle b/app/build.gradle
index b92df2d4c..d0426d5a2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -113,7 +113,7 @@ ext {
androidxRoomVersion = '2.6.1'
androidxWorkVersion = '2.8.1'
- icepickVersion = '3.2.0'
+ stateSaverVersion = '1.4.1'
exoPlayerVersion = '2.18.7'
googleAutoServiceVersion = '1.1.1'
groupieVersion = '2.10.1'
@@ -236,8 +236,9 @@ dependencies {
/** Third-party libraries **/
// Instance state boilerplate elimination
- implementation "frankiesardo:icepick:${icepickVersion}"
- kapt "frankiesardo:icepick-processor:${icepickVersion}"
+ implementation 'com.github.livefront:bridge:v2.0.2'
+ implementation "com.evernote:android-state:$stateSaverVersion"
+ kapt "com.evernote:android-state-processor:$stateSaverVersion"
// HTML parser
implementation "org.jsoup:jsoup:1.17.2"
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 435c4e29b..215df0da5 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -13,15 +13,6 @@
## Rules for ExoPlayer
-keep class com.google.android.exoplayer2.** { *; }
-## Rules for Icepick. Copy pasted from https://github.com/frankiesardo/icepick
--dontwarn icepick.**
--keep class icepick.** { *; }
--keep class **$$Icepick { *; }
--keepclasseswithmembernames class * {
- @icepick.* ;
-}
--keepnames class * { @icepick.State *;}
-
## Rules for OkHttp. Copy pasted from https://github.com/square/okhttp
-dontwarn okhttp3.**
-dontwarn okio.**
diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java
index d92425d20..9bc25d55d 100644
--- a/app/src/main/java/org/schabi/newpipe/App.java
+++ b/app/src/main/java/org/schabi/newpipe/App.java
@@ -19,11 +19,12 @@ import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.ktx.ExceptionUtils;
import org.schabi.newpipe.settings.NewPipeSettings;
+import org.schabi.newpipe.util.BridgeStateSaverInitializer;
import org.schabi.newpipe.util.Localization;
-import org.schabi.newpipe.util.image.ImageStrategy;
-import org.schabi.newpipe.util.image.PicassoHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.StateSaver;
+import org.schabi.newpipe.util.image.ImageStrategy;
+import org.schabi.newpipe.util.image.PicassoHelper;
import org.schabi.newpipe.util.image.PreferredImageQuality;
import java.io.IOException;
@@ -101,6 +102,7 @@ public class App extends Application {
Localization.getPreferredContentCountry(this));
Localization.initPrettyTime(Localization.resolvePrettyTime(getApplicationContext()));
+ BridgeStateSaverInitializer.init(this);
StateSaver.init(this);
initNotificationChannels();
diff --git a/app/src/main/java/org/schabi/newpipe/BaseFragment.java b/app/src/main/java/org/schabi/newpipe/BaseFragment.java
index 7a06771dd..a55a341e6 100644
--- a/app/src/main/java/org/schabi/newpipe/BaseFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/BaseFragment.java
@@ -10,8 +10,9 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import icepick.Icepick;
-import icepick.State;
+import com.evernote.android.state.State;
+import com.livefront.bridge.Bridge;
+
public abstract class BaseFragment extends Fragment {
protected final String TAG = getClass().getSimpleName() + "@" + Integer.toHexString(hashCode());
@@ -48,7 +49,7 @@ public abstract class BaseFragment extends Fragment {
+ "savedInstanceState = [" + savedInstanceState + "]");
}
super.onCreate(savedInstanceState);
- Icepick.restoreInstanceState(this, savedInstanceState);
+ Bridge.restoreInstanceState(this, savedInstanceState);
if (savedInstanceState != null) {
onRestoreInstanceState(savedInstanceState);
}
@@ -70,7 +71,7 @@ public abstract class BaseFragment extends Fragment {
@Override
public void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
- Icepick.saveInstanceState(this, outState);
+ Bridge.saveInstanceState(this, outState);
}
protected void onRestoreInstanceState(@NonNull final Bundle savedInstanceState) {
diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java
index c59dc7532..197c965ba 100644
--- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java
@@ -41,6 +41,9 @@ import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.preference.PreferenceManager;
+import com.evernote.android.state.State;
+import com.livefront.bridge.Bridge;
+
import org.schabi.newpipe.database.stream.model.StreamEntity;
import org.schabi.newpipe.databinding.ListRadioIconItemBinding;
import org.schabi.newpipe.databinding.SingleChoiceDialogViewBinding;
@@ -98,8 +101,6 @@ import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
-import icepick.Icepick;
-import icepick.State;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Single;
@@ -152,7 +153,7 @@ public class RouterActivity extends AppCompatActivity {
getWindow().setAttributes(params);
super.onCreate(savedInstanceState);
- Icepick.restoreInstanceState(this, savedInstanceState);
+ Bridge.restoreInstanceState(this, savedInstanceState);
// FragmentManager will take care to recreate (Playlist|Download)Dialog when screen rotates
// We used to .setOnDismissListener(dialog -> finish()); when creating these DialogFragments
@@ -197,7 +198,7 @@ public class RouterActivity extends AppCompatActivity {
@Override
protected void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
- Icepick.saveInstanceState(this, outState);
+ Bridge.saveInstanceState(this, outState);
}
@Override
diff --git a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt
index 7f148e9b5..045278da7 100644
--- a/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt
+++ b/app/src/main/java/org/schabi/newpipe/about/AboutActivity.kt
@@ -138,8 +138,12 @@ class AboutActivity : AppCompatActivity() {
"https://github.com/lisawray/groupie", StandardLicenses.MIT
),
SoftwareComponent(
- "Icepick", "2015", "Frankie Sardo",
- "https://github.com/frankiesardo/icepick", StandardLicenses.EPL1
+ "Android-State", "2018", "Evernote",
+ "https://github.com/Evernote/android-state", StandardLicenses.EPL1
+ ),
+ SoftwareComponent(
+ "Bridge", "2021", "Livefront",
+ "https://github.com/livefront/bridge", StandardLicenses.APACHE2
),
SoftwareComponent(
"Jsoup", "2009 - 2020", "Jonathan Hedley",
diff --git a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java
index db2066b27..34a4ba022 100644
--- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java
+++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java
@@ -39,6 +39,8 @@ import androidx.documentfile.provider.DocumentFile;
import androidx.fragment.app.DialogFragment;
import androidx.preference.PreferenceManager;
+import com.evernote.android.state.State;
+import com.livefront.bridge.Bridge;
import com.nononsenseapps.filepicker.Utils;
import org.schabi.newpipe.MainActivity;
@@ -59,6 +61,8 @@ import org.schabi.newpipe.settings.NewPipeSettings;
import org.schabi.newpipe.streams.io.NoFileManagerSafeGuard;
import org.schabi.newpipe.streams.io.StoredDirectoryHelper;
import org.schabi.newpipe.streams.io.StoredFileHelper;
+import org.schabi.newpipe.util.AudioTrackAdapter;
+import org.schabi.newpipe.util.AudioTrackAdapter.AudioTracksWrapper;
import org.schabi.newpipe.util.FilePickerActivityHelper;
import org.schabi.newpipe.util.FilenameUtils;
import org.schabi.newpipe.util.ListHelper;
@@ -67,8 +71,6 @@ import org.schabi.newpipe.util.SecondaryStreamHelper;
import org.schabi.newpipe.util.SimpleOnSeekBarChangeListener;
import org.schabi.newpipe.util.StreamItemAdapter;
import org.schabi.newpipe.util.StreamItemAdapter.StreamInfoWrapper;
-import org.schabi.newpipe.util.AudioTrackAdapter;
-import org.schabi.newpipe.util.AudioTrackAdapter.AudioTracksWrapper;
import org.schabi.newpipe.util.ThemeHelper;
import java.io.File;
@@ -79,8 +81,6 @@ import java.util.Locale;
import java.util.Objects;
import java.util.Optional;
-import icepick.Icepick;
-import icepick.State;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import us.shandian.giga.get.MissionRecoveryInfo;
import us.shandian.giga.postprocessing.Postprocessing;
@@ -214,7 +214,7 @@ public class DownloadDialog extends DialogFragment
context = getContext();
setStyle(STYLE_NO_TITLE, ThemeHelper.getDialogTheme(context));
- Icepick.restoreInstanceState(this, savedInstanceState);
+ Bridge.restoreInstanceState(this, savedInstanceState);
this.audioTrackAdapter = new AudioTrackAdapter(wrappedAudioTracks);
this.subtitleStreamsAdapter = new StreamItemAdapter<>(wrappedSubtitleStreams);
@@ -372,7 +372,7 @@ public class DownloadDialog extends DialogFragment
@Override
public void onSaveInstanceState(@NonNull final Bundle outState) {
super.onSaveInstanceState(outState);
- Icepick.saveInstanceState(this, outState);
+ Bridge.saveInstanceState(this, outState);
}
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/BaseStateFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/BaseStateFragment.java
index a3d3d8b60..8361953b9 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/BaseStateFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/BaseStateFragment.java
@@ -13,6 +13,8 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment;
+import com.evernote.android.state.State;
+
import org.schabi.newpipe.BaseFragment;
import org.schabi.newpipe.R;
import org.schabi.newpipe.error.ErrorInfo;
@@ -22,8 +24,6 @@ import org.schabi.newpipe.util.InfoCache;
import java.util.concurrent.atomic.AtomicBoolean;
-import icepick.State;
-
public abstract class BaseStateFragment extends BaseFragment implements ViewContract {
@State
protected AtomicBoolean wasLoading = new AtomicBoolean();
@@ -134,6 +134,7 @@ public abstract class BaseStateFragment extends BaseFragment implements ViewC
hideErrorPanel();
}
+ @Override
public void showEmptyState() {
isLoading.set(false);
if (emptyStateView != null) {
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java
index 581e54156..52fb3f29e 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/DescriptionFragment.java
@@ -11,6 +11,8 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
+import com.evernote.android.state.State;
+
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.stream.Description;
@@ -19,8 +21,6 @@ import org.schabi.newpipe.util.Localization;
import java.util.List;
-import icepick.State;
-
public class DescriptionFragment extends BaseDescriptionFragment {
@State
@@ -31,7 +31,7 @@ public class DescriptionFragment extends BaseDescriptionFragment {
}
public DescriptionFragment() {
- // keep empty constructor for IcePick when resuming fragment from memory
+ // keep empty constructor for State when resuming fragment from memory
}
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
index 95b54f65a..1d1e166e7 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
@@ -56,6 +56,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;
+import com.evernote.android.state.State;
import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.material.appbar.AppBarLayout;
@@ -127,7 +128,6 @@ import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
-import icepick.State;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
import io.reactivex.rxjava3.disposables.Disposable;
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java
index dd5eb6c8a..61a361f23 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListInfoFragment.java
@@ -9,6 +9,8 @@ import android.view.View;
import androidx.annotation.NonNull;
+import com.evernote.android.state.State;
+
import org.schabi.newpipe.R;
import org.schabi.newpipe.error.ErrorInfo;
import org.schabi.newpipe.error.UserAction;
@@ -24,7 +26,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
-import icepick.State;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Single;
import io.reactivex.rxjava3.disposables.Disposable;
@@ -143,7 +144,7 @@ public abstract class BaseListInfoFragment {
+ .subscribe((@NonNull final L result) -> {
isLoading.set(false);
currentInfo = result;
currentNextPage = result.getNextPage();
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java
index 0dc2fb65a..b7f4a9d3d 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelAboutFragment.java
@@ -10,6 +10,8 @@ import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.evernote.android.state.State;
+
import org.schabi.newpipe.R;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.channel.ChannelInfo;
@@ -20,8 +22,6 @@ import org.schabi.newpipe.util.Localization;
import java.util.List;
-import icepick.State;
-
public class ChannelAboutFragment extends BaseDescriptionFragment {
@State
protected ChannelInfo channelInfo;
@@ -31,7 +31,7 @@ public class ChannelAboutFragment extends BaseDescriptionFragment {
}
public ChannelAboutFragment() {
- // keep empty constructor for IcePick when resuming fragment from memory
+ // keep empty constructor for State when resuming fragment from memory
}
@Override
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java
index fd382adbf..d67cd11f1 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java
@@ -25,6 +25,7 @@ import androidx.core.graphics.ColorUtils;
import androidx.core.view.MenuProvider;
import androidx.preference.PreferenceManager;
+import com.evernote.android.state.State;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.tabs.TabLayout;
import com.jakewharton.rxbinding4.view.RxView;
@@ -50,16 +51,15 @@ import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.Localization;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.StateSaver;
-import org.schabi.newpipe.util.image.ImageStrategy;
-import org.schabi.newpipe.util.image.PicassoHelper;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.util.external_communication.ShareUtils;
+import org.schabi.newpipe.util.image.ImageStrategy;
+import org.schabi.newpipe.util.image.PicassoHelper;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.TimeUnit;
-import icepick.State;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.disposables.CompositeDisposable;
@@ -249,7 +249,7 @@ public class ChannelFragment extends BaseStateFragment
//////////////////////////////////////////////////////////////////////////*/
private void monitorSubscription(final ChannelInfo info) {
- final Consumer onError = (Throwable throwable) -> {
+ final Consumer onError = (final Throwable throwable) -> {
animate(binding.channelSubscribeButton, false, 100);
showSnackBarError(new ErrorInfo(throwable, UserAction.SUBSCRIPTION_GET,
"Get subscription status", currentInfo));
@@ -284,14 +284,14 @@ public class ChannelFragment extends BaseStateFragment
}
private Function