mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-24 09:42:16 -05:00
some fixes
This commit is contained in:
parent
e7ebbc5ef6
commit
d6726fe9d6
@ -83,18 +83,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
setDrawingCacheEnabled(true);
|
||||
setAlwaysDrawnWithCacheEnabled(true);
|
||||
|
||||
mDeleteButton = (BootstrapButton) findViewById(R.id.delete);
|
||||
mDeleteButton.setOnClickListener(this);
|
||||
mIsMainUserId = (RadioButton) findViewById(R.id.isMainUserId);
|
||||
mIsMainUserId.setOnClickListener(this);
|
||||
|
||||
mName = (EditText) findViewById(R.id.name);
|
||||
mName.addTextChangedListener(new TextWatcher() {
|
||||
TextWatcher mTextWatcher = new TextWatcher() {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
@ -110,9 +99,24 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
mEditorListener.onEdited();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
setDrawingCacheEnabled(true);
|
||||
setAlwaysDrawnWithCacheEnabled(true);
|
||||
|
||||
mDeleteButton = (BootstrapButton) findViewById(R.id.delete);
|
||||
mDeleteButton.setOnClickListener(this);
|
||||
mIsMainUserId = (RadioButton) findViewById(R.id.isMainUserId);
|
||||
mIsMainUserId.setOnClickListener(this);
|
||||
|
||||
mName = (EditText) findViewById(R.id.name);
|
||||
mName.addTextChangedListener(mTextWatcher);
|
||||
mEmail = (EditText) findViewById(R.id.email);
|
||||
mEmail.addTextChangedListener(mTextWatcher);
|
||||
mComment = (EditText) findViewById(R.id.comment);
|
||||
mComment.addTextChangedListener(mTextWatcher);
|
||||
|
||||
super.onFinishInflate();
|
||||
}
|
||||
@ -120,8 +124,11 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
public void setValue(String userId, boolean isMainID, boolean isNewId) {
|
||||
|
||||
mName.setText("");
|
||||
mOriginalName = "";
|
||||
mComment.setText("");
|
||||
mOriginalComment = "";
|
||||
mEmail.setText("");
|
||||
mOriginalEmail = "";
|
||||
mIsNewId = isNewId;
|
||||
|
||||
String[] result = PgpKeyHelper.splitUserId(userId);
|
||||
@ -213,9 +220,9 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
@Override
|
||||
public boolean needsSaving() {
|
||||
boolean retval = (mOriginallyMainUserID != isMainUserId());
|
||||
retval |= (mOriginalName.equals( ("" + mName.getText()).trim() ) );
|
||||
retval |= (mOriginalEmail.equals( ("" + mEmail.getText()).trim() ) );
|
||||
retval |= (mOriginalComment.equals( ("" + mComment.getText()).trim() ) );
|
||||
retval |= !(mOriginalName.equals( ("" + mName.getText()).trim() ) );
|
||||
retval |= !(mOriginalEmail.equals( ("" + mEmail.getText()).trim() ) );
|
||||
retval |= !(mOriginalComment.equals( ("" + mComment.getText()).trim() ) );
|
||||
retval |= mIsNewId;
|
||||
return retval;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user