use of com.keepassdroid.fingerprint.FingerPrintAnimatedVector in project KeePassDX by Kunzisoft.
the class PasswordActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefsNoBackup = PreferencesUtil.getNoBackupSharedPreferences(getApplicationContext());
mRememberKeyfile = prefs.getBoolean(getString(R.string.keyfile_key), getResources().getBoolean(R.bool.keyfile_default));
setContentView(R.layout.password);
Toolbar toolbar = findViewById(R.id.toolbar);
toolbar.setTitle(getString(R.string.app_name));
setSupportActionBar(toolbar);
assert getSupportActionBar() != null;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
confirmButtonView = findViewById(R.id.pass_ok);
filenameView = findViewById(R.id.filename);
passwordView = findViewById(R.id.password);
keyFileView = findViewById(R.id.pass_keyfile);
checkboxPasswordView = findViewById(R.id.password_checkbox);
checkboxKeyfileView = findViewById(R.id.keyfile_checkox);
checkboxDefaultDatabaseView = findViewById(R.id.default_database);
View browseView = findViewById(R.id.browse_button);
keyFileHelper = new KeyFileHelper(PasswordActivity.this);
browseView.setOnClickListener(keyFileHelper.getOpenFileOnClickViewListener());
passwordView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (!editable.toString().isEmpty() && !checkboxPasswordView.isChecked())
checkboxPasswordView.setChecked(true);
}
});
keyFileView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
if (!editable.toString().isEmpty() && !checkboxKeyfileView.isChecked())
checkboxKeyfileView.setChecked(true);
}
});
defaultCheckChange = new DefaultCheckChange();
validateButtonViewClickListener = new ValidateButtonViewClickListener();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
fingerprintContainerView = findViewById(R.id.fingerprint_container);
fingerprintTextView = findViewById(R.id.fingerprint_label);
initForFingerprint();
fingerPrintAnimatedVector = new FingerPrintAnimatedVector(this, findViewById(R.id.fingerprint_image));
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
autofillHelper = new AutofillHelper();
autofillHelper.retrieveAssistStructure(getIntent());
}
}
use of com.keepassdroid.fingerprint.FingerPrintAnimatedVector in project KeePassDX by Kunzisoft.
the class FingerPrintDialog method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View rootView = inflater.inflate(R.layout.fingerprint_dialog, null);
View fingerprintSettingWayTextView = rootView.findViewById(R.id.fingerprint_setting_way_text);
fingerprintSettingWayTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(android.provider.Settings.ACTION_SECURITY_SETTINGS));
}
});
fingerPrintAnimatedVector = new FingerPrintAnimatedVector(getContext(), (ImageView) rootView.findViewById(R.id.fingerprint_image));
builder.setView(rootView).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
}
});
return builder.create();
}
Aggregations