Loading app/src/main/java/net/sourceforge/opencamera/MyPreferenceFragment.java +36 −177 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; //import android.content.Intent; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.pm.PackageInfo; Loading @@ -21,7 +21,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.Point; //import android.net.Uri; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.preference.EditTextPreference; Loading @@ -34,8 +34,9 @@ import android.preference.PreferenceGroup; import android.preference.PreferenceManager; import android.preference.TwoStatePreference; import android.text.SpannableString; //import android.text.Spanned; import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.text.style.URLSpan; import android.util.DisplayMetrics; import android.util.Log; import android.view.Display; Loading @@ -46,15 +47,14 @@ import android.widget.Toast; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Scanner; import foundation.e.camera.BuildConfig; import foundation.e.camera.R; /** Fragment to handle the Settings UI. Note that originally this was a Loading Loading @@ -82,6 +82,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) { Loading @@ -90,6 +91,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 ) Loading Loading @@ -699,54 +702,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } } { List<String> camera_api_values = new ArrayList<>(); List<String> camera_api_entries = new ArrayList<>(); // all devices support old api camera_api_values.add("preference_camera_api_old"); camera_api_entries.add(getActivity().getResources().getString(R.string.preference_camera_api_old)); final boolean supports_camera2 = bundle.getBoolean("supports_camera2"); if( MyDebug.LOG ) Log.d(TAG, "supports_camera2: " + supports_camera2); if( supports_camera2 ) { camera_api_values.add("preference_camera_api_camera2"); camera_api_entries.add(getActivity().getResources().getString(R.string.preference_camera_api_camera2)); } if( camera_api_values.size() == 1 ) { // if only supports 1 API, no point showing the preference camera_api_values.clear(); camera_api_entries.clear(); } readFromBundle(camera_api_values.toArray(new String[0]), camera_api_entries.toArray(new String[0]), "preference_camera_api", PreferenceKeys.CameraAPIPreferenceDefault, "preference_category_online"); if( camera_api_values.size() >= 2 ) { final Preference pref = findPreference("preference_camera_api"); pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference arg0, Object newValue) { if( pref.getKey().equals("preference_camera_api") ) { ListPreference list_pref = (ListPreference)pref; if( list_pref.getValue().equals(newValue) ) { if( MyDebug.LOG ) Log.d(TAG, "user selected same camera API"); } else { if( MyDebug.LOG ) Log.d(TAG, "user changed camera API - need to restart"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.restartOpenCamera(); } } return true; } }); } } /*final boolean supports_camera2 = bundle.getBoolean("supports_camera2"); if( MyDebug.LOG ) Log.d(TAG, "supports_camera2: " + supports_camera2); if( supports_camera2 ) { Loading @@ -769,7 +725,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared Preference pref = findPreference("preference_use_camera2"); PreferenceGroup pg = (PreferenceGroup)this.findPreference("preference_category_online"); pg.removePreference(pref); }*/ } { final Preference pref = findPreference("preference_online_help"); Loading @@ -796,60 +752,8 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared if( pref.getKey().equals("preference_privacy_policy") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked privacy policy"); clickedPrivacyPolicy(); } return false; } }); } // licences { final Preference pref = findPreference("preference_licence_open_camera"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_open_camera") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked open camera licence"); // display the GPL v3 text displayTextDialog(R.string.preference_licence_open_camera, "gpl-3.0.txt"); return false; } return false; } }); } { final Preference pref = findPreference("preference_licence_google_icons"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_google_icons") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked google material design icons licence"); // display the Apache licence 2.0 text displayTextDialog(R.string.preference_licence_google_icons, "google_material_design_icons_LICENSE-2.0.txt"); return false; } return false; } }); } { final Preference pref = findPreference("preference_licence_online"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_online") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked online licences"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlineLicences(); main_activity.launchOnlinePrivacyPolicy(); return false; } return false; Loading @@ -857,8 +761,6 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared }); } // end licences { ListPreference pref = (ListPreference)findPreference("preference_ghost_image"); Loading Loading @@ -1014,7 +916,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared }); } /*{ { final Preference pref = findPreference("preference_donate"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override Loading @@ -1022,6 +924,17 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared if( pref.getKey().equals("preference_donate") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked to donate"); /*Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.getDonateMarketLink())); try { startActivity(browserIntent); } catch(ActivityNotFoundException e) { // needed in case market:// not supported if( MyDebug.LOG ) Log.d(TAG, "can't launch market:// intent"); browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.getDonateLink())); startActivity(browserIntent); }*/ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.DonateLink)); startActivity(browserIntent); return false; Loading @@ -1029,19 +942,21 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared return false; } }); }*/ } { 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()); alertDialog.setTitle(R.string.preference_about); final StringBuilder about_string = new StringBuilder(); final String gpl_link = "GPL v3 or later"; final String online_help_link = "online help"; String version = "UNKNOWN_VERSION"; int version_code = -1; try { Loading @@ -1058,6 +973,10 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared about_string.append(version); about_string.append("\nCode: "); about_string.append(version_code); about_string.append("\n(c) 2013-2019 Mark Harman"); about_string.append("\nReleased under the "); about_string.append(gpl_link); about_string.append(" (Open Camera also uses additional third party files, see " + online_help_link + " for full licences and attributions.)"); about_string.append("\nPackage: "); about_string.append(MyPreferenceFragment.this.getActivity().getPackageName()); about_string.append("\nAndroid API version: "); Loading Loading @@ -1339,6 +1258,9 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } SpannableString span = new SpannableString(about_string); // Google Play prelaunch accessibility warnings suggest using URLSpan instead of ClickableSpan span.setSpan(new URLSpan("http://www.gnu.org/copyleft/gpl.html"), about_string.indexOf(gpl_link), about_string.indexOf(gpl_link) + gpl_link.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); span.setSpan(new URLSpan(MainActivity.getOnlineHelpUrl("#licence")), about_string.indexOf(online_help_link), about_string.indexOf(online_help_link) + online_help_link.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); // clickable text is only supported if we call setMovementMethod on the TextView - which means we need to create // our own for the AlertDialog! Loading Loading @@ -1525,69 +1447,6 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } } /* The user clicked the privacy policy preference. */ public void clickedPrivacyPolicy() { if( MyDebug.LOG ) Log.d(TAG, "clickedPrivacyPolicy()"); /*MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlinePrivacyPolicy();*/ AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity()); alertDialog.setTitle(R.string.preference_privacy_policy); alertDialog.setMessage(R.string.preference_privacy_policy_text); alertDialog.setPositiveButton(android.R.string.ok, null); alertDialog.setNegativeButton(R.string.preference_privacy_policy_online, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if( MyDebug.LOG ) Log.d(TAG, "online privacy policy"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlinePrivacyPolicy(); } }); final AlertDialog alert = alertDialog.create(); // AlertDialog.Builder.setOnDismissListener() requires API level 17, so do it this way instead alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { if( MyDebug.LOG ) Log.d(TAG, "reset dialog dismissed"); dialogs.remove(alert); } }); alert.show(); dialogs.add(alert); } /* Displays a dialog with text loaded from a file in assets. */ private void displayTextDialog(int title_id, String file) { try { InputStream inputStream = getActivity().getAssets().open(file); Scanner scanner = new Scanner(inputStream).useDelimiter("\\A"); AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity()); alertDialog.setTitle(getActivity().getResources().getString(title_id)); alertDialog.setMessage(scanner.next()); alertDialog.setPositiveButton(android.R.string.ok, null); final AlertDialog alert = alertDialog.create(); // AlertDialog.Builder.setOnDismissListener() requires API level 17, so do it this way instead alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { if( MyDebug.LOG ) Log.d(TAG, "text dialog dismissed"); dialogs.remove(alert); } }); alert.show(); dialogs.add(alert); } catch(IOException e) { e.printStackTrace(); } } /** 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. Loading app/src/main/res/values-az/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -310,5 +310,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> app/src/main/res/values-be/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -356,5 +356,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> app/src/main/res/values-cs/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -360,5 +360,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> app/src/main/res/values-de/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -811,5 +811,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
app/src/main/java/net/sourceforge/opencamera/MyPreferenceFragment.java +36 −177 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ import android.content.ClipData; import android.content.ClipboardManager; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; //import android.content.Intent; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.pm.PackageInfo; Loading @@ -21,7 +21,7 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.Point; //import android.net.Uri; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.preference.EditTextPreference; Loading @@ -34,8 +34,9 @@ import android.preference.PreferenceGroup; import android.preference.PreferenceManager; import android.preference.TwoStatePreference; import android.text.SpannableString; //import android.text.Spanned; import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.text.style.URLSpan; import android.util.DisplayMetrics; import android.util.Log; import android.view.Display; Loading @@ -46,15 +47,14 @@ import android.widget.Toast; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Scanner; import foundation.e.camera.BuildConfig; import foundation.e.camera.R; /** Fragment to handle the Settings UI. Note that originally this was a Loading Loading @@ -82,6 +82,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) { Loading @@ -90,6 +91,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 ) Loading Loading @@ -699,54 +702,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } } { List<String> camera_api_values = new ArrayList<>(); List<String> camera_api_entries = new ArrayList<>(); // all devices support old api camera_api_values.add("preference_camera_api_old"); camera_api_entries.add(getActivity().getResources().getString(R.string.preference_camera_api_old)); final boolean supports_camera2 = bundle.getBoolean("supports_camera2"); if( MyDebug.LOG ) Log.d(TAG, "supports_camera2: " + supports_camera2); if( supports_camera2 ) { camera_api_values.add("preference_camera_api_camera2"); camera_api_entries.add(getActivity().getResources().getString(R.string.preference_camera_api_camera2)); } if( camera_api_values.size() == 1 ) { // if only supports 1 API, no point showing the preference camera_api_values.clear(); camera_api_entries.clear(); } readFromBundle(camera_api_values.toArray(new String[0]), camera_api_entries.toArray(new String[0]), "preference_camera_api", PreferenceKeys.CameraAPIPreferenceDefault, "preference_category_online"); if( camera_api_values.size() >= 2 ) { final Preference pref = findPreference("preference_camera_api"); pref.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference arg0, Object newValue) { if( pref.getKey().equals("preference_camera_api") ) { ListPreference list_pref = (ListPreference)pref; if( list_pref.getValue().equals(newValue) ) { if( MyDebug.LOG ) Log.d(TAG, "user selected same camera API"); } else { if( MyDebug.LOG ) Log.d(TAG, "user changed camera API - need to restart"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.restartOpenCamera(); } } return true; } }); } } /*final boolean supports_camera2 = bundle.getBoolean("supports_camera2"); if( MyDebug.LOG ) Log.d(TAG, "supports_camera2: " + supports_camera2); if( supports_camera2 ) { Loading @@ -769,7 +725,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared Preference pref = findPreference("preference_use_camera2"); PreferenceGroup pg = (PreferenceGroup)this.findPreference("preference_category_online"); pg.removePreference(pref); }*/ } { final Preference pref = findPreference("preference_online_help"); Loading @@ -796,60 +752,8 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared if( pref.getKey().equals("preference_privacy_policy") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked privacy policy"); clickedPrivacyPolicy(); } return false; } }); } // licences { final Preference pref = findPreference("preference_licence_open_camera"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_open_camera") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked open camera licence"); // display the GPL v3 text displayTextDialog(R.string.preference_licence_open_camera, "gpl-3.0.txt"); return false; } return false; } }); } { final Preference pref = findPreference("preference_licence_google_icons"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_google_icons") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked google material design icons licence"); // display the Apache licence 2.0 text displayTextDialog(R.string.preference_licence_google_icons, "google_material_design_icons_LICENSE-2.0.txt"); return false; } return false; } }); } { final Preference pref = findPreference("preference_licence_online"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference arg0) { if( pref.getKey().equals("preference_licence_online") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked online licences"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlineLicences(); main_activity.launchOnlinePrivacyPolicy(); return false; } return false; Loading @@ -857,8 +761,6 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared }); } // end licences { ListPreference pref = (ListPreference)findPreference("preference_ghost_image"); Loading Loading @@ -1014,7 +916,7 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared }); } /*{ { final Preference pref = findPreference("preference_donate"); pref.setOnPreferenceClickListener(new OnPreferenceClickListener() { @Override Loading @@ -1022,6 +924,17 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared if( pref.getKey().equals("preference_donate") ) { if( MyDebug.LOG ) Log.d(TAG, "user clicked to donate"); /*Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.getDonateMarketLink())); try { startActivity(browserIntent); } catch(ActivityNotFoundException e) { // needed in case market:// not supported if( MyDebug.LOG ) Log.d(TAG, "can't launch market:// intent"); browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.getDonateLink())); startActivity(browserIntent); }*/ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(MainActivity.DonateLink)); startActivity(browserIntent); return false; Loading @@ -1029,19 +942,21 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared return false; } }); }*/ } { 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()); alertDialog.setTitle(R.string.preference_about); final StringBuilder about_string = new StringBuilder(); final String gpl_link = "GPL v3 or later"; final String online_help_link = "online help"; String version = "UNKNOWN_VERSION"; int version_code = -1; try { Loading @@ -1058,6 +973,10 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared about_string.append(version); about_string.append("\nCode: "); about_string.append(version_code); about_string.append("\n(c) 2013-2019 Mark Harman"); about_string.append("\nReleased under the "); about_string.append(gpl_link); about_string.append(" (Open Camera also uses additional third party files, see " + online_help_link + " for full licences and attributions.)"); about_string.append("\nPackage: "); about_string.append(MyPreferenceFragment.this.getActivity().getPackageName()); about_string.append("\nAndroid API version: "); Loading Loading @@ -1339,6 +1258,9 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } SpannableString span = new SpannableString(about_string); // Google Play prelaunch accessibility warnings suggest using URLSpan instead of ClickableSpan span.setSpan(new URLSpan("http://www.gnu.org/copyleft/gpl.html"), about_string.indexOf(gpl_link), about_string.indexOf(gpl_link) + gpl_link.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); span.setSpan(new URLSpan(MainActivity.getOnlineHelpUrl("#licence")), about_string.indexOf(online_help_link), about_string.indexOf(online_help_link) + online_help_link.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); // clickable text is only supported if we call setMovementMethod on the TextView - which means we need to create // our own for the AlertDialog! Loading Loading @@ -1525,69 +1447,6 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared } } /* The user clicked the privacy policy preference. */ public void clickedPrivacyPolicy() { if( MyDebug.LOG ) Log.d(TAG, "clickedPrivacyPolicy()"); /*MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlinePrivacyPolicy();*/ AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity()); alertDialog.setTitle(R.string.preference_privacy_policy); alertDialog.setMessage(R.string.preference_privacy_policy_text); alertDialog.setPositiveButton(android.R.string.ok, null); alertDialog.setNegativeButton(R.string.preference_privacy_policy_online, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if( MyDebug.LOG ) Log.d(TAG, "online privacy policy"); MainActivity main_activity = (MainActivity)MyPreferenceFragment.this.getActivity(); main_activity.launchOnlinePrivacyPolicy(); } }); final AlertDialog alert = alertDialog.create(); // AlertDialog.Builder.setOnDismissListener() requires API level 17, so do it this way instead alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { if( MyDebug.LOG ) Log.d(TAG, "reset dialog dismissed"); dialogs.remove(alert); } }); alert.show(); dialogs.add(alert); } /* Displays a dialog with text loaded from a file in assets. */ private void displayTextDialog(int title_id, String file) { try { InputStream inputStream = getActivity().getAssets().open(file); Scanner scanner = new Scanner(inputStream).useDelimiter("\\A"); AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity()); alertDialog.setTitle(getActivity().getResources().getString(title_id)); alertDialog.setMessage(scanner.next()); alertDialog.setPositiveButton(android.R.string.ok, null); final AlertDialog alert = alertDialog.create(); // AlertDialog.Builder.setOnDismissListener() requires API level 17, so do it this way instead alert.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface arg0) { if( MyDebug.LOG ) Log.d(TAG, "text dialog dismissed"); dialogs.remove(alert); } }); alert.show(); dialogs.add(alert); } catch(IOException e) { e.printStackTrace(); } } /** 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. Loading
app/src/main/res/values-az/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -310,5 +310,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>
app/src/main/res/values-be/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -356,5 +356,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>
app/src/main/res/values-cs/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -360,5 +360,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>
app/src/main/res/values-de/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -811,5 +811,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>