Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c2a6919 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Camera: Change default camera save folder

parent d49655fb
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -378,6 +378,16 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
        if( MyDebug.LOG )
            Log.d(TAG, "onCreate: time after updating folder history: " + (System.currentTimeMillis() - debug_time));

        boolean isFirstTimeSaveLocation = sharedPreferences.getBoolean("isFirstTimeSaveLocation", true);
        String save_location = sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera");

        if (isFirstTimeSaveLocation && save_location.equals("OpenCamera")) {
            SharedPreferences.Editor editor = sharedPreferences.edit();
            editor.putString(PreferenceKeys.SaveLocationPreferenceKey, "Camera");
            editor.putBoolean("isFirstTimeSaveLocation", false);
            editor.apply();
        }

        // set up sensors
        mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);

@@ -1144,7 +1154,7 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                String new_folder;
                if( res.alt == null ) {
                    // no alternative, fall back to default
                    new_folder = "OpenCamera";
                    new_folder = "Camera";
                }
                else {
                    // replace with the alternative
@@ -5448,7 +5458,7 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
        editText.setHint(getResources().getString(R.string.preference_save_location));
        editText.setInputType(InputType.TYPE_CLASS_TEXT);
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
        editText.setText(sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "OpenCamera"));
        editText.setText(sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera"));
        InputFilter filter = new InputFilter() {
            // whilst Android seems to allow any characters on internal memory, SD cards are typically formatted with FAT32
            final String disallowed = "|\\?*<\":>";
+1 −1
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared

                        about_string.append("\nUsing SAF?: ");
                        about_string.append(sharedPreferences.getBoolean(PreferenceKeys.UsingSAFPreferenceKey, false));
                        String save_location = sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "OpenCamera");
                        String save_location = sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera");
                        about_string.append("\nSave Location: ");
                        about_string.append(save_location);
                        String save_location_saf = sharedPreferences.getString(PreferenceKeys.SaveLocationSAFPreferenceKey, "");
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ public class StorageUtils {
    // only valid if !isUsingSAF()
    String getSaveLocation() {
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        return sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "OpenCamera");
        return sharedPreferences.getString(PreferenceKeys.SaveLocationPreferenceKey, "Camera");
    }

    // only valid if isUsingSAF()
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@
        android:dialogTitle="@string/preference_save_location"
        android:dialogMessage="@string/preference_save_location_summary"
        android:inputType="text"
        android:defaultValue="OpenCamera"
        android:defaultValue="Camera"
        />

    <!--  if we move this to another PreferenceGroup, we should update code to remove this Preference -->