Correctly enable/disable the fingerprint option in the intro

This commit is contained in:
Alexander Bakker 2018-06-07 12:42:25 +02:00
parent 9c0ce4210c
commit 8419e1f35d
2 changed files with 5 additions and 6 deletions

View file

@ -8,10 +8,8 @@ import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.Spinner;
import android.widget.TextView;
import com.github.paolorotolo.appintro.ISlidePolicy;
@ -25,7 +23,6 @@ public class CustomAuthenticationSlide extends Fragment implements ISlidePolicy,
public static final int CRYPT_TYPE_PASS = 2;
public static final int CRYPT_TYPE_FINGER = 3;
private Spinner _authenticationSpinner;
private RadioGroup _buttonGroup;
private int _bgColor;
@ -36,13 +33,13 @@ public class CustomAuthenticationSlide extends Fragment implements ISlidePolicy,
_buttonGroup.setOnCheckedChangeListener(this);
onCheckedChanged(_buttonGroup, _buttonGroup.getCheckedRadioButtonId());
// only show the fingerprint option if the api version is new enough, permission is granted and a scanner is found
// only enable the fingerprint option if the api version is new enough, permission is granted and a scanner is found
FingerprintManager manager = FingerprintHelper.getManager(getContext());
if (manager != null) {
RadioButton button = view.findViewById(R.id.rb_fingerprint);
TextView text = view.findViewById(R.id.text_rb_fingerprint);
button.setEnabled(false);
text.setEnabled(false);
button.setEnabled(true);
text.setEnabled(true);
}
view.findViewById(R.id.main).setBackgroundColor(_bgColor);