diff options
Diffstat (limited to 'OpenKeychain/src')
3 files changed, 35 insertions, 2 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java index 3789ff55d..dceb9a0fc 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyActivity.java @@ -371,8 +371,8 @@ public class ViewKeyActivity extends ActionBarActivity { protected void onPostExecute(Void unused) { // Register callback to set NDEF message - mNfcAdapter.setNdefPushMessageCallback(mNdefCallback - , ViewKeyActivity.this); + mNfcAdapter.setNdefPushMessageCallback(mNdefCallback, + ViewKeyActivity.this); // Register callback to listen for message-sent success mNfcAdapter.setOnNdefPushCompleteCallback(mNdefCompleteCallback, ViewKeyActivity.this); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java index ed274c025..534fbfb02 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyKeysAdapter.java @@ -27,6 +27,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; + import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.helper.OtherHelper; import org.sufficientlysecure.keychain.pgp.PgpKeyHelper; @@ -172,4 +173,16 @@ public class ViewKeyKeysAdapter extends CursorAdapter { 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; + } + } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java index 82c311f59..a33d2cb0f 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java @@ -191,4 +191,24 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. 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); + } + } + } |