mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Add education to database selection
This commit is contained in:
@@ -81,6 +81,7 @@ dependencies {
|
||||
implementation "joda-time:joda-time:2.9.9"
|
||||
implementation "org.sufficientlysecure:html-textview:3.5"
|
||||
implementation "com.nononsenseapps:filepicker:4.1.0"
|
||||
implementation "com.getkeepsafe.taptargetview:taptargetview:1.11.0"
|
||||
// Permissions
|
||||
implementation ("com.github.hotchemi:permissionsdispatcher:$permissionDispatcherVersion") {
|
||||
// if you don't use android.app.Fragment you can exclude support for them
|
||||
|
||||
@@ -42,6 +42,8 @@ import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.getkeepsafe.taptargetview.TapTarget;
|
||||
import com.getkeepsafe.taptargetview.TapTargetSequence;
|
||||
import com.keepassdroid.activities.GroupActivity;
|
||||
import com.keepassdroid.app.App;
|
||||
import com.keepassdroid.autofill.AutofillHelper;
|
||||
@@ -212,8 +214,45 @@ public class FileSelectActivity extends StylishActivity implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For the first time show the tuto
|
||||
if (!PreferencesUtil.isEducationSelectDatabasePerformed(this)) {
|
||||
new TapTargetSequence(this)
|
||||
.targets(
|
||||
TapTarget.forView(findViewById(R.id.create_database),
|
||||
getString(R.string.education_create_database_title),
|
||||
getString(R.string.education_create_database_summary))
|
||||
.tintTarget(false),
|
||||
TapTarget.forView(findViewById(R.id.browse_button),
|
||||
getString(R.string.education_select_database_title),
|
||||
getString(R.string.education_select_database_summary))
|
||||
.tintTarget(false),
|
||||
TapTarget.forView(findViewById(R.id.open_database),
|
||||
getString(R.string.education_open_link_database_title),
|
||||
getString(R.string.education_open_link_database_summary))
|
||||
.tintTarget(false)
|
||||
).listener(new TapTargetSequence.Listener() {
|
||||
@Override
|
||||
public void onSequenceFinish() {
|
||||
saveEducationPreference();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSequenceStep(TapTarget lastTarget, boolean targetClicked) {}
|
||||
|
||||
@Override
|
||||
public void onSequenceCanceled(TapTarget lastTarget) {}
|
||||
}).continueOnCancel(true).start();
|
||||
}
|
||||
}
|
||||
|
||||
private void saveEducationPreference() {
|
||||
SharedPreferences sharedPreferences = PreferencesUtil.getEducationSharedPreferences(this);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
editor.putBoolean(getString(R.string.education_select_db_key), true);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private void launchPasswordActivityWithPath(String path) {
|
||||
try {
|
||||
AssistStructure assistStructure = null;
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.Set;
|
||||
public class PreferencesUtil {
|
||||
|
||||
private static final String NO_BACKUP_PREFERENCE_FILE_NAME = "nobackup";
|
||||
private static final String EDUCATION_PREFERENCE = "kdbxeducation";
|
||||
|
||||
public static SharedPreferences getNoBackupSharedPreferences(Context ctx) {
|
||||
return ctx.getSharedPreferences(
|
||||
@@ -40,6 +41,12 @@ public class PreferencesUtil {
|
||||
Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static SharedPreferences getEducationSharedPreferences(Context ctx) {
|
||||
return ctx.getSharedPreferences(
|
||||
PreferencesUtil.EDUCATION_PREFERENCE,
|
||||
Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
public static void deleteAllValuesFromNoBackupPreferences(Context ctx) {
|
||||
SharedPreferences prefsNoBackup = getNoBackupSharedPreferences(ctx);
|
||||
SharedPreferences.Editor sharedPreferencesEditor = prefsNoBackup.edit();
|
||||
@@ -137,4 +144,10 @@ public class PreferencesUtil {
|
||||
return prefs.getBoolean(ctx.getString(R.string.allow_copy_password_key),
|
||||
ctx.getResources().getBoolean(R.bool.allow_copy_password_default));
|
||||
}
|
||||
|
||||
public static boolean isEducationSelectDatabasePerformed(Context context) {
|
||||
SharedPreferences prefs = getEducationSharedPreferences(context);
|
||||
return prefs.getBoolean(context.getString(R.string.education_select_db_key),
|
||||
context.getResources().getBoolean(R.bool.education_select_db_default));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +249,13 @@
|
||||
<string name="warning_disabling_storage_access_framework">ATTENTION : désactiver cette fonctionnalité peut engendrer une impossibilité d\'ouvrir ou sauvegarder les bases de données</string>
|
||||
<string name="open_link_database">Lien du fichier Kdbx à ouvrir</string>
|
||||
|
||||
<string name="education_create_database_title">Créez votre fichier de base de données</string>
|
||||
<string name="education_create_database_summary">Vous ne connaissez pas encore KeePass DX, créer votre premier fichier de gestion de mots de passe.</string>
|
||||
<string name="education_select_database_title">Ouvrez une base de données existante</string>
|
||||
<string name="education_select_database_summary">Vous avez déjà utilisé un lecteur KeePass. Ouvrez simplement votre fichier depuis votre navigateur de fichiers.</string>
|
||||
<string name="education_open_link_database_title">Un lien vers l\'emplacement de votre fichier suffit</string>
|
||||
<string name="education_open_link_database_summary">Vous pouvez aussi ouvrir votre base avec un lien physique, les liens file:// et content:// sont acceptés.</string>
|
||||
|
||||
<string-array name="timeout_options">
|
||||
<item>5 secondes</item>
|
||||
<item>10 secondes</item>
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<string name="monospace_font_fields_enable_key" translatable="false">monospace_font_extra_fields_enable_key</string>
|
||||
<string name="auto_open_file_uri_key" translatable="false">auto_open_file_uri_key</string>
|
||||
<string name="allow_copy_password_key" translatable="false">allow_copy_password_key</string>
|
||||
<string name="education_select_db_key" translatable="false">education_select_db_key</string>
|
||||
|
||||
<bool name="maskpass_default" translatable="false">true</bool>
|
||||
<bool name="keyfile_default" translatable="false">true</bool>
|
||||
@@ -84,6 +85,7 @@
|
||||
<bool name="monospace_font_fields_enable_default" translatable="false">true</bool>
|
||||
<bool name="auto_open_file_uri_default" translatable="false">true</bool>
|
||||
<bool name="allow_copy_password_default" translatable="false">true</bool> <!-- TODO To change after implementing the way to enter password < O -->
|
||||
<bool name="education_select_db_default" translatable="false">false</bool>
|
||||
|
||||
<string name="app_timeout_default" translatable="false">300000</string>
|
||||
<string name="clipboard_timeout_default" translatable="false">60000</string>
|
||||
|
||||
@@ -250,6 +250,13 @@
|
||||
<string name="warning_disabling_storage_access_framework">WARNING : disabling this feature may result in an inability to open or save the databases</string>
|
||||
<string name="open_link_database">Link of the Kdbx file to open</string>
|
||||
|
||||
<string name="education_create_database_title">Create your database file</string>
|
||||
<string name="education_create_database_summary">You don\'t know KeePass DX yet, create your first password management file.</string>
|
||||
<string name="education_select_database_title">Open an existing database</string>
|
||||
<string name="education_select_database_summary">You have already used a KeePass manager. Just open your file from your file browser.</string>
|
||||
<string name="education_open_link_database_title">A link to the location of your file is sufficient</string>
|
||||
<string name="education_open_link_database_summary">You can also open your base with a physical link, the links file:// and content:// are accepted.</string>
|
||||
|
||||
<string-array name="timeout_options">
|
||||
<item>5 seconds</item>
|
||||
<item>10 seconds</item>
|
||||
|
||||
Reference in New Issue
Block a user