mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 08:32:34 +00:00
Fixed passphrase prompt activity theming attributes.
This commit is contained in:
@@ -23,9 +23,6 @@ import android.content.Intent;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
|
||||
import androidx.core.os.CancellationSignal;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.SpannableString;
|
||||
@@ -49,6 +46,9 @@ import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
|
||||
import androidx.core.os.CancellationSignal;
|
||||
|
||||
import org.thoughtcrime.securesms.animation.AnimationCompleteListener;
|
||||
import org.thoughtcrime.securesms.components.AnimatingToggle;
|
||||
import org.thoughtcrime.securesms.crypto.InvalidPassphraseException;
|
||||
@@ -76,8 +76,8 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
private Button lockScreenButton;
|
||||
|
||||
private EditText passphraseText;
|
||||
// private ImageButton showButton;
|
||||
// private ImageButton hideButton;
|
||||
private ImageButton showButton;
|
||||
private ImageButton hideButton;
|
||||
private AnimatingToggle visibilityToggle;
|
||||
|
||||
private FingerprintManagerCompat fingerprintManager;
|
||||
@@ -91,8 +91,6 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i(TAG, "onCreate()");
|
||||
dynamicLanguage.onCreate(this);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.prompt_passphrase_activity);
|
||||
@@ -203,11 +201,10 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
|
||||
private void initializeResources() {
|
||||
|
||||
// ImageButton okButton = findViewById(R.id.ok_button);
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
ImageButton okButton = findViewById(R.id.ok_button);
|
||||
|
||||
// showButton = findViewById(R.id.passphrase_visibility);
|
||||
// hideButton = findViewById(R.id.passphrase_visibility_off);
|
||||
showButton = findViewById(R.id.passphrase_visibility);
|
||||
hideButton = findViewById(R.id.passphrase_visibility_off);
|
||||
visibilityToggle = findViewById(R.id.button_toggle);
|
||||
passphraseText = findViewById(R.id.passphrase_edit);
|
||||
passphraseAuthContainer = findViewById(R.id.password_auth_container);
|
||||
@@ -217,20 +214,16 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
fingerprintCancellationSignal = new CancellationSignal();
|
||||
fingerprintListener = new FingerprintListener();
|
||||
|
||||
// setSupportActionBar(toolbar);
|
||||
// getSupportActionBar().setTitle("");
|
||||
|
||||
SpannableString hint = new SpannableString(" " + getString(R.string.PassphrasePromptActivity_enter_passphrase));
|
||||
hint.setSpan(new RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
|
||||
passphraseText.setHint(hint);
|
||||
// okButton.setOnClickListener(new OkButtonClickListener());
|
||||
// showButton.setOnClickListener(new ShowButtonOnClickListener());
|
||||
// hideButton.setOnClickListener(new HideButtonOnClickListener());
|
||||
okButton.setOnClickListener(new OkButtonClickListener());
|
||||
showButton.setOnClickListener(new ShowButtonOnClickListener());
|
||||
hideButton.setOnClickListener(new HideButtonOnClickListener());
|
||||
passphraseText.setOnEditorActionListener(new PassphraseActionListener());
|
||||
passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock),
|
||||
EditorInfo.IME_ACTION_DONE);
|
||||
passphraseText.setImeActionLabel(getString(R.string.prompt_passphrase_activity__unlock), EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
fingerprintPrompt.setImageResource(R.drawable.ic_fingerprint_white_48dp);
|
||||
fingerprintPrompt.getBackground().setColorFilter(getResources().getColor(R.color.signal_primary), PorterDuff.Mode.SRC_IN);
|
||||
@@ -316,7 +309,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
private class ShowButtonOnClickListener implements OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// visibilityToggle.display(hideButton);
|
||||
visibilityToggle.display(hideButton);
|
||||
setPassphraseVisibility(true);
|
||||
}
|
||||
}
|
||||
@@ -324,7 +317,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
||||
private class HideButtonOnClickListener implements OnClickListener {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// visibilityToggle.display(showButton);
|
||||
visibilityToggle.display(showButton);
|
||||
setPassphraseVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user