mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-06 17:25:05 -05:00
experimental cert display
This commit is contained in:
parent
7a8db90425
commit
3b38ffe55e
@ -39,6 +39,7 @@ 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;
|
||||||
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
import org.sufficientlysecure.keychain.provider.KeychainContract;
|
||||||
|
import org.sufficientlysecure.keychain.provider.KeychainDatabase;
|
||||||
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
import org.sufficientlysecure.keychain.provider.ProviderHelper;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyKeysAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyKeysAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.ViewKeyUserIdsAdapter;
|
||||||
@ -174,9 +175,9 @@ public class ViewKeyMainFragment extends Fragment implements
|
|||||||
static final int KEYRING_INDEX_USER_ID = 2;
|
static final int KEYRING_INDEX_USER_ID = 2;
|
||||||
|
|
||||||
static final String[] USER_IDS_PROJECTION = new String[]{ KeychainContract.UserIds._ID, KeychainContract.UserIds.USER_ID,
|
static final String[] USER_IDS_PROJECTION = new String[]{ KeychainContract.UserIds._ID, KeychainContract.UserIds.USER_ID,
|
||||||
KeychainContract.UserIds.RANK,};
|
KeychainContract.UserIds.RANK, "verified" };
|
||||||
// not the main user id
|
// not the main user id
|
||||||
static final String USER_IDS_SELECTION = KeychainContract.UserIds.RANK + " > 0 ";
|
static final String USER_IDS_SELECTION = KeychainDatabase.Tables.USER_IDS + "." + KeychainContract.UserIds.RANK + " > 0 ";
|
||||||
static final String USER_IDS_SORT_ORDER = KeychainContract.UserIds.USER_ID + " COLLATE LOCALIZED ASC";
|
static final String USER_IDS_SORT_ORDER = KeychainContract.UserIds.USER_ID + " COLLATE LOCALIZED ASC";
|
||||||
|
|
||||||
static final String[] KEYS_PROJECTION = new String[]{KeychainContract.Keys._ID, KeychainContract.Keys.KEY_ID,
|
static final String[] KEYS_PROJECTION = new String[]{KeychainContract.Keys._ID, KeychainContract.Keys.KEY_ID,
|
||||||
|
@ -32,6 +32,7 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
|||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
|
|
||||||
private int mIndexUserId;
|
private int mIndexUserId;
|
||||||
|
private int mVerifiedId;
|
||||||
|
|
||||||
public ViewKeyUserIdsAdapter(Context context, Cursor c, int flags) {
|
public ViewKeyUserIdsAdapter(Context context, Cursor c, int flags) {
|
||||||
super(context, c, flags);
|
super(context, c, flags);
|
||||||
@ -57,15 +58,17 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter {
|
|||||||
private void initIndex(Cursor cursor) {
|
private void initIndex(Cursor cursor) {
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
mIndexUserId = cursor.getColumnIndexOrThrow(UserIds.USER_ID);
|
mIndexUserId = cursor.getColumnIndexOrThrow(UserIds.USER_ID);
|
||||||
|
mVerifiedId = cursor.getColumnIndexOrThrow("verified");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindView(View view, Context context, Cursor cursor) {
|
public void bindView(View view, Context context, Cursor cursor) {
|
||||||
String userIdStr = cursor.getString(mIndexUserId);
|
String userIdStr = cursor.getString(mIndexUserId);
|
||||||
|
int verified = cursor.getInt(mVerifiedId);
|
||||||
|
|
||||||
TextView userId = (TextView) view.findViewById(R.id.userId);
|
TextView userId = (TextView) view.findViewById(R.id.userId);
|
||||||
userId.setText(userIdStr);
|
userId.setText(userIdStr + (verified > 0 ? " (ok)" : "(nope)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user