Disable selection of user ids and keys in view key

This commit is contained in:
Dominik Schürmann 2014-04-10 14:14:32 +02:00
parent a85b217756
commit a63488cce3
3 changed files with 35 additions and 2 deletions

View File

@ -371,8 +371,8 @@ public class ViewKeyActivity extends ActionBarActivity {
protected void onPostExecute(Void unused) { protected void onPostExecute(Void unused) {
// Register callback to set NDEF message // Register callback to set NDEF message
mNfcAdapter.setNdefPushMessageCallback(mNdefCallback mNfcAdapter.setNdefPushMessageCallback(mNdefCallback,
, ViewKeyActivity.this); ViewKeyActivity.this);
// Register callback to listen for message-sent success // Register callback to listen for message-sent success
mNfcAdapter.setOnNdefPushCompleteCallback(mNdefCompleteCallback, mNfcAdapter.setOnNdefPushCompleteCallback(mNdefCompleteCallback,
ViewKeyActivity.this); ViewKeyActivity.this);

View File

@ -27,6 +27,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.helper.OtherHelper; import org.sufficientlysecure.keychain.helper.OtherHelper;
import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper;
@ -172,4 +173,16 @@ public class ViewKeyKeysAdapter extends CursorAdapter {
return view; return view;
} }
// Disable selection of items, http://stackoverflow.com/a/4075045
@Override
public boolean areAllItemsEnabled() {
return false;
}
// Disable selection of items, http://stackoverflow.com/a/4075045
@Override
public boolean isEnabled(int position) {
return false;
}
} }

View File

@ -191,4 +191,24 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView.
return view; return view;
} }
// Disable selection of items for lists without checkboxes, http://stackoverflow.com/a/4075045
@Override
public boolean areAllItemsEnabled() {
if (mCheckStates == null) {
return false;
} else {
return super.areAllItemsEnabled();
}
}
// Disable selection of items for lists without checkboxes, http://stackoverflow.com/a/4075045
@Override
public boolean isEnabled(int position) {
if (mCheckStates == null) {
return false;
} else {
return super.isEnabled(position);
}
}
} }