mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-30 05:48:09 +00:00
added copy password with a timer
This commit is contained in:
parent
f0152ecfa2
commit
51b3334000
@ -1,13 +1,13 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 20
|
compileSdkVersion 19
|
||||||
buildToolsVersion "20.0.0"
|
buildToolsVersion "19.1.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.zeapo.pwdstore"
|
applicationId "com.zeapo.pwdstore"
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 20
|
targetSdkVersion 19
|
||||||
versionCode 6
|
versionCode 6
|
||||||
versionName "1.1-b1"
|
versionName "1.1-b1"
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@ import android.app.Activity;
|
|||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -57,6 +59,8 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
private String accountName = "";
|
private String accountName = "";
|
||||||
SharedPreferences settings;
|
SharedPreferences settings;
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
|
ClipboardManager clipboard;
|
||||||
|
|
||||||
|
|
||||||
private ProgressDialog bindingDialog;
|
private ProgressDialog bindingDialog;
|
||||||
|
|
||||||
@ -78,6 +82,7 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
this.activity = this;
|
this.activity = this;
|
||||||
|
this.clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
|
|
||||||
// some persistance
|
// some persistance
|
||||||
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
settings = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
@ -128,6 +133,9 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
setResult(RESULT_OK);
|
setResult(RESULT_OK);
|
||||||
finish();
|
finish();
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.copy_password:
|
||||||
|
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", ((TextView) findViewById(R.id.crypto_password_show)).getText());
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@ -212,6 +220,10 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Boolean b) {
|
protected void onPostExecute(Boolean b) {
|
||||||
|
|
||||||
|
ClipData clip = ClipData.newPlainText("pgp_handler_result_pm", "MyPasswordIsDaBest!");
|
||||||
|
clipboard.setPrimaryClip(clip);
|
||||||
|
|
||||||
//clear password
|
//clear password
|
||||||
((TextView) findViewById(R.id.crypto_password_show)).setText("");
|
((TextView) findViewById(R.id.crypto_password_show)).setText("");
|
||||||
((TextView) findViewById(R.id.crypto_extra_show)).setText("");
|
((TextView) findViewById(R.id.crypto_extra_show)).setText("");
|
||||||
|
BIN
app/src/main/res/drawable-hdpi/ico_copy.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ico_copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 235 B |
BIN
app/src/main/res/drawable-mdpi/ico_copy.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ico_copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 191 B |
BIN
app/src/main/res/drawable-xhdpi/ico_copy.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ico_copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 263 B |
BIN
app/src/main/res/drawable-xxhdpi/ico_copy.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ico_copy.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 345 B |
@ -1,4 +1,9 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context="com.zeapo.pwdstore.crypto.PgpHandler" >
|
tools:context="com.zeapo.pwdstore.crypto.PgpHandler" >
|
||||||
|
<item android:title="Copy password"
|
||||||
|
android:icon="@drawable/ico_copy"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:id="@+id/copy_password"
|
||||||
|
/>
|
||||||
</menu>
|
</menu>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user