Search in sources :

Example 1 with FingerPrintAnimatedVector

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());
    }
}
Also used : KeyFileHelper(com.keepassdroid.fileselect.KeyFileHelper) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) FingerPrintAnimatedVector(com.keepassdroid.fingerprint.FingerPrintAnimatedVector) View(android.view.View) TextView(android.widget.TextView) AutofillHelper(com.keepassdroid.autofill.AutofillHelper) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with FingerPrintAnimatedVector

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();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) DialogInterface(android.content.DialogInterface) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) LayoutInflater(android.view.LayoutInflater) FingerPrintAnimatedVector(com.keepassdroid.fingerprint.FingerPrintAnimatedVector) ImageView(android.widget.ImageView) NonNull(android.support.annotation.NonNull)

Aggregations

View (android.view.View)2 FingerPrintAnimatedVector (com.keepassdroid.fingerprint.FingerPrintAnimatedVector)2 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 NonNull (android.support.annotation.NonNull)1 AlertDialog (android.support.v7.app.AlertDialog)1 Toolbar (android.support.v7.widget.Toolbar)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 LayoutInflater (android.view.LayoutInflater)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 AutofillHelper (com.keepassdroid.autofill.AutofillHelper)1 KeyFileHelper (com.keepassdroid.fileselect.KeyFileHelper)1