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

Commit e51aab49 authored by Mohit Mali's avatar Mohit Mali
Browse files

Update About content

parent 727eaf7b
Loading
Loading
Loading
Loading
+365 −361
Original line number Diff line number Diff line
@@ -54,7 +54,9 @@ import java.util.HashSet;
import java.util.List;
import java.util.Locale;

/** Fragment to handle the Settings UI. Note that originally this was a

/**
 * Fragment to handle the Settings UI. Note that originally this was a
 * PreferenceActivity rather than a PreferenceFragment which required all
 * communication to be via the bundle (since this replaced the MainActivity,
 * meaning we couldn't access data from that class. This no longer applies due
@@ -79,6 +81,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
     * so this code isn't necessary - but there shouldn't be harm to leave it here for future use.
     */
    private final HashSet<AlertDialog> dialogs = new HashSet<>();
    public static final String BUILD_VERION = "build_version";

    @Override
    public void onCreate(Bundle savedInstanceState) {
@@ -87,6 +90,8 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.preferences);

        findPreference(BUILD_VERION).setSummary(BuildConfig.VERSION_NAME);

        final Bundle bundle = getArguments();
        this.cameraId = bundle.getInt("cameraId");
        if (MyDebug.LOG)
@@ -226,8 +231,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            lp.setValue(resolution_value);
            // now set the key, so we save for the correct cameraId
            lp.setKey(resolution_preference_key);
        }
        else {
        } else {
            Preference pref = findPreference("preference_resolution");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_photo_settings");
            pg.removePreference(pref);
@@ -253,8 +257,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                int fps = video_fps[k];
                if (video_fps_high_speed != null && video_fps_high_speed[k]) {
                    entries[i] = fps + high_speed_append;
                }
                else {
                } else {
                    entries[i] = "" + fps;
                }
                values[i] = "" + fps;
@@ -293,8 +296,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            Preference pref = findPreference("preference_raw");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_photo_settings");
            pg.removePreference(pref);
        }
        else {
        } else {
            ListPreference pref = (ListPreference) findPreference("preference_raw");

            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
@@ -495,8 +497,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            String title = is_high_speed ? getResources().getString(R.string.video_quality) + " [" + getResources().getString(R.string.high_speed) + "]" : getResources().getString(R.string.video_quality);
            lp.setTitle(title);
            lp.setDialogTitle(title);
        }
        else {
        } else {
            Preference pref = findPreference("preference_video_quality");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_video_settings");
            pg.removePreference(pref);
@@ -604,8 +605,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            Preference pref = findPreference("preference_category_exif_tags");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_photo_settings");
            pg.removePreference(pref);
        }
        else {
        } else {
            setSummary("preference_exif_artist");
            setSummary("preference_exif_copyright");
        }
@@ -656,8 +656,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            pref = findPreference("preference_camera2_photo_video_recording");
            pg = (PreferenceGroup) this.findPreference("preference_category_photo_debugging");
            pg.removePreference(pref);
        }
        else {
        } else {
            if (!supports_photo_video_recording) {
                Preference pref = findPreference("preference_camera2_photo_video_recording");
                PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_category_photo_debugging");
@@ -714,8 +713,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                    return false;
                }
            });
        }
        else {
        } else {
            Preference pref = findPreference("preference_use_camera2");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_category_online");
            pg.removePreference(pref);
@@ -805,8 +803,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                    if (main_activity.getStorageUtils().isUsingSAF()) {
                        main_activity.openFolderChooserDialogSAF(true);
                        return true;
                    }
                    else {
                    } else {
                        File start_folder = main_activity.getStorageUtils().getImageFolder();

                        FolderChooserDialog fragment = new SaveFolderChooserDialog();
@@ -822,8 +819,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            Preference pref = findPreference("preference_using_saf");
            PreferenceGroup pg = (PreferenceGroup) this.findPreference("preference_screen_camera_controls_more");
            pg.removePreference(pref);
        }
        else {
        } else {
            final Preference pref = findPreference("preference_using_saf");
            pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                @Override
@@ -842,8 +838,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                Toast.makeText(main_activity, R.string.saf_select_save_location, Toast.LENGTH_SHORT).show();
                                main_activity.openFolderChooserDialogSAF(true);
                            }
                        }
                        else {
                        } else {
                            if (MyDebug.LOG)
                                Log.d(TAG, "saf is now disabled");
                        }
