2017-08-05 15:15:31 +02:00
|
|
|
package me.impy.aegis;
|
|
|
|
|
2017-08-06 18:15:47 +02:00
|
|
|
import android.content.Context;
|
2017-08-05 15:15:31 +02:00
|
|
|
import android.os.Bundle;
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
import android.widget.RadioButton;
|
|
|
|
import android.widget.RadioGroup;
|
2017-08-06 16:03:36 +02:00
|
|
|
import android.widget.Toast;
|
2017-08-05 15:15:31 +02:00
|
|
|
|
|
|
|
import agency.tango.materialintroscreen.SlideFragment;
|
|
|
|
|
2017-08-06 16:03:36 +02:00
|
|
|
public class CustomAuthenticationSlide extends SlideFragment {
|
|
|
|
private RadioGroup buttonGroup;
|
2017-08-05 15:15:31 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
|
|
|
final View view = inflater.inflate(R.layout.fragment_authentication_slide, container, false);
|
2017-08-06 16:03:36 +02:00
|
|
|
buttonGroup = (RadioGroup) view.findViewById(R.id.rg_authenticationMethod);
|
2017-08-05 15:15:31 +02:00
|
|
|
|
2017-08-06 16:03:36 +02:00
|
|
|
RadioButton button = (RadioButton) view.findViewById(R.id.rb_fingerprint);
|
2017-08-06 18:15:47 +02:00
|
|
|
button.setOnClickListener(new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
if (canMoveFurther()) {
|
|
|
|
buttonGroup.clearCheck();
|
|
|
|
Toast.makeText(CustomAuthenticationSlide.this.getActivity(), "Fingerprint is not supported yet", Toast.LENGTH_SHORT).show();
|
|
|
|
}
|
2017-08-05 15:15:31 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return view;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int backgroundColor() {
|
|
|
|
return R.color.colorHeaderSuccess;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int buttonsColor() {
|
|
|
|
return R.color.colorAccent;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canMoveFurther() {
|
2017-08-06 16:03:36 +02:00
|
|
|
return buttonGroup.getCheckedRadioButtonId() != -1;
|
2017-08-05 15:15:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String cantMoveFurtherErrorMessage() {
|
|
|
|
return "Please select an authentication method";
|
|
|
|
}
|
2017-08-06 16:03:36 +02:00
|
|
|
}
|