mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 14:02:49 +00:00
Start hooking up the intro to the database code
Fingerprint stuff has been left out for now
This commit is contained in:
parent
f1b499f101
commit
53e86db187
11 changed files with 311 additions and 633 deletions
|
@ -1,53 +1,31 @@
|
|||
package me.impy.aegis;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.RequiresApi;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.mattprecious.swirl.SwirlView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import agency.tango.materialintroscreen.SlideFragment;
|
||||
import me.impy.aegis.finger.FingerprintAuthenticationDialogFragment;
|
||||
import me.impy.aegis.finger.SetFingerprintAuthenticationDialog;
|
||||
|
||||
public class CustomAuthenticationSlide extends SlideFragment implements SetFingerprintAuthenticationDialog.InterfaceCommunicator{
|
||||
private CheckBox checkBox;
|
||||
private RadioButton fingerprintRadioButton;
|
||||
private RadioGroup authenticationMethodRadioGroup;
|
||||
|
||||
public static final int DIALOG_FRAGMENT = 1;
|
||||
public class CustomAuthenticationSlide extends SlideFragment {
|
||||
private RadioGroup buttonGroup;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_authentication_slide, container, false);
|
||||
final CustomAuthenticationSlide caller = this;
|
||||
buttonGroup = (RadioGroup) view.findViewById(R.id.rg_authenticationMethod);
|
||||
|
||||
fingerprintRadioButton = (RadioButton) view.findViewById(R.id.rb_fingerprint);
|
||||
fingerprintRadioButton.setOnClickListener(new View.OnClickListener() {
|
||||
@RequiresApi(api = Build.VERSION_CODES.M)
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
SetFingerprintAuthenticationDialog fragment = new SetFingerprintAuthenticationDialog();
|
||||
//fragment.setCryptoObject(new FingerprintManager.CryptoObject(cipher));
|
||||
fragment.setStage(SetFingerprintAuthenticationDialog.Stage.FINGERPRINT);
|
||||
fragment.setCaller(caller);
|
||||
//fragment.setAction(action);
|
||||
fragment.show(getActivity().getFragmentManager(), "dialog");
|
||||
RadioButton button = (RadioButton) view.findViewById(R.id.rb_fingerprint);
|
||||
button.setOnClickListener(v -> {
|
||||
if (canMoveFurther()) {
|
||||
buttonGroup.clearCheck();
|
||||
Toast.makeText(getActivity().getBaseContext(), "Fingerprint is not supported yet", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
authenticationMethodRadioGroup = (RadioGroup) view.findViewById(R.id.rg_authenticationMethod);
|
||||
return view;
|
||||
}
|
||||
|
||||
|
@ -63,27 +41,11 @@ public class CustomAuthenticationSlide extends SlideFragment implements SetFinge
|
|||
|
||||
@Override
|
||||
public boolean canMoveFurther() {
|
||||
return authenticationMethodRadioGroup.getCheckedRadioButtonId() != -1;
|
||||
return buttonGroup.getCheckedRadioButtonId() != -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String cantMoveFurtherErrorMessage() {
|
||||
return "Please select an authentication method";
|
||||
//return getString(R.string.error_message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendRequestCode(int code) {
|
||||
if (code == 1) {
|
||||
|
||||
} else if (code == 0){
|
||||
authenticationMethodRadioGroup.clearCheck();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue