diff --git a/app/src/main/java/net/sourceforge/opencamera/MainActivity.java b/app/src/main/java/net/sourceforge/opencamera/MainActivity.java index 3d46eddbb516944d944f070e5874d120073f9a96..8b0bffe862d3ed4d6103d359832e1f1bc2448019 100644 --- a/app/src/main/java/net/sourceforge/opencamera/MainActivity.java +++ b/app/src/main/java/net/sourceforge/opencamera/MainActivity.java @@ -367,23 +367,28 @@ public class MainActivity extends AppCompatActivity { Log.d(TAG, "onCreate: time after updating folder history: " + (System.currentTimeMillis() - debug_time)); SharedPreferences.Editor editor = sharedPreferences.edit(); - if (DeviceSettings.isMurenaOne()) { - boolean isFirstTime = sharedPreferences.getBoolean("isFirstTimeMurenaOne", true); - if (isFirstTime && applicationInterface.getEdgeModePref().equals("default")) { - editor.putString(PreferenceKeys.EdgeModePreferenceKey, "off"); - editor.putBoolean("isFirstTimeMurenaOne", false); - editor.apply(); - } + int isFirstTime = sharedPreferences.getInt("isFirstTimeChange", 0); + switch (isFirstTime) { + case 0: + String edge_pref = applicationInterface.getEdgeModePref(); + if (DeviceSettings.isMurenaOne() && edge_pref.equals("default")) { + editor.putString(PreferenceKeys.EdgeModePreferenceKey, "off"); + } + String save_location = sharedPreferences.getString( + PreferenceKeys.SaveLocationPreferenceKey, "Camera"); + if (save_location.equals("OpenCamera")) { + editor.putString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"); + } + isFirstTime++; + case 1: + editor.putBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, false); + isFirstTime++; + break; + default: + break; } - boolean isFirstTimeSaveLocation = sharedPreferences.getBoolean("isFirstTimeSaveLocation", true); - String save_location = sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"); - - if (isFirstTimeSaveLocation && save_location.equals("OpenCamera")) { - editor.putString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"); - editor.putBoolean("isFirstTimeSaveLocation", false); - editor.apply(); - } + editor.putInt("isFirstTimeChange", isFirstTime).apply(); // set up sensors mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); @@ -3906,7 +3911,7 @@ public class MainActivity extends AppCompatActivity { // done here rather than onCreate, so that changing it in preferences takes effect without restarting app SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); final WindowManager.LayoutParams layout = getWindow().getAttributes(); - if( force_max || sharedPreferences.getBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, true) ) { + if( force_max || sharedPreferences.getBoolean(PreferenceKeys.MaxBrightnessPreferenceKey, false) ) { layout.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_FULL; } else { diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index d3d45529e46228351da41a90b96a7e0efb070c55..af7a515429841f5e0052a5cbd85233b816085ee5 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -698,7 +698,7 @@ android:key="preference_max_brightness" android:title="@string/preference_max_brightness" android:summary="@string/preference_max_brightness_summary" - android:defaultValue="true" + android:defaultValue="false" />