Don't hide already revealed entries on OTP update

This commit is contained in:
Jakob Nixdorf 2017-07-06 12:11:30 +02:00
parent 937ddcfb23
commit bc1f8002fa
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC

View file

@ -297,6 +297,8 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
private ViewHolderEventCallback eventCallback; private ViewHolderEventCallback eventCallback;
private boolean ttr_enabled = false;
protected TextView OTPValue; protected TextView OTPValue;
protected TextView OTPValueCover; protected TextView OTPValueCover;
protected TextView OTPLabel; protected TextView OTPLabel;
@ -334,8 +336,10 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
public void setTapToReveal(boolean ttr) { public void setTapToReveal(boolean ttr) {
if (ttr) { if (ttr) {
OTPValue.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_visibility_visible, 0, 0, 0); OTPValue.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_visibility_visible, 0, 0, 0);
if (! ttr_enabled || OTPValue.getVisibility() == View.GONE) {
OTPValue.setVisibility(View.GONE); OTPValue.setVisibility(View.GONE);
OTPValueCover.setVisibility(View.VISIBLE); OTPValueCover.setVisibility(View.VISIBLE);
}
OTPValue.setOnClickListener(new View.OnClickListener() { OTPValue.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -360,6 +364,8 @@ public class EntriesCardAdapter extends RecyclerView.Adapter<EntriesCardAdapter.
OTPValue.setOnClickListener(null); OTPValue.setOnClickListener(null);
OTPValueCover.setOnClickListener(null); OTPValueCover.setOnClickListener(null);
} }
ttr_enabled = ttr;
} }
@Override @Override