|
|
@ -16,16 +16,12 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.graphics.drawable.Drawable;
|
|
|
|
|
|
|
|
import android.os.Build;
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
|
import android.support.v7.app.ActionBar;
|
|
|
|
import android.text.Editable;
|
|
|
|
import android.text.Editable;
|
|
|
|
import android.text.SpannableString;
|
|
|
|
import android.text.SpannableString;
|
|
|
|
import android.text.Spanned;
|
|
|
|
import android.text.Spanned;
|
|
|
|
import android.text.style.ForegroundColorSpan;
|
|
|
|
|
|
|
|
import android.text.style.RelativeSizeSpan;
|
|
|
|
import android.text.style.RelativeSizeSpan;
|
|
|
|
import android.text.style.TypefaceSpan;
|
|
|
|
import android.text.style.TypefaceSpan;
|
|
|
|
import android.view.KeyEvent;
|
|
|
|
import android.view.KeyEvent;
|
|
|
@ -42,9 +38,9 @@ import android.widget.Toast;
|
|
|
|
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.InvalidPassphraseException;
|
|
|
|
import org.thoughtcrime.securesms.crypto.InvalidPassphraseException;
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecretUtil;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.util.DynamicIntroTheme;
|
|
|
|
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
|
|
|
import org.thoughtcrime.securesms.util.DynamicLanguage;
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
|
|
|
import org.thoughtcrime.securesms.util.Util;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Activity that prompts for a user's passphrase.
|
|
|
|
* Activity that prompts for a user's passphrase.
|
|
|
@ -53,12 +49,14 @@ import org.thoughtcrime.securesms.util.Util;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class PassphrasePromptActivity extends PassphraseActivity {
|
|
|
|
public class PassphrasePromptActivity extends PassphraseActivity {
|
|
|
|
|
|
|
|
|
|
|
|
private DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
|
|
|
private DynamicIntroTheme dynamicTheme = new DynamicIntroTheme();
|
|
|
|
|
|
|
|
private DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
|
|
|
|
|
|
|
|
|
|
|
private EditText passphraseText;
|
|
|
|
private EditText passphraseText;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
|
|
|
dynamicTheme.onCreate(this);
|
|
|
|
dynamicLanguage.onCreate(this);
|
|
|
|
dynamicLanguage.onCreate(this);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
|
|
|
|
|
@ -69,6 +67,7 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onResume() {
|
|
|
|
public void onResume() {
|
|
|
|
super.onResume();
|
|
|
|
super.onResume();
|
|
|
|
|
|
|
|
dynamicTheme.onResume(this);
|
|
|
|
dynamicLanguage.onResume(this);
|
|
|
|
dynamicLanguage.onResume(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -119,14 +118,13 @@ public class PassphrasePromptActivity extends PassphraseActivity {
|
|
|
|
|
|
|
|
|
|
|
|
private void initializeResources() {
|
|
|
|
private void initializeResources() {
|
|
|
|
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
|
|
|
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
|
|
|
getSupportActionBar().setCustomView(R.layout.light_centered_app_title);
|
|
|
|
getSupportActionBar().setCustomView(R.layout.centered_app_title);
|
|
|
|
|
|
|
|
|
|
|
|
ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
|
|
|
|
ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
|
|
|
|
passphraseText = (EditText) findViewById(R.id.passphrase_edit);
|
|
|
|
passphraseText = (EditText) findViewById(R.id.passphrase_edit);
|
|
|
|
SpannableString hint = new SpannableString(" " + getString(R.string.PassphrasePromptActivity_enter_passphrase));
|
|
|
|
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 RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
hint.setSpan(new TypefaceSpan("sans-serif"), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
hint.setSpan(new ForegroundColorSpan(0xcc000000), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
passphraseText.setHint(hint);
|
|
|
|
passphraseText.setHint(hint);
|
|
|
|
okButton.setOnClickListener(new OkButtonClickListener());
|
|
|
|
okButton.setOnClickListener(new OkButtonClickListener());
|
|
|
|