aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 7245a977d..c3693c24b 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -118,7 +118,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
}
};
- private ConversationActivity activity;
+ private final ConversationActivity activity;
private DisplayMetrics metrics;
@@ -815,9 +815,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
viewHolder.load_more_messages = (Button) view.findViewById(R.id.load_more_messages);
break;
default:
- view = new View(getContext());
- viewHolder = null;
- break;
+ throw new AssertionError("Unknown view type");
}
if (viewHolder.messageBody != null) {
listSelectionManager.onCreate(viewHolder.messageBody, new MessageBodyActionModeCallback(viewHolder.messageBody));
@@ -913,16 +911,13 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
}
} else {
displayInfoMessage(viewHolder, activity.getString(R.string.install_openkeychain), darkBackground);
- if (viewHolder != null) {
- viewHolder.message_box
- .setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- activity.showInstallPgpDialog();
- }
- });
- }
+ viewHolder.message_box.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ activity.showInstallPgpDialog();
+ }
+ });
}
} else if (message.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED) {
displayDecryptionFailed(viewHolder, darkBackground);