mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
restore stories autoplay; close #1409 (main)
This commit is contained in:
parent
c2ac61986f
commit
dcd00ce60b
@ -1029,7 +1029,7 @@ public class StoryViewerFragment extends Fragment {
|
||||
if (context == null) return;
|
||||
player = new SimpleExoPlayer.Builder(context).build();
|
||||
binding.playerView.setPlayer(player);
|
||||
player.setPlayWhenReady(settingsHelper.getBoolean(PreferenceKeys.AUTOPLAY_VIDEOS));
|
||||
player.setPlayWhenReady(settingsHelper.getBoolean(PreferenceKeys.AUTOPLAY_VIDEOS_STORIES));
|
||||
|
||||
final Uri uri = Uri.parse(url);
|
||||
final MediaItem mediaItem = MediaItem.fromUri(uri);
|
||||
@ -1130,7 +1130,7 @@ public class StoryViewerFragment extends Fragment {
|
||||
if (context == null) return;
|
||||
player = new SimpleExoPlayer.Builder(context).build();
|
||||
binding.playerView.setPlayer(player);
|
||||
player.setPlayWhenReady(settingsHelper.getBoolean(PreferenceKeys.AUTOPLAY_VIDEOS));
|
||||
player.setPlayWhenReady(settingsHelper.getBoolean(PreferenceKeys.AUTOPLAY_VIDEOS_STORIES));
|
||||
|
||||
final Uri uri = Uri.parse(url);
|
||||
final MediaItem mediaItem = MediaItem.fromUri(uri);
|
||||
|
@ -30,8 +30,7 @@ object PreferenceKeys {
|
||||
const val TOGGLE_KEYWORD_FILTER = "toggle_keyword_filter"
|
||||
const val DOWNLOAD_PREPEND_USER_NAME = "download_user_name"
|
||||
const val PLAY_IN_BACKGROUND = "play_in_background"
|
||||
const val FOLDER_SAVE_TO = "saved_to"
|
||||
const val AUTOPLAY_VIDEOS = "autoplay_videos"
|
||||
const val AUTOPLAY_VIDEOS_STORIES = "autoplay_videos"
|
||||
const val MUTED_VIDEOS = "muted_videos"
|
||||
const val SHOW_CAPTIONS = "show_captions"
|
||||
const val CUSTOM_DATE_TIME_FORMAT_ENABLED = "data_time_custom_enabled"
|
||||
|
@ -18,6 +18,7 @@ public class StoriesPreferencesFragment extends BasePreferencesFragment {
|
||||
screen.addPreference(getStorySortPreference(context));
|
||||
screen.addPreference(getHideMutedReelsPreference(context));
|
||||
screen.addPreference(getMarkStoriesSeenPreference(context));
|
||||
screen.addPreference(getAutoPlayPreference(context));
|
||||
}
|
||||
|
||||
private Preference getStorySortPreference(@NonNull final Context context) {
|
||||
@ -53,4 +54,12 @@ public class StoriesPreferencesFragment extends BasePreferencesFragment {
|
||||
preference.setIconSpaceReserved(false);
|
||||
return preference;
|
||||
}
|
||||
|
||||
private Preference getAutoPlayPreference(@NonNull final Context context) {
|
||||
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(context);
|
||||
preference.setKey(PreferenceKeys.AUTOPLAY_VIDEOS_STORIES);
|
||||
preference.setTitle(R.string.autoplay_stories_setting);
|
||||
preference.setIconSpaceReserved(false);
|
||||
return preference;
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import androidx.annotation.StringDef
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import java.util.*
|
||||
|
||||
import awais.instagrabber.utils.Constants
|
||||
import awais.instagrabber.fragments.settings.PreferenceKeys
|
||||
|
||||
class SettingsHelper(context: Context) {
|
||||
@ -117,8 +116,7 @@ class SettingsHelper(context: Context) {
|
||||
@StringDef(
|
||||
PreferenceKeys.DOWNLOAD_USER_FOLDER,
|
||||
PreferenceKeys.DOWNLOAD_PREPEND_USER_NAME,
|
||||
PreferenceKeys.FOLDER_SAVE_TO,
|
||||
PreferenceKeys.AUTOPLAY_VIDEOS,
|
||||
PreferenceKeys.AUTOPLAY_VIDEOS_STORIES,
|
||||
PreferenceKeys.MUTED_VIDEOS,
|
||||
PreferenceKeys.SHOW_CAPTIONS,
|
||||
PreferenceKeys.CUSTOM_DATE_TIME_FORMAT_ENABLED,
|
||||
|
@ -32,6 +32,7 @@
|
||||
<string name="hide_muted_reels_setting">Hide muted stories from feed</string>
|
||||
<string name="dm_mark_as_seen_setting">Mark DM as seen after viewing</string>
|
||||
<string name="dm_mark_as_seen_setting_summary">Other members will know you viewed it</string>
|
||||
<string name="autoplay_stories_setting">Autoplay video stories</string>
|
||||
<string name="activity_setting">Enable activity notifications</string>
|
||||
<string name="story_sort_setting">Feed stories sort</string>
|
||||
<string name="error_loading_profile">Error loading profile! Is the username valid? If so, you may be ratelimited.</string>
|
||||
|
Loading…
Reference in New Issue
Block a user