Use AndroidX preference
This commit is contained in:
parent
79e2bb382f
commit
ba6c7de35a
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<RelatedStreamInf
|
|||
autoplaySwitch = headerRootLayout.findViewById(R.id.autoplay_switch);
|
||||
|
||||
final SharedPreferences pref = PreferenceManager
|
||||
.getDefaultSharedPreferences(getContext());
|
||||
.getDefaultSharedPreferences(requireContext());
|
||||
final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
|
||||
autoplaySwitch.setChecked(autoplay);
|
||||
autoplaySwitch.setOnCheckedChangeListener((compoundButton, b) ->
|
||||
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<RelatedStreamInf
|
|||
@Override
|
||||
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences,
|
||||
final String s) {
|
||||
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
final SharedPreferences pref =
|
||||
PreferenceManager.getDefaultSharedPreferences(requireContext());
|
||||
final boolean autoplay = pref.getBoolean(getString(R.string.auto_queue_key), false);
|
||||
if (autoplaySwitch != null) {
|
||||
autoplaySwitch.setChecked(autoplay);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.schabi.newpipe.info_list.holder;
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
|
|
@ -4,7 +4,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;
|
||||
|
|
|
@ -27,10 +27,10 @@ import android.content.Intent
|
|||
import android.content.IntentFilter
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.preference.PreferenceManager
|
||||
import android.util.Log
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.preference.PreferenceManager
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.Notification
|
||||
import io.reactivex.Single
|
||||
|
|
|
@ -20,7 +20,7 @@ package org.schabi.newpipe.local.history;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import android.content.res.Configuration
|
|||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.os.Parcelable
|
||||
import android.preference.PreferenceManager
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
|
@ -20,6 +19,7 @@ import android.view.ViewGroup
|
|||
import android.widget.Toast
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.nononsenseapps.filepicker.Utils
|
||||
import com.xwray.groupie.Group
|
||||
|
|
|
@ -27,7 +27,7 @@ import android.content.SharedPreferences;
|
|||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.media.AudioManager;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
|
|
@ -30,7 +30,7 @@ import android.graphics.Bitmap;
|
|||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
|
|
|
@ -32,7 +32,7 @@ import android.graphics.Color;
|
|||
import android.graphics.PorterDuff;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import android.view.Menu;
|
||||
|
|
|
@ -32,7 +32,7 @@ import android.graphics.Point;
|
|||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
|
|
|
@ -3,7 +3,7 @@ package org.schabi.newpipe.player.helper;
|
|||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
|
@ -239,12 +239,13 @@ public class PlaybackParameterDialog extends DialogFragment {
|
|||
unhookingCheckbox = rootView.findViewById(R.id.unhookCheckbox);
|
||||
if (unhookingCheckbox != null) {
|
||||
// restore whether pitch and tempo are unhooked or not
|
||||
unhookingCheckbox.setChecked(PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
unhookingCheckbox.setChecked(PreferenceManager
|
||||
.getDefaultSharedPreferences(requireContext())
|
||||
.getBoolean(getString(R.string.playback_unhook_key), true));
|
||||
|
||||
unhookingCheckbox.setOnCheckedChangeListener((compoundButton, isChecked) -> {
|
||||
// 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();
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<String, ?> entries = (Map<String, ?>) input.readObject();
|
||||
for (final Map.Entry<String, ?> entry : entries.entrySet()) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:summary="%s"
|
||||
android:title="@string/theme_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/show_hold_to_append_key"
|
||||
|
|
|
@ -45,39 +45,39 @@
|
|||
android:title="@string/peertube_instance_url_title"
|
||||
android:summary="@string/peertube_instance_url_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/show_age_restricted_content"
|
||||
android:title="@string/show_age_restricted_content_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/youtube_restricted_mode_enabled"
|
||||
android:title="@string/youtube_restricted_mode_enabled_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/show_search_suggestions_key"
|
||||
android:summary="@string/show_search_suggestions_summary"
|
||||
android:title="@string/show_search_suggestions_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/download_thumbnail_key"
|
||||
android:title="@string/download_thumbnail_title"
|
||||
android:summary="@string/download_thumbnail_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/show_next_video_key"
|
||||
android:title="@string/show_next_and_similar_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/show_comments_key"
|
||||
|
@ -109,7 +109,7 @@
|
|||
android:title="@string/feed_update_threshold_title"
|
||||
android:summary="@string/feed_update_threshold_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/feed_use_dedicated_fetch_method_key"
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
android:key="general_preferences"
|
||||
android:title="@string/settings_category_debug_title">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/allow_heap_dumping_key"
|
||||
android:title="@string/enable_leak_canary_title"
|
||||
android:summary="@string/enable_leak_canary_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/allow_disposed_exceptions_key"
|
||||
android:title="@string/enable_disposed_exceptions_title"
|
||||
android:summary="@string/enable_disposed_exceptions_summary"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/show_original_time_ago_key"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:summary="@string/downloads_storage_ask_summary_kitkat"
|
||||
android:title="@string/downloads_storage_ask_title" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/storage_use_saf"
|
||||
|
@ -58,14 +58,14 @@
|
|||
android:summary="@string/max_retry_desc"
|
||||
android:title="@string/max_retry_msg" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/downloads_cross_network"
|
||||
android:summary="@string/pause_downloads_on_mobile_desc"
|
||||
android:title="@string/pause_downloads_on_mobile" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/downloads_queue_limit"
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
android:key="general_preferences"
|
||||
android:title="@string/settings_category_history_title">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="@string/enable_watch_history_key"
|
||||
android:summary="@string/enable_watch_history_summary"
|
||||
android:title="@string/enable_watch_history_title"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:dependency="@string/enable_watch_history_key"
|
||||
android:key="@string/enable_playback_resume_key"
|
||||
|
@ -19,14 +19,14 @@
|
|||
android:title="@string/enable_playback_resume_title"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="@string/enable_playback_state_lists_key"
|
||||
android:summary="@string/enable_playback_state_lists_summary"
|
||||
android:title="@string/enable_playback_state_lists_title"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="@string/enable_search_history_key"
|
||||
android:summary="@string/enable_search_history_summary"
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
android:key="general_preferences"
|
||||
android:title="@string/settings_category_updates_title">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/update_app_key"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
android:summary="%s"
|
||||
android:title="@string/limit_mobile_data_usage_title" />
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/show_higher_resolutions_key"
|
||||
|
@ -61,27 +61,27 @@
|
|||
android:layout="@layout/settings_category_header_layout"
|
||||
android:title="@string/settings_category_player_title">
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/use_external_video_player_key"
|
||||
android:summary="@string/use_external_video_player_summary"
|
||||
android:title="@string/use_external_video_player_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/use_external_audio_player_key"
|
||||
android:title="@string/use_external_audio_player_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/show_play_with_kodi_key"
|
||||
android:summary="@string/show_play_with_kodi_summary"
|
||||
android:title="@string/show_play_with_kodi_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/enable_lock_screen_video_thumbnail_key"
|
||||
|
@ -121,42 +121,42 @@
|
|||
android:summary="@string/autoplay_summary"
|
||||
android:title="@string/autoplay_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/auto_queue_key"
|
||||
android:summary="@string/auto_queue_summary"
|
||||
android:title="@string/auto_queue_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/resume_on_audio_focus_gain_key"
|
||||
android:summary="@string/resume_on_audio_focus_gain_summary"
|
||||
android:title="@string/resume_on_audio_focus_gain_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/volume_gesture_control_key"
|
||||
android:summary="@string/volume_gesture_control_summary"
|
||||
android:title="@string/volume_gesture_control_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/brightness_gesture_control_key"
|
||||
android:summary="@string/brightness_gesture_control_summary"
|
||||
android:title="@string/brightness_gesture_control_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="true"
|
||||
android:key="@string/popup_remember_size_pos_key"
|
||||
android:summary="@string/popup_remember_size_pos_summary"
|
||||
android:title="@string/popup_remember_size_pos_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/use_inexact_seek_key"
|
||||
|
@ -172,7 +172,7 @@
|
|||
android:summary="%s"
|
||||
android:title="@string/seek_duration_title"/>
|
||||
|
||||
<SwitchPreference
|
||||
<SwitchPreferenceCompat
|
||||
app:iconSpaceReserved="false"
|
||||
android:defaultValue="false"
|
||||
android:key="@string/clear_queue_confirmation_key"
|
||||
|
|
Loading…
Reference in New Issue