Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0'
Browse files Browse the repository at this point in the history
 - generated password now updates on changes for softkeyboards on real devices
  • Loading branch information
James Stapleton committed Jul 13, 2014
2 parents 119a98f + 86741a9 commit b2a348d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion passwordmaker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ android {
defaultConfig {
minSdkVersion 15 //2014-06-15: 84.3% of android users are using Sdk Version 15+. So lets shoot for that.
targetSdkVersion 19
versionCode 20000
versionCode 20001
versionName getVersionName()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import android.os.Message;
import android.support.v7.app.ActionBarActivity;
import android.text.ClipboardManager;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.*;
import android.widget.*;
Expand Down Expand Up @@ -73,14 +75,14 @@ protected void onCreate(Bundle savedInstanceState) {

AutoCompleteTextView inputText = (AutoCompleteTextView) findViewById(R.id.txtInput);
if (inputText != null) {
inputText.setOnKeyListener(mUpdatePasswordKeyListener);
inputText.addTextChangedListener(createUpdatePasswordKeyListener());
inputText.setOnFocusChangeListener(mUpdatePasswordFocusListener);
inputText.setAdapter(favoritesAdapter);
inputText.setThreshold(1);
}
TextView text = (TextView) findViewById(R.id.txtMasterPass);
if (text != null)
text.setOnKeyListener(mUpdatePasswordKeyListener);
text.addTextChangedListener(createUpdatePasswordKeyListener());
if (text != null)
text.setOnFocusChangeListener(mUpdatePasswordFocusListener);
Button button = (Button) findViewById(R.id.btnCopy);
Expand Down Expand Up @@ -395,12 +397,14 @@ public void onClick(DialogInterface dialog, int which) {
alert.show();
}

private View.OnKeyListener mUpdatePasswordKeyListener = new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
updatePassword(true);
return false;
}
};
private TextWatcher createUpdatePasswordKeyListener() {
return new TextWatcherAdapter() {
@Override
public void afterTextChanged(Editable s) {
updatePassword(true);
}
};
}

private View.OnClickListener mCopyButtonClick = new View.OnClickListener() {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.passwordmaker.android;

import android.text.Editable;
import android.text.TextWatcher;

public abstract class TextWatcherAdapter implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {

}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {

}

@Override
public void afterTextChanged(Editable s) {

}
}

0 comments on commit b2a348d

Please sign in to comment.