Button Text changes to Change Passphrase if Passphrase is set

This commit is contained in:
Sreeram Boyapati 2014-03-18 20:40:09 +05:30
parent efab1d27ac
commit f34b3ee531

View File

@ -368,9 +368,8 @@ public class EditKeyActivity extends ActionBarActivity {
}
mCurrentPassphrase = "";
buildLayout();
mIsPassPhraseSet = PassphraseCacheService.hasPassphrase(this, masterKeyId);
buildLayout();
if (!mIsPassPhraseSet) {
// check "no passphrase" checkbox and remove button
mNoPassphrase.setChecked(true);
@ -425,11 +424,14 @@ public class EditKeyActivity extends ActionBarActivity {
// find views
mChangePassphrase = (BootstrapButton) findViewById(R.id.edit_key_btn_change_passphrase);
mNoPassphrase = (CheckBox) findViewById(R.id.edit_key_no_passphrase);
// Build layout based on given userIds and keys
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout container = (LinearLayout) findViewById(R.id.edit_key_container);
if(mIsPassPhraseSet){
mChangePassphrase.setText(getString(R.string.btn_change_passphrase));
}
mUserIdsView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false);
mUserIdsView.setType(Id.type.user_id);
mUserIdsView.setCanEdit(mMasterCanSign);