@@ -939,11 +934,11 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
        }

        {
            final Preference pref = findPreference("preference_about");
            final Preference pref = findPreference("preference_debug_info");
            pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                @Override
                public boolean onPreferenceClick(Preference arg0) {
                    if( pref.getKey().equals("preference_about") ) {
                    if (pref.getKey().equals("preference_debug_info")) {
                        if (MyDebug.LOG)
                            Log.d(TAG, "user clicked about");
                        AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity());
@@ -957,8 +952,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                            PackageInfo pInfo = MyPreferenceFragment.this.getActivity().getPackageManager().getPackageInfo(MyPreferenceFragment.this.getActivity().getPackageName(), 0);
                            version = pInfo.versionName;
                            version_code = pInfo.versionCode;
                        }
                        catch(NameNotFoundException e) {
                        } catch (NameNotFoundException e) {
                            if (MyDebug.LOG)
                                Log.d(TAG, "NameNotFoundException exception trying to get version number");
                            e.printStackTrace();
@@ -1153,8 +1147,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                }
                                about_string.append(flash_values[i]);
                            }
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }
                        about_string.append("\nFocus modes: ");
@@ -1166,8 +1159,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                }
                                about_string.append(focus_values[i]);
                            }
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }
                        about_string.append("\nColor effects: ");
@@ -1179,8 +1171,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                }
                                about_string.append(color_effects_values[i]);
                            }
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }
                        about_string.append("\nScene modes: ");
@@ -1192,8 +1183,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                }
                                about_string.append(scene_modes_values[i]);
                            }
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }
                        about_string.append("\nWhite balances: ");
@@ -1205,8 +1195,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                }
                                about_string.append(white_balances_values[i]);
                            }
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }
                        if (!using_android_l) {
@@ -1246,8 +1235,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                        String parameters_string = bundle.getString("parameters_string");
                        if (parameters_string != null) {
                            about_string.append(parameters_string);
                        }
                        else {
                        } else {
                            about_string.append("None");
                        }

@@ -1347,8 +1335,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                            }
                            editText.setText(mediaFilename);
                            editText.setSelection(mediaFilename.length());
                        }
                        catch(IOException e) {
                        } catch (IOException e) {
                            Log.e(TAG, "failed to obtain a filename");
                            e.printStackTrace();
                        }
@@ -1407,8 +1394,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                    PackageInfo pInfo = MyPreferenceFragment.this.getActivity().getPackageManager().getPackageInfo(MyPreferenceFragment.this.getActivity().getPackageName(), 0);
                                    int version_code = pInfo.versionCode;
                                    editor.putInt(PreferenceKeys.LatestVersionPreferenceKey, version_code);
                                }
                                catch(NameNotFoundException e) {
                                } catch (NameNotFoundException e) {
                                    if (MyDebug.LOG)
                                        Log.d(TAG, "NameNotFoundException exception trying to get version number");
                                    e.printStackTrace();
@@ -1439,9 +1425,26 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                }
            });
        }

       /* final Preference aboutPref = findPreference("preference_about");
        aboutPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {

                if (aboutPref.getKey().equals("preference_about")) {

                    getFragmentManager().beginTransaction().add(android.R.id.content, new AboutPreference()).addToBackStack(null).commit();
                }

    /** Removes an entry and value pair from a ListPreference, if it exists.
                return false;
            }
        });*/

    }

    /**
     * Removes an entry and value pair from a ListPreference, if it exists.
     *
     * @param preference_key Key of the ListPreference to remove the supplied entry/value.
     * @param filter_value   The value to remove from the list.
     */
@@ -1523,8 +1526,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
            if (MyDebug.LOG)
                Log.d(TAG, "    value: " + Arrays.toString(values));
            lp.setValue(value);
        }
        else {
        } else {
            if (MyDebug.LOG)
                Log.d(TAG, "remove preference " + preference_key + " from category " + preference_category_key);
            Preference pref = findPreference(preference_key);
@@ -1594,15 +1596,15 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
        if (pref instanceof TwoStatePreference) {
            TwoStatePreference twoStatePref = (TwoStatePreference) pref;
            twoStatePref.setChecked(prefs.getBoolean(key, true));
        }
        else if( pref instanceof  ListPreference ) {
        } else if (pref instanceof ListPreference) {
            ListPreference listPref = (ListPreference) pref;
            listPref.setValue(prefs.getString(key, ""));
        }
        setSummary(key);
    }

    /** Programmatically sets summaries as required.
    /**
     * Programmatically sets summaries as required.
     * Remember to call setSummary() from the constructor for any keys we set, to initialise the
     * summary.
     */
