From 27eb7c0f1be4c3633dc72f4dba199ce971b12aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 9 Apr 2014 01:11:33 +0200 Subject: [PATCH] Cleanup in SelectKeyCursorAdapter --- .../keychain/ui/SelectPublicKeyFragment.java | 2 +- .../keychain/ui/adapter/SelectKeyCursorAdapter.java | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java index 24fe43843..52b400481 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/SelectPublicKeyFragment.java @@ -244,7 +244,7 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T Vector userIds = new Vector(); for (int i = 0; i < getListView().getCount(); ++i) { if (getListView().isItemChecked(i)) { - userIds.add((String) mAdapter.getUserId(i)); + userIds.add(mAdapter.getUserId(i)); } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java index fbbb9caa4..d7f8c8e7a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/SelectKeyCursorAdapter.java @@ -25,6 +25,7 @@ import android.view.ViewGroup; import android.widget.CheckBox; import android.widget.ListView; import android.widget.TextView; + import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; @@ -91,8 +92,6 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter { @Override public void bindView(View view, Context context, Cursor cursor) { - boolean valid = cursor.getInt(mIndexProjectionValid) > 0; - TextView mainUserId = (TextView) view.findViewById(R.id.mainUserId); TextView mainUserIdRest = (TextView) view.findViewById(R.id.mainUserIdRest); TextView keyId = (TextView) view.findViewById(R.id.keyId); @@ -112,13 +111,10 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter { mainUserIdRest.setText(""); } - // TODO: needed to key id to no? - keyId.setText(R.string.no_key); long masterKeyId = cursor.getLong(mIndexMasterKeyId); keyId.setText(PgpKeyHelper.convertKeyIdToHexShort(masterKeyId)); - // TODO: needed to set unknown_status? - status.setText(R.string.unknown_status); + boolean valid = cursor.getInt(mIndexProjectionValid) > 0; if (valid) { if (mKeyType == Id.type.public_key) { status.setText(R.string.can_encrypt); @@ -149,8 +145,6 @@ public class SelectKeyCursorAdapter extends HighlightQueryCursorAdapter { selected.setVisibility(View.GONE); } - status.setText(status.getText() + " "); - view.setEnabled(valid); mainUserId.setEnabled(valid); mainUserIdRest.setEnabled(valid);