mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-14 14:10:28 -05:00
First code style changes in ui
This commit is contained in:
parent
f26ba217e5
commit
ad1e047aa9
@ -17,8 +17,20 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.widget.*;
|
||||||
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.spongycastle.openpgp.PGPSignature;
|
import org.spongycastle.openpgp.PGPSignature;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
@ -33,25 +45,7 @@ import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
|||||||
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import java.util.Iterator;
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.os.Messenger;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signs the specified public key with the specified secret master key
|
* Signs the specified public key with the specified secret master key
|
||||||
@ -87,7 +81,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
|||||||
mSelectKeyserverSpinner = (Spinner) findViewById(R.id.sign_key_keyserver);
|
mSelectKeyserverSpinner = (Spinner) findViewById(R.id.sign_key_keyserver);
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
|
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
|
||||||
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
|
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
|
||||||
.getKeyServers());
|
.getKeyServers());
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
mSelectKeyserverSpinner.setAdapter(adapter);
|
mSelectKeyserverSpinner.setAdapter(adapter);
|
||||||
|
|
||||||
|
@ -17,37 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
|
|
||||||
import org.openintents.openpgp.OpenPgpSignatureResult;
|
|
||||||
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
|
||||||
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
|
||||||
import org.sufficientlysecure.keychain.helper.FileHelper;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpHelper;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.exception.NoAsymmetricEncryptionException;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
|
||||||
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -59,16 +28,34 @@ import android.os.Messenger;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.CheckBox;
|
import android.widget.*;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import android.widget.ViewFlipper;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import com.devspark.appmsg.AppMsg;
|
import com.devspark.appmsg.AppMsg;
|
||||||
|
import org.openintents.openpgp.OpenPgpSignatureResult;
|
||||||
|
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
||||||
|
import org.sufficientlysecure.keychain.helper.FileHelper;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerify;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpDecryptVerifyResult;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpHelper;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.exception.NoAsymmetricEncryptionException;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
||||||
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
||||||
|
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.DeleteFileDialogFragment;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.FileDialogFragment;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public class DecryptActivity extends DrawerActivity {
|
public class DecryptActivity extends DrawerActivity {
|
||||||
@ -533,7 +520,8 @@ public class DecryptActivity extends DrawerActivity {
|
|||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (inStream != null) inStream.close();
|
if (inStream != null) inStream.close();
|
||||||
} catch (Exception e){ }
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
inStream = new ByteArrayInputStream(mMessage.getText().toString().getBytes());
|
inStream = new ByteArrayInputStream(mMessage.getText().toString().getBytes());
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.service.remote.RegisteredAppsListActivity;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@ -30,17 +26,14 @@ import android.support.v4.app.ActionBarDrawerToggle;
|
|||||||
import android.support.v4.view.GravityCompat;
|
import android.support.v4.view.GravityCompat;
|
||||||
import android.support.v4.widget.DrawerLayout;
|
import android.support.v4.widget.DrawerLayout;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.LayoutInflater;
|
import android.view.*;
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.FontAwesomeText;
|
import com.beardedhen.androidbootstrap.FontAwesomeText;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.remote.RegisteredAppsListActivity;
|
||||||
|
|
||||||
public class DrawerActivity extends ActionBarActivity {
|
public class DrawerActivity extends ActionBarActivity {
|
||||||
private DrawerLayout mDrawerLayout;
|
private DrawerLayout mDrawerLayout;
|
||||||
@ -50,9 +43,9 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
private CharSequence mDrawerTitle;
|
private CharSequence mDrawerTitle;
|
||||||
private CharSequence mTitle;
|
private CharSequence mTitle;
|
||||||
|
|
||||||
private static Class[] mItemsClass = new Class[] { KeyListActivity.class,
|
private static Class[] mItemsClass = new Class[]{KeyListActivity.class,
|
||||||
EncryptActivity.class, DecryptActivity.class, ImportKeysActivity.class,
|
EncryptActivity.class, DecryptActivity.class, ImportKeysActivity.class,
|
||||||
RegisteredAppsListActivity.class };
|
RegisteredAppsListActivity.class};
|
||||||
private Class mSelectedItem;
|
private Class mSelectedItem;
|
||||||
|
|
||||||
private static final int MENU_ID_PREFERENCE = 222;
|
private static final int MENU_ID_PREFERENCE = 222;
|
||||||
@ -67,12 +60,12 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
// opens
|
// opens
|
||||||
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
|
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
|
||||||
|
|
||||||
NavItem mItemIconTexts[] = new NavItem[] {
|
NavItem mItemIconTexts[] = new NavItem[]{
|
||||||
new NavItem("fa-user", getString(R.string.nav_contacts)),
|
new NavItem("fa-user", getString(R.string.nav_contacts)),
|
||||||
new NavItem("fa-lock", getString(R.string.nav_encrypt)),
|
new NavItem("fa-lock", getString(R.string.nav_encrypt)),
|
||||||
new NavItem("fa-unlock", getString(R.string.nav_decrypt)),
|
new NavItem("fa-unlock", getString(R.string.nav_decrypt)),
|
||||||
new NavItem("fa-download", getString(R.string.nav_import)),
|
new NavItem("fa-download", getString(R.string.nav_import)),
|
||||||
new NavItem("fa-android", getString(R.string.nav_apps)) };
|
new NavItem("fa-android", getString(R.string.nav_apps))};
|
||||||
|
|
||||||
mDrawerList.setAdapter(new NavigationDrawerAdapter(this, R.layout.drawer_list_item,
|
mDrawerList.setAdapter(new NavigationDrawerAdapter(this, R.layout.drawer_list_item,
|
||||||
mItemIconTexts));
|
mItemIconTexts));
|
||||||
@ -86,10 +79,10 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
// ActionBarDrawerToggle ties together the the proper interactions
|
// ActionBarDrawerToggle ties together the the proper interactions
|
||||||
// between the sliding drawer and the action bar app icon
|
// between the sliding drawer and the action bar app icon
|
||||||
mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
|
mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
|
||||||
mDrawerLayout, /* DrawerLayout object */
|
mDrawerLayout, /* DrawerLayout object */
|
||||||
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
|
R.drawable.ic_drawer, /* nav drawer image to replace 'Up' caret */
|
||||||
R.string.drawer_open, /* "open drawer" description for accessibility */
|
R.string.drawer_open, /* "open drawer" description for accessibility */
|
||||||
R.string.drawer_close /* "close drawer" description for accessibility */
|
R.string.drawer_close /* "close drawer" description for accessibility */
|
||||||
) {
|
) {
|
||||||
public void onDrawerClosed(View view) {
|
public void onDrawerClosed(View view) {
|
||||||
getSupportActionBar().setTitle(mTitle);
|
getSupportActionBar().setTitle(mTitle);
|
||||||
@ -97,7 +90,7 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
supportInvalidateOptionsMenu();
|
supportInvalidateOptionsMenu();
|
||||||
|
|
||||||
// call intent activity if selected
|
// call intent activity if selected
|
||||||
if(mSelectedItem != null) {
|
if (mSelectedItem != null) {
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(0, 0);
|
overridePendingTransition(0, 0);
|
||||||
|
|
||||||
@ -149,18 +142,18 @@ public class DrawerActivity extends ActionBarActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case MENU_ID_PREFERENCE: {
|
case MENU_ID_PREFERENCE: {
|
||||||
Intent intent = new Intent(this, PreferencesActivity.class);
|
Intent intent = new Intent(this, PreferencesActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case MENU_ID_HELP: {
|
case MENU_ID_HELP: {
|
||||||
Intent intent = new Intent(this, HelpActivity.class);
|
Intent intent = new Intent(this, HelpActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle action buttons
|
// Handle action buttons
|
||||||
|
@ -17,10 +17,25 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.app.Activity;
|
||||||
import java.util.GregorianCalendar;
|
import android.app.ProgressDialog;
|
||||||
import java.util.Vector;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import android.view.*;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.Toast;
|
||||||
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
@ -44,30 +59,9 @@ import org.sufficientlysecure.keychain.ui.widget.UserIdEditor;
|
|||||||
import org.sufficientlysecure.keychain.util.IterableIterator;
|
import org.sufficientlysecure.keychain.util.IterableIterator;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import android.app.Activity;
|
import java.util.ArrayList;
|
||||||
import android.app.ProgressDialog;
|
import java.util.GregorianCalendar;
|
||||||
import android.content.Context;
|
import java.util.Vector;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.os.Messenger;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
|
|
||||||
public class EditKeyActivity extends ActionBarActivity {
|
public class EditKeyActivity extends ActionBarActivity {
|
||||||
|
|
||||||
@ -130,7 +124,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle intent action to create new key
|
* Handle intent action to create new key
|
||||||
*
|
*
|
||||||
* @param intent
|
* @param intent
|
||||||
*/
|
*/
|
||||||
private void handleActionCreateKey(Intent intent) {
|
private void handleActionCreateKey(Intent intent) {
|
||||||
@ -146,7 +140,8 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
cancelClicked();
|
cancelClicked();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Bundle extras = intent.getExtras();
|
Bundle extras = intent.getExtras();
|
||||||
|
|
||||||
@ -245,7 +240,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle intent action to edit existing key
|
* Handle intent action to edit existing key
|
||||||
*
|
*
|
||||||
* @param intent
|
* @param intent
|
||||||
*/
|
*/
|
||||||
private void handleActionEditKey(Intent intent) {
|
private void handleActionEditKey(Intent intent) {
|
||||||
@ -323,28 +318,28 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.menu_key_edit_cancel:
|
case R.id.menu_key_edit_cancel:
|
||||||
cancelClicked();
|
cancelClicked();
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_edit_export_file:
|
case R.id.menu_key_edit_export_file:
|
||||||
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
long[] ids = new long[]{Long.valueOf(mDataUri.getLastPathSegment())};
|
||||||
mExportHelper.showExportKeysDialog(ids, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
|
mExportHelper.showExportKeysDialog(ids, Id.type.secret_key, Constants.path.APP_DIR_FILE_SEC);
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_edit_delete: {
|
case R.id.menu_key_edit_delete: {
|
||||||
// Message is received after key is deleted
|
// Message is received after key is deleted
|
||||||
Handler returnHandler = new Handler() {
|
Handler returnHandler = new Handler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message message) {
|
public void handleMessage(Message message) {
|
||||||
if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
|
if (message.what == DeleteKeyDialogFragment.MESSAGE_OKAY) {
|
||||||
setResult(RESULT_CANCELED);
|
setResult(RESULT_CANCELED);
|
||||||
finish();
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
mExportHelper.deleteKey(mDataUri, Id.type.secret_key, returnHandler);
|
mExportHelper.deleteKey(mDataUri, Id.type.secret_key, returnHandler);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
@ -584,7 +579,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns user ids from the SectionView
|
* Returns user ids from the SectionView
|
||||||
*
|
*
|
||||||
* @param userIdsView
|
* @param userIdsView
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -633,7 +628,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns keys from the SectionView
|
* Returns keys from the SectionView
|
||||||
*
|
*
|
||||||
* @param keysView
|
* @param keysView
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -656,7 +651,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns usage selections of keys from the SectionView
|
* Returns usage selections of keys from the SectionView
|
||||||
*
|
*
|
||||||
* @param keysView
|
* @param keysView
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -17,9 +17,22 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.io.File;
|
import android.app.ProgressDialog;
|
||||||
import java.util.Vector;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.Messenger;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.animation.AlphaAnimation;
|
||||||
|
import android.view.animation.Animation;
|
||||||
|
import android.view.animation.AnimationUtils;
|
||||||
|
import android.widget.*;
|
||||||
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import com.beardedhen.androidbootstrap.FontAwesomeText;
|
||||||
|
import com.devspark.appmsg.AppMsg;
|
||||||
import org.spongycastle.openpgp.PGPPublicKey;
|
import org.spongycastle.openpgp.PGPPublicKey;
|
||||||
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
import org.spongycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
@ -43,31 +56,8 @@ import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
|||||||
import org.sufficientlysecure.keychain.util.Choice;
|
import org.sufficientlysecure.keychain.util.Choice;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import java.io.File;
|
||||||
import android.content.Intent;
|
import java.util.Vector;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.os.Messenger;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.animation.AlphaAnimation;
|
|
||||||
import android.view.animation.Animation;
|
|
||||||
import android.view.animation.AnimationUtils;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
import android.widget.ViewFlipper;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
import com.beardedhen.androidbootstrap.FontAwesomeText;
|
|
||||||
import com.devspark.appmsg.AppMsg;
|
|
||||||
|
|
||||||
public class EncryptActivity extends DrawerActivity {
|
public class EncryptActivity extends DrawerActivity {
|
||||||
|
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
@ -31,6 +26,10 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
|
||||||
public class HelpAboutFragment extends Fragment {
|
public class HelpAboutFragment extends Fragment {
|
||||||
@ -55,7 +54,7 @@ public class HelpAboutFragment extends Fragment {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current package version.
|
* Get the current package version.
|
||||||
*
|
*
|
||||||
* @return The current version.
|
* @return The current version.
|
||||||
*/
|
*/
|
||||||
private String getVersion() {
|
private String getVersion() {
|
||||||
@ -73,4 +72,4 @@ public class HelpAboutFragment extends Fragment {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.TabsAdapter;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.TabsAdapter;
|
||||||
|
|
||||||
public class HelpActivity extends ActionBarActivity {
|
public class HelpActivity extends ActionBarActivity {
|
||||||
public static final String EXTRA_SELECTED_TAB = "selected_tab";
|
public static final String EXTRA_SELECTED_TAB = "selected_tab";
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@ -27,11 +25,12 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
|
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
||||||
|
|
||||||
public class HelpHtmlFragment extends Fragment {
|
public class HelpHtmlFragment extends Fragment {
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
private int htmlFile;
|
private int mHtmlFile;
|
||||||
|
|
||||||
public static final String ARG_HTML_FILE = "htmlFile";
|
public static final String ARG_HTML_FILE = "htmlFile";
|
||||||
|
|
||||||
@ -52,8 +51,8 @@ public class HelpHtmlFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
mActivity = getActivity();
|
mActivity = getActivity();
|
||||||
|
|
||||||
htmlFile = getArguments().getInt(ARG_HTML_FILE);
|
mHtmlFile = getArguments().getInt(ARG_HTML_FILE);
|
||||||
|
|
||||||
ScrollView scroller = new ScrollView(mActivity);
|
ScrollView scroller = new ScrollView(mActivity);
|
||||||
HtmlTextView text = new HtmlTextView(mActivity);
|
HtmlTextView text = new HtmlTextView(mActivity);
|
||||||
@ -66,11 +65,11 @@ public class HelpHtmlFragment extends Fragment {
|
|||||||
scroller.addView(text);
|
scroller.addView(text);
|
||||||
|
|
||||||
// load html from raw resource (Parsing handled by HtmlTextView library)
|
// load html from raw resource (Parsing handled by HtmlTextView library)
|
||||||
text.setHtmlFromRawResource(getActivity(), htmlFile);
|
text.setHtmlFromRawResource(getActivity(), mHtmlFile);
|
||||||
|
|
||||||
// no flickering when clicking textview for Android < 4
|
// no flickering when clicking textview for Android < 4
|
||||||
text.setTextColor(getResources().getColor(android.R.color.black));
|
text.setTextColor(getResources().getColor(android.R.color.black));
|
||||||
|
|
||||||
return scroller;
|
return scroller;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,8 @@ import android.support.v7.app.ActionBar;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import com.devspark.appmsg.AppMsg;
|
import com.devspark.appmsg.AppMsg;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
@ -17,17 +17,15 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
||||||
|
|
||||||
public class ImportKeysClipboardFragment extends Fragment {
|
public class ImportKeysClipboardFragment extends Fragment {
|
||||||
|
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.FileHelper;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -29,8 +24,11 @@ import android.support.v4.app.Fragment;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.FileHelper;
|
||||||
|
|
||||||
public class ImportKeysFileFragment extends Fragment {
|
public class ImportKeysFileFragment extends Fragment {
|
||||||
private ImportKeysActivity mImportActivity;
|
private ImportKeysActivity mImportActivity;
|
||||||
|
@ -17,25 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.Preferences;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.AsyncTaskResultWrapper;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysAdapter;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListLoader;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListServerLoader;
|
|
||||||
import org.sufficientlysecure.keychain.util.InputData;
|
|
||||||
import org.sufficientlysecure.keychain.util.KeyServer;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -44,8 +25,21 @@ import android.support.v4.app.LoaderManager;
|
|||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.devspark.appmsg.AppMsg;
|
import com.devspark.appmsg.AppMsg;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.Preferences;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.*;
|
||||||
|
import org.sufficientlysecure.keychain.util.InputData;
|
||||||
|
import org.sufficientlysecure.keychain.util.KeyServer;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ImportKeysListFragment extends ListFragment implements
|
public class ImportKeysListFragment extends ListFragment implements
|
||||||
LoaderManager.LoaderCallbacks<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>> {
|
LoaderManager.LoaderCallbacks<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>> {
|
||||||
@ -225,16 +219,16 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
switch (loader.getId()) {
|
switch (loader.getId()) {
|
||||||
case LOADER_ID_BYTES:
|
case LOADER_ID_BYTES:
|
||||||
|
|
||||||
if(error == null){
|
if (error == null) {
|
||||||
// No error
|
// No error
|
||||||
} else if(error instanceof ImportKeysListLoader.FileHasNoContent) {
|
} else if (error instanceof ImportKeysListLoader.FileHasNoContent) {
|
||||||
AppMsg.makeText(getActivity(), R.string.error_import_file_no_content,
|
AppMsg.makeText(getActivity(), R.string.error_import_file_no_content,
|
||||||
AppMsg.STYLE_ALERT).show();
|
AppMsg.STYLE_ALERT).show();
|
||||||
} else if(error instanceof ImportKeysListLoader.NonPgpPart) {
|
} else if (error instanceof ImportKeysListLoader.NonPgpPart) {
|
||||||
AppMsg.makeText(getActivity(),
|
AppMsg.makeText(getActivity(),
|
||||||
((ImportKeysListLoader.NonPgpPart) error).getCount() + " " + getResources().
|
((ImportKeysListLoader.NonPgpPart) error).getCount() + " " + getResources().
|
||||||
getQuantityString(R.plurals.error_import_non_pgp_part,
|
getQuantityString(R.plurals.error_import_non_pgp_part,
|
||||||
((ImportKeysListLoader.NonPgpPart) error).getCount()),
|
((ImportKeysListLoader.NonPgpPart) error).getCount()),
|
||||||
new AppMsg.Style(AppMsg.LENGTH_LONG, R.color.confirm)).show();
|
new AppMsg.Style(AppMsg.LENGTH_LONG, R.color.confirm)).show();
|
||||||
} else {
|
} else {
|
||||||
AppMsg.makeText(getActivity(), R.string.error_generic_report_bug,
|
AppMsg.makeText(getActivity(), R.string.error_generic_report_bug,
|
||||||
@ -244,19 +238,19 @@ public class ImportKeysListFragment extends ListFragment implements
|
|||||||
|
|
||||||
case LOADER_ID_SERVER_QUERY:
|
case LOADER_ID_SERVER_QUERY:
|
||||||
|
|
||||||
if(error == null) {
|
if (error == null) {
|
||||||
AppMsg.makeText(
|
AppMsg.makeText(
|
||||||
getActivity(), getResources().getQuantityString(R.plurals.keys_found,
|
getActivity(), getResources().getQuantityString(R.plurals.keys_found,
|
||||||
mAdapter.getCount(), mAdapter.getCount()),
|
mAdapter.getCount(), mAdapter.getCount()),
|
||||||
AppMsg.STYLE_INFO
|
AppMsg.STYLE_INFO
|
||||||
).show();
|
).show();
|
||||||
} else if(error instanceof KeyServer.InsufficientQuery) {
|
} else if (error instanceof KeyServer.InsufficientQuery) {
|
||||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_insufficient_query,
|
AppMsg.makeText(getActivity(), R.string.error_keyserver_insufficient_query,
|
||||||
AppMsg.STYLE_ALERT).show();
|
AppMsg.STYLE_ALERT).show();
|
||||||
} else if(error instanceof KeyServer.QueryException) {
|
} else if (error instanceof KeyServer.QueryException) {
|
||||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_query,
|
AppMsg.makeText(getActivity(), R.string.error_keyserver_query,
|
||||||
AppMsg.STYLE_ALERT).show();
|
AppMsg.STYLE_ALERT).show();
|
||||||
} else if(error instanceof KeyServer.TooManyResponses) {
|
} else if (error instanceof KeyServer.TooManyResponses) {
|
||||||
AppMsg.makeText(getActivity(), R.string.error_keyserver_too_many_responses,
|
AppMsg.makeText(getActivity(), R.string.error_keyserver_too_many_responses,
|
||||||
AppMsg.STYLE_ALERT).show();
|
AppMsg.STYLE_ALERT).show();
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@ -26,8 +24,8 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
public class ImportKeysNFCFragment extends Fragment {
|
public class ImportKeysNFCFragment extends Fragment {
|
||||||
|
|
||||||
|
@ -17,14 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.util.IntentIntegratorSupportV4;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -36,9 +28,15 @@ import android.view.ViewGroup;
|
|||||||
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.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import com.google.zxing.integration.android.IntentResult;
|
import com.google.zxing.integration.android.IntentResult;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.util.IntentIntegratorSupportV4;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class ImportKeysQrCodeFragment extends Fragment {
|
public class ImportKeysQrCodeFragment extends Fragment {
|
||||||
|
|
||||||
@ -94,45 +92,45 @@ public class ImportKeysQrCodeFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
switch (requestCode & 0xFFFF) {
|
switch (requestCode & 0xFFFF) {
|
||||||
case IntentIntegratorSupportV4.REQUEST_CODE: {
|
case IntentIntegratorSupportV4.REQUEST_CODE: {
|
||||||
IntentResult scanResult = IntentIntegratorSupportV4.parseActivityResult(requestCode,
|
IntentResult scanResult = IntentIntegratorSupportV4.parseActivityResult(requestCode,
|
||||||
resultCode, data);
|
resultCode, data);
|
||||||
if (scanResult != null && scanResult.getFormatName() != null) {
|
if (scanResult != null && scanResult.getFormatName() != null) {
|
||||||
String scannedContent = scanResult.getContents();
|
String scannedContent = scanResult.getContents();
|
||||||
|
|
||||||
Log.d(Constants.TAG, "scannedContent: " + scannedContent);
|
Log.d(Constants.TAG, "scannedContent: " + scannedContent);
|
||||||
|
|
||||||
// look if it's fingerprint only
|
// look if it's fingerprint only
|
||||||
if (scannedContent.toLowerCase(Locale.ENGLISH).startsWith(Constants.FINGERPRINT_SCHEME)) {
|
if (scannedContent.toLowerCase(Locale.ENGLISH).startsWith(Constants.FINGERPRINT_SCHEME)) {
|
||||||
importFingerprint(Uri.parse(scanResult.getContents()));
|
importFingerprint(Uri.parse(scanResult.getContents()));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// look if it is the whole key
|
||||||
|
String[] parts = scannedContent.split(",");
|
||||||
|
if (parts.length == 3) {
|
||||||
|
importParts(parts);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// is this a full key encoded as qr code?
|
||||||
|
if (scannedContent.startsWith("-----BEGIN PGP")) {
|
||||||
|
mImportActivity.loadCallback(scannedContent.getBytes(), null, null, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// fail...
|
||||||
|
Toast.makeText(getActivity(), R.string.import_qr_code_wrong, Toast.LENGTH_LONG)
|
||||||
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// look if it is the whole key
|
break;
|
||||||
String[] parts = scannedContent.split(",");
|
|
||||||
if (parts.length == 3) {
|
|
||||||
importParts(parts);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// is this a full key encoded as qr code?
|
|
||||||
if (scannedContent.startsWith("-----BEGIN PGP")) {
|
|
||||||
mImportActivity.loadCallback(scannedContent.getBytes(), null, null, null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// fail...
|
|
||||||
Toast.makeText(getActivity(), R.string.import_qr_code_wrong, Toast.LENGTH_LONG)
|
|
||||||
.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
default:
|
||||||
}
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
default:
|
break;
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.Preferences;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@ -36,8 +31,11 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.Preferences;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class ImportKeysServerFragment extends Fragment {
|
public class ImportKeysServerFragment extends Fragment {
|
||||||
public static final String ARG_QUERY = "query";
|
public static final String ARG_QUERY = "query";
|
||||||
|
@ -17,15 +17,14 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
||||||
|
|
||||||
public class KeyListActivity extends DrawerActivity {
|
public class KeyListActivity extends DrawerActivity {
|
||||||
|
|
||||||
|
@ -17,27 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyTypes;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.HighlightQueryCursorAdapter;
|
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import se.emilsjolander.stickylistheaders.ApiLevelTooLowException;
|
|
||||||
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
|
|
||||||
import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -45,11 +24,7 @@ import android.content.Intent;
|
|||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.*;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.os.Messenger;
|
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
@ -58,23 +33,31 @@ import android.support.v4.view.MenuItemCompat;
|
|||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.ActionMode;
|
import android.view.*;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.AbsListView.MultiChoiceModeListener;
|
import android.widget.AbsListView.MultiChoiceModeListener;
|
||||||
import android.widget.AdapterView;
|
import android.widget.*;
|
||||||
import android.widget.Button;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ExportHelper;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyTypes;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.HighlightQueryCursorAdapter;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.DeleteKeyDialogFragment;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
import se.emilsjolander.stickylistheaders.ApiLevelTooLowException;
|
||||||
|
import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter;
|
||||||
|
import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public key list with sticky list headers. It does _not_ extend ListFragment because it uses
|
* Public key list with sticky list headers. It does _not_ extend ListFragment because it uses
|
||||||
@ -566,8 +549,8 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
|
|||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
holder = new HeaderViewHolder();
|
holder = new HeaderViewHolder();
|
||||||
convertView = mInflater.inflate(R.layout.key_list_header, parent, false);
|
convertView = mInflater.inflate(R.layout.key_list_header, parent, false);
|
||||||
holder.text = (TextView) convertView.findViewById(R.id.stickylist_header_text);
|
holder.mText = (TextView) convertView.findViewById(R.id.stickylist_header_text);
|
||||||
holder.count = (TextView) convertView.findViewById(R.id.contacts_num);
|
holder.mCount = (TextView) convertView.findViewById(R.id.contacts_num);
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
} else {
|
} else {
|
||||||
holder = (HeaderViewHolder) convertView.getTag();
|
holder = (HeaderViewHolder) convertView.getTag();
|
||||||
@ -587,11 +570,11 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
|
|||||||
{ // set contact count
|
{ // set contact count
|
||||||
int num = mCursor.getCount();
|
int num = mCursor.getCount();
|
||||||
String contactsTotal = getResources().getQuantityString(R.plurals.n_contacts, num, num);
|
String contactsTotal = getResources().getQuantityString(R.plurals.n_contacts, num, num);
|
||||||
holder.count.setText(contactsTotal);
|
holder.mCount.setText(contactsTotal);
|
||||||
holder.count.setVisibility(View.VISIBLE);
|
holder.mCount.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.text.setText(convertView.getResources().getString(R.string.my_keys));
|
holder.mText.setText(convertView.getResources().getString(R.string.my_keys));
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,8 +584,8 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
|
|||||||
if (userId != null && userId.length() > 0) {
|
if (userId != null && userId.length() > 0) {
|
||||||
headerText = "" + mCursor.getString(KeyListFragment.INDEX_USER_ID).subSequence(0, 1).charAt(0);
|
headerText = "" + mCursor.getString(KeyListFragment.INDEX_USER_ID).subSequence(0, 1).charAt(0);
|
||||||
}
|
}
|
||||||
holder.text.setText(headerText);
|
holder.mText.setText(headerText);
|
||||||
holder.count.setVisibility(View.GONE);
|
holder.mCount.setVisibility(View.GONE);
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,8 +618,8 @@ public class KeyListFragment extends Fragment implements SearchView.OnQueryTextL
|
|||||||
}
|
}
|
||||||
|
|
||||||
class HeaderViewHolder {
|
class HeaderViewHolder {
|
||||||
TextView text;
|
TextView mText;
|
||||||
TextView count;
|
TextView mCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,6 +16,11 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.*;
|
||||||
import org.spongycastle.bcpg.HashAlgorithmTags;
|
import org.spongycastle.bcpg.HashAlgorithmTags;
|
||||||
import org.spongycastle.openpgp.PGPEncryptedData;
|
import org.spongycastle.openpgp.PGPEncryptedData;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
@ -24,17 +29,6 @@ import org.sufficientlysecure.keychain.R;
|
|||||||
import org.sufficientlysecure.keychain.helper.Preferences;
|
import org.sufficientlysecure.keychain.helper.Preferences;
|
||||||
import org.sufficientlysecure.keychain.ui.widget.IntegerListPreference;
|
import org.sufficientlysecure.keychain.ui.widget.IntegerListPreference;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceActivity;
|
|
||||||
import android.preference.PreferenceFragment;
|
|
||||||
import android.preference.PreferenceScreen;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
@ -86,13 +80,13 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
initializeEncryptionAlgorithm(
|
initializeEncryptionAlgorithm(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM));
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM));
|
||||||
|
|
||||||
int[] valueIds = new int[] { Id.choice.compression.none, Id.choice.compression.zip,
|
int[] valueIds = new int[]{Id.choice.compression.none, Id.choice.compression.zip,
|
||||||
Id.choice.compression.zlib, Id.choice.compression.bzip2, };
|
Id.choice.compression.zlib, Id.choice.compression.bzip2,};
|
||||||
String[] entries = new String[] {
|
String[] entries = new String[]{
|
||||||
getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")",
|
getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")",
|
||||||
"ZIP (" + getString(R.string.compression_fast) + ")",
|
"ZIP (" + getString(R.string.compression_fast) + ")",
|
||||||
"ZLIB (" + getString(R.string.compression_fast) + ")",
|
"ZLIB (" + getString(R.string.compression_fast) + ")",
|
||||||
"BZIP2 (" + getString(R.string.compression_very_slow) + ")", };
|
"BZIP2 (" + getString(R.string.compression_very_slow) + ")",};
|
||||||
String[] values = new String[valueIds.length];
|
String[] values = new String[valueIds.length];
|
||||||
for (int i = 0; i < values.length; ++i) {
|
for (int i = 0; i < values.length; ++i) {
|
||||||
values[i] = "" + valueIds[i];
|
values[i] = "" + valueIds[i];
|
||||||
@ -100,15 +94,15 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
|
|
||||||
initializeHashAlgorithm(
|
initializeHashAlgorithm(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM),
|
||||||
valueIds, entries, values);
|
valueIds, entries, values);
|
||||||
|
|
||||||
initializeMessageCompression(
|
initializeMessageCompression(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION),
|
||||||
valueIds, entries, values);
|
valueIds, entries, values);
|
||||||
|
|
||||||
initializeFileCompression(
|
initializeFileCompression(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION),
|
||||||
entries, values);
|
entries, values);
|
||||||
|
|
||||||
initializeAsciiArmour((CheckBoxPreference) findPreference(Constants.pref.DEFAULT_ASCII_ARMOUR));
|
initializeAsciiArmour((CheckBoxPreference) findPreference(Constants.pref.DEFAULT_ASCII_ARMOUR));
|
||||||
|
|
||||||
@ -149,7 +143,9 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
loadHeadersFromResource(R.xml.preference_headers, target);
|
loadHeadersFromResource(R.xml.preference_headers, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This fragment shows the general preferences in android 3.0+ */
|
/**
|
||||||
|
* This fragment shows the general preferences in android 3.0+
|
||||||
|
*/
|
||||||
public static class GeneralPrefsFragment extends PreferenceFragment {
|
public static class GeneralPrefsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
private PreferenceScreen mKeyServerPreference = null;
|
private PreferenceScreen mKeyServerPreference = null;
|
||||||
@ -204,7 +200,9 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This fragment shows the advanced preferences in android 3.0+ */
|
/**
|
||||||
|
* This fragment shows the advanced preferences in android 3.0+
|
||||||
|
*/
|
||||||
public static class AdvancedPrefsFragment extends PreferenceFragment {
|
public static class AdvancedPrefsFragment extends PreferenceFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -217,13 +215,13 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
initializeEncryptionAlgorithm(
|
initializeEncryptionAlgorithm(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM));
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_ENCRYPTION_ALGORITHM));
|
||||||
|
|
||||||
int[] valueIds = new int[] { Id.choice.compression.none, Id.choice.compression.zip,
|
int[] valueIds = new int[]{Id.choice.compression.none, Id.choice.compression.zip,
|
||||||
Id.choice.compression.zlib, Id.choice.compression.bzip2, };
|
Id.choice.compression.zlib, Id.choice.compression.bzip2,};
|
||||||
String[] entries = new String[] {
|
String[] entries = new String[]{
|
||||||
getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")",
|
getString(R.string.choice_none) + " (" + getString(R.string.compression_fast) + ")",
|
||||||
"ZIP (" + getString(R.string.compression_fast) + ")",
|
"ZIP (" + getString(R.string.compression_fast) + ")",
|
||||||
"ZLIB (" + getString(R.string.compression_fast) + ")",
|
"ZLIB (" + getString(R.string.compression_fast) + ")",
|
||||||
"BZIP2 (" + getString(R.string.compression_very_slow) + ")", };
|
"BZIP2 (" + getString(R.string.compression_very_slow) + ")",};
|
||||||
String[] values = new String[valueIds.length];
|
String[] values = new String[valueIds.length];
|
||||||
for (int i = 0; i < values.length; ++i) {
|
for (int i = 0; i < values.length; ++i) {
|
||||||
values[i] = "" + valueIds[i];
|
values[i] = "" + valueIds[i];
|
||||||
@ -231,11 +229,11 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
|
|
||||||
initializeHashAlgorithm(
|
initializeHashAlgorithm(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_HASH_ALGORITHM),
|
||||||
valueIds, entries, values);
|
valueIds, entries, values);
|
||||||
|
|
||||||
initializeMessageCompression(
|
initializeMessageCompression(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_MESSAGE_COMPRESSION),
|
||||||
valueIds, entries, values);
|
valueIds, entries, values);
|
||||||
|
|
||||||
initializeFileCompression(
|
initializeFileCompression(
|
||||||
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION),
|
(IntegerListPreference) findPreference(Constants.pref.DEFAULT_FILE_COMPRESSION),
|
||||||
@ -247,7 +245,7 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isValidFragment (String fragmentName) {
|
protected boolean isValidFragment(String fragmentName) {
|
||||||
return AdvancedPrefsFragment.class.getName().equals(fragmentName)
|
return AdvancedPrefsFragment.class.getName().equals(fragmentName)
|
||||||
|| GeneralPrefsFragment.class.getName().equals(fragmentName)
|
|| GeneralPrefsFragment.class.getName().equals(fragmentName)
|
||||||
|| super.isValidFragment(fragmentName);
|
|| super.isValidFragment(fragmentName);
|
||||||
@ -268,12 +266,12 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void initializeEncryptionAlgorithm(final IntegerListPreference mEncryptionAlgorithm) {
|
private static void initializeEncryptionAlgorithm(final IntegerListPreference mEncryptionAlgorithm) {
|
||||||
int valueIds[] = { PGPEncryptedData.AES_128, PGPEncryptedData.AES_192,
|
int valueIds[] = {PGPEncryptedData.AES_128, PGPEncryptedData.AES_192,
|
||||||
PGPEncryptedData.AES_256, PGPEncryptedData.BLOWFISH, PGPEncryptedData.TWOFISH,
|
PGPEncryptedData.AES_256, PGPEncryptedData.BLOWFISH, PGPEncryptedData.TWOFISH,
|
||||||
PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.TRIPLE_DES,
|
PGPEncryptedData.CAST5, PGPEncryptedData.DES, PGPEncryptedData.TRIPLE_DES,
|
||||||
PGPEncryptedData.IDEA, };
|
PGPEncryptedData.IDEA,};
|
||||||
String entries[] = { "AES-128", "AES-192", "AES-256", "Blowfish", "Twofish", "CAST5",
|
String entries[] = {"AES-128", "AES-192", "AES-256", "Blowfish", "Twofish", "CAST5",
|
||||||
"DES", "Triple DES", "IDEA", };
|
"DES", "Triple DES", "IDEA",};
|
||||||
String values[] = new String[valueIds.length];
|
String values[] = new String[valueIds.length];
|
||||||
for (int i = 0; i < values.length; ++i) {
|
for (int i = 0; i < values.length; ++i) {
|
||||||
values[i] = "" + valueIds[i];
|
values[i] = "" + valueIds[i];
|
||||||
@ -296,11 +294,11 @@ public class PreferencesActivity extends PreferenceActivity {
|
|||||||
|
|
||||||
private static void initializeHashAlgorithm
|
private static void initializeHashAlgorithm
|
||||||
(final IntegerListPreference mHashAlgorithm, int[] valueIds, String[] entries, String[] values) {
|
(final IntegerListPreference mHashAlgorithm, int[] valueIds, String[] entries, String[] values) {
|
||||||
valueIds = new int[] { HashAlgorithmTags.MD5, HashAlgorithmTags.RIPEMD160,
|
valueIds = new int[]{HashAlgorithmTags.MD5, HashAlgorithmTags.RIPEMD160,
|
||||||
HashAlgorithmTags.SHA1, HashAlgorithmTags.SHA224, HashAlgorithmTags.SHA256,
|
HashAlgorithmTags.SHA1, HashAlgorithmTags.SHA224, HashAlgorithmTags.SHA256,
|
||||||
HashAlgorithmTags.SHA384, HashAlgorithmTags.SHA512, };
|
HashAlgorithmTags.SHA384, HashAlgorithmTags.SHA512,};
|
||||||
entries = new String[] { "MD5", "RIPEMD-160", "SHA-1", "SHA-224", "SHA-256", "SHA-384",
|
entries = new String[]{"MD5", "RIPEMD-160", "SHA-1", "SHA-224", "SHA-256", "SHA-384",
|
||||||
"SHA-512", };
|
"SHA-512",};
|
||||||
values = new String[valueIds.length];
|
values = new String[valueIds.length];
|
||||||
for (int i = 0; i < values.length; ++i) {
|
for (int i = 0; i < values.length; ++i) {
|
||||||
values[i] = "" + valueIds[i];
|
values[i] = "" + valueIds[i];
|
||||||
|
@ -16,14 +16,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
|
||||||
import org.sufficientlysecure.keychain.ui.widget.Editor;
|
|
||||||
import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
|
|
||||||
import org.sufficientlysecure.keychain.ui.widget.KeyServerEditor;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -33,6 +25,13 @@ import android.view.View;
|
|||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
||||||
|
import org.sufficientlysecure.keychain.ui.widget.Editor;
|
||||||
|
import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
|
||||||
|
import org.sufficientlysecure.keychain.ui.widget.KeyServerEditor;
|
||||||
|
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
public class PreferencesKeyServerActivity extends ActionBarActivity implements OnClickListener,
|
public class PreferencesKeyServerActivity extends ActionBarActivity implements OnClickListener,
|
||||||
EditorListener {
|
EditorListener {
|
||||||
@ -63,7 +62,8 @@ public class PreferencesKeyServerActivity extends ActionBarActivity implements O
|
|||||||
// cancel
|
// cancel
|
||||||
cancelClicked();
|
cancelClicked();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
setContentView(R.layout.key_server_preference);
|
setContentView(R.layout.key_server_preference);
|
||||||
|
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.ActionBarHelper;
|
||||||
|
|
||||||
public class SelectPublicKeyActivity extends ActionBarActivity {
|
public class SelectPublicKeyActivity extends ActionBarActivity {
|
||||||
|
|
||||||
@ -59,7 +58,8 @@ public class SelectPublicKeyActivity extends ActionBarActivity {
|
|||||||
// cancel
|
// cancel
|
||||||
cancelClicked();
|
cancelClicked();
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
setContentView(R.layout.select_public_key_activity);
|
setContentView(R.layout.select_public_key_activity);
|
||||||
|
|
||||||
|
@ -17,19 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.compatibility.ListFragmentWorkaround;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.SelectKeyCursorAdapter;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.DatabaseUtils;
|
import android.database.DatabaseUtils;
|
||||||
@ -45,12 +32,19 @@ import android.view.Gravity;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.EditText;
|
import android.widget.*;
|
||||||
import android.widget.FrameLayout;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import android.widget.LinearLayout;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import android.widget.ListView;
|
import org.sufficientlysecure.keychain.compatibility.ListFragmentWorkaround;
|
||||||
import android.widget.ProgressBar;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
import android.widget.TextView;
|
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.SelectKeyCursorAdapter;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Vector;
|
||||||
|
|
||||||
public class SelectPublicKeyFragment extends ListFragmentWorkaround implements TextWatcher,
|
public class SelectPublicKeyFragment extends ListFragmentWorkaround implements TextWatcher,
|
||||||
LoaderManager.LoaderCallbacks<Cursor> {
|
LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBar;
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
public class SelectSecretKeyActivity extends ActionBarActivity {
|
public class SelectSecretKeyActivity extends ActionBarActivity {
|
||||||
|
|
||||||
@ -90,7 +89,7 @@ public class SelectSecretKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This is executed by SelectSecretKeyFragment after clicking on an item
|
* This is executed by SelectSecretKeyFragment after clicking on an item
|
||||||
*
|
*
|
||||||
* @param masterKeyId
|
* @param masterKeyId
|
||||||
* @param userId
|
* @param userId
|
||||||
*/
|
*/
|
||||||
|
@ -17,17 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables;
|
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.SelectKeyCursorAdapter;
|
|
||||||
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@ -39,6 +28,16 @@ import android.view.View;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase.Tables;
|
||||||
|
import org.sufficientlysecure.keychain.ui.adapter.SelectKeyCursorAdapter;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class SelectSecretKeyFragment extends ListFragment implements
|
public class SelectSecretKeyFragment extends ListFragment implements
|
||||||
LoaderManager.LoaderCallbacks<Cursor> {
|
LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
@ -46,9 +45,9 @@ public class SelectSecretKeyFragment extends ListFragment implements
|
|||||||
private SelectSecretKeyActivity mActivity;
|
private SelectSecretKeyActivity mActivity;
|
||||||
private SelectKeyCursorAdapter mAdapter;
|
private SelectKeyCursorAdapter mAdapter;
|
||||||
private ListView mListView;
|
private ListView mListView;
|
||||||
|
|
||||||
private boolean mFilterCertify;
|
private boolean mFilterCertify;
|
||||||
|
|
||||||
private static final String ARG_FILTER_CERTIFY = "filter_certify";
|
private static final String ARG_FILTER_CERTIFY = "filter_certify";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -122,7 +121,7 @@ public class SelectSecretKeyFragment extends ListFragment implements
|
|||||||
|
|
||||||
// These are the rows that we will retrieve.
|
// These are the rows that we will retrieve.
|
||||||
long now = new Date().getTime() / 1000;
|
long now = new Date().getTime() / 1000;
|
||||||
String[] projection = new String[] {
|
String[] projection = new String[]{
|
||||||
KeyRings._ID,
|
KeyRings._ID,
|
||||||
KeyRings.MASTER_KEY_ID,
|
KeyRings.MASTER_KEY_ID,
|
||||||
UserIds.USER_ID,
|
UserIds.USER_ID,
|
||||||
@ -142,7 +141,7 @@ public class SelectSecretKeyFragment extends ListFragment implements
|
|||||||
+ Keys.IS_REVOKED + " = '0' AND valid_keys." + Keys.CAN_SIGN
|
+ Keys.IS_REVOKED + " = '0' AND valid_keys." + Keys.CAN_SIGN
|
||||||
+ " = '1' AND valid_keys." + Keys.CREATION + " <= '" + now + "' AND "
|
+ " = '1' AND valid_keys." + Keys.CREATION + " <= '" + now + "' AND "
|
||||||
+ "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys." + Keys.EXPIRY
|
+ "(valid_keys." + Keys.EXPIRY + " IS NULL OR valid_keys." + Keys.EXPIRY
|
||||||
+ " >= '" + now + "')) AS " + SelectKeyCursorAdapter.PROJECTION_ROW_VALID, };
|
+ " >= '" + now + "')) AS " + SelectKeyCursorAdapter.PROJECTION_ROW_VALID,};
|
||||||
|
|
||||||
String orderBy = UserIds.USER_ID + " ASC";
|
String orderBy = UserIds.USER_ID + " ASC";
|
||||||
|
|
||||||
|
@ -17,6 +17,16 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
@ -24,21 +34,6 @@ import org.sufficientlysecure.keychain.R;
|
|||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.ActivityOptions;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
|
||||||
|
|
||||||
public class SelectSecretKeyLayoutFragment extends Fragment {
|
public class SelectSecretKeyLayoutFragment extends Fragment {
|
||||||
|
|
||||||
private TextView mKeyUserId;
|
private TextView mKeyUserId;
|
||||||
|
@ -17,13 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.Preferences;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -36,8 +29,13 @@ import android.view.View.OnClickListener;
|
|||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.Preferences;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the selected public key to a keyserver
|
* Sends the selected public key to a keyserver
|
||||||
@ -59,7 +57,7 @@ public class UploadKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
|
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
|
||||||
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
|
android.R.layout.simple_spinner_item, Preferences.getPreferences(this)
|
||||||
.getKeyServers());
|
.getKeyServers());
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
mKeyServerSpinner.setAdapter(adapter);
|
mKeyServerSpinner.setAdapter(adapter);
|
||||||
if (adapter.getCount() > 0) {
|
if (adapter.getCount() > 0) {
|
||||||
|
@ -29,7 +29,6 @@ import android.support.v7.app.ActionBarActivity;
|
|||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
@ -89,7 +88,7 @@ public class ViewKeyActivity extends ActionBarActivity {
|
|||||||
// given valid /public/ query
|
// given valid /public/ query
|
||||||
long rowId = ProviderHelper.getRowId(this, getIntent().getData());
|
long rowId = ProviderHelper.getRowId(this, getIntent().getData());
|
||||||
// TODO: handle (rowId == 0) with something else than a crash
|
// TODO: handle (rowId == 0) with something else than a crash
|
||||||
mDataUri = KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(rowId)) ;
|
mDataUri = KeychainContract.KeyRings.buildPublicKeyRingsUri(Long.toString(rowId));
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle mainBundle = new Bundle();
|
Bundle mainBundle = new Bundle();
|
||||||
|
@ -18,10 +18,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui;
|
package org.sufficientlysecure.keychain.ui;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.nfc.NdefMessage;
|
import android.nfc.NdefMessage;
|
||||||
@ -35,6 +31,9 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||||
public class ViewKeyActivityJB extends ViewKeyActivity implements CreateNdefMessageCallback,
|
public class ViewKeyActivityJB extends ViewKeyActivity implements CreateNdefMessageCallback,
|
||||||
@ -66,7 +65,7 @@ public class ViewKeyActivityJB extends ViewKeyActivity implements CreateNdefMess
|
|||||||
// get public keyring as byte array
|
// get public keyring as byte array
|
||||||
long masterKeyId = ProviderHelper.getMasterKeyId(this, dataUri);
|
long masterKeyId = ProviderHelper.getMasterKeyId(this, dataUri);
|
||||||
mSharedKeyringBytes = ProviderHelper.getKeyRingsAsByteArray(this, dataUri,
|
mSharedKeyringBytes = ProviderHelper.getKeyRingsAsByteArray(this, dataUri,
|
||||||
new long[] { masterKeyId });
|
new long[]{masterKeyId});
|
||||||
|
|
||||||
// Register callback to set NDEF message
|
// Register callback to set NDEF message
|
||||||
mNfcAdapter.setNdefPushMessageCallback(this, this);
|
mNfcAdapter.setNdefPushMessageCallback(this, this);
|
||||||
@ -109,10 +108,10 @@ public class ViewKeyActivityJB extends ViewKeyActivity implements CreateNdefMess
|
|||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
switch (msg.what) {
|
switch (msg.what) {
|
||||||
case NFC_SENT:
|
case NFC_SENT:
|
||||||
Toast.makeText(getApplicationContext(), R.string.nfc_successfull, Toast.LENGTH_LONG)
|
Toast.makeText(getApplicationContext(), R.string.nfc_successfull, Toast.LENGTH_LONG)
|
||||||
.show();
|
.show();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -24,9 +24,7 @@ import android.support.v4.app.Fragment;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
@ -29,16 +29,13 @@ import android.support.v4.content.Loader;
|
|||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.text.style.BackgroundColorSpan;
|
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.OtherHelper;
|
import org.sufficientlysecure.keychain.helper.OtherHelper;
|
||||||
@ -49,13 +46,11 @@ import org.sufficientlysecure.keychain.ui.adapter.ViewKeyKeysAdapter;
|
|||||||
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
public class ViewKeyMainFragment extends Fragment implements
|
public class ViewKeyMainFragment extends Fragment implements
|
||||||
LoaderManager.LoaderCallbacks<Cursor>{
|
LoaderManager.LoaderCallbacks<Cursor> {
|
||||||
|
|
||||||
public static final String ARG_DATA_URI = "uri";
|
public static final String ARG_DATA_URI = "uri";
|
||||||
|
|
||||||
@ -130,7 +125,7 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
|
|
||||||
{ // label whether secret key is available, and edit button if it is
|
{ // label whether secret key is available, and edit button if it is
|
||||||
final long masterKeyId = ProviderHelper.getMasterKeyId(getActivity(), mDataUri);
|
final long masterKeyId = ProviderHelper.getMasterKeyId(getActivity(), mDataUri);
|
||||||
if(ProviderHelper.hasSecretKeyByMasterKeyId(getActivity(), masterKeyId)) {
|
if (ProviderHelper.hasSecretKeyByMasterKeyId(getActivity(), masterKeyId)) {
|
||||||
// set this attribute. this is a LITTLE unclean, but we have the info available
|
// set this attribute. this is a LITTLE unclean, but we have the info available
|
||||||
// right here, so why not.
|
// right here, so why not.
|
||||||
mSecretKey.setTextColor(getResources().getColor(R.color.emphasis));
|
mSecretKey.setTextColor(getResources().getColor(R.color.emphasis));
|
||||||
@ -341,7 +336,7 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
g = Math.min(255, (int) (g * factor));
|
g = Math.min(255, (int) (g * factor));
|
||||||
b = Math.min(255, (int) (b * factor));
|
b = Math.min(255, (int) (b * factor));
|
||||||
|
|
||||||
// If it is too light, then darken it to a respective maximal brightness.
|
// If it is too light, then darken it to a respective maximal brightness.
|
||||||
} else if (brightness > 180) {
|
} else if (brightness > 180) {
|
||||||
double factor = 180.0 / brightness;
|
double factor = 180.0 / brightness;
|
||||||
r = (int) (r * factor);
|
r = (int) (r * factor);
|
||||||
@ -352,7 +347,7 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
// Create a foreground color with the 3 digest integers as RGB
|
// Create a foreground color with the 3 digest integers as RGB
|
||||||
// and then converting that int to hex to use as a color
|
// and then converting that int to hex to use as a color
|
||||||
sb.setSpan(new ForegroundColorSpan(Color.rgb(r, g, b)),
|
sb.setSpan(new ForegroundColorSpan(Color.rgb(r, g, b)),
|
||||||
i, spanEnd, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
i, spanEnd, Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(Constants.TAG, "Colorization failed", e);
|
Log.e(Constants.TAG, "Colorization failed", e);
|
||||||
|
@ -22,14 +22,15 @@ package org.sufficientlysecure.keychain.ui.adapter;
|
|||||||
* You can pass the result and an exception in it if an error occurred.
|
* You can pass the result and an exception in it if an error occurred.
|
||||||
* Concept found at:
|
* Concept found at:
|
||||||
* https://stackoverflow.com/questions/19593577/how-to-handle-errors-in-custom-asynctaskloader
|
* https://stackoverflow.com/questions/19593577/how-to-handle-errors-in-custom-asynctaskloader
|
||||||
|
*
|
||||||
* @param <T> - Typ of the result which is wrapped
|
* @param <T> - Typ of the result which is wrapped
|
||||||
*/
|
*/
|
||||||
public class AsyncTaskResultWrapper <T>{
|
public class AsyncTaskResultWrapper<T> {
|
||||||
|
|
||||||
private final T result;
|
private final T result;
|
||||||
private final Exception error;
|
private final Exception error;
|
||||||
|
|
||||||
public AsyncTaskResultWrapper(T result, Exception error){
|
public AsyncTaskResultWrapper(T result, Exception error) {
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.error = error;
|
this.error = error;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ import android.database.Cursor;
|
|||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
@ -17,12 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -36,13 +30,19 @@ import android.widget.CheckBox;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
||||||
protected LayoutInflater mInflater;
|
protected LayoutInflater mInflater;
|
||||||
protected Activity mActivity;
|
protected Activity mActivity;
|
||||||
|
|
||||||
protected List<ImportKeysListEntry> data;
|
protected List<ImportKeysListEntry> data;
|
||||||
static class ViewHolder{
|
|
||||||
|
static class ViewHolder {
|
||||||
private TextView mainUserId;
|
private TextView mainUserId;
|
||||||
private TextView mainUserIdRest;
|
private TextView mainUserIdRest;
|
||||||
private TextView keyId;
|
private TextView keyId;
|
||||||
@ -51,6 +51,7 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
|||||||
private TextView status;
|
private TextView status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImportKeysAdapter(Activity activity) {
|
public ImportKeysAdapter(Activity activity) {
|
||||||
super(activity, -1);
|
super(activity, -1);
|
||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
@ -95,7 +96,7 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
|||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
ImportKeysListEntry entry = data.get(position);
|
ImportKeysListEntry entry = data.get(position);
|
||||||
ViewHolder holder;
|
ViewHolder holder;
|
||||||
if(convertView == null) {
|
if (convertView == null) {
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
convertView = mInflater.inflate(R.layout.import_keys_list_entry, null);
|
convertView = mInflater.inflate(R.layout.import_keys_list_entry, null);
|
||||||
holder.mainUserId = (TextView) convertView.findViewById(R.id.mainUserId);
|
holder.mainUserId = (TextView) convertView.findViewById(R.id.mainUserId);
|
||||||
@ -105,9 +106,8 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
|||||||
holder.algorithm = (TextView) convertView.findViewById(R.id.algorithm);
|
holder.algorithm = (TextView) convertView.findViewById(R.id.algorithm);
|
||||||
holder.status = (TextView) convertView.findViewById(R.id.status);
|
holder.status = (TextView) convertView.findViewById(R.id.status);
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
}
|
} else {
|
||||||
else{
|
holder = (ViewHolder) convertView.getTag();
|
||||||
holder = (ViewHolder)convertView.getTag();
|
|
||||||
}
|
}
|
||||||
// main user id
|
// main user id
|
||||||
String userId = entry.userIds.get(0);
|
String userId = entry.userIds.get(0);
|
||||||
|
@ -19,12 +19,6 @@ package org.sufficientlysecure.keychain.ui.adapter;
|
|||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import org.spongycastle.openpgp.PGPKeyRing;
|
import org.spongycastle.openpgp.PGPKeyRing;
|
||||||
import org.spongycastle.openpgp.PGPPublicKey;
|
import org.spongycastle.openpgp.PGPPublicKey;
|
||||||
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
import org.spongycastle.openpgp.PGPSecretKeyRing;
|
||||||
@ -33,6 +27,11 @@ import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|||||||
import org.sufficientlysecure.keychain.util.IterableIterator;
|
import org.sufficientlysecure.keychain.util.IterableIterator;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class ImportKeysListEntry implements Serializable, Parcelable {
|
public class ImportKeysListEntry implements Serializable, Parcelable {
|
||||||
private static final long serialVersionUID = -7797972103284992662L;
|
private static final long serialVersionUID = -7797972103284992662L;
|
||||||
public ArrayList<String> userIds;
|
public ArrayList<String> userIds;
|
||||||
|
@ -17,10 +17,8 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import android.content.Context;
|
||||||
import java.io.InputStream;
|
import android.support.v4.content.AsyncTaskLoader;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.spongycastle.openpgp.PGPKeyRing;
|
import org.spongycastle.openpgp.PGPKeyRing;
|
||||||
import org.spongycastle.openpgp.PGPObjectFactory;
|
import org.spongycastle.openpgp.PGPObjectFactory;
|
||||||
import org.spongycastle.openpgp.PGPUtil;
|
import org.spongycastle.openpgp.PGPUtil;
|
||||||
@ -29,8 +27,9 @@ import org.sufficientlysecure.keychain.util.InputData;
|
|||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.PositionAwareInputStream;
|
import org.sufficientlysecure.keychain.util.PositionAwareInputStream;
|
||||||
|
|
||||||
import android.content.Context;
|
import java.io.BufferedInputStream;
|
||||||
import android.support.v4.content.AsyncTaskLoader;
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>> {
|
public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>> {
|
||||||
|
|
||||||
@ -40,9 +39,11 @@ public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper
|
|||||||
|
|
||||||
public static class NonPgpPart extends Exception {
|
public static class NonPgpPart extends Exception {
|
||||||
private int count;
|
private int count;
|
||||||
|
|
||||||
public NonPgpPart(int count) {
|
public NonPgpPart(int count) {
|
||||||
this.count = count;
|
this.count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@ -101,7 +102,7 @@ public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads all PGPKeyRing objects from input
|
* Reads all PGPKeyRing objects from input
|
||||||
*
|
*
|
||||||
* @param inputData
|
* @param inputData
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -145,13 +146,13 @@ public class ImportKeysListLoader extends AsyncTaskLoader<AsyncTaskResultWrapper
|
|||||||
nonPgpCounter = 0;
|
nonPgpCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isEmpty) {
|
if (isEmpty) {
|
||||||
Log.e(Constants.TAG, "File has no content!", new FileHasNoContent());
|
Log.e(Constants.TAG, "File has no content!", new FileHasNoContent());
|
||||||
entryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>
|
entryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>
|
||||||
(data, new FileHasNoContent());
|
(data, new FileHasNoContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nonPgpCounter > 0) {
|
if (nonPgpCounter > 0) {
|
||||||
entryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>
|
entryListWrapper = new AsyncTaskResultWrapper<ArrayList<ImportKeysListEntry>>
|
||||||
(data, new NonPgpPart(nonPgpCounter));
|
(data, new NonPgpPart(nonPgpCounter));
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ package org.sufficientlysecure.keychain.ui.adapter;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.v4.content.AsyncTaskLoader;
|
import android.support.v4.content.AsyncTaskLoader;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
||||||
import org.sufficientlysecure.keychain.util.KeyServer;
|
import org.sufficientlysecure.keychain.util.KeyServer;
|
||||||
|
@ -17,15 +17,11 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.SortedSet;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
public class KeyValueSpinnerAdapter extends ArrayAdapter<String> {
|
public class KeyValueSpinnerAdapter extends ArrayAdapter<String> {
|
||||||
private final HashMap<Integer, String> mData;
|
private final HashMap<Integer, String> mData;
|
||||||
private final int[] mKeys;
|
private final int[] mKeys;
|
||||||
|
@ -17,12 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@ -31,7 +25,11 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.KeyRings;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
|
|
||||||
|
|
||||||
public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter {
|
public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter {
|
||||||
@ -50,7 +48,7 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter {
|
|||||||
public final static String PROJECTION_ROW_VALID = "valid";
|
public final static String PROJECTION_ROW_VALID = "valid";
|
||||||
|
|
||||||
public SelectKeyCursorAdapter(Context context, Cursor c, int flags, ListView listView,
|
public SelectKeyCursorAdapter(Context context, Cursor c, int flags, ListView listView,
|
||||||
int keyType) {
|
int keyType) {
|
||||||
super(context, c, flags);
|
super(context, c, flags);
|
||||||
|
|
||||||
mInflater = LayoutInflater.from(context);
|
mInflater = LayoutInflater.from(context);
|
||||||
@ -69,7 +67,7 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter {
|
|||||||
/**
|
/**
|
||||||
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
||||||
* performance comparison see http://stackoverflow.com/a/17999582
|
* performance comparison see http://stackoverflow.com/a/17999582
|
||||||
*
|
*
|
||||||
* @param cursor
|
* @param cursor
|
||||||
*/
|
*/
|
||||||
private void initIndex(Cursor cursor) {
|
private void initIndex(Cursor cursor) {
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
@ -29,6 +25,9 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.Keys;
|
||||||
|
|
||||||
public class ViewKeyKeysAdapter extends CursorAdapter {
|
public class ViewKeyKeysAdapter extends CursorAdapter {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
@ -59,7 +58,7 @@ public class ViewKeyKeysAdapter extends CursorAdapter {
|
|||||||
/**
|
/**
|
||||||
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
||||||
* performance comparison see http://stackoverflow.com/a/17999582
|
* performance comparison see http://stackoverflow.com/a/17999582
|
||||||
*
|
*
|
||||||
* @param cursor
|
* @param cursor
|
||||||
*/
|
*/
|
||||||
private void initIndex(Cursor cursor) {
|
private void initIndex(Cursor cursor) {
|
||||||
|
@ -17,9 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
@ -27,6 +24,8 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainContract.UserIds;
|
||||||
|
|
||||||
public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
@ -51,7 +50,7 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
|||||||
/**
|
/**
|
||||||
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
||||||
* performance comparison see http://stackoverflow.com/a/17999582
|
* performance comparison see http://stackoverflow.com/a/17999582
|
||||||
*
|
*
|
||||||
* @param cursor
|
* @param cursor
|
||||||
*/
|
*/
|
||||||
private void initIndex(Cursor cursor) {
|
private void initIndex(Cursor cursor) {
|
||||||
|
@ -23,7 +23,6 @@ import android.content.DialogInterface;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
public class BadImportKeyDialogFragment extends DialogFragment {
|
public class BadImportKeyDialogFragment extends DialogFragment {
|
||||||
|
@ -27,13 +27,11 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.util.Choice;
|
import org.sufficientlysecure.keychain.util.Choice;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
public class CreateKeyDialogFragment extends DialogFragment {
|
public class CreateKeyDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.dialog;
|
package org.sufficientlysecure.keychain.ui.dialog;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
@ -32,6 +28,9 @@ import android.os.Messenger;
|
|||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
||||||
|
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
||||||
|
|
||||||
public class DeleteFileDialogFragment extends DialogFragment {
|
public class DeleteFileDialogFragment extends DialogFragment {
|
||||||
private static final String ARG_DELETE_FILE = "delete_file";
|
private static final String ARG_DELETE_FILE = "delete_file";
|
||||||
|
@ -28,7 +28,6 @@ import android.os.Messenger;
|
|||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
@ -118,7 +117,7 @@ public class DeleteKeyDialogFragment extends DialogFragment {
|
|||||||
String selectionIDs = "";
|
String selectionIDs = "";
|
||||||
for (int i = 0; i < keyRingRowIds.length; i++) {
|
for (int i = 0; i < keyRingRowIds.length; i++) {
|
||||||
selectionIDs += "'" + String.valueOf(keyRingRowIds[i]) + "'";
|
selectionIDs += "'" + String.valueOf(keyRingRowIds[i]) + "'";
|
||||||
if (i+1 < keyRingRowIds.length)
|
if (i + 1 < keyRingRowIds.length)
|
||||||
selectionIDs += ",";
|
selectionIDs += ",";
|
||||||
}
|
}
|
||||||
selection += selectionIDs + ")";
|
selection += selectionIDs + ")";
|
||||||
|
@ -17,11 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.dialog;
|
package org.sufficientlysecure.keychain.ui.dialog;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.helper.FileHelper;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -38,8 +33,11 @@ import android.view.View;
|
|||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.helper.FileHelper;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class FileDialogFragment extends DialogFragment {
|
public class FileDialogFragment extends DialogFragment {
|
||||||
private static final String ARG_MESSENGER = "messenger";
|
private static final String ARG_MESSENGER = "messenger";
|
||||||
@ -66,7 +64,7 @@ public class FileDialogFragment extends DialogFragment {
|
|||||||
* Creates new instance of this file dialog fragment
|
* Creates new instance of this file dialog fragment
|
||||||
*/
|
*/
|
||||||
public static FileDialogFragment newInstance(Messenger messenger, String title, String message,
|
public static FileDialogFragment newInstance(Messenger messenger, String title, String message,
|
||||||
String defaultFile, String checkboxText) {
|
String defaultFile, String checkboxText) {
|
||||||
FileDialogFragment frag = new FileDialogFragment();
|
FileDialogFragment frag = new FileDialogFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putParcelable(ARG_MESSENGER, messenger);
|
args.putParcelable(ARG_MESSENGER, messenger);
|
||||||
@ -176,34 +174,33 @@ public class FileDialogFragment extends DialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
switch (requestCode & 0xFFFF) {
|
switch (requestCode & 0xFFFF) {
|
||||||
case REQUEST_CODE: {
|
case REQUEST_CODE: {
|
||||||
if (resultCode == Activity.RESULT_OK && data != null) {
|
if (resultCode == Activity.RESULT_OK && data != null) {
|
||||||
try {
|
try {
|
||||||
String path = data.getData().getPath();
|
String path = data.getData().getPath();
|
||||||
Log.d(Constants.TAG, "path=" + path);
|
Log.d(Constants.TAG, "path=" + path);
|
||||||
|
|
||||||
// set filename used in export/import dialogs
|
// set filename used in export/import dialogs
|
||||||
setFilename(path);
|
setFilename(path);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
Log.e(Constants.TAG, "Nullpointer while retrieving path!", e);
|
Log.e(Constants.TAG, "Nullpointer while retrieving path!", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
default:
|
||||||
}
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
default:
|
break;
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send message back to handler which is initialized in a activity
|
* Send message back to handler which is initialized in a activity
|
||||||
*
|
*
|
||||||
* @param what
|
* @param what Message integer you want to send
|
||||||
* Message integer you want to send
|
|
||||||
*/
|
*/
|
||||||
private void sendMessageToHandler(Integer what, Bundle data) {
|
private void sendMessageToHandler(Integer what, Bundle data) {
|
||||||
Message msg = Message.obtain();
|
Message msg = Message.obtain();
|
||||||
|
@ -17,20 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.dialog;
|
package org.sufficientlysecure.keychain.ui.dialog;
|
||||||
|
|
||||||
import org.spongycastle.openpgp.PGPException;
|
|
||||||
import org.spongycastle.openpgp.PGPPrivateKey;
|
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
|
||||||
import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|
||||||
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
|
||||||
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -52,6 +38,19 @@ import android.widget.EditText;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TextView.OnEditorActionListener;
|
import android.widget.TextView.OnEditorActionListener;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import org.spongycastle.openpgp.PGPException;
|
||||||
|
import org.spongycastle.openpgp.PGPPrivateKey;
|
||||||
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
|
import org.spongycastle.openpgp.operator.PBESecretKeyDecryptor;
|
||||||
|
import org.spongycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
|
||||||
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
|
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class PassphraseDialogFragment extends DialogFragment implements OnEditorActionListener {
|
public class PassphraseDialogFragment extends DialogFragment implements OnEditorActionListener {
|
||||||
private static final String ARG_MESSENGER = "messenger";
|
private static final String ARG_MESSENGER = "messenger";
|
||||||
@ -66,16 +65,14 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new instance of this dialog fragment
|
* Creates new instance of this dialog fragment
|
||||||
*
|
*
|
||||||
* @param secretKeyId
|
* @param secretKeyId secret key id you want to use
|
||||||
* secret key id you want to use
|
* @param messenger to communicate back after caching the passphrase
|
||||||
* @param messenger
|
|
||||||
* to communicate back after caching the passphrase
|
|
||||||
* @return
|
* @return
|
||||||
* @throws PgpGeneralException
|
* @throws PgpGeneralException
|
||||||
*/
|
*/
|
||||||
public static PassphraseDialogFragment newInstance(Context context, Messenger messenger,
|
public static PassphraseDialogFragment newInstance(Context context, Messenger messenger,
|
||||||
long secretKeyId) throws PgpGeneralException {
|
long secretKeyId) throws PgpGeneralException {
|
||||||
// check if secret key has a passphrase
|
// check if secret key has a passphrase
|
||||||
if (!(secretKeyId == Id.key.symmetric || secretKeyId == Id.key.none)) {
|
if (!(secretKeyId == Id.key.symmetric || secretKeyId == Id.key.none)) {
|
||||||
if (!PassphraseCacheService.hasPassphrase(context, secretKeyId)) {
|
if (!PassphraseCacheService.hasPassphrase(context, secretKeyId)) {
|
||||||
@ -171,7 +168,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
Toast.makeText(activity,
|
Toast.makeText(activity,
|
||||||
R.string.error_could_not_extract_private_key,
|
R.string.error_could_not_extract_private_key,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
sendMessageToHandler(MESSAGE_CANCEL);
|
sendMessageToHandler(MESSAGE_CANCEL);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -187,14 +184,14 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
} catch (PGPException e) {
|
} catch (PGPException e) {
|
||||||
Toast.makeText(activity, R.string.wrong_passphrase,
|
Toast.makeText(activity, R.string.wrong_passphrase,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
sendMessageToHandler(MESSAGE_CANCEL);
|
sendMessageToHandler(MESSAGE_CANCEL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(activity, R.string.error_could_not_extract_private_key,
|
Toast.makeText(activity, R.string.error_could_not_extract_private_key,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
sendMessageToHandler(MESSAGE_CANCEL);
|
sendMessageToHandler(MESSAGE_CANCEL);
|
||||||
return; // ran out of keys to try
|
return; // ran out of keys to try
|
||||||
}
|
}
|
||||||
@ -207,7 +204,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
// cache the new passphrase
|
// cache the new passphrase
|
||||||
Log.d(Constants.TAG, "Everything okay! Caching entered passphrase");
|
Log.d(Constants.TAG, "Everything okay! Caching entered passphrase");
|
||||||
PassphraseCacheService.addCachedPassphrase(activity, keyId, passphrase);
|
PassphraseCacheService.addCachedPassphrase(activity, keyId, passphrase);
|
||||||
if ( !keyOK && clickSecretKey.getKeyID() != keyId) {
|
if (!keyOK && clickSecretKey.getKeyID() != keyId) {
|
||||||
PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(),
|
PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(),
|
||||||
passphrase);
|
passphrase);
|
||||||
}
|
}
|
||||||
@ -265,9 +262,8 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send message back to handler which is initialized in a activity
|
* Send message back to handler which is initialized in a activity
|
||||||
*
|
*
|
||||||
* @param what
|
* @param what Message integer you want to send
|
||||||
* Message integer you want to send
|
|
||||||
*/
|
*/
|
||||||
private void sendMessageToHandler(Integer what) {
|
private void sendMessageToHandler(Integer what) {
|
||||||
Message msg = Message.obtain();
|
Message msg = Message.obtain();
|
||||||
|
@ -26,7 +26,6 @@ import android.content.DialogInterface.OnKeyListener;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
public class ProgressDialogFragment extends DialogFragment {
|
public class ProgressDialogFragment extends DialogFragment {
|
||||||
|
@ -17,10 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.dialog;
|
package org.sufficientlysecure.keychain.ui.dialog;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -40,6 +36,9 @@ import android.widget.EditText;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TextView.OnEditorActionListener;
|
import android.widget.TextView.OnEditorActionListener;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class SetPassphraseDialogFragment extends DialogFragment implements OnEditorActionListener {
|
public class SetPassphraseDialogFragment extends DialogFragment implements OnEditorActionListener {
|
||||||
private static final String ARG_MESSENGER = "messenger";
|
private static final String ARG_MESSENGER = "messenger";
|
||||||
@ -55,11 +54,9 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new instance of this dialog fragment
|
* Creates new instance of this dialog fragment
|
||||||
*
|
*
|
||||||
* @param title
|
* @param title title of dialog
|
||||||
* title of dialog
|
* @param messenger to communicate back after setting the passphrase
|
||||||
* @param messenger
|
|
||||||
* to communicate back after setting the passphrase
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static SetPassphraseDialogFragment newInstance(Messenger messenger, int title) {
|
public static SetPassphraseDialogFragment newInstance(Messenger messenger, int title) {
|
||||||
@ -96,7 +93,7 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
|
|||||||
mPassphraseAgainEditText = (EditText) view.findViewById(R.id.passphrase_passphrase_again);
|
mPassphraseAgainEditText = (EditText) view.findViewById(R.id.passphrase_passphrase_again);
|
||||||
|
|
||||||
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dismiss();
|
dismiss();
|
||||||
@ -130,7 +127,7 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
|
|||||||
});
|
});
|
||||||
|
|
||||||
alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
dismiss();
|
dismiss();
|
||||||
@ -168,9 +165,8 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send message back to handler which is initialized in a activity
|
* Send message back to handler which is initialized in a activity
|
||||||
*
|
*
|
||||||
* @param what
|
* @param what Message integer you want to send
|
||||||
* Message integer you want to send
|
|
||||||
*/
|
*/
|
||||||
private void sendMessageToHandler(Integer what, Bundle data) {
|
private void sendMessageToHandler(Integer what, Bundle data) {
|
||||||
Message msg = Message.obtain();
|
Message msg = Message.obtain();
|
||||||
|
@ -17,9 +17,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.dialog;
|
package org.sufficientlysecure.keychain.ui.dialog;
|
||||||
|
|
||||||
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -31,6 +28,8 @@ import android.os.Bundle;
|
|||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import org.sufficientlysecure.htmltextview.HtmlTextView;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
|
||||||
public class ShareNfcDialogFragment extends DialogFragment {
|
public class ShareNfcDialogFragment extends DialogFragment {
|
||||||
|
@ -28,7 +28,6 @@ import android.view.View;
|
|||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
@ -24,7 +24,7 @@ import android.widget.ListView;
|
|||||||
/**
|
/**
|
||||||
* Automatically calculate height of ListView based on contained items. This enables to put this
|
* Automatically calculate height of ListView based on contained items. This enables to put this
|
||||||
* ListView into a ScrollView without messing up.
|
* ListView into a ScrollView without messing up.
|
||||||
*
|
* <p/>
|
||||||
* from
|
* from
|
||||||
* http://stackoverflow.com/questions/2419246/how-do-i-create-a-listview-thats-not-in-a-scrollview-
|
* http://stackoverflow.com/questions/2419246/how-do-i-create-a-listview-thats-not-in-a-scrollview-
|
||||||
* or-has-the-scrollview-dis
|
* or-has-the-scrollview-dis
|
||||||
|
@ -25,7 +25,7 @@ import android.util.AttributeSet;
|
|||||||
* values should use {@link android.content.SharedPreferences#getInt}. When using XML-declared
|
* values should use {@link android.content.SharedPreferences#getInt}. When using XML-declared
|
||||||
* arrays for entry values, the arrays should be regular string arrays containing valid integer
|
* arrays for entry values, the arrays should be regular string arrays containing valid integer
|
||||||
* values.
|
* values.
|
||||||
*
|
*
|
||||||
* @author Rodrigo Damazio
|
* @author Rodrigo Damazio
|
||||||
*/
|
*/
|
||||||
public class IntegerListPreference extends ListPreference {
|
public class IntegerListPreference extends ListPreference {
|
||||||
|
@ -16,20 +16,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.widget;
|
package org.sufficientlysecure.keychain.ui.widget;
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.TimeZone;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import org.spongycastle.openpgp.PGPPublicKey;
|
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
|
||||||
import org.sufficientlysecure.keychain.Id;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
|
||||||
import org.sufficientlysecure.keychain.util.Choice;
|
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.DatePickerDialog;
|
import android.app.DatePickerDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
@ -40,13 +26,17 @@ import android.util.AttributeSet;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.*;
|
||||||
import android.widget.DatePicker;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.spongycastle.openpgp.PGPPublicKey;
|
||||||
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
|
import org.sufficientlysecure.keychain.Id;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
|
import org.sufficientlysecure.keychain.util.Choice;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
||||||
private PGPSecretKey mKey;
|
private PGPSecretKey mKey;
|
||||||
@ -99,7 +89,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
new Choice(Id.choice.usage.encrypt_only, getResources().getString(
|
new Choice(Id.choice.usage.encrypt_only, getResources().getString(
|
||||||
R.string.choice_encrypt_only)),
|
R.string.choice_encrypt_only)),
|
||||||
new Choice(Id.choice.usage.sign_and_encrypt, getResources().getString(
|
new Choice(Id.choice.usage.sign_and_encrypt, getResources().getString(
|
||||||
R.string.choice_sign_and_encrypt)), };
|
R.string.choice_sign_and_encrypt)),};
|
||||||
ArrayAdapter<Choice> adapter = new ArrayAdapter<Choice>(getContext(),
|
ArrayAdapter<Choice> adapter = new ArrayAdapter<Choice>(getContext(),
|
||||||
android.R.layout.simple_spinner_item, choices);
|
android.R.layout.simple_spinner_item, choices);
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
@ -144,11 +134,11 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
dialog.getDatePicker().setCalendarViewShown(false);
|
dialog.getDatePicker().setCalendarViewShown(false);
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
|
||||||
if ( dialog != null && mCreatedDate != null ) {
|
if (dialog != null && mCreatedDate != null) {
|
||||||
dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
dialog.getDatePicker().setMinDate(mCreatedDate.getTime().getTime() + DateUtils.DAY_IN_MILLIS);
|
||||||
} else {
|
} else {
|
||||||
//When created date isn't available
|
//When created date isn't available
|
||||||
dialog.getDatePicker().setMinDate(date.getTime().getTime()+ DateUtils.DAY_IN_MILLIS);
|
dialog.getDatePicker().setMinDate(date.getTime().getTime() + DateUtils.DAY_IN_MILLIS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,6 +280,7 @@ class ExpiryDatePickerDialog extends DatePickerDialog {
|
|||||||
public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
|
public ExpiryDatePickerDialog(Context context, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth) {
|
||||||
super(context, callBack, year, monthOfYear, dayOfMonth);
|
super(context, callBack, year, monthOfYear, dayOfMonth);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set permanent title.
|
//Set permanent title.
|
||||||
public void setTitle(CharSequence title) {
|
public void setTitle(CharSequence title) {
|
||||||
super.setTitle(getContext().getString(R.string.expiry_date_dialog_title));
|
super.setTitle(getContext().getString(R.string.expiry_date_dialog_title));
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.widget;
|
package org.sufficientlysecure.keychain.ui.widget;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -25,8 +23,8 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
|
||||||
public class KeyServerEditor extends LinearLayout implements Editor, OnClickListener {
|
public class KeyServerEditor extends LinearLayout implements Editor, OnClickListener {
|
||||||
private EditorListener mEditorListener = null;
|
private EditorListener mEditorListener = null;
|
||||||
|
@ -31,9 +31,7 @@ import android.view.View.OnClickListener;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
|
||||||
import org.spongycastle.openpgp.PGPSecretKey;
|
import org.spongycastle.openpgp.PGPSecretKey;
|
||||||
import org.sufficientlysecure.keychain.Id;
|
import org.sufficientlysecure.keychain.Id;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
@ -26,7 +26,7 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Copied from StickyListHeaders lib example
|
* Copied from StickyListHeaders lib example
|
||||||
*
|
*
|
||||||
* @author Eric Frohnhoefer
|
* @author Eric Frohnhoefer
|
||||||
*/
|
*/
|
||||||
public class UnderlineTextView extends TextView {
|
public class UnderlineTextView extends TextView {
|
||||||
|
@ -16,21 +16,19 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.widget;
|
package org.sufficientlysecure.keychain.ui.widget;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import android.widget.*;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.*;
|
||||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||||
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class UserIdEditor extends LinearLayout implements Editor, OnClickListener {
|
public class UserIdEditor extends LinearLayout implements Editor, OnClickListener {
|
||||||
private EditorListener mEditorListener = null;
|
private EditorListener mEditorListener = null;
|
||||||
|
|
||||||
@ -109,7 +107,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
|||||||
mEmail.setAdapter(
|
mEmail.setAdapter(
|
||||||
new ArrayAdapter<String>
|
new ArrayAdapter<String>
|
||||||
(this.getContext(), android.R.layout.simple_dropdown_item_1line,
|
(this.getContext(), android.R.layout.simple_dropdown_item_1line,
|
||||||
ContactHelper.getMailAccounts(getContext())
|
ContactHelper.getMailAccounts(getContext())
|
||||||
));
|
));
|
||||||
|
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
|
Loading…
Reference in New Issue
Block a user