@@ -1641,8 +1643,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                            pref.setSummary(R.string.preference_textstamp_summary);
                            break;
                    }
                }
                else {
                } else {
                    // non-default value, so display the current value
                    pref.setSummary(editTextPref.getText());
                }
@@ -1666,7 +1667,8 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
				/*if( main_activity.getStorageUtils().isUsingSAF() ) {
					main_activity.openLoadSettingsChooserDialogSAF(true);
				}
				else*/ {
				else*/
                {
                    FolderChooserDialog fragment = new LoadSettingsFileChooserDialog();
                    fragment.setShowDCIMShortcut(false);
                    fragment.setShowNewFolderButton(false);
@@ -1691,4 +1693,6 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
        alert.show();
        dialogs.add(alert);
    }


}
+8 −0
Original line number Diff line number Diff line
@@ -311,5 +311,13 @@

    <string name="preference_ui_placement_left">Sol əllə işləyənlər üçün</string>
    <string name="preference_ui_placement_right">Sağ əllə işləyənlər üçün</string>
    <string name="preferences_about_title">About</string>
    <string name="preferences_build_version">Quraşdırma versiyası</string>
    <string name="preferences_about_app">Kamera OpenCamera-dan çəngəldir</string>
    <string name="preferences_authors">Müəlliflər</string>
    <string name="preferences_source_code">Mənbə kodu</string>
    <string name="preferences_licence">Lisenziyası</string>
    <string name="preferences_app_info_title">Kamera məlumatları</string>
    <string name="preferences_service_terms">Xidmət şərtləri</string>

</resources>
+8 −0
Original line number Diff line number Diff line
@@ -357,5 +357,13 @@

    <string name="preference_stamp_style_shadowed">Тэкст з ценем</string>
    <string name="preference_stamp_style_plain">Звычайны тэкст</string>
    <string name="preferences_about_title">About</string>
    <string name="preferences_build_version">Зборка версіі</string>
    <string name="preferences_about_app">Камера раздвоеная ад OpenCamera</string>
    <string name="preferences_authors">Аўтары</string>
    <string name="preferences_source_code">Зыходны код</string>
    <string name="preferences_licence">Ліцэнзія</string>
    <string name="preferences_app_info_title">Інфармацыя пра камеру</string>
    <string name="preferences_service_terms">Умовы прадастаўлення паслуг</string>

</resources>
+8 −0
Original line number Diff line number Diff line
@@ -361,5 +361,13 @@

    <string name="preference_stamp_style_shadowed">Vystínovaný text</string>
    <string name="preference_stamp_style_plain">Prostý text</string>
    <string name="preferences_about_title">About</string>
    <string name="preferences_build_version">Sestavte verzi</string>
    <string name="preferences_about_app">Kamera je vidlice z OpenCamera</string>
    <string name="preferences_authors">Autor</string>
    <string name="preferences_source_code">Zdrojový kód</string>
    <string name="preferences_licence">Licence</string>
    <string name="preferences_app_info_title">Informace o kameře</string>
    <string name="preferences_service_terms">Podmínky služby</string>

</resources>
+8 −0
Original line number Diff line number Diff line
@@ -814,5 +814,13 @@

    <string name="preference_stamp_style_shadowed">Schattierter Text</string>
    <string name="preference_stamp_style_plain">Normaler Text</string>
    <string name="preferences_about_title">About</string>
    <string name="preferences_build_version">Build version</string>
    <string name="preferences_about_app">Die Kamera ist von OpenCamera gespalten</string>
    <string name="preferences_authors">Autor</string>
    <string name="preferences_source_code">Quellcode</string>
    <string name="preferences_licence">Lizenz</string>
    <string name="preferences_app_info_title">Kamerainformationen</string>
    <string name="preferences_service_terms">Nutzungsbedingungen</string>

</resources>
Loading