encryptkeycompletionview: don't initialize to null on attach

This commit is contained in:
Vincent Breitmoser
2015-11-30 19:01:06 +01:00
parent df219b61c6
commit cb1527e2a1
2 changed files with 3 additions and 12 deletions

View File

@@ -91,16 +91,16 @@ public class EncryptModeAsymmetricFragment extends EncryptModeFragment {
});
final ViewAnimator vEncryptionIcon = (ViewAnimator) view.findViewById(R.id.result_encryption_icon);
mEncryptKeyView.setTokenListener(new TokenListener() {
mEncryptKeyView.setTokenListener(new TokenListener<KeyItem>() {
@Override
public void onTokenAdded(Object o) {
public void onTokenAdded(KeyItem o) {
if (vEncryptionIcon.getDisplayedChild() != 1) {
vEncryptionIcon.setDisplayedChild(1);
}
}
@Override
public void onTokenRemoved(Object o) {
public void onTokenRemoved(KeyItem o) {
int child = mEncryptKeyView.getObjects().isEmpty() ? 0 : 1;
if (vEncryptionIcon.getDisplayedChild() != child) {
vEncryptionIcon.setDisplayedChild(child);

View File

@@ -110,7 +110,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
if (getContext() instanceof FragmentActivity) {
mLoaderManager = ((FragmentActivity) getContext()).getSupportLoaderManager();
mLoaderManager.initLoader(0, null, this);
} else {
Log.e(Constants.TAG, "EncryptKeyCompletionView must be attached to a FragmentActivity, this is " + getContext().getClass());
}
@@ -135,12 +134,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
+ KeyRings.IS_EXPIRED + " = 0 AND "
+ Tables.KEYS + "." + KeyRings.IS_REVOKED + " = 0";
if (args == null || !args.containsKey(ARG_QUERY)) {
// mAdapter.setSearchQuery(null);
// return new CursorLoader(getContext(), baseUri, projection, where, null, null);
return null;
}
String query = args.getString(ARG_QUERY);
mAdapter.setSearchQuery(query);
@@ -169,8 +162,6 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView<KeyItem>
super.showDropDown();
}
@Override
public void onFocusChanged(boolean hasFocus, int direction, Rect previous) {
super.onFocusChanged(hasFocus, direction, previous);