1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-23 11:32:32 +01:00

reformatted and commented code

This commit is contained in:
Harshal Lele 2020-01-28 20:14:35 +05:30
parent 52420d4bf1
commit 1f24c18614

View File

@ -24,11 +24,18 @@ public class VideoAudioSettingsFragment extends BasePreferenceFragment {
listener = new SharedPreferences.OnSharedPreferenceChangeListener() { listener = new SharedPreferences.OnSharedPreferenceChangeListener() {
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) { public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
//on M and above, if user chooses to minimise to popup player on exit and the app doesn't have
//display over other apps permission, show a snackbar to let the user give permission
if(s.equals(getString(R.string.minimize_on_exit_key))){ if(s.equals(getString(R.string.minimize_on_exit_key))){
String newSetting = sharedPreferences.getString(s,null); String newSetting = sharedPreferences.getString(s,null);
if(newSetting != null){ if(newSetting != null){
if(newSetting.equals(getString(R.string.minimize_on_exit_popup_key))){ if(newSetting.equals(getString(R.string.minimize_on_exit_popup_key))){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getContext())){ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(getContext())){
Snackbar.make(getListView(),R.string.permission_display_over_apps,Snackbar.LENGTH_INDEFINITE) Snackbar.make(getListView(),R.string.permission_display_over_apps,Snackbar.LENGTH_INDEFINITE)
.setAction(R.string.settings, new View.OnClickListener() { .setAction(R.string.settings, new View.OnClickListener() {
@Override @Override