From ba6c7de35a87c92f65a3b5d9f0f65d3c0aaa22c7 Mon Sep 17 00:00:00 2001 From: TacoTheDank Date: Thu, 27 Aug 2020 16:55:57 -0400 Subject: [PATCH] Use AndroidX preference --- .../newpipe/CheckForNewAppVersionTask.java | 2 +- .../org/schabi/newpipe/DownloaderImpl.java | 2 +- .../org/schabi/newpipe/ImageDownloader.java | 2 +- .../java/org/schabi/newpipe/MainActivity.java | 2 +- .../org/schabi/newpipe/RouterActivity.java | 2 +- .../newpipe/download/DownloadDialog.java | 4 ++-- .../newpipe/fragments/MainFragment.java | 6 ++--- .../fragments/detail/VideoDetailFragment.java | 12 ++++------ .../fragments/list/BaseListFragment.java | 2 +- .../fragments/list/search/SearchFragment.java | 2 +- .../list/videos/RelatedVideosFragment.java | 9 +++---- .../holder/StreamInfoItemHolder.java | 2 +- .../newpipe/local/BaseLocalListFragment.java | 2 +- .../local/feed/service/FeedLoadService.kt | 2 +- .../local/history/HistoryRecordManager.java | 2 +- .../subscription/SubscriptionFragment.kt | 2 +- .../org/schabi/newpipe/player/BasePlayer.java | 2 +- .../org/schabi/newpipe/player/MainPlayer.java | 2 +- .../schabi/newpipe/player/VideoPlayer.java | 2 +- .../newpipe/player/VideoPlayerImpl.java | 2 +- .../helper/PlaybackParameterDialog.java | 7 +++--- .../newpipe/player/helper/PlayerHelper.java | 2 +- .../settings/BasePreferenceFragment.java | 4 ++-- .../settings/ContentSettingsFragment.java | 10 ++++---- .../PeertubeInstanceListFragment.java | 2 +- .../newpipe/settings/tabs/TabsManager.java | 2 +- .../schabi/newpipe/util/FilenameUtils.java | 2 +- .../org/schabi/newpipe/util/ListHelper.java | 2 +- .../org/schabi/newpipe/util/Localization.java | 2 +- .../schabi/newpipe/util/NavigationHelper.java | 2 +- .../schabi/newpipe/util/PeertubeHelper.java | 2 +- .../schabi/newpipe/util/ServiceHelper.java | 2 +- .../org/schabi/newpipe/util/ThemeHelper.java | 2 +- .../giga/service/DownloadManagerService.java | 2 +- .../giga/ui/fragment/MissionsFragment.java | 4 ++-- app/src/main/res/xml/appearance_settings.xml | 2 +- app/src/main/res/xml/content_settings.xml | 14 +++++------ app/src/main/res/xml/debug_settings.xml | 6 ++--- app/src/main/res/xml/download_settings.xml | 6 ++--- app/src/main/res/xml/history_settings.xml | 8 +++---- app/src/main/res/xml/update_settings.xml | 2 +- app/src/main/res/xml/video_audio_settings.xml | 24 +++++++++---------- 42 files changed, 86 insertions(+), 86 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java index 0d211fdfd..d91230765 100644 --- a/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java +++ b/app/src/main/java/org/schabi/newpipe/CheckForNewAppVersionTask.java @@ -11,7 +11,7 @@ import android.content.pm.Signature; import android.net.ConnectivityManager; import android.net.Uri; import android.os.AsyncTask; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import androidx.core.app.NotificationCompat; diff --git a/app/src/main/java/org/schabi/newpipe/DownloaderImpl.java b/app/src/main/java/org/schabi/newpipe/DownloaderImpl.java index 9cba0667b..c1c3eb0cd 100644 --- a/app/src/main/java/org/schabi/newpipe/DownloaderImpl.java +++ b/app/src/main/java/org/schabi/newpipe/DownloaderImpl.java @@ -2,7 +2,7 @@ package org.schabi.newpipe; import android.content.Context; import android.os.Build; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; diff --git a/app/src/main/java/org/schabi/newpipe/ImageDownloader.java b/app/src/main/java/org/schabi/newpipe/ImageDownloader.java index ca61c9655..c2897cff1 100644 --- a/app/src/main/java/org/schabi/newpipe/ImageDownloader.java +++ b/app/src/main/java/org/schabi/newpipe/ImageDownloader.java @@ -4,7 +4,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import com.nostra13.universalimageloader.core.download.BaseImageDownloader; diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index c3086d02c..aedf64231 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -27,7 +27,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.view.KeyEvent; diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java index 70fceaf07..391574e56 100644 --- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java +++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java @@ -8,7 +8,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.text.TextUtils; import android.view.ContextThemeWrapper; import android.view.LayoutInflater; 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 ab44e0fc1..17d079d50 100644 --- a/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java +++ b/app/src/main/java/org/schabi/newpipe/download/DownloadDialog.java @@ -10,7 +10,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.IBinder; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater; @@ -295,7 +295,7 @@ public class DownloadDialog extends DialogFragment initToolbar(view.findViewById(R.id.toolbar)); setupDownloadOptions(); - prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + prefs = PreferenceManager.getDefaultSharedPreferences(requireContext()); final int threads = prefs.getInt(getString(R.string.default_download_threads), 3); threadsCountTextView.setText(String.valueOf(threads)); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java index 472dc3409..d138a298c 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/MainFragment.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.fragments; import android.content.Context; import android.content.res.ColorStateList; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; @@ -74,7 +74,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte youtubeRestrictedModeEnabledKey = getString(R.string.youtube_restricted_mode_enabled); previousYoutubeRestrictedModeEnabled = - PreferenceManager.getDefaultSharedPreferences(getContext()) + PreferenceManager.getDefaultSharedPreferences(requireContext()) .getBoolean(youtubeRestrictedModeEnabledKey, false); } @@ -105,7 +105,7 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte super.onResume(); final boolean youtubeRestrictedModeEnabled = - PreferenceManager.getDefaultSharedPreferences(getContext()) + PreferenceManager.getDefaultSharedPreferences(requireContext()) .getBoolean(youtubeRestrictedModeEnabledKey, false); if (previousYoutubeRestrictedModeEnabled != youtubeRestrictedModeEnabled) { previousYoutubeRestrictedModeEnabled = youtubeRestrictedModeEnabled; 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 b92becbd1..863c4eb7e 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 @@ -16,7 +16,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.provider.Settings; import android.text.Html; import android.text.Spanned; @@ -427,7 +427,7 @@ public class VideoDetailFragment currentWorker.dispose(); } saveCurrentAndRestoreDefaultBrightness(); - PreferenceManager.getDefaultSharedPreferences(getContext()) + PreferenceManager.getDefaultSharedPreferences(requireContext()) .edit() .putString(getString(R.string.stream_info_selected_tab_key), pageAdapter.getItemTitle(viewPager.getCurrentItem())) @@ -553,7 +553,6 @@ public class VideoDetailFragment Serializable serializable = savedState.getSerializable(INFO_KEY); if (serializable instanceof StreamInfo) { - //noinspection unchecked currentInfo = (StreamInfo) serializable; InfoCache.getInstance().putInfo(serviceId, url, currentInfo, InfoItem.InfoType.STREAM); } @@ -673,7 +672,7 @@ public class VideoDetailFragment } break; case R.id.detail_title_root_layout: - ShareUtils.copyToClipboard(getContext(), videoTitleTextView.getText().toString()); + ShareUtils.copyToClipboard(requireContext(), videoTitleTextView.getText().toString()); break; } @@ -1106,7 +1105,7 @@ public class VideoDetailFragment player.toggleFullscreen(); } - if (!useExternalAudioPlayer && android.os.Build.VERSION.SDK_INT >= 16) { + if (!useExternalAudioPlayer) { openNormalBackgroundPlayer(append); } else { startOnExternalPlayer(activity, currentInfo, audioStream); @@ -1308,7 +1307,6 @@ public class VideoDetailFragment if (Build.VERSION.SDK_INT >= 24) { parsedDescription = Html.fromHtml(descriptionText, 0); } else { - //noinspection deprecation parsedDescription = Html.fromHtml(descriptionText); } return parsedDescription; @@ -1320,7 +1318,7 @@ public class VideoDetailFragment videoDescriptionView.setVisibility(View.VISIBLE); })); } else if (description.getType() == Description.MARKDOWN) { - final Markwon markwon = Markwon.builder(getContext()) + final Markwon markwon = Markwon.builder(requireContext()) .usePlugin(LinkifyPlugin.create()) .build(); markwon.setMarkdown(videoDescriptionView, description.getContent()); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java index 152221c4c..37598eb1a 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/BaseListFragment.java @@ -6,7 +6,7 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.view.Menu; import android.view.MenuInflater; diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java index 44cdb8164..18c7fb1dd 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/search/SearchFragment.java @@ -5,7 +5,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.text.Editable; import android.text.Html; import android.text.TextUtils; diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java index 0aef68d90..9d1f5acbd 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/videos/RelatedVideosFragment.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.fragments.list.videos; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -78,11 +78,11 @@ public class RelatedVideosFragment extends BaseListInfoFragment - PreferenceManager.getDefaultSharedPreferences(getContext()).edit() + PreferenceManager.getDefaultSharedPreferences(requireContext()).edit() .putBoolean(getString(R.string.auto_queue_key), b).apply()); return headerRootLayout; } else { @@ -201,7 +201,8 @@ public class RelatedVideosFragment extends BaseListInfoFragment { // save whether pitch and tempo are unhooked or not - PreferenceManager.getDefaultSharedPreferences(getContext()) + PreferenceManager.getDefaultSharedPreferences(requireContext()) .edit() .putBoolean(getString(R.string.playback_unhook_key), isChecked) .apply(); diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java index 09072340b..2d29082f0 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.player.helper; import android.content.Context; import android.content.SharedPreferences; import android.os.Build; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.provider.Settings; import android.view.accessibility.CaptioningManager; diff --git a/app/src/main/java/org/schabi/newpipe/settings/BasePreferenceFragment.java b/app/src/main/java/org/schabi/newpipe/settings/BasePreferenceFragment.java index d8b686297..c49be8c56 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/BasePreferenceFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/BasePreferenceFragment.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.settings; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.view.View; import androidx.annotation.Nullable; @@ -20,7 +20,7 @@ public abstract class BasePreferenceFragment extends PreferenceFragmentCompat { @Override public void onCreate(@Nullable final Bundle savedInstanceState) { - defaultPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); + defaultPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); super.onCreate(savedInstanceState); } diff --git a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java index 6ea2cc8a6..df30a21f3 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java @@ -7,7 +7,7 @@ import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.widget.Toast; @@ -74,7 +74,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { initialSelectedContentCountry = org.schabi.newpipe.util.Localization .getPreferredContentCountry(requireContext()); initialLanguage = PreferenceManager - .getDefaultSharedPreferences(getContext()).getString("app_language_key", "en"); + .getDefaultSharedPreferences(requireContext()).getString("app_language_key", "en"); } @Override @@ -148,7 +148,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { final ContentCountry selectedContentCountry = org.schabi.newpipe.util.Localization .getPreferredContentCountry(requireContext()); final String selectedLanguage = PreferenceManager - .getDefaultSharedPreferences(getContext()).getString("app_language_key", "en"); + .getDefaultSharedPreferences(requireContext()).getString("app_language_key", "en"); if (!selectedLocalization.equals(initialSelectedLocalization) || !selectedContentCountry.equals(initialSelectedContentCountry) @@ -217,7 +217,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { try { output = new ObjectOutputStream(new FileOutputStream(dst)); final SharedPreferences pref - = PreferenceManager.getDefaultSharedPreferences(getContext()); + = PreferenceManager.getDefaultSharedPreferences(requireContext()); output.writeObject(pref.getAll()); } catch (final IOException e) { @@ -299,7 +299,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment { try { input = new ObjectInputStream(new FileInputStream(src)); final SharedPreferences.Editor prefEdit = PreferenceManager - .getDefaultSharedPreferences(getContext()).edit(); + .getDefaultSharedPreferences(requireContext()).edit(); prefEdit.clear(); final Map entries = (Map) input.readObject(); for (final Map.Entry entry : entries.entrySet()) { diff --git a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java index dfa975eef..7dc96e882 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/PeertubeInstanceListFragment.java @@ -4,7 +4,7 @@ import android.annotation.SuppressLint; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.text.InputType; import android.view.LayoutInflater; import android.view.Menu; diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/TabsManager.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/TabsManager.java index 316e3a835..02b0c3df5 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/TabsManager.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/TabsManager.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.settings.tabs; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.widget.Toast; import org.schabi.newpipe.R; diff --git a/app/src/main/java/org/schabi/newpipe/util/FilenameUtils.java b/app/src/main/java/org/schabi/newpipe/util/FilenameUtils.java index dda01b60c..27e1f3048 100644 --- a/app/src/main/java/org/schabi/newpipe/util/FilenameUtils.java +++ b/app/src/main/java/org/schabi/newpipe/util/FilenameUtils.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.util; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import org.schabi.newpipe.R; diff --git a/app/src/main/java/org/schabi/newpipe/util/ListHelper.java b/app/src/main/java/org/schabi/newpipe/util/ListHelper.java index be0630cac..7a428a05d 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ListHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ListHelper.java @@ -3,7 +3,7 @@ package org.schabi.newpipe.util; import android.content.Context; import android.content.SharedPreferences; import android.net.ConnectivityManager; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import androidx.annotation.Nullable; import androidx.annotation.StringRes; diff --git a/app/src/main/java/org/schabi/newpipe/util/Localization.java b/app/src/main/java/org/schabi/newpipe/util/Localization.java index 3642216ff..767cebcea 100644 --- a/app/src/main/java/org/schabi/newpipe/util/Localization.java +++ b/app/src/main/java/org/schabi/newpipe/util/Localization.java @@ -5,7 +5,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.text.TextUtils; import android.util.DisplayMetrics; diff --git a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java index 96dfc1925..693265fcd 100644 --- a/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/NavigationHelper.java @@ -7,7 +7,7 @@ import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.widget.Toast; diff --git a/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java b/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java index 5481b519c..e28095798 100644 --- a/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/PeertubeHelper.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.util; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import com.grack.nanojson.JsonArray; import com.grack.nanojson.JsonObject; diff --git a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java index 1ab54343a..8f3423b22 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java @@ -2,7 +2,7 @@ package org.schabi.newpipe.util; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import androidx.annotation.DrawableRes; import androidx.annotation.StringRes; diff --git a/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java b/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java index 88e1a31cd..051fbbcf8 100644 --- a/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java +++ b/app/src/main/java/org/schabi/newpipe/util/ThemeHelper.java @@ -21,7 +21,7 @@ package org.schabi.newpipe.util; import android.content.Context; import android.content.res.TypedArray; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.TypedValue; import android.view.ContextThemeWrapper; diff --git a/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java b/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java index 3da0e75b8..a78c0db42 100755 --- a/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java +++ b/app/src/main/java/us/shandian/giga/service/DownloadManagerService.java @@ -24,7 +24,7 @@ import android.os.Handler.Callback; import android.os.IBinder; import android.os.Message; import android.os.Parcelable; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.util.Log; import android.util.SparseArray; import android.widget.Toast; diff --git a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java index 09f4d0c79..35f40aa82 100644 --- a/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java +++ b/app/src/main/java/us/shandian/giga/ui/fragment/MissionsFragment.java @@ -11,7 +11,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.IBinder; -import android.preference.PreferenceManager; +import androidx.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -97,7 +97,7 @@ public class MissionsFragment extends Fragment { public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.missions, container, false); - mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); + mPrefs = PreferenceManager.getDefaultSharedPreferences(requireActivity()); mLinear = mPrefs.getBoolean("linear", false); // Bind the service diff --git a/app/src/main/res/xml/appearance_settings.xml b/app/src/main/res/xml/appearance_settings.xml index 31be267af..8049da868 100644 --- a/app/src/main/res/xml/appearance_settings.xml +++ b/app/src/main/res/xml/appearance_settings.xml @@ -13,7 +13,7 @@ android:summary="%s" android:title="@string/theme_title"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -