aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java10
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java9
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java21
-rw-r--r--src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java6
4 files changed, 16 insertions, 30 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
index 20195256..42ce5349 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java
@@ -6,7 +6,6 @@ import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.IntentSender.SendIntentException;
-import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Bundle;
@@ -42,7 +41,6 @@ import eu.siacs.conversations.entities.MucOptions.User;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.services.XmppConnectionService.OnConversationUpdate;
import eu.siacs.conversations.services.XmppConnectionService.OnMucRosterUpdate;
-import eu.siacs.conversations.utils.UIHelper;
import eu.siacs.conversations.xmpp.jid.Jid;
public class ConferenceDetailsActivity extends XmppActivity implements OnConversationUpdate, OnMucRosterUpdate, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnRoleChanged, XmppConnectionService.OnConferenceOptionsPushed {
@@ -55,7 +53,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
inviteToConversation(mConversation);
}
};
- private LinearLayout mMainLayout;
private TextView mYourNick;
private ImageView mYourPhoto;
private ImageButton mEditNickButton;
@@ -190,7 +187,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_muc_details);
- mMainLayout = (LinearLayout) findViewById(R.id.muc_main_layout);
mYourNick = (TextView) findViewById(R.id.muc_your_nick);
mYourPhoto = (ImageView) findViewById(R.id.your_photo);
mEditNickButton = (ImageButton) findViewById(R.id.edit_nick_button);
@@ -454,12 +450,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
}
}
- @Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mMainLayout);
- }
-
private void updateView() {
final MucOptions mucOptions = mConversation.getMucOptions();
final User self = mucOptions.getSelf();
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index ebac6feb..10bdaab1 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -7,7 +7,6 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender.SendIntentException;
import android.content.SharedPreferences;
-import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -100,7 +99,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
}
}
};
- private LinearLayout mainLayout;
private Jid accountJid;
private Jid contactJid;
private TextView contactJidTv;
@@ -199,7 +197,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
this.messageFingerprint = getIntent().getStringExtra("fingerprint");
setContentView(R.layout.activity_contact_details);
- mainLayout = (LinearLayout) findViewById(R.id.details_main_layout);
contactJidTv = (TextView) findViewById(R.id.details_contactjid);
accountJidTv = (TextView) findViewById(R.id.details_account);
lastseen = (TextView) findViewById(R.id.details_lastseen);
@@ -300,12 +297,6 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
return true;
}
- @Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mainLayout);
- }
-
private void populateView() {
invalidateOptionsMenu();
setTitle(contact.getDisplayName());
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 80b054a4..5c772220 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -17,6 +17,7 @@ import android.provider.MediaStore;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.util.Log;
+import android.view.Gravity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
@@ -510,22 +511,22 @@ public class ConversationActivity extends XmppActivity
}
final Conversation conversation = getSelectedConversation();
final int encryption = conversation.getNextEncryption();
+ final int mode = conversation.getMode();
if (encryption == Message.ENCRYPTION_PGP) {
if (hasPgp()) {
- if (conversation.getContact().getPgpKeyId() != 0) {
+ if (mode == Conversation.MODE_SINGLE && conversation.getContact().getPgpKeyId() != 0) {
xmppConnectionService.getPgpEngine().hasKey(
conversation.getContact(),
new UiCallback<Contact>() {
@Override
- public void userInputRequried(PendingIntent pi,
- Contact contact) {
- ConversationActivity.this.runIntent(pi,attachmentChoice);
+ public void userInputRequried(PendingIntent pi, Contact contact) {
+ ConversationActivity.this.runIntent(pi, attachmentChoice);
}
@Override
public void success(Contact contact) {
- selectPresenceToAttachFile(attachmentChoice,encryption);
+ selectPresenceToAttachFile(attachmentChoice, encryption);
}
@Override
@@ -533,6 +534,16 @@ public class ConversationActivity extends XmppActivity
displayErrorDialog(error);
}
});
+ } else if (mode == Conversation.MODE_MULTI && conversation.getMucOptions().pgpKeysInUse()) {
+ if (!conversation.getMucOptions().everybodyHasKeys()) {
+ Toast warning = Toast
+ .makeText(this,
+ R.string.missing_public_keys,
+ Toast.LENGTH_LONG);
+ warning.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
+ warning.show();
+ }
+ selectPresenceToAttachFile(attachmentChoice, encryption);
} else {
final ConversationFragment fragment = (ConversationFragment) getFragmentManager()
.findFragmentByTag("conversation");
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
index 180fc8b8..5fe5848c 100644
--- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java
@@ -483,12 +483,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
}
@Override
- public void onConfigurationChanged (Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- UIHelper.resetChildMargins(mMainLayout);
- }
-
- @Override
public boolean onOptionsItemSelected(final MenuItem item) {
switch (item.getItemId()) {
case R.id.action_show_block_list: