mirror of
https://github.com/Docile-Alligator/Infinity-For-Reddit.git
synced 2025-10-29 19:44:40 +00:00
Listen to Reddit Video Default Resolution changes.
This commit is contained in:
parent
c52e2993e0
commit
98a06cc165
@ -1587,6 +1587,14 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
mLongPressPostMediaAction = value;
|
mLongPressPostMediaAction = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDataSavingModeDefaultResolution(int value) {
|
||||||
|
mDataSavingModeDefaultResolution = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNonDataSavingModeDefaultResolution(int value) {
|
||||||
|
mNonDataSavingModeDefaultResolution = value;
|
||||||
|
}
|
||||||
|
|
||||||
@OptIn(markerClass = UnstableApi.class)
|
@OptIn(markerClass = UnstableApi.class)
|
||||||
@Override
|
@Override
|
||||||
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
|
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
|
||||||
|
|||||||
@ -353,6 +353,18 @@ public abstract class PostFragmentBase extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SharedPreferencesLiveDataKt.stringLiveData(mSharedPreferences, SharedPreferencesUtils.REDDIT_VIDEO_DEFAULT_RESOLUTION, "360").observe(getViewLifecycleOwner(), s -> {
|
||||||
|
if (getPostAdapter() != null) {
|
||||||
|
getPostAdapter().setDataSavingModeDefaultResolution(Integer.parseInt(s));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
SharedPreferencesLiveDataKt.stringLiveData(mSharedPreferences, SharedPreferencesUtils.REDDIT_VIDEO_DEFAULT_RESOLUTION_NO_DATA_SAVING, "0").observe(getViewLifecycleOwner(), s -> {
|
||||||
|
if (getPostAdapter() != null) {
|
||||||
|
getPostAdapter().setNonDataSavingModeDefaultResolution(Integer.parseInt(s));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return super.onCreateView(inflater, container, savedInstanceState);
|
return super.onCreateView(inflater, container, savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user