@@ -58,6 +58,7 @@ public class ShowEntry extends Fragment implements OnClickListener, BackButtonHa
58
58
private transient EditText userText ;
59
59
private transient EditText passwordText ;
60
60
private transient EditText descriptionText ;
61
+ private boolean passwordVisibleWhenNotEditing ;
61
62
62
63
/**
63
64
* Creates a ShowEntry fragment.
@@ -167,7 +168,7 @@ private void addToClipboard(String data) {
167
168
private void prepareUiElements (View v ) {
168
169
if (!(edit || delete )) {
169
170
TextView passTitle = (TextView ) v .findViewById (R .id .passwordLabel );
170
- passTitle .append (" (tap here to reveal)" );
171
+ passTitle .append (" (tap here to reveal or hide )" );
171
172
passTitle .setOnTouchListener (this );
172
173
}
173
174
Button eb = (Button ) v .findViewById (R .id .editButton );
@@ -253,10 +254,12 @@ private void restore(Bundle state) {
253
254
254
255
@ Override
255
256
public boolean onTouch (View view , MotionEvent motionEvent ) {
256
- if (motionEvent .getAction () == MotionEvent .ACTION_DOWN ) {
257
+ if (motionEvent .getAction () == MotionEvent .ACTION_DOWN && ! passwordVisibleWhenNotEditing ) {
257
258
passwordText .setTransformationMethod (null );
258
- } else {
259
+ passwordVisibleWhenNotEditing = !passwordVisibleWhenNotEditing ;
260
+ } else if (motionEvent .getAction () == MotionEvent .ACTION_DOWN && passwordVisibleWhenNotEditing ) {
259
261
passwordText .setTransformationMethod (PasswordTransformationMethod .getInstance ());
262
+ passwordVisibleWhenNotEditing = !passwordVisibleWhenNotEditing ;
260
263
}
261
264
return true ;
262
265
}
0 commit comments