mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Change education for group screen
This commit is contained in:
@@ -42,7 +42,7 @@ import android.view.MenuItem;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
|
|
||||||
import com.getkeepsafe.taptargetview.TapTarget;
|
import com.getkeepsafe.taptargetview.TapTarget;
|
||||||
import com.getkeepsafe.taptargetview.TapTargetSequence;
|
import com.getkeepsafe.taptargetview.TapTargetView;
|
||||||
import com.kunzisoft.keepass.R;
|
import com.kunzisoft.keepass.R;
|
||||||
import com.kunzisoft.keepass.adapters.NodeAdapter;
|
import com.kunzisoft.keepass.adapters.NodeAdapter;
|
||||||
import com.kunzisoft.keepass.app.App;
|
import com.kunzisoft.keepass.app.App;
|
||||||
@@ -263,57 +263,102 @@ public class GroupActivity extends ListNodesActivity
|
|||||||
addNodeButtonView.showButton();
|
addNodeButtonView.showButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void checkAndPerformedEducation(Menu menu) {
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
|
||||||
boolean parentOnPrepareOptionMenu = super.onPrepareOptionsMenu(menu);
|
|
||||||
|
|
||||||
// Launch education screen
|
// If no node, show education to add new one
|
||||||
new Handler().post(this::checkAndPerformedEducation);
|
if (mAdapter.getItemCount() <= 0) {
|
||||||
|
if (!PreferencesUtil.isEducationNewNodePerformed(this)) {
|
||||||
|
|
||||||
return parentOnPrepareOptionMenu;
|
TapTargetView.showFor(this,
|
||||||
}
|
TapTarget.forView(findViewById(R.id.add_button),
|
||||||
|
getString(R.string.education_new_node_title),
|
||||||
|
getString(R.string.education_new_node_summary))
|
||||||
|
.tintTarget(false)
|
||||||
|
.cancelable(true),
|
||||||
|
new TapTargetView.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onTargetClick(TapTargetView view) {
|
||||||
|
super.onTargetClick(view);
|
||||||
|
addNodeButtonView.openButtonIfClose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
PreferencesUtil.saveEducationPreference(this,
|
||||||
|
R.string.education_new_node_key);
|
||||||
|
|
||||||
private void checkAndPerformedEducation() {
|
}
|
||||||
// For the first time show the tuto
|
|
||||||
if (!PreferencesUtil.isEducationGroupPerformed(this)) {
|
|
||||||
|
|
||||||
new TapTargetSequence(this)
|
// Else show the search education
|
||||||
.targets(
|
} else if (!PreferencesUtil.isEducationSearchPerformed(this)) {
|
||||||
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_search,
|
|
||||||
getString(R.string.education_search_title),
|
|
||||||
getString(R.string.education_search_summary)),
|
|
||||||
//TapTarget.forToolbarMenuItem(toolbar, R.id.menu_lock,
|
|
||||||
// getString(R.string.education_lock_title),
|
|
||||||
// getString(R.string.education_lock_summary)),
|
|
||||||
//TapTarget.forToolbarMenuItem(toolbar, R.id.menu_sort,
|
|
||||||
// getString(R.string.education_sort_title),
|
|
||||||
// getString(R.string.education_sort_summary)),
|
|
||||||
TapTarget.forView(findViewById(R.id.add_button),
|
|
||||||
getString(R.string.education_new_node_title),
|
|
||||||
getString(R.string.education_new_node_summary))
|
|
||||||
.tintTarget(false)
|
|
||||||
).listener(new TapTargetSequence.Listener() {
|
|
||||||
@Override
|
|
||||||
public void onSequenceFinish() {
|
|
||||||
saveEducationPreference();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
TapTargetView.showFor(this,
|
||||||
public void onSequenceStep(TapTarget lastTarget, boolean targetClicked) {}
|
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_search,
|
||||||
|
getString(R.string.education_search_title),
|
||||||
|
getString(R.string.education_search_summary))
|
||||||
|
.tintTarget(true)
|
||||||
|
.cancelable(true),
|
||||||
|
new TapTargetView.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onTargetClick(TapTargetView view) {
|
||||||
|
super.onTargetClick(view);
|
||||||
|
MenuItem searchItem = menu.findItem(R.id.menu_search);
|
||||||
|
searchItem.expandActionView();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
PreferencesUtil.saveEducationPreference(this,
|
||||||
|
R.string.education_search_key);
|
||||||
|
|
||||||
@Override
|
// Else show the sort education
|
||||||
public void onSequenceCanceled(TapTarget lastTarget) {}
|
} else if (!PreferencesUtil.isEducationSortPerformed(this)) {
|
||||||
}).continueOnCancel(true).start();
|
|
||||||
|
try {
|
||||||
|
TapTargetView.showFor(this,
|
||||||
|
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_sort,
|
||||||
|
getString(R.string.education_sort_title),
|
||||||
|
getString(R.string.education_sort_summary))
|
||||||
|
.tintTarget(true)
|
||||||
|
.cancelable(true),
|
||||||
|
new TapTargetView.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onTargetClick(TapTargetView view) {
|
||||||
|
super.onTargetClick(view);
|
||||||
|
MenuItem sortItem = menu.findItem(R.id.menu_sort);
|
||||||
|
onOptionsItemSelected(sortItem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
PreferencesUtil.saveEducationPreference(this,
|
||||||
|
R.string.education_sort_key);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// If icon not visible
|
||||||
|
Log.w(TAG, "Can't performed education for sort");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Else show the lock education
|
||||||
|
} else if (!PreferencesUtil.isEducationLockPerformed(this)) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
TapTargetView.showFor(this,
|
||||||
|
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_lock,
|
||||||
|
getString(R.string.education_lock_title),
|
||||||
|
getString(R.string.education_lock_summary))
|
||||||
|
.tintTarget(true)
|
||||||
|
.cancelable(true),
|
||||||
|
new TapTargetView.Listener() {
|
||||||
|
@Override
|
||||||
|
public void onTargetClick(TapTargetView view) {
|
||||||
|
super.onTargetClick(view);
|
||||||
|
MenuItem lockItem = menu.findItem(R.id.menu_lock);
|
||||||
|
onOptionsItemSelected(lockItem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
PreferencesUtil.saveEducationPreference(this,
|
||||||
|
R.string.education_lock_key);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// If icon not visible
|
||||||
|
Log.w(TAG, "Can't performed education for lock");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveEducationPreference() {
|
|
||||||
SharedPreferences sharedPreferences = PreferencesUtil.getEducationSharedPreferences(this);
|
|
||||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
|
||||||
editor.putBoolean(getString(R.string.education_group_key), true);
|
|
||||||
editor.apply();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
@@ -377,6 +422,9 @@ public class GroupActivity extends ListNodesActivity
|
|||||||
|
|
||||||
super.onCreateOptionsMenu(menu);
|
super.onCreateOptionsMenu(menu);
|
||||||
|
|
||||||
|
// Launch education screen
|
||||||
|
new Handler().post(() -> checkAndPerformedEducation(menu));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ public class PasswordActivity extends StylishActivity
|
|||||||
.tintTarget(false);
|
.tintTarget(false);
|
||||||
targets.add(fingerprintTapTarget);
|
targets.add(fingerprintTapTarget);
|
||||||
}
|
}
|
||||||
|
// TODO make a period for donation
|
||||||
|
|
||||||
if (!targets.isEmpty()) {
|
if (!targets.isEmpty()) {
|
||||||
new TapTargetSequence(this)
|
new TapTargetSequence(this)
|
||||||
|
|||||||
@@ -153,7 +153,10 @@ public class PreferencesUtil {
|
|||||||
R.string.education_create_db_key,
|
R.string.education_create_db_key,
|
||||||
R.string.education_select_db_key,
|
R.string.education_select_db_key,
|
||||||
R.string.education_open_link_db_key,
|
R.string.education_open_link_db_key,
|
||||||
R.string.education_group_key,
|
R.string.education_search_key,
|
||||||
|
R.string.education_new_node_key,
|
||||||
|
R.string.education_sort_key,
|
||||||
|
R.string.education_lock_key,
|
||||||
R.string.education_entry_key,
|
R.string.education_entry_key,
|
||||||
R.string.education_password_key,
|
R.string.education_password_key,
|
||||||
R.string.education_entry_edit_key
|
R.string.education_entry_edit_key
|
||||||
@@ -186,10 +189,28 @@ public class PreferencesUtil {
|
|||||||
context.getResources().getBoolean(R.bool.education_open_link_db_default));
|
context.getResources().getBoolean(R.bool.education_open_link_db_default));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEducationGroupPerformed(Context context) {
|
public static boolean isEducationSearchPerformed(Context context) {
|
||||||
SharedPreferences prefs = getEducationSharedPreferences(context);
|
SharedPreferences prefs = getEducationSharedPreferences(context);
|
||||||
return prefs.getBoolean(context.getString(R.string.education_group_key),
|
return prefs.getBoolean(context.getString(R.string.education_search_key),
|
||||||
context.getResources().getBoolean(R.bool.education_group_default));
|
context.getResources().getBoolean(R.bool.education_search_default));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEducationNewNodePerformed(Context context) {
|
||||||
|
SharedPreferences prefs = getEducationSharedPreferences(context);
|
||||||
|
return prefs.getBoolean(context.getString(R.string.education_new_node_key),
|
||||||
|
context.getResources().getBoolean(R.bool.education_new_node_default));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEducationSortPerformed(Context context) {
|
||||||
|
SharedPreferences prefs = getEducationSharedPreferences(context);
|
||||||
|
return prefs.getBoolean(context.getString(R.string.education_sort_key),
|
||||||
|
context.getResources().getBoolean(R.bool.education_sort_default));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEducationLockPerformed(Context context) {
|
||||||
|
SharedPreferences prefs = getEducationSharedPreferences(context);
|
||||||
|
return prefs.getBoolean(context.getString(R.string.education_lock_key),
|
||||||
|
context.getResources().getBoolean(R.bool.education_lock_default));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEducationEntryPerformed(Context context) {
|
public static boolean isEducationEntryPerformed(Context context) {
|
||||||
|
|||||||
@@ -148,6 +148,15 @@ public class AddNodeButtonView extends RelativeLayout {
|
|||||||
addButtonView.hide(onAddButtonVisibilityChangedListener);
|
addButtonView.hide(onAddButtonVisibilityChangedListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start the animation to close the button
|
||||||
|
*/
|
||||||
|
public void openButtonIfClose() {
|
||||||
|
if(state.equals(State.CLOSE)) {
|
||||||
|
startGlobalAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the animation to close the button
|
* Start the animation to close the button
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -24,5 +24,6 @@
|
|||||||
android:title="@string/menu_search"
|
android:title="@string/menu_search"
|
||||||
app:showAsAction="always|collapseActionView"
|
app:showAsAction="always|collapseActionView"
|
||||||
android:orderInCategory="31"
|
android:orderInCategory="31"
|
||||||
|
android:iconifiedByDefault="true"
|
||||||
app:actionViewClass="android.support.v7.widget.SearchView" />
|
app:actionViewClass="android.support.v7.widget.SearchView" />
|
||||||
</menu>
|
</menu>
|
||||||
@@ -261,9 +261,9 @@
|
|||||||
<string name="education_open_link_database_title">Un lien vers l\'emplacement de votre fichier suffit</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. (Avec file:// et content:// par exemple).</string>
|
<string name="education_open_link_database_summary">Vous pouvez aussi ouvrir votre base avec un lien physique. (Avec file:// et content:// par exemple).</string>
|
||||||
<string name="education_new_node_title">Ajoutez de nouveaux éléments à votre base</string>
|
<string name="education_new_node_title">Ajoutez de nouveaux éléments à votre base</string>
|
||||||
<string name="education_new_node_summary">Ajoutez des entrées pour gérer vos identités numériques.\nAjoutez des groupes (l\'équivalent des dossiers) pour organiser vos entrées et votre base.</string>
|
<string name="education_new_node_summary">Ajoutez des entrées pour gérer vos identités numériques.\n\nAjoutez des groupes (l\'équivalent des dossiers) pour organiser vos entrées et votre base.</string>
|
||||||
<string name="education_search_title">Recherchez facilement vos entrées</string>
|
<string name="education_search_title">Recherchez facilement vos entrées</string>
|
||||||
<string name="education_search_summary">Recherchez des entrées par titre, nom d\'utilisateur ou d\'autres champs pour récupérer facilement vos mots de passes.</string>
|
<string name="education_search_summary">Recherchez des entrées par titre, nom d\'utilisateur ou par d\'autres champs pour récupérer facilement vos mots de passes.</string>
|
||||||
<string name="education_fingerprint_title">Débloquez votre base de données avec votre empreinte digitale</string>
|
<string name="education_fingerprint_title">Débloquez votre base de données avec votre empreinte digitale</string>
|
||||||
<string name="education_fingerprint_summary">Faites le lien entre votre mot de passe et votre empreinte digitale pour facilement dévérouiller votre base de données.</string>
|
<string name="education_fingerprint_summary">Faites le lien entre votre mot de passe et votre empreinte digitale pour facilement dévérouiller votre base de données.</string>
|
||||||
<string name="education_entry_edit_title">Editez l\'entrée</string>
|
<string name="education_entry_edit_title">Editez l\'entrée</string>
|
||||||
@@ -279,7 +279,7 @@
|
|||||||
<string name="education_field_copy_title">Copiez un champ</string>
|
<string name="education_field_copy_title">Copiez un champ</string>
|
||||||
<string name="education_field_copy_summary">Copiez un champ facilement dans le presse-papiers pour le coller où vous voulez.</string>
|
<string name="education_field_copy_summary">Copiez un champ facilement dans le presse-papiers pour le coller où vous voulez.</string>
|
||||||
<string name="education_lock_title">Vérouillez la base de données</string>
|
<string name="education_lock_title">Vérouillez la base de données</string>
|
||||||
<string name="education_lock_summary">Verrouillez votre base de données rapidement, vous pouvez paramétrer l\'application pour qu\'elle se verrouille après un certain temps et lorsqu'un écran est éteint.</string>
|
<string name="education_lock_summary">Verrouillez votre base de données rapidement, vous pouvez paramétrer l\'application pour qu\'elle se verrouille après un certain temps et lorsqu\'un écran est éteint.</string>
|
||||||
<string name="education_sort_title">Triez les éléments</string>
|
<string name="education_sort_title">Triez les éléments</string>
|
||||||
<string name="education_sort_summary">Triez les entrées et les groupes en fonction de paramètres spécifiques.</string>
|
<string name="education_sort_summary">Triez les entrées et les groupes en fonction de paramètres spécifiques.</string>
|
||||||
<string name="education_donation_title">Participez</string>
|
<string name="education_donation_title">Participez</string>
|
||||||
|
|||||||
@@ -76,7 +76,10 @@
|
|||||||
<string name="education_create_db_key" translatable="false">education_create_db_key</string>
|
<string name="education_create_db_key" translatable="false">education_create_db_key</string>
|
||||||
<string name="education_select_db_key" translatable="false">education_select_db_key</string>
|
<string name="education_select_db_key" translatable="false">education_select_db_key</string>
|
||||||
<string name="education_open_link_db_key" translatable="false">education_open_link_db_key</string>
|
<string name="education_open_link_db_key" translatable="false">education_open_link_db_key</string>
|
||||||
<string name="education_group_key" translatable="false">education_group_key</string>
|
<string name="education_search_key" translatable="false">education_search_key</string>
|
||||||
|
<string name="education_new_node_key" translatable="false">education_new_node_key</string>
|
||||||
|
<string name="education_sort_key" translatable="false">education_sort_key</string>
|
||||||
|
<string name="education_lock_key" translatable="false">education_lock_key</string>
|
||||||
<string name="education_entry_key" translatable="false">education_entry_key</string>
|
<string name="education_entry_key" translatable="false">education_entry_key</string>
|
||||||
<string name="education_password_key" translatable="false">education_password_key</string>
|
<string name="education_password_key" translatable="false">education_password_key</string>
|
||||||
<string name="education_entry_edit_key" translatable="false">education_entry_edit_key</string>
|
<string name="education_entry_edit_key" translatable="false">education_entry_edit_key</string>
|
||||||
@@ -100,7 +103,10 @@
|
|||||||
<bool name="education_create_db_default" translatable="false">false</bool>
|
<bool name="education_create_db_default" translatable="false">false</bool>
|
||||||
<bool name="education_select_db_default" translatable="false">false</bool>
|
<bool name="education_select_db_default" translatable="false">false</bool>
|
||||||
<bool name="education_open_link_db_default" translatable="false">false</bool>
|
<bool name="education_open_link_db_default" translatable="false">false</bool>
|
||||||
<bool name="education_group_default" translatable="false">false</bool>
|
<bool name="education_search_default" translatable="false">false</bool>
|
||||||
|
<bool name="education_new_node_default" translatable="false">false</bool>
|
||||||
|
<bool name="education_sort_default" translatable="false">false</bool>
|
||||||
|
<bool name="education_lock_default" translatable="false">false</bool>
|
||||||
<bool name="education_entry_default" translatable="false">false</bool>
|
<bool name="education_entry_default" translatable="false">false</bool>
|
||||||
<bool name="education_password_default" translatable="false">false</bool>
|
<bool name="education_password_default" translatable="false">false</bool>
|
||||||
<bool name="education_entry_edit_default" translatable="false">false</bool>
|
<bool name="education_entry_edit_default" translatable="false">false</bool>
|
||||||
|
|||||||
@@ -265,7 +265,7 @@
|
|||||||
<string name="education_open_link_database_title">A link to the location of your file is sufficient</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 (With file:// and content:// for example).</string>
|
<string name="education_open_link_database_summary">You can also open your base with a physical link (With file:// and content:// for example).</string>
|
||||||
<string name="education_new_node_title">Add new items to your base</string>
|
<string name="education_new_node_title">Add new items to your base</string>
|
||||||
<string name="education_new_node_summary">Add entries to manage your digital identities.\nAdd groups (the equivalent of folders) to organize your entries and your database.</string>
|
<string name="education_new_node_summary">Add entries to manage your digital identities.\n\nAdd groups (the equivalent of folders) to organize your entries and your database.</string>
|
||||||
<string name="education_search_title">Easily search your entries</string>
|
<string name="education_search_title">Easily search your entries</string>
|
||||||
<string name="education_search_summary">Search for entries by title, username or other fields to easily retrieve your passwords.</string>
|
<string name="education_search_summary">Search for entries by title, username or other fields to easily retrieve your passwords.</string>
|
||||||
<string name="education_fingerprint_title">Unlock your database with your fingerprint</string>
|
<string name="education_fingerprint_title">Unlock your database with your fingerprint</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user