Added "Show Time" preference and changed default to 45 to match pass
This commit is contained in:
parent
a9126f7214
commit
240bb9cd67
2 changed files with 51 additions and 55 deletions
|
@ -1,5 +1,21 @@
|
||||||
package com.zeapo.pwdstore.crypto;
|
package com.zeapo.pwdstore.crypto;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.eclipse.jgit.util.StringUtils;
|
||||||
|
import org.openintents.openpgp.IOpenPgpService;
|
||||||
|
import org.openintents.openpgp.OpenPgpError;
|
||||||
|
import org.openintents.openpgp.util.OpenPgpApi;
|
||||||
|
import org.openintents.openpgp.util.OpenPgpServiceConnection;
|
||||||
|
import org.openintents.openpgp.util.OpenPgpUtils;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
@ -7,7 +23,6 @@ import android.app.PendingIntent;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentSender;
|
import android.content.IntentSender;
|
||||||
|
@ -22,35 +37,15 @@ import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.GridLayout;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.zeapo.pwdstore.GitAsyncTask;
|
|
||||||
import com.zeapo.pwdstore.R;
|
import com.zeapo.pwdstore.R;
|
||||||
import com.zeapo.pwdstore.UserPreference;
|
import com.zeapo.pwdstore.UserPreference;
|
||||||
import com.zeapo.pwdstore.utils.PasswordRepository;
|
import com.zeapo.pwdstore.utils.PasswordRepository;
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.eclipse.jgit.api.Git;
|
|
||||||
import org.eclipse.jgit.util.StringUtils;
|
|
||||||
import org.openintents.openpgp.IOpenPgpService;
|
|
||||||
import org.openintents.openpgp.OpenPgpError;
|
|
||||||
import org.openintents.openpgp.OpenPgpSignatureResult;
|
|
||||||
import org.openintents.openpgp.util.OpenPgpApi;
|
|
||||||
import org.openintents.openpgp.util.OpenPgpServiceConnection;
|
|
||||||
import org.openintents.openpgp.util.OpenPgpUtils;
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnBound{
|
public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnBound{
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,8 +201,6 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DelayShow extends AsyncTask<Void, Integer, Boolean> {
|
public class DelayShow extends AsyncTask<Void, Integer, Boolean> {
|
||||||
int count = 0;
|
|
||||||
final int SHOW_TIME = 10;
|
|
||||||
ProgressBar pb;
|
ProgressBar pb;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -221,15 +214,20 @@ public class PgpHandler extends Activity implements OpenPgpServiceConnection.OnB
|
||||||
((LinearLayout) findViewById(R.id.crypto_extra_show_layout)).setVisibility(View.VISIBLE);
|
((LinearLayout) findViewById(R.id.crypto_extra_show_layout)).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
this.pb = (ProgressBar) findViewById(R.id.pbLoading);
|
this.pb = (ProgressBar) findViewById(R.id.pbLoading);
|
||||||
|
|
||||||
|
// Make Show Time a user preference
|
||||||
|
// kLeZ: Changed to match the default for pass
|
||||||
|
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(container.getContext());
|
||||||
|
final int SHOW_TIME = Integer.parseInt(settings.getString("general_show_time", "45"));
|
||||||
this.pb.setMax(SHOW_TIME);
|
this.pb.setMax(SHOW_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Boolean doInBackground(Void... params) {
|
protected Boolean doInBackground(Void... params) {
|
||||||
while (this.count < SHOW_TIME) {
|
while (this.pb.getProgress() < this.pb.getMax())
|
||||||
|
{
|
||||||
SystemClock.sleep(1000);
|
SystemClock.sleep(1000);
|
||||||
this.count++;
|
publishProgress(this.pb.getProgress() + 1);
|
||||||
publishProgress(this.count);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,35 +2,33 @@
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<PreferenceCategory android:title="Git">
|
<PreferenceCategory android:title="Git">
|
||||||
<EditTextPreference android:title="Server"
|
<EditTextPreference android:title="Server"
|
||||||
android:key="git_remote_server"
|
android:key="git_remote_server" android:hint="server.com"
|
||||||
android:hint="server.com"
|
android:inputType="textUri" />
|
||||||
android:inputType="textUri"/>
|
|
||||||
<EditTextPreference android:title="Remote location"
|
<EditTextPreference android:title="Remote location"
|
||||||
android:key="git_remote_location"
|
android:key="git_remote_location" android:hint="path/to/repository"
|
||||||
android:hint="path/to/repository"
|
android:inputType="textUri" />
|
||||||
android:inputType="textUri"/>
|
|
||||||
<EditTextPreference android:title="Username"
|
<EditTextPreference android:title="Username"
|
||||||
android:key="git_remote_username"
|
android:key="git_remote_username" android:hint="username"
|
||||||
android:hint="username"
|
android:inputType="textPersonName" />
|
||||||
android:inputType="textPersonName"/>
|
<Preference android:title="SSH Key" android:key="ssh_key" />
|
||||||
<Preference
|
|
||||||
android:title="SSH Key"
|
|
||||||
android:key="ssh_key"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory android:title="Crypto">
|
<PreferenceCategory android:title="Crypto">
|
||||||
<org.openintents.openpgp.util.OpenPgpListPreference
|
<org.openintents.openpgp.util.OpenPgpListPreference
|
||||||
android:key="openpgp_provider_list"
|
android:key="openpgp_provider_list" android:title="Select OpenPGP Provider!" />
|
||||||
android:title="Select OpenPGP Provider!" />
|
|
||||||
|
|
||||||
<EditTextPreference android:title="Set your OpenPGP account"
|
<EditTextPreference android:title="Set your OpenPGP account"
|
||||||
android:hint="mail@somewhere.tld"
|
android:hint="mail@somewhere.tld" android:key="openpgp_account_name"
|
||||||
android:key="openpgp_account_name"
|
android:inputType="textEmailAddress" />
|
||||||
android:inputType="textEmailAddress"/>
|
|
||||||
|
|
||||||
<Preference
|
<Preference android:title="Select OpenPGP Key id"
|
||||||
android:title="Select OpenPGP Key id"
|
android:key="openpgp_key_id" />
|
||||||
android:key="openpgp_key_id"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
<PreferenceCategory android:title="General">
|
||||||
|
<EditTextPreference android:title="Password Show Time"
|
||||||
|
android:dialogTitle="Set the time you want the password to be in clipboard"
|
||||||
|
android:summary="Set the time you want the password to be in clipboard"
|
||||||
|
android:hint="45" android:key="general_show_time" />
|
||||||
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
Loading…
Add table
Add a link
Reference in a new issue