Edit key: subkey adding, not finished
This commit is contained in:
@@ -57,6 +57,7 @@ import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter;
|
|||||||
import org.sufficientlysecure.keychain.ui.adapter.SubkeysAddedAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.SubkeysAddedAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAddedAdapter;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.ChangeExpiryDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.ChangeExpiryDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.EditSubkeyDialogFragment;
|
||||||
@@ -65,7 +66,6 @@ import org.sufficientlysecure.keychain.ui.dialog.PassphraseDialogFragment;
|
|||||||
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class EditKeyFragment extends LoaderFragment implements
|
public class EditKeyFragment extends LoaderFragment implements
|
||||||
@@ -453,8 +453,21 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addSubkey() {
|
private void addSubkey() {
|
||||||
// default values
|
boolean willBeMasterKey = mSubkeysAdapter.getCount() == 0
|
||||||
mSubkeysAddedAdapter.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
|
&& mSubkeysAddedAdapter.getCount() == 0;
|
||||||
|
|
||||||
|
AddSubkeyDialogFragment addSubkeyDialogFragment =
|
||||||
|
AddSubkeyDialogFragment.newInstance(willBeMasterKey);
|
||||||
|
addSubkeyDialogFragment
|
||||||
|
.setOnAlgorithmSelectedListener(
|
||||||
|
new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onAlgorithmSelected(SaveKeyringParcel.SubkeyAdd newSubkey) {
|
||||||
|
mSubkeysAddedAdapter.add(new SaveKeyringParcel.SubkeyAdd(Constants.choice.algorithm.rsa, 4096, KeyFlags.SIGN_DATA, null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
addSubkeyDialogFragment.show(getActivity().getSupportFragmentManager(), "addSubkeyDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cachePassphraseForEdit() {
|
private void cachePassphraseForEdit() {
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ public class ImportKeysAdapter extends ArrayAdapter<ImportKeysListEntry> {
|
|||||||
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);
|
||||||
holder.mainUserIdRest = (TextView) convertView.findViewById(R.id.mainUserIdRest);
|
holder.mainUserIdRest = (TextView) convertView.findViewById(R.id.mainUserIdRest);
|
||||||
holder.keyId = (TextView) convertView.findViewById(R.id.keyId);
|
holder.keyId = (TextView) convertView.findViewById(R.id.subkey_item_key_id);
|
||||||
holder.fingerprint = (TextView) convertView.findViewById(R.id.view_key_fingerprint);
|
holder.fingerprint = (TextView) convertView.findViewById(R.id.view_key_fingerprint);
|
||||||
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);
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ abstract public class SelectKeyCursorAdapter extends CursorAdapter {
|
|||||||
holder.view = view;
|
holder.view = view;
|
||||||
holder.mainUserId = (TextView) view.findViewById(R.id.mainUserId);
|
holder.mainUserId = (TextView) view.findViewById(R.id.mainUserId);
|
||||||
holder.mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
holder.mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest);
|
||||||
holder.keyId = (TextView) view.findViewById(R.id.keyId);
|
holder.keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
|
||||||
holder.status = (TextView) view.findViewById(R.id.status);
|
holder.status = (TextView) view.findViewById(R.id.status);
|
||||||
holder.selected = (CheckBox) view.findViewById(R.id.selected);
|
holder.selected = (CheckBox) view.findViewById(R.id.selected);
|
||||||
view.setTag(holder);
|
view.setTag(holder);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.adapter;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.ColorStateList;
|
import android.content.res.ColorStateList;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -106,15 +107,18 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindView(View view, Context context, Cursor cursor) {
|
public void bindView(View view, Context context, Cursor cursor) {
|
||||||
TextView vKeyId = (TextView) view.findViewById(R.id.keyId);
|
TextView vKeyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
|
||||||
TextView vKeyDetails = (TextView) view.findViewById(R.id.keyDetails);
|
TextView vKeyDetails = (TextView) view.findViewById(R.id.subkey_item_details);
|
||||||
TextView vKeyExpiry = (TextView) view.findViewById(R.id.keyExpiry);
|
TextView vKeyExpiry = (TextView) view.findViewById(R.id.subkey_item_expiry);
|
||||||
ImageView vMasterKeyIcon = (ImageView) view.findViewById(R.id.ic_masterKey);
|
ImageView vCertifyIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_certify);
|
||||||
ImageView vCertifyIcon = (ImageView) view.findViewById(R.id.ic_certifyKey);
|
ImageView vEncryptIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_encrypt);
|
||||||
ImageView vEncryptIcon = (ImageView) view.findViewById(R.id.ic_encryptKey);
|
ImageView vSignIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_sign);
|
||||||
ImageView vSignIcon = (ImageView) view.findViewById(R.id.ic_signKey);
|
ImageView vRevokedIcon = (ImageView) view.findViewById(R.id.subkey_item_ic_revoked);
|
||||||
ImageView vRevokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey);
|
ImageView vEditImage = (ImageView) view.findViewById(R.id.subkey_item_edit_image);
|
||||||
ImageView vEditImage = (ImageView) view.findViewById(R.id.user_id_item_edit_image);
|
|
||||||
|
// not used:
|
||||||
|
ImageView deleteImage = (ImageView) view.findViewById(R.id.subkey_item_delete_button);
|
||||||
|
deleteImage.setVisibility(View.GONE);
|
||||||
|
|
||||||
long keyId = cursor.getLong(INDEX_KEY_ID);
|
long keyId = cursor.getLong(INDEX_KEY_ID);
|
||||||
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(keyId);
|
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(keyId);
|
||||||
@@ -133,8 +137,14 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
vKeyDetails.setText(algorithmStr);
|
vKeyDetails.setText(algorithmStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean isMasterKey = cursor.getInt(INDEX_RANK) == 0;
|
||||||
|
if (isMasterKey) {
|
||||||
|
vKeyId.setTypeface(null, Typeface.BOLD);
|
||||||
|
} else {
|
||||||
|
vKeyId.setTypeface(null, Typeface.NORMAL);
|
||||||
|
}
|
||||||
|
|
||||||
// Set icons according to properties
|
// Set icons according to properties
|
||||||
vMasterKeyIcon.setVisibility(cursor.getInt(INDEX_RANK) == 0 ? View.VISIBLE : View.INVISIBLE);
|
|
||||||
vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
|
vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
|
||||||
vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
|
vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
|
||||||
vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
|
vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
|
||||||
@@ -157,13 +167,13 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isRevoked) {
|
if (isRevoked) {
|
||||||
vRevokedKeyIcon.setVisibility(View.VISIBLE);
|
vRevokedIcon.setVisibility(View.VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
vKeyId.setTextColor(mDefaultTextColor);
|
vKeyId.setTextColor(mDefaultTextColor);
|
||||||
vKeyDetails.setTextColor(mDefaultTextColor);
|
vKeyDetails.setTextColor(mDefaultTextColor);
|
||||||
vKeyExpiry.setTextColor(mDefaultTextColor);
|
vKeyExpiry.setTextColor(mDefaultTextColor);
|
||||||
|
|
||||||
vRevokedKeyIcon.setVisibility(View.GONE);
|
vRevokedIcon.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isExpired;
|
boolean isExpired;
|
||||||
@@ -195,7 +205,7 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
public View newView(Context context, Cursor cursor, ViewGroup parent) {
|
||||||
View view = mInflater.inflate(R.layout.view_key_subkey_item, null);
|
View view = mInflater.inflate(R.layout.view_key_subkey_item, null);
|
||||||
if (mDefaultTextColor == null) {
|
if (mDefaultTextColor == null) {
|
||||||
TextView keyId = (TextView) view.findViewById(R.id.keyId);
|
TextView keyId = (TextView) view.findViewById(R.id.subkey_item_key_id);
|
||||||
mDefaultTextColor = keyId.getTextColors();
|
mDefaultTextColor = keyId.getTextColors();
|
||||||
}
|
}
|
||||||
return view;
|
return view;
|
||||||
|
|||||||
@@ -17,48 +17,28 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.adapter;
|
package org.sufficientlysecure.keychain.ui.adapter;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.text.format.DateFormat;
|
||||||
import android.os.Build;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.util.Patterns;
|
|
||||||
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.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.Spinner;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.helper.ContactHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
|
||||||
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment;
|
|
||||||
import org.sufficientlysecure.keychain.util.Choice;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.Date;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
|
|
||||||
public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAdd> {
|
public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAdd> {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
public interface OnAlgorithmSelectedListener {
|
|
||||||
public void onAlgorithmSelected(Choice algorithmChoice, int keySize);
|
|
||||||
}
|
|
||||||
|
|
||||||
// hold a private reference to the underlying data List
|
// hold a private reference to the underlying data List
|
||||||
private List<SaveKeyringParcel.SubkeyAdd> mData;
|
private List<SaveKeyringParcel.SubkeyAdd> mData;
|
||||||
|
|
||||||
@@ -70,12 +50,13 @@ public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAd
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder {
|
static class ViewHolder {
|
||||||
public OnAlgorithmSelectedListener mAlgorithmSelectedListener;
|
public TextView vKeyId;
|
||||||
public Spinner mAlgorithmSpinner;
|
public TextView vKeyDetails;
|
||||||
public Spinner mKeySizeSpinner;
|
public TextView vKeyExpiry;
|
||||||
public TextView mCustomKeyTextView;
|
public ImageView vCertifyIcon;
|
||||||
public EditText mCustomKeyEditText;
|
public ImageView vEncryptIcon;
|
||||||
public TextView mCustomKeyInfoTextView;
|
public ImageView vSignIcon;
|
||||||
|
public ImageView vRevokedIcon;
|
||||||
public ImageButton vDelete;
|
public ImageButton vDelete;
|
||||||
// also hold a reference to the model item
|
// also hold a reference to the model item
|
||||||
public SaveKeyringParcel.SubkeyAdd mModel;
|
public SaveKeyringParcel.SubkeyAdd mModel;
|
||||||
@@ -84,44 +65,24 @@ public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAd
|
|||||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
// Not recycled, inflate a new view
|
// Not recycled, inflate a new view
|
||||||
convertView = mInflater.inflate(R.layout.edit_key_subkey_added_item, null);
|
convertView = mInflater.inflate(R.layout.view_key_subkey_item, null);
|
||||||
final ViewHolder holder = new ViewHolder();
|
final ViewHolder holder = new ViewHolder();
|
||||||
holder.mAlgorithmSpinner = (Spinner) convertView.findViewById(R.id.create_key_algorithm);
|
holder.vKeyId = (TextView) convertView.findViewById(R.id.subkey_item_key_id);
|
||||||
holder.mKeySizeSpinner = (Spinner) convertView.findViewById(R.id.create_key_size);
|
holder.vKeyDetails = (TextView) convertView.findViewById(R.id.subkey_item_details);
|
||||||
holder.mCustomKeyTextView = (TextView) convertView.findViewById(R.id.custom_key_size_label);
|
holder.vKeyExpiry = (TextView) convertView.findViewById(R.id.subkey_item_expiry);
|
||||||
holder.mCustomKeyEditText = (EditText) convertView.findViewById(R.id.custom_key_size_input);
|
holder.vCertifyIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_certify);
|
||||||
holder.mCustomKeyInfoTextView = (TextView) convertView.findViewById(R.id.custom_key_size_info);
|
holder.vEncryptIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_encrypt);
|
||||||
holder.vDelete = (ImageButton) convertView.findViewById(R.id.subkey_added_item_delete);
|
holder.vSignIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_sign);
|
||||||
|
holder.vRevokedIcon = (ImageView) convertView.findViewById(R.id.subkey_item_ic_revoked);
|
||||||
|
holder.vDelete = (ImageButton) convertView.findViewById(R.id.subkey_item_delete_button);
|
||||||
|
holder.vDelete.setVisibility(View.VISIBLE); // always visible
|
||||||
|
|
||||||
|
// not used:
|
||||||
|
ImageView editImage = (ImageView) convertView.findViewById(R.id.subkey_item_edit_image);
|
||||||
|
editImage.setVisibility(View.GONE);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
|
|
||||||
holder.mAlgorithmSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
Choice newKeyAlgorithmChoice = (Choice) holder.mAlgorithmSpinner.getSelectedItem();
|
|
||||||
// update referenced model item
|
|
||||||
holder.mModel.mAlgorithm = newKeyAlgorithmChoice.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
Choice newKeyAlgorithmChoice = (Choice) holder.mAlgorithmSpinner.getSelectedItem();
|
|
||||||
int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(),
|
|
||||||
getSelectedKeyLength(holder.mKeySizeSpinner, holder.mCustomKeyEditText));
|
|
||||||
// update referenced model item
|
|
||||||
holder.mModel.mKeysize = newKeySize;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.vDelete.setOnClickListener(new View.OnClickListener() {
|
holder.vDelete.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -136,83 +97,30 @@ public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAd
|
|||||||
// save reference to model item
|
// save reference to model item
|
||||||
holder.mModel = getItem(position);
|
holder.mModel = getItem(position);
|
||||||
|
|
||||||
// TODO
|
String algorithmStr = PgpKeyHelper.getAlgorithmInfo(
|
||||||
boolean wouldBeMasterKey = false;
|
mActivity,
|
||||||
// boolean wouldBeMasterKey = (childCount == 0);
|
holder.mModel.mAlgorithm,
|
||||||
|
holder.mModel.mKeysize
|
||||||
|
);
|
||||||
|
holder.vKeyId.setText("new");
|
||||||
|
holder.vKeyDetails.setText(algorithmStr);
|
||||||
|
|
||||||
ArrayList<Choice> choices = new ArrayList<Choice>();
|
// Set icons according to properties
|
||||||
choices.add(new Choice(Constants.choice.algorithm.dsa, mActivity.getResources().getString(
|
// holder.vMasterIcon.setVisibility(cursor.getInt(INDEX_RANK) == 0 ? View.VISIBLE : View.INVISIBLE);
|
||||||
R.string.dsa)));
|
// holder.vCertifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
|
||||||
if (!wouldBeMasterKey) {
|
// holder.vEncryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
|
||||||
choices.add(new Choice(Constants.choice.algorithm.elgamal, mActivity.getResources().getString(
|
// holder.vSignIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
|
||||||
R.string.elgamal)));
|
// if (!cursor.isNull(INDEX_EXPIRY)) {
|
||||||
}
|
// Date expiryDate = new Date(cursor.getLong(INDEX_EXPIRY) * 1000);
|
||||||
|
// isExpired = expiryDate.before(new Date());
|
||||||
choices.add(new Choice(Constants.choice.algorithm.rsa, mActivity.getResources().getString(
|
//
|
||||||
R.string.rsa)));
|
// holder.vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": "
|
||||||
|
// + DateFormat.getDateFormat(context).format(expiryDate));
|
||||||
ArrayAdapter<Choice> adapter = new ArrayAdapter<Choice>(mActivity,
|
// } else {
|
||||||
android.R.layout.simple_spinner_item, choices);
|
// isExpired = false;
|
||||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
//
|
||||||
holder.mAlgorithmSpinner.setAdapter(adapter);
|
// holder.vKeyExpiry.setText(context.getString(R.string.label_expiry) + ": " + context.getString(R.string.none));
|
||||||
// make RSA the default
|
// }
|
||||||
for (int i = 0; i < choices.size(); ++i) {
|
|
||||||
if (choices.get(i).getId() == Constants.choice.algorithm.rsa) {
|
|
||||||
holder.mAlgorithmSpinner.setSelection(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// dynamic ArrayAdapter must be created (instead of ArrayAdapter.getFromResource), because it's content may change
|
|
||||||
ArrayAdapter<CharSequence> keySizeAdapter = new ArrayAdapter<CharSequence>(mActivity, android.R.layout.simple_spinner_item,
|
|
||||||
new ArrayList<CharSequence>(Arrays.asList(mActivity.getResources().getStringArray(R.array.rsa_key_size_spinner_values))));
|
|
||||||
keySizeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
|
||||||
holder.mKeySizeSpinner.setAdapter(keySizeAdapter);
|
|
||||||
holder.mKeySizeSpinner.setSelection(1); // Default to 4096 for the key length
|
|
||||||
|
|
||||||
holder.mCustomKeyEditText.addTextChangedListener(new TextWatcher() {
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
// setOkButtonAvailability(alertDialog);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.mKeySizeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
setCustomKeyVisibility(holder.mKeySizeSpinner, holder.mCustomKeyEditText,
|
|
||||||
holder.mCustomKeyTextView, holder.mCustomKeyInfoTextView);
|
|
||||||
// setOkButtonAvailability(alertDialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.mAlgorithmSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
|
||||||
@Override
|
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
|
||||||
setKeyLengthSpinnerValuesForAlgorithm(((Choice) parent.getSelectedItem()).getId(),
|
|
||||||
holder.mKeySizeSpinner, holder.mCustomKeyInfoTextView);
|
|
||||||
|
|
||||||
setCustomKeyVisibility(holder.mKeySizeSpinner, holder.mCustomKeyEditText,
|
|
||||||
holder.mCustomKeyTextView, holder.mCustomKeyInfoTextView);
|
|
||||||
// setOkButtonAvailability(alertDialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNothingSelected(AdapterView<?> parent) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//
|
//
|
||||||
// holder.vAddress.setText(holder.mModel.address);
|
// holder.vAddress.setText(holder.mModel.address);
|
||||||
// holder.vAddress.setThreshold(1); // Start working from first character
|
// holder.vAddress.setThreshold(1); // Start working from first character
|
||||||
@@ -227,135 +135,4 @@ public class SubkeysAddedAdapter extends ArrayAdapter<SaveKeyringParcel.SubkeyAd
|
|||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int getSelectedKeyLength(Spinner keySizeSpinner, EditText customKeyEditText) {
|
|
||||||
final String selectedItemString = (String) keySizeSpinner.getSelectedItem();
|
|
||||||
final String customLengthString = mActivity.getResources().getString(R.string.key_size_custom);
|
|
||||||
final boolean customSelected = customLengthString.equals(selectedItemString);
|
|
||||||
String keyLengthString = customSelected ? customKeyEditText.getText().toString() : selectedItemString;
|
|
||||||
int keySize;
|
|
||||||
try {
|
|
||||||
keySize = Integer.parseInt(keyLengthString);
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
keySize = 0;
|
|
||||||
}
|
|
||||||
return keySize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <h3>RSA</h3>
|
|
||||||
* <p>for RSA algorithm, key length must be greater than 1024 (according to
|
|
||||||
* <a href="https://github.com/open-keychain/open-keychain/issues/102">#102</a>). Possibility to generate keys bigger
|
|
||||||
* than 8192 bits is currently disabled, because it's almost impossible to generate them on a mobile device (check
|
|
||||||
* <a href="http://www.javamex.com/tutorials/cryptography/rsa_key_length.shtml">RSA key length plot</a> and
|
|
||||||
* <a href="http://www.keylength.com/">Cryptographic Key Length Recommendation</a>). Also, key length must be a
|
|
||||||
* multiplicity of 8.</p>
|
|
||||||
* <h3>ElGamal</h3>
|
|
||||||
* <p>For ElGamal algorithm, supported key lengths are 1536, 2048, 3072, 4096 or 8192 bits.</p>
|
|
||||||
* <h3>DSA</h3>
|
|
||||||
* <p>For DSA algorithm key length must be between 512 and 1024. Also, it must me dividable by 64.</p>
|
|
||||||
*
|
|
||||||
* @return correct key length, according to SpongyCastle specification. Returns <code>-1</code>, if key length is
|
|
||||||
* inappropriate.
|
|
||||||
*/
|
|
||||||
private int getProperKeyLength(int algorithmId, int currentKeyLength) {
|
|
||||||
final int[] elGamalSupportedLengths = {1536, 2048, 3072, 4096, 8192};
|
|
||||||
int properKeyLength = -1;
|
|
||||||
switch (algorithmId) {
|
|
||||||
case Constants.choice.algorithm.rsa:
|
|
||||||
if (currentKeyLength > 1024 && currentKeyLength <= 8192) {
|
|
||||||
properKeyLength = currentKeyLength + ((8 - (currentKeyLength % 8)) % 8);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Constants.choice.algorithm.elgamal:
|
|
||||||
int[] elGammalKeyDiff = new int[elGamalSupportedLengths.length];
|
|
||||||
for (int i = 0; i < elGamalSupportedLengths.length; i++) {
|
|
||||||
elGammalKeyDiff[i] = Math.abs(elGamalSupportedLengths[i] - currentKeyLength);
|
|
||||||
}
|
|
||||||
int minimalValue = Integer.MAX_VALUE;
|
|
||||||
int minimalIndex = -1;
|
|
||||||
for (int i = 0; i < elGammalKeyDiff.length; i++) {
|
|
||||||
if (elGammalKeyDiff[i] <= minimalValue) {
|
|
||||||
minimalValue = elGammalKeyDiff[i];
|
|
||||||
minimalIndex = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
properKeyLength = elGamalSupportedLengths[minimalIndex];
|
|
||||||
break;
|
|
||||||
case Constants.choice.algorithm.dsa:
|
|
||||||
if (currentKeyLength >= 512 && currentKeyLength <= 1024) {
|
|
||||||
properKeyLength = currentKeyLength + ((64 - (currentKeyLength % 64)) % 64);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return properKeyLength;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: make this an error message on the field
|
|
||||||
// private boolean setOkButtonAvailability(AlertDialog alertDialog) {
|
|
||||||
// final Choice selectedAlgorithm = (Choice) mAlgorithmSpinner.getSelectedItem();
|
|
||||||
// final int selectedKeySize = getSelectedKeyLength(); //Integer.parseInt((String) mKeySizeSpinner.getSelectedItem());
|
|
||||||
// final int properKeyLength = getProperKeyLength(selectedAlgorithm.getId(), selectedKeySize);
|
|
||||||
// alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(properKeyLength > 0);
|
|
||||||
// }
|
|
||||||
|
|
||||||
private void setCustomKeyVisibility(Spinner keySizeSpinner, EditText customkeyedittext, TextView customKeyTextView, TextView customKeyInfoTextView) {
|
|
||||||
final String selectedItemString = (String) keySizeSpinner.getSelectedItem();
|
|
||||||
final String customLengthString = mActivity.getResources().getString(R.string.key_size_custom);
|
|
||||||
final boolean customSelected = customLengthString.equals(selectedItemString);
|
|
||||||
final int visibility = customSelected ? View.VISIBLE : View.GONE;
|
|
||||||
|
|
||||||
customkeyedittext.setVisibility(visibility);
|
|
||||||
customKeyTextView.setVisibility(visibility);
|
|
||||||
customKeyInfoTextView.setVisibility(visibility);
|
|
||||||
|
|
||||||
// hide keyboard after setting visibility to gone
|
|
||||||
if (visibility == View.GONE) {
|
|
||||||
InputMethodManager imm = (InputMethodManager)
|
|
||||||
mActivity.getSystemService(mActivity.INPUT_METHOD_SERVICE);
|
|
||||||
imm.hideSoftInputFromWindow(customkeyedittext.getWindowToken(), 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setKeyLengthSpinnerValuesForAlgorithm(int algorithmId, Spinner keySizeSpinner, TextView customKeyInfoTextView) {
|
|
||||||
final ArrayAdapter<CharSequence> keySizeAdapter = (ArrayAdapter<CharSequence>) keySizeSpinner.getAdapter();
|
|
||||||
final Object selectedItem = keySizeSpinner.getSelectedItem();
|
|
||||||
keySizeAdapter.clear();
|
|
||||||
switch (algorithmId) {
|
|
||||||
case Constants.choice.algorithm.rsa:
|
|
||||||
replaceArrayAdapterContent(keySizeAdapter, R.array.rsa_key_size_spinner_values);
|
|
||||||
customKeyInfoTextView.setText(mActivity.getResources().getString(R.string.key_size_custom_info_rsa));
|
|
||||||
break;
|
|
||||||
case Constants.choice.algorithm.elgamal:
|
|
||||||
replaceArrayAdapterContent(keySizeAdapter, R.array.elgamal_key_size_spinner_values);
|
|
||||||
customKeyInfoTextView.setText(""); // ElGamal does not support custom key length
|
|
||||||
break;
|
|
||||||
case Constants.choice.algorithm.dsa:
|
|
||||||
replaceArrayAdapterContent(keySizeAdapter, R.array.dsa_key_size_spinner_values);
|
|
||||||
customKeyInfoTextView.setText(mActivity.getResources().getString(R.string.key_size_custom_info_dsa));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
keySizeAdapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
// when switching algorithm, try to select same key length as before
|
|
||||||
for (int i = 0; i < keySizeAdapter.getCount(); i++) {
|
|
||||||
if (selectedItem.equals(keySizeAdapter.getItem(i))) {
|
|
||||||
keySizeSpinner.setSelection(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
|
||||||
private void replaceArrayAdapterContent(ArrayAdapter<CharSequence> arrayAdapter, int stringArrayResourceId) {
|
|
||||||
final String[] spinnerValuesStringArray = mActivity.getResources().getStringArray(stringArrayResourceId);
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
||||||
arrayAdapter.addAll(spinnerValuesStringArray);
|
|
||||||
} else {
|
|
||||||
for (final String value : spinnerValuesStringArray) {
|
|
||||||
arrayAdapter.add(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,20 +36,22 @@ import android.widget.EditText;
|
|||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import org.spongycastle.bcpg.sig.KeyFlags;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
import org.sufficientlysecure.keychain.Constants;
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
|
import org.sufficientlysecure.keychain.service.SaveKeyringParcel;
|
||||||
import org.sufficientlysecure.keychain.util.Choice;
|
import org.sufficientlysecure.keychain.util.Choice;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class CreateKeyDialogFragment extends DialogFragment {
|
public class AddSubkeyDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
public interface OnAlgorithmSelectedListener {
|
public interface OnAlgorithmSelectedListener {
|
||||||
public void onAlgorithmSelected(Choice algorithmChoice, int keySize);
|
public void onAlgorithmSelected(SaveKeyringParcel.SubkeyAdd newSubkey);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String ARG_EDITOR_CHILD_COUNT = "child_count";
|
private static final String ARG_WILL_BE_MASTER_KEY = "will_be_master_key";
|
||||||
|
|
||||||
private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
|
private OnAlgorithmSelectedListener mAlgorithmSelectedListener;
|
||||||
private Spinner mAlgorithmSpinner;
|
private Spinner mAlgorithmSpinner;
|
||||||
@@ -62,11 +64,11 @@ public class CreateKeyDialogFragment extends DialogFragment {
|
|||||||
mAlgorithmSelectedListener = listener;
|
mAlgorithmSelectedListener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CreateKeyDialogFragment newInstance(int mEditorChildCount) {
|
public static AddSubkeyDialogFragment newInstance(boolean willBeMasterKey) {
|
||||||
CreateKeyDialogFragment frag = new CreateKeyDialogFragment();
|
AddSubkeyDialogFragment frag = new AddSubkeyDialogFragment();
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
|
|
||||||
args.putInt(ARG_EDITOR_CHILD_COUNT, mEditorChildCount);
|
args.putBoolean(ARG_WILL_BE_MASTER_KEY, willBeMasterKey);
|
||||||
|
|
||||||
frag.setArguments(args);
|
frag.setArguments(args);
|
||||||
|
|
||||||
@@ -78,7 +80,7 @@ public class CreateKeyDialogFragment extends DialogFragment {
|
|||||||
final FragmentActivity context = getActivity();
|
final FragmentActivity context = getActivity();
|
||||||
final LayoutInflater mInflater;
|
final LayoutInflater mInflater;
|
||||||
|
|
||||||
final int childCount = getArguments().getInt(ARG_EDITOR_CHILD_COUNT);
|
final boolean willBeMasterKey = getArguments().getBoolean(ARG_WILL_BE_MASTER_KEY);
|
||||||
mInflater = context.getLayoutInflater();
|
mInflater = context.getLayoutInflater();
|
||||||
|
|
||||||
CustomAlertDialogBuilder dialog = new CustomAlertDialogBuilder(context);
|
CustomAlertDialogBuilder dialog = new CustomAlertDialogBuilder(context);
|
||||||
@@ -87,13 +89,11 @@ public class CreateKeyDialogFragment extends DialogFragment {
|
|||||||
dialog.setView(view);
|
dialog.setView(view);
|
||||||
dialog.setTitle(R.string.title_create_key);
|
dialog.setTitle(R.string.title_create_key);
|
||||||
|
|
||||||
boolean wouldBeMasterKey = (childCount == 0);
|
|
||||||
|
|
||||||
mAlgorithmSpinner = (Spinner) view.findViewById(R.id.create_key_algorithm);
|
mAlgorithmSpinner = (Spinner) view.findViewById(R.id.create_key_algorithm);
|
||||||
ArrayList<Choice> choices = new ArrayList<Choice>();
|
ArrayList<Choice> choices = new ArrayList<Choice>();
|
||||||
choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
|
choices.add(new Choice(Constants.choice.algorithm.dsa, getResources().getString(
|
||||||
R.string.dsa)));
|
R.string.dsa)));
|
||||||
if (!wouldBeMasterKey) {
|
if (!willBeMasterKey) {
|
||||||
choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
|
choices.add(new Choice(Constants.choice.algorithm.elgamal, getResources().getString(
|
||||||
R.string.elgamal)));
|
R.string.elgamal)));
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,13 @@ public class CreateKeyDialogFragment extends DialogFragment {
|
|||||||
di.dismiss();
|
di.dismiss();
|
||||||
Choice newKeyAlgorithmChoice = (Choice) mAlgorithmSpinner.getSelectedItem();
|
Choice newKeyAlgorithmChoice = (Choice) mAlgorithmSpinner.getSelectedItem();
|
||||||
int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(), getSelectedKeyLength());
|
int newKeySize = getProperKeyLength(newKeyAlgorithmChoice.getId(), getSelectedKeyLength());
|
||||||
mAlgorithmSelectedListener.onAlgorithmSelected(newKeyAlgorithmChoice, newKeySize);
|
SaveKeyringParcel.SubkeyAdd newSubkey = new SaveKeyringParcel.SubkeyAdd(
|
||||||
|
newKeyAlgorithmChoice.getId(),
|
||||||
|
newKeySize,
|
||||||
|
KeyFlags.SIGN_DATA, //TODO
|
||||||
|
null
|
||||||
|
);
|
||||||
|
mAlgorithmSelectedListener.onAlgorithmSelected(newSubkey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -120,7 +120,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
|||||||
setAlwaysDrawnWithCacheEnabled(true);
|
setAlwaysDrawnWithCacheEnabled(true);
|
||||||
|
|
||||||
mAlgorithm = (TextView) findViewById(R.id.algorithm);
|
mAlgorithm = (TextView) findViewById(R.id.algorithm);
|
||||||
mKeyId = (TextView) findViewById(R.id.keyId);
|
mKeyId = (TextView) findViewById(R.id.subkey_item_key_id);
|
||||||
mCreationDate = (TextView) findViewById(R.id.creation);
|
mCreationDate = (TextView) findViewById(R.id.creation);
|
||||||
mExpiryDateButton = (Button) findViewById(R.id.expiry);
|
mExpiryDateButton = (Button) findViewById(R.id.expiry);
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,7 @@
|
|||||||
|
|
||||||
package org.sufficientlysecure.keychain.ui.widget;
|
package org.sufficientlysecure.keychain.ui.widget;
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Message;
|
|
||||||
import android.os.Messenger;
|
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -36,10 +30,8 @@ import android.widget.ImageButton;
|
|||||||
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
|
import org.sufficientlysecure.keychain.pgp.UncachedSecretKey;
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentService;
|
|
||||||
import org.sufficientlysecure.keychain.service.KeychainIntentServiceHandler;
|
|
||||||
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
import org.sufficientlysecure.keychain.service.PassphraseCacheService;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.CreateKeyDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.AddSubkeyDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.ProgressDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
|
import org.sufficientlysecure.keychain.ui.widget.Editor.EditorListener;
|
||||||
import org.sufficientlysecure.keychain.util.Choice;
|
import org.sufficientlysecure.keychain.util.Choice;
|
||||||
@@ -280,19 +272,19 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
|||||||
}
|
}
|
||||||
|
|
||||||
case TYPE_KEY: {
|
case TYPE_KEY: {
|
||||||
CreateKeyDialogFragment mCreateKeyDialogFragment =
|
// AddSubkeyDialogFragment mCreateKeyDialogFragment =
|
||||||
CreateKeyDialogFragment.newInstance(mEditors.getChildCount());
|
// AddSubkeyDialogFragment.newInstance(mEditors.getChildCount());
|
||||||
mCreateKeyDialogFragment
|
// mCreateKeyDialogFragment
|
||||||
.setOnAlgorithmSelectedListener(
|
// .setOnAlgorithmSelectedListener(
|
||||||
new CreateKeyDialogFragment.OnAlgorithmSelectedListener() {
|
// new AddSubkeyDialogFragment.OnAlgorithmSelectedListener() {
|
||||||
@Override
|
// @Override
|
||||||
public void onAlgorithmSelected(Choice algorithmChoice, int keySize) {
|
// public void onAlgorithmSelected(Choice algorithmChoice, int keySize) {
|
||||||
mNewKeyAlgorithmChoice = algorithmChoice;
|
// mNewKeyAlgorithmChoice = algorithmChoice;
|
||||||
mNewKeySize = keySize;
|
// mNewKeySize = keySize;
|
||||||
createKey();
|
// createKey();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog");
|
// mCreateKeyDialogFragment.show(mActivity.getSupportFragmentManager(), "createKeyDialog");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,97 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="16dp"
|
android:paddingLeft="16dp"
|
||||||
android:paddingRight="16dp"
|
android:paddingRight="16dp"
|
||||||
android:stretchColumns="1" >
|
android:stretchColumns="1">
|
||||||
|
|
||||||
|
<TableRow>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_expiry"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dip"
|
||||||
|
android:text="@string/label_expiry" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/expiry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:text="@string/none"
|
||||||
|
android:background="@drawable/button_edgy" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:id="@+id/row_certify">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_usage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dip"
|
||||||
|
android:text="@string/label_usage" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/chkCertify"
|
||||||
|
android:enabled="false"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/flag_certify" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:id="@+id/row_sign">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/label_usage2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dip"
|
||||||
|
android:text="@string/label_usage" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/chkSign"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/flag_sign" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:id="@+id/row_encrypt">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dip" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/chkEncrypt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/flag_encrypt" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:id="@+id/row_authenticate">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dip" />
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/chkAuthenticate"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/flag_authenticate" />
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -17,13 +100,6 @@
|
|||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:text="@string/key_creation_el_gamal_info" />
|
android:text="@string/key_creation_el_gamal_info" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:text="@string/key_creation_weak_rsa_info" />
|
|
||||||
|
|
||||||
<TableRow>
|
<TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -58,28 +134,28 @@
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/custom_key_size_label"
|
android:id="@+id/custom_key_size_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:padding="4dp"
|
android:padding="4dp"
|
||||||
android:text="@string/key_size_custom_info"
|
android:text="@string/key_size_custom_info"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/custom_key_size_input"
|
android:id="@+id/custom_key_size_input"
|
||||||
android:layout_width="0dip"
|
android:layout_width="0dip"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/custom_key_size_info"
|
android:id="@+id/custom_key_size_info"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:padding="4dp" />
|
android:padding="4dp" />
|
||||||
|
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
android:text="@string/label_key_id" />
|
android:text="@string/label_key_id" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyId"
|
android:id="@+id/subkey_item_key_id"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
|
|||||||
@@ -1,179 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="5dp">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:minWidth="10dp"
|
|
||||||
android:background="@color/android_green_light" />
|
|
||||||
|
|
||||||
<TableLayout
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:paddingLeft="8dp"
|
|
||||||
android:stretchColumns="1">
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/label_expiry"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingRight="10dip"
|
|
||||||
android:text="@string/label_expiry" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/expiry"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="40dp"
|
|
||||||
android:text="@string/none"
|
|
||||||
android:background="@drawable/button_edgy" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow
|
|
||||||
android:id="@+id/row_certify">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/label_usage"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingRight="10dip"
|
|
||||||
android:text="@string/label_usage" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkCertify"
|
|
||||||
android:enabled = "false"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/flag_certify" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow
|
|
||||||
android:id="@+id/row_sign">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/label_usage2"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingRight="10dip"
|
|
||||||
android:text="@string/label_usage" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkSign"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/flag_sign" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow
|
|
||||||
android:id="@+id/row_encrypt">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingRight="10dip" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkEncrypt"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/flag_encrypt" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow
|
|
||||||
android:id="@+id/row_authenticate">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:paddingRight="10dip" />
|
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/chkAuthenticate"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/flag_authenticate" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:text="@string/key_creation_el_gamal_info" />
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:text="@string/label_algorithm" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/create_key_algorithm"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:padding="4dp" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:text="@string/label_key_size" />
|
|
||||||
|
|
||||||
<Spinner
|
|
||||||
android:id="@+id/create_key_size"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:gravity="right"
|
|
||||||
android:padding="4dp" />
|
|
||||||
</TableRow>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/custom_key_size_label"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:text="@string/key_size_custom_info"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/custom_key_size_input"
|
|
||||||
android:layout_width="0dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:inputType="number"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/custom_key_size_info"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:padding="4dp"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</TableLayout>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/subkey_added_item_delete"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:src="@drawable/ic_action_cancel"
|
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
style="@style/SelectableItem" />
|
|
||||||
</LinearLayout>
|
|
||||||
@@ -100,7 +100,7 @@
|
|||||||
android:orientation="vertical" />
|
android:orientation="vertical" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyId"
|
android:id="@+id/subkey_item_key_id"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="0xBBBBBBBBBBBBBBBB"
|
android:text="0xBBBBBBBBBBBBBBBB"
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyId"
|
android:id="@+id/subkey_item_key_id"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="0xBBBBBBBBBBBBBBB"
|
android:text="0xBBBBBBBBBBBBBBB"
|
||||||
|
|||||||
@@ -6,36 +6,39 @@
|
|||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:singleLine="true">
|
android:singleLine="true">
|
||||||
|
|
||||||
<ImageView
|
<FrameLayout
|
||||||
android:id="@+id/ic_masterKey"
|
android:id="@+id/subkey_item_buttons"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
|
||||||
android:src="@drawable/key_small"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true" />
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/user_id_item_edit_image"
|
|
||||||
android:src="@drawable/ic_action_edit"
|
|
||||||
android:padding="8dp"
|
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentEnd="true" />
|
android:layout_alignParentEnd="true">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/subkey_item_edit_image"
|
||||||
|
android:src="@drawable/ic_action_edit"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/subkey_item_delete_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:src="@drawable/ic_action_cancel"
|
||||||
|
style="@style/SelectableItem" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_toRightOf="@id/ic_masterKey"
|
android:layout_toLeftOf="@id/subkey_item_buttons"
|
||||||
android:layout_toLeftOf="@id/user_id_item_edit_image"
|
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="8dp"
|
android:layout_marginLeft="8dp"
|
||||||
android:id="@+id/linearLayout">
|
android:layout_marginRight="8dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -46,7 +49,7 @@
|
|||||||
android:paddingTop="2dip">
|
android:paddingTop="2dip">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyId"
|
android:id="@+id/subkey_item_key_id"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="0x00000000"
|
android:text="0x00000000"
|
||||||
@@ -55,7 +58,7 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_certifyKey"
|
android:id="@+id/subkey_item_ic_certify"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/certify_small"
|
android:src="@drawable/certify_small"
|
||||||
@@ -63,7 +66,7 @@
|
|||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_encryptKey"
|
android:id="@+id/subkey_item_ic_encrypt"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/encrypted_small"
|
android:src="@drawable/encrypted_small"
|
||||||
@@ -71,7 +74,7 @@
|
|||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_signKey"
|
android:id="@+id/subkey_item_ic_sign"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/signed_small"
|
android:src="@drawable/signed_small"
|
||||||
@@ -79,7 +82,7 @@
|
|||||||
android:layout_gravity="center_vertical" />
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ic_revokedKey"
|
android:id="@+id/subkey_item_ic_revoked"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/revoked_key_small"
|
android:src="@drawable/revoked_key_small"
|
||||||
@@ -94,7 +97,7 @@
|
|||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyDetails"
|
android:id="@+id/subkey_item_details"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingRight="5dip"
|
android:paddingRight="5dip"
|
||||||
@@ -103,7 +106,7 @@
|
|||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/keyExpiry"
|
android:id="@+id/subkey_item_expiry"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Expiry: 4/7/2016"
|
android:text="Expiry: 4/7/2016"
|
||||||
|
|||||||
Reference in New Issue
Block a user