mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-10 19:15:06 -05:00
Cleanup in SelectKeyCursorAdapter
This commit is contained in:
parent
9fb493418e
commit
27eb7c0f1b
@ -244,7 +244,7 @@ public class SelectPublicKeyFragment extends ListFragmentWorkaround implements T
|
||||
Vector<String> userIds = new Vector<String>();
|
||||
for (int i = 0; i < getListView().getCount(); ++i) {
|
||||
if (getListView().isItemChecked(i)) {
|
||||
userIds.add((String) mAdapter.getUserId(i));
|
||||
userIds.add(mAdapter.getUserId(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user