mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Fix settings migration
This commit is contained in:
		| @@ -111,31 +111,17 @@ public final class SettingMigrations { | ||||
|     public static final Migration MIGRATION_4_5 = new Migration(4, 5) { | ||||
|         @Override | ||||
|         protected void migrate(final Context context) { | ||||
|             final boolean brightnessGestureSwitch = sp.getBoolean( | ||||
|                     context.getString(R.string.left_gesture_control_key), true); | ||||
|             final boolean volumeGestureSwitch = sp.getBoolean( | ||||
|                     context.getString(R.string.right_gesture_control_key), true); | ||||
|             final boolean brightness = sp.getBoolean("brightness_gesture_control", true); | ||||
|             final boolean volume = sp.getBoolean("volume_gesture_control", true); | ||||
|  | ||||
|             final SharedPreferences.Editor editor = sp.edit(); | ||||
|  | ||||
|             if (volumeGestureSwitch) { | ||||
|                 if (!brightnessGestureSwitch) { | ||||
|                     editor.putString(context.getString(R.string.left_gesture_control_key), | ||||
|                             context.getString(R.string.brightness)); | ||||
|                 } | ||||
|                 editor.putString(context.getString(R.string.right_gesture_control_key), | ||||
|                         context.getString(R.string.volume)); | ||||
|             } else if (brightnessGestureSwitch) { | ||||
|                 editor.putString(context.getString(R.string.right_gesture_control_key), | ||||
|                         context.getString(R.string.brightness)); | ||||
|                 editor.putString(context.getString(R.string.left_gesture_control_key), | ||||
|                         context.getString(R.string.volume)); | ||||
|             } else { | ||||
|                 editor.putString(context.getString(R.string.left_gesture_control_key), | ||||
|                         context.getString(R.string.none)); | ||||
|                 editor.putString(context.getString(R.string.right_gesture_control_key), | ||||
|                         context.getString(R.string.none)); | ||||
|             } | ||||
|             editor.putString(context.getString(R.string.right_gesture_control_key), | ||||
|                     context.getString(volume | ||||
|                             ? R.string.volume_control_key : R.string.none_control_key)); | ||||
|             editor.putString(context.getString(R.string.left_gesture_control_key), | ||||
|                     context.getString(brightness | ||||
|                             ? R.string.brightness_control_key : R.string.none_control_key)); | ||||
|  | ||||
|             editor.apply(); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox