From b1efbbdee0a3e19c28a2e85be34dddb66bcfe1e5 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Sun, 10 May 2015 14:03:31 +0200 Subject: [PATCH] Added AlertDialog on first startup to inform the user, that this is an early alpha and that he/she should be careful. --- .../sticktoalbum/MainActivity.java | 26 ++++++++++++++++++- app/src/main/res/values-de/strings.xml | 5 +++- app/src/main/res/values/strings.xml | 5 +++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/de/vanitasvitae/sticktoalbum/MainActivity.java b/app/src/main/java/de/vanitasvitae/sticktoalbum/MainActivity.java index 5f45f70..0a35789 100644 --- a/app/src/main/java/de/vanitasvitae/sticktoalbum/MainActivity.java +++ b/app/src/main/java/de/vanitasvitae/sticktoalbum/MainActivity.java @@ -44,6 +44,7 @@ public class MainActivity extends ActionBarActivity { private ArrayList sharedMedia; private static String Tag = "stickToAlbum"; + SharedPreferences sharedPref = null; @Override protected void onCreate(Bundle savedInstanceState) @@ -51,7 +52,7 @@ public class MainActivity extends ActionBarActivity super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); + sharedPref = PreferenceManager.getDefaultSharedPreferences(this); String appDirectoryPath = sharedPref.getString(SettingsActivity.KEY_PREF_APP_PATH, ""); if(appDirectoryPath.isEmpty()) @@ -83,6 +84,29 @@ public class MainActivity extends ActionBarActivity } } + protected void onResume() + { + super.onResume(); + + if (sharedPref.getBoolean("firstrun", true)) + { + AlertDialog.Builder firstRunDialog = new AlertDialog.Builder(this); + firstRunDialog.setTitle(R.string.dialog_title_first_run); + firstRunDialog.setMessage(R.string.dialog_content_first_run); + firstRunDialog.setPositiveButton(R.string.understood, new DialogInterface.OnClickListener() + { + @Override + public void onClick(DialogInterface dialog, int which) + { + dialog.dismiss(); + } + }); + firstRunDialog.setCancelable(false); + firstRunDialog.show(); + sharedPref.edit().putBoolean("firstrun", false).commit(); + } + } + /** * Handle one single file being shared with the application. * Add the files Uri to the list of files to move and open the saveDialog. diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aca813a..39659c2 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -6,12 +6,15 @@ Teile Fotos (oder Videos) mit StickToAlbum, um diese in ein Album zu verschieben. Funktion nicht verfügbar Diese Funktion ist noch nicht fertig implementiert.\nSchau mal nach Updates :) + Achtung! + Diese App ist in einer frühen Entwicklungsphase und könnte instabil sein! Sei vorsichtig, wenn du deine schönsten Bilder verwaltest. Die App könnte abstürzen und die geteilten Daten vernichten! Bitte gebe einen Albumnamen ein! Einstellungen OK Abbrechen + Ok, ich werde vorsichtig sein. Neues Album Speicherort - Wo sollen neue Alben angelegt werden? Um zurückzusetzen, lösche diesen Wert und starte die App neu. + Wo sollen neue Alben angelegt werden? Um den Speicherort auf den Standardwert zurückzusetzen, lösche diesen Wert und starte die App neu. \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 793b286..a84dc82 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,12 +6,15 @@ In order to stick photos in albums, you have to share those photos (or videos) with this app. Feature unavailable This feature is not implemented yet.\nCheck out updates :) + Warning! + This app is an early alpha version and can be unstable! Do not rely on it while handling your most precious images. The app may crash and destroy your data! Please enter valid album name! Settings OK Cancel + I will be careful! New Album Album Directory - In which directory are Albums located? Delete value and restart app to reset. + In which directory are Albums located? Delete value and restart the app to reset this to default. \ No newline at end of file