Skip to content

Commit

Permalink
solve bug 0000396
Browse files Browse the repository at this point in the history
  • Loading branch information
domjos1994 committed Oct 24, 2019
1 parent 43b5c7e commit a7a0f91
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import android.graphics.drawable.Drawable;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.PasswordTransformationMethod;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
Expand Down Expand Up @@ -79,6 +80,7 @@ protected void initActions() {
this.lvAccounts.click(new SwipeRefreshDeleteList.ClickListener() {
@Override
public void onClick(ListObject listObject) {
txtAccountPassword.setTransformationMethod(new PasswordTransformationMethod());
if (listObject != null) {
currentAccount = (Authentication) listObject.getDescriptionObject();
accountValidator.addDuplicatedEntry(txtAccountTitle, "accounts", "title", currentAccount.getId());
Expand Down Expand Up @@ -220,6 +222,15 @@ public void afterTextChanged(Editable s) {
}
}
});

this.txtAccountPassword.setOnLongClickListener(view -> {
if(this.txtAccountPassword.getTransformationMethod()!=null) {
this.txtAccountPassword.setTransformationMethod(null);
} else {
this.txtAccountPassword.setTransformationMethod(new PasswordTransformationMethod());
}
return false;
});
}

@Override
Expand Down Expand Up @@ -370,13 +381,13 @@ protected void manageControls(boolean editMode, boolean reset, boolean selected)
this.txtAccountExtended.setEnabled(editMode);

if (reset) {
this.txtAccountPassword.setTransformationMethod(new PasswordTransformationMethod());
this.currentAccount = new Authentication();
this.chkAccountGuest.setChecked(false);
this.objectToControls();
}
}

@SuppressWarnings("deprecation")
private void objectToControls() {
if (this.currentAccount != null) {
this.txtAccountTitle.setText(this.currentAccount.getTitle());
Expand Down

0 comments on commit a7a0f91

Please sign in to comment.