mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix read-only education screen
This commit is contained in:
@@ -417,6 +417,44 @@ public class PasswordActivity extends StylishActivity
|
||||
@Override
|
||||
public void onTargetClick(TapTargetView view) {
|
||||
super.onTargetClick(view);
|
||||
performedReadOnlyEducation(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOuterCircleClick(TapTargetView view) {
|
||||
super.onOuterCircleClick(view);
|
||||
view.dismiss(false);
|
||||
performedReadOnlyEducation(menu);
|
||||
|
||||
}
|
||||
});
|
||||
// TODO make a period for donation
|
||||
PreferencesUtil.saveEducationPreference(PasswordActivity.this,
|
||||
R.string.education_unlock_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and display learning views
|
||||
* Displays read-only if available
|
||||
*/
|
||||
private void performedReadOnlyEducation(Menu menu) {
|
||||
if (!PreferencesUtil.isEducationReadOnlyPerformed(this)) {
|
||||
try {
|
||||
TapTargetView.showFor(this,
|
||||
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_open_file_read_mode_key,
|
||||
getString(R.string.education_read_only_title),
|
||||
getString(R.string.education_read_only_summary))
|
||||
.textColorInt(Color.WHITE)
|
||||
.tintTarget(true)
|
||||
.cancelable(true),
|
||||
new TapTargetView.Listener() {
|
||||
@Override
|
||||
public void onTargetClick(TapTargetView view) {
|
||||
super.onTargetClick(view);
|
||||
MenuItem editItem = menu.findItem(R.id.menu_open_file_read_mode_key);
|
||||
onOptionsItemSelected(editItem);
|
||||
checkAndPerformedEducationForFingerprint();
|
||||
}
|
||||
|
||||
@@ -425,43 +463,13 @@ public class PasswordActivity extends StylishActivity
|
||||
super.onOuterCircleClick(view);
|
||||
view.dismiss(false);
|
||||
checkAndPerformedEducationForFingerprint();
|
||||
|
||||
}
|
||||
});
|
||||
// TODO make a period for donation
|
||||
PreferencesUtil.saveEducationPreference(PasswordActivity.this,
|
||||
R.string.education_unlock_key);
|
||||
|
||||
} else if (!PreferencesUtil.isEducationReadOnlyPerformed(this)) {
|
||||
|
||||
try {
|
||||
TapTargetView.showFor(this,
|
||||
TapTarget.forToolbarMenuItem(toolbar, R.id.menu_open_file_read_mode_key,
|
||||
getString(R.string.education_read_only_title),
|
||||
getString(R.string.education_read_only_summary))
|
||||
.textColorInt(Color.WHITE)
|
||||
.tintTarget(true)
|
||||
.cancelable(true),
|
||||
new TapTargetView.Listener() {
|
||||
@Override
|
||||
public void onTargetClick(TapTargetView view) {
|
||||
super.onTargetClick(view);
|
||||
MenuItem editItem = menu.findItem(R.id.menu_open_file_read_mode_key);
|
||||
onOptionsItemSelected(editItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOuterCircleClick(TapTargetView view) {
|
||||
super.onOuterCircleClick(view);
|
||||
view.dismiss(false);
|
||||
}
|
||||
});
|
||||
PreferencesUtil.saveEducationPreference(this,
|
||||
R.string.education_read_only_key);
|
||||
} catch (Exception e) {
|
||||
// If icon not visible
|
||||
Log.w(TAG, "Can't performed education for entry's edition");
|
||||
}
|
||||
PreferencesUtil.saveEducationPreference(this,
|
||||
R.string.education_read_only_key);
|
||||
} catch (Exception e) {
|
||||
// If icon not visible
|
||||
Log.w(TAG, "Can't performed education for entry's edition");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user