remove init methods from adapter
This commit is contained in:
@@ -343,6 +343,7 @@ public class KeychainIntentService extends IntentService
|
|||||||
|
|
||||||
setProgress(R.string.progress_done, 100, 100);
|
setProgress(R.string.progress_done, 100, 100);
|
||||||
|
|
||||||
|
// cache new passphrase
|
||||||
if (saveParcel.newPassphrase != null) {
|
if (saveParcel.newPassphrase != null) {
|
||||||
PassphraseCacheService.addCachedPassphrase(this, masterKeyId, saveParcel.newPassphrase);
|
PassphraseCacheService.addCachedPassphrase(this, masterKeyId, saveParcel.newPassphrase);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
public static final String ARG_DATA_URI = "uri";
|
public static final String ARG_DATA_URI = "uri";
|
||||||
|
|
||||||
private ListView mUserIdsList;
|
private ListView mUserIdsList;
|
||||||
private ListView mKeysList;
|
private ListView mSubkeysList;
|
||||||
private ListView mUserIdsAddedList;
|
private ListView mUserIdsAddedList;
|
||||||
private ListView mKeysAddedList;
|
private ListView mKeysAddedList;
|
||||||
private View mChangePassphrase;
|
private View mChangePassphrase;
|
||||||
@@ -76,7 +76,7 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
private static final int LOADER_ID_KEYS = 1;
|
private static final int LOADER_ID_KEYS = 1;
|
||||||
|
|
||||||
private UserIdsAdapter mUserIdsAdapter;
|
private UserIdsAdapter mUserIdsAdapter;
|
||||||
private SubkeysAdapter mKeysAdapter;
|
private SubkeysAdapter mSubkeysAdapter;
|
||||||
private UserIdsAddedAdapter mUserIdsAddedAdapter;
|
private UserIdsAddedAdapter mUserIdsAddedAdapter;
|
||||||
private ArrayList<UserIdsAddedAdapter.UserIdModel> mUserIdsAddedData;
|
private ArrayList<UserIdsAddedAdapter.UserIdModel> mUserIdsAddedData;
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
View view = inflater.inflate(R.layout.edit_key_fragment, getContainer());
|
View view = inflater.inflate(R.layout.edit_key_fragment, getContainer());
|
||||||
|
|
||||||
mUserIdsList = (ListView) view.findViewById(R.id.edit_key_user_ids);
|
mUserIdsList = (ListView) view.findViewById(R.id.edit_key_user_ids);
|
||||||
mKeysList = (ListView) view.findViewById(R.id.edit_key_keys);
|
mSubkeysList = (ListView) view.findViewById(R.id.edit_key_keys);
|
||||||
mUserIdsAddedList = (ListView) view.findViewById(R.id.edit_key_user_ids_added);
|
mUserIdsAddedList = (ListView) view.findViewById(R.id.edit_key_user_ids_added);
|
||||||
mKeysAddedList = (ListView) view.findViewById(R.id.edit_key_keys_added);
|
mKeysAddedList = (ListView) view.findViewById(R.id.edit_key_keys_added);
|
||||||
mChangePassphrase = view.findViewById(R.id.edit_key_action_change_passphrase);
|
mChangePassphrase = view.findViewById(R.id.edit_key_action_change_passphrase);
|
||||||
@@ -191,13 +191,13 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: from savedInstance?!
|
// TODO: mUserIdsAddedData and SaveParcel from savedInstance?!
|
||||||
mUserIdsAddedData = new ArrayList<UserIdsAddedAdapter.UserIdModel>();
|
mUserIdsAddedData = new ArrayList<UserIdsAddedAdapter.UserIdModel>();
|
||||||
mUserIdsAddedAdapter = new UserIdsAddedAdapter(getActivity(), mUserIdsAddedData);
|
mUserIdsAddedAdapter = new UserIdsAddedAdapter(getActivity(), mUserIdsAddedData);
|
||||||
mUserIdsAddedList.setAdapter(mUserIdsAddedAdapter);
|
mUserIdsAddedList.setAdapter(mUserIdsAddedAdapter);
|
||||||
|
|
||||||
mKeysAdapter = new SubkeysAdapter(getActivity(), null, 0);
|
mSubkeysAdapter = new SubkeysAdapter(getActivity(), null, 0);
|
||||||
mKeysList.setAdapter(mKeysAdapter);
|
mSubkeysList.setAdapter(mSubkeysAdapter);
|
||||||
|
|
||||||
// Prepare the loaders. Either re-connect with an existing ones,
|
// Prepare the loaders. Either re-connect with an existing ones,
|
||||||
// or start new ones.
|
// or start new ones.
|
||||||
@@ -235,7 +235,7 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LOADER_ID_KEYS:
|
case LOADER_ID_KEYS:
|
||||||
mKeysAdapter.swapCursor(data);
|
mSubkeysAdapter.swapCursor(data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
mUserIdsAdapter.swapCursor(null);
|
mUserIdsAdapter.swapCursor(null);
|
||||||
break;
|
break;
|
||||||
case LOADER_ID_KEYS:
|
case LOADER_ID_KEYS:
|
||||||
mKeysAdapter.swapCursor(null);
|
mSubkeysAdapter.swapCursor(null);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,22 +38,11 @@ import java.util.Date;
|
|||||||
public class SubkeysAdapter extends CursorAdapter {
|
public class SubkeysAdapter extends CursorAdapter {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
|
|
||||||
private int mIndexKeyId;
|
|
||||||
private int mIndexAlgorithm;
|
|
||||||
private int mIndexKeySize;
|
|
||||||
private int mIndexRank;
|
|
||||||
private int mIndexCanCertify;
|
|
||||||
private int mIndexCanEncrypt;
|
|
||||||
private int mIndexCanSign;
|
|
||||||
private int mIndexHasSecret;
|
|
||||||
private int mIndexRevokedKey;
|
|
||||||
private int mIndexExpiry;
|
|
||||||
|
|
||||||
private boolean hasAnySecret;
|
private boolean hasAnySecret;
|
||||||
|
|
||||||
private ColorStateList mDefaultTextColor;
|
private ColorStateList mDefaultTextColor;
|
||||||
|
|
||||||
public static final String[] KEYS_PROJECTION = new String[] {
|
public static final String[] KEYS_PROJECTION = new String[]{
|
||||||
Keys._ID,
|
Keys._ID,
|
||||||
Keys.KEY_ID,
|
Keys.KEY_ID,
|
||||||
Keys.RANK,
|
Keys.RANK,
|
||||||
@@ -68,24 +57,33 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
Keys.EXPIRY,
|
Keys.EXPIRY,
|
||||||
Keys.FINGERPRINT
|
Keys.FINGERPRINT
|
||||||
};
|
};
|
||||||
|
private static final int INDEX_ID = 0;
|
||||||
|
private static final int INDEX_KEY_ID = 1;
|
||||||
|
private static final int INDEX_RANK = 2;
|
||||||
|
private static final int INDEX_ALGORITHM = 3;
|
||||||
|
private static final int INDEX_KEY_SIZE = 4;
|
||||||
|
private static final int INDEX_HAS_SECRET = 5;
|
||||||
|
private static final int INDEX_CAN_CERTIFY = 6;
|
||||||
|
private static final int INDEX_CAN_ENCRYPT = 7;
|
||||||
|
private static final int INDEX_CAN_SIGN = 8;
|
||||||
|
private static final int INDEX_IS_REVOKED = 9;
|
||||||
|
private static final int INDEX_CREATION = 10;
|
||||||
|
private static final int INDEX_EXPIRY = 11;
|
||||||
|
private static final int INDEX_FINGERPRINT = 12;
|
||||||
|
|
||||||
public SubkeysAdapter(Context context, Cursor c, int flags) {
|
public SubkeysAdapter(Context context, Cursor c, int flags) {
|
||||||
super(context, c, flags);
|
super(context, c, flags);
|
||||||
|
|
||||||
mInflater = LayoutInflater.from(context);
|
mInflater = LayoutInflater.from(context);
|
||||||
|
|
||||||
initIndex(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor swapCursor(Cursor newCursor) {
|
public Cursor swapCursor(Cursor newCursor) {
|
||||||
initIndex(newCursor);
|
|
||||||
|
|
||||||
hasAnySecret = false;
|
hasAnySecret = false;
|
||||||
if (newCursor != null) {
|
if (newCursor != null) {
|
||||||
newCursor.moveToFirst();
|
newCursor.moveToFirst();
|
||||||
do {
|
do {
|
||||||
if (newCursor.getInt(mIndexHasSecret) != 0) {
|
if (newCursor.getInt(INDEX_HAS_SECRET) != 0) {
|
||||||
hasAnySecret = true;
|
hasAnySecret = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -95,27 +93,6 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
return super.swapCursor(newCursor);
|
return super.swapCursor(newCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
|
||||||
* performance comparison see http://stackoverflow.com/a/17999582
|
|
||||||
*
|
|
||||||
* @param cursor
|
|
||||||
*/
|
|
||||||
private void initIndex(Cursor cursor) {
|
|
||||||
if (cursor != null) {
|
|
||||||
mIndexKeyId = cursor.getColumnIndexOrThrow(Keys.KEY_ID);
|
|
||||||
mIndexAlgorithm = cursor.getColumnIndexOrThrow(Keys.ALGORITHM);
|
|
||||||
mIndexKeySize = cursor.getColumnIndexOrThrow(Keys.KEY_SIZE);
|
|
||||||
mIndexRank = cursor.getColumnIndexOrThrow(Keys.RANK);
|
|
||||||
mIndexCanCertify = cursor.getColumnIndexOrThrow(Keys.CAN_CERTIFY);
|
|
||||||
mIndexCanEncrypt = cursor.getColumnIndexOrThrow(Keys.CAN_ENCRYPT);
|
|
||||||
mIndexCanSign = cursor.getColumnIndexOrThrow(Keys.CAN_SIGN);
|
|
||||||
mIndexHasSecret = cursor.getColumnIndexOrThrow(Keys.HAS_SECRET);
|
|
||||||
mIndexRevokedKey = cursor.getColumnIndexOrThrow(Keys.IS_REVOKED);
|
|
||||||
mIndexExpiry = cursor.getColumnIndexOrThrow(Keys.EXPIRY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindView(View view, Context context, Cursor cursor) {
|
public void bindView(View view, Context context, Cursor cursor) {
|
||||||
TextView keyId = (TextView) view.findViewById(R.id.keyId);
|
TextView keyId = (TextView) view.findViewById(R.id.keyId);
|
||||||
@@ -127,16 +104,16 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey);
|
ImageView signIcon = (ImageView) view.findViewById(R.id.ic_signKey);
|
||||||
ImageView revokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey);
|
ImageView revokedKeyIcon = (ImageView) view.findViewById(R.id.ic_revokedKey);
|
||||||
|
|
||||||
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(cursor.getLong(mIndexKeyId));
|
String keyIdStr = PgpKeyHelper.convertKeyIdToHex(cursor.getLong(INDEX_KEY_ID));
|
||||||
String algorithmStr = PgpKeyHelper.getAlgorithmInfo(
|
String algorithmStr = PgpKeyHelper.getAlgorithmInfo(
|
||||||
context,
|
context,
|
||||||
cursor.getInt(mIndexAlgorithm),
|
cursor.getInt(INDEX_ALGORITHM),
|
||||||
cursor.getInt(mIndexKeySize)
|
cursor.getInt(INDEX_KEY_SIZE)
|
||||||
);
|
);
|
||||||
|
|
||||||
keyId.setText(keyIdStr);
|
keyId.setText(keyIdStr);
|
||||||
// may be set with additional "stripped" later on
|
// may be set with additional "stripped" later on
|
||||||
if (hasAnySecret && cursor.getInt(mIndexHasSecret) == 0) {
|
if (hasAnySecret && cursor.getInt(INDEX_HAS_SECRET) == 0) {
|
||||||
keyDetails.setText(algorithmStr + ", " +
|
keyDetails.setText(algorithmStr + ", " +
|
||||||
context.getString(R.string.key_stripped));
|
context.getString(R.string.key_stripped));
|
||||||
} else {
|
} else {
|
||||||
@@ -144,13 +121,13 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set icons according to properties
|
// Set icons according to properties
|
||||||
masterKeyIcon.setVisibility(cursor.getInt(mIndexRank) == 0 ? View.VISIBLE : View.INVISIBLE);
|
masterKeyIcon.setVisibility(cursor.getInt(INDEX_RANK) == 0 ? View.VISIBLE : View.INVISIBLE);
|
||||||
certifyIcon.setVisibility(cursor.getInt(mIndexCanCertify) != 0 ? View.VISIBLE : View.GONE);
|
certifyIcon.setVisibility(cursor.getInt(INDEX_CAN_CERTIFY) != 0 ? View.VISIBLE : View.GONE);
|
||||||
encryptIcon.setVisibility(cursor.getInt(mIndexCanEncrypt) != 0 ? View.VISIBLE : View.GONE);
|
encryptIcon.setVisibility(cursor.getInt(INDEX_CAN_ENCRYPT) != 0 ? View.VISIBLE : View.GONE);
|
||||||
signIcon.setVisibility(cursor.getInt(mIndexCanSign) != 0 ? View.VISIBLE : View.GONE);
|
signIcon.setVisibility(cursor.getInt(INDEX_CAN_SIGN) != 0 ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
boolean valid = true;
|
boolean valid = true;
|
||||||
if (cursor.getInt(mIndexRevokedKey) > 0) {
|
if (cursor.getInt(INDEX_IS_REVOKED) > 0) {
|
||||||
revokedKeyIcon.setVisibility(View.VISIBLE);
|
revokedKeyIcon.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
valid = false;
|
valid = false;
|
||||||
@@ -162,17 +139,19 @@ public class SubkeysAdapter extends CursorAdapter {
|
|||||||
revokedKeyIcon.setVisibility(View.GONE);
|
revokedKeyIcon.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cursor.isNull(mIndexExpiry)) {
|
if (!cursor.isNull(INDEX_EXPIRY)) {
|
||||||
Date expiryDate = new Date(cursor.getLong(mIndexExpiry) * 1000);
|
Date expiryDate = new Date(cursor.getLong(INDEX_EXPIRY) * 1000);
|
||||||
|
|
||||||
valid = valid && expiryDate.after(new Date());
|
valid = valid && expiryDate.after(new Date());
|
||||||
keyExpiry.setText(
|
keyExpiry.setText(
|
||||||
context.getString(R.string.label_expiry) + ": " +
|
context.getString(R.string.label_expiry) + ": " +
|
||||||
DateFormat.getDateFormat(context).format(expiryDate));
|
DateFormat.getDateFormat(context).format(expiryDate)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
keyExpiry.setText(
|
keyExpiry.setText(
|
||||||
context.getString(R.string.label_expiry) + ": " +
|
context.getString(R.string.label_expiry) + ": " +
|
||||||
context.getString(R.string.none));
|
context.getString(R.string.none)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if key is expired or revoked, strike through text
|
// if key is expired or revoked, strike through text
|
||||||
|
|||||||
@@ -41,9 +41,6 @@ import java.util.ArrayList;
|
|||||||
public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemClickListener {
|
public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemClickListener {
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
|
|
||||||
private int mIndexUserId, mIndexRank;
|
|
||||||
private int mVerifiedId, mIsRevoked, mIsPrimary;
|
|
||||||
|
|
||||||
private final ArrayList<Boolean> mCheckStates;
|
private final ArrayList<Boolean> mCheckStates;
|
||||||
|
|
||||||
private SaveKeyringParcel mSaveKeyringParcel;
|
private SaveKeyringParcel mSaveKeyringParcel;
|
||||||
@@ -56,6 +53,13 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
UserIds.IS_PRIMARY,
|
UserIds.IS_PRIMARY,
|
||||||
UserIds.IS_REVOKED
|
UserIds.IS_REVOKED
|
||||||
};
|
};
|
||||||
|
private static final int INDEX_ID = 0;
|
||||||
|
private static final int INDEX_USER_ID = 1;
|
||||||
|
private static final int INDEX_RANK = 2;
|
||||||
|
private static final int INDEX_VERIFIED = 3;
|
||||||
|
private static final int INDEX_IS_PRIMARY = 4;
|
||||||
|
private static final int INDEX_IS_REVOKED = 5;
|
||||||
|
|
||||||
|
|
||||||
public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes,
|
public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes,
|
||||||
SaveKeyringParcel saveKeyringParcel) {
|
SaveKeyringParcel saveKeyringParcel) {
|
||||||
@@ -64,8 +68,6 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
|
|
||||||
mCheckStates = showCheckBoxes ? new ArrayList<Boolean>() : null;
|
mCheckStates = showCheckBoxes ? new ArrayList<Boolean>() : null;
|
||||||
mSaveKeyringParcel = saveKeyringParcel;
|
mSaveKeyringParcel = saveKeyringParcel;
|
||||||
|
|
||||||
initIndex(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes) {
|
public UserIdsAdapter(Context context, Cursor c, int flags, boolean showCheckBoxes) {
|
||||||
@@ -82,7 +84,6 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor swapCursor(Cursor newCursor) {
|
public Cursor swapCursor(Cursor newCursor) {
|
||||||
initIndex(newCursor);
|
|
||||||
if (mCheckStates != null) {
|
if (mCheckStates != null) {
|
||||||
mCheckStates.clear();
|
mCheckStates.clear();
|
||||||
if (newCursor != null) {
|
if (newCursor != null) {
|
||||||
@@ -91,7 +92,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
// initialize to true (use case knowledge: we usually want to sign all uids)
|
// initialize to true (use case knowledge: we usually want to sign all uids)
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
newCursor.moveToPosition(i);
|
newCursor.moveToPosition(i);
|
||||||
int verified = newCursor.getInt(mVerifiedId);
|
int verified = newCursor.getInt(INDEX_VERIFIED);
|
||||||
mCheckStates.add(verified != Certs.VERIFIED_SECRET);
|
mCheckStates.add(verified != Certs.VERIFIED_SECRET);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,22 +101,6 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
return super.swapCursor(newCursor);
|
return super.swapCursor(newCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get column indexes for performance reasons just once in constructor and swapCursor. For a
|
|
||||||
* performance comparison see http://stackoverflow.com/a/17999582
|
|
||||||
*
|
|
||||||
* @param cursor
|
|
||||||
*/
|
|
||||||
private void initIndex(Cursor cursor) {
|
|
||||||
if (cursor != null) {
|
|
||||||
mIndexUserId = cursor.getColumnIndexOrThrow(UserIds.USER_ID);
|
|
||||||
mIndexRank = cursor.getColumnIndexOrThrow(UserIds.RANK);
|
|
||||||
mVerifiedId = cursor.getColumnIndexOrThrow(UserIds.VERIFIED);
|
|
||||||
mIsRevoked = cursor.getColumnIndexOrThrow(UserIds.IS_REVOKED);
|
|
||||||
mIsPrimary = cursor.getColumnIndexOrThrow(UserIds.IS_PRIMARY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindView(View view, Context context, Cursor cursor) {
|
public void bindView(View view, Context context, Cursor cursor) {
|
||||||
TextView vName = (TextView) view.findViewById(R.id.userId);
|
TextView vName = (TextView) view.findViewById(R.id.userId);
|
||||||
@@ -125,7 +110,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
ImageView vHasChanges = (ImageView) view.findViewById(R.id.has_changes);
|
ImageView vHasChanges = (ImageView) view.findViewById(R.id.has_changes);
|
||||||
ImageView vEditImage = (ImageView) view.findViewById(R.id.edit_image);
|
ImageView vEditImage = (ImageView) view.findViewById(R.id.edit_image);
|
||||||
|
|
||||||
String userId = cursor.getString(mIndexUserId);
|
String userId = cursor.getString(INDEX_USER_ID);
|
||||||
String[] splitUserId = KeyRing.splitUserId(userId);
|
String[] splitUserId = KeyRing.splitUserId(userId);
|
||||||
if (splitUserId[0] != null) {
|
if (splitUserId[0] != null) {
|
||||||
vName.setText(splitUserId[0]);
|
vName.setText(splitUserId[0]);
|
||||||
@@ -145,8 +130,8 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
vComment.setVisibility(View.GONE);
|
vComment.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isPrimary = cursor.getInt(mIsPrimary) != 0;
|
boolean isPrimary = cursor.getInt(INDEX_IS_PRIMARY) != 0;
|
||||||
boolean isRevoked = cursor.getInt(mIsRevoked) > 0;
|
boolean isRevoked = cursor.getInt(INDEX_IS_REVOKED) > 0;
|
||||||
|
|
||||||
// for edit key
|
// for edit key
|
||||||
if (mSaveKeyringParcel != null) {
|
if (mSaveKeyringParcel != null) {
|
||||||
@@ -189,7 +174,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
|
|
||||||
// verified: has been verified
|
// verified: has been verified
|
||||||
// isPrimary: show small star icon for primary user ids
|
// isPrimary: show small star icon for primary user ids
|
||||||
int verified = cursor.getInt(mVerifiedId);
|
int verified = cursor.getInt(INDEX_VERIFIED);
|
||||||
switch (verified) {
|
switch (verified) {
|
||||||
case Certs.VERIFIED_SECRET:
|
case Certs.VERIFIED_SECRET:
|
||||||
vVerified.setImageResource(isPrimary
|
vVerified.setImageResource(isPrimary
|
||||||
@@ -237,7 +222,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
for (int i = 0; i < mCheckStates.size(); i++) {
|
for (int i = 0; i < mCheckStates.size(); i++) {
|
||||||
if (mCheckStates.get(i)) {
|
if (mCheckStates.get(i)) {
|
||||||
mCursor.moveToPosition(i);
|
mCursor.moveToPosition(i);
|
||||||
result.add(mCursor.getString(mIndexUserId));
|
result.add(mCursor.getString(INDEX_USER_ID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@@ -245,7 +230,7 @@ public class UserIdsAdapter extends CursorAdapter implements AdapterView.OnItemC
|
|||||||
|
|
||||||
public String getUserId(int position) {
|
public String getUserId(int position) {
|
||||||
mCursor.moveToPosition(position);
|
mCursor.moveToPosition(position);
|
||||||
return mCursor.getString(mIndexUserId);
|
return mCursor.getString(INDEX_USER_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user