diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-22 13:23:35 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-22 13:23:35 +0200 |
commit | 45aede14bd7d384e8adbcd6697ba39b1dcbf77b4 (patch) | |
tree | 760d017b369aa8648c00234ad979f42f1ee6e9cb /src/eu/siacs | |
parent | bb065020ff6145adf8fb2726928f11e0ea7140b6 (diff) |
fixed #452
Diffstat (limited to 'src/eu/siacs')
4 files changed, 22 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index 03d034d9..07c26259 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -154,7 +154,11 @@ public class ConversationActivity extends XmppActivity implements if (ab != null) { ab.setDisplayHomeAsUpEnabled(true); ab.setHomeButtonEnabled(true); - ab.setTitle(getSelectedConversation().getName()); + if (getSelectedConversation().getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) { + ab.setTitle(getSelectedConversation().getName()); + } else { + ab.setTitle(getSelectedConversation().getContactJid().split("/")[0]); + } } invalidateOptionsMenu(); if (!getSelectedConversation().isRead()) { diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index 299bf281..feed9df5 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -380,7 +380,11 @@ public class ConversationFragment extends Fragment { activity.getSlidingPaneLayout().closePane(); activity.getActionBar().setDisplayHomeAsUpEnabled(true); activity.getActionBar().setHomeButtonEnabled(true); - activity.getActionBar().setTitle(conversation.getName()); + if (conversation.getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) { + activity.getActionBar().setTitle(conversation.getName()); + } else { + activity.getActionBar().setTitle(conversation.getContactJid().split("/")[0]); + } activity.invalidateOptionsMenu(); } } diff --git a/src/eu/siacs/conversations/ui/XmppActivity.java b/src/eu/siacs/conversations/ui/XmppActivity.java index 351462ae..26a33d1a 100644 --- a/src/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/eu/siacs/conversations/ui/XmppActivity.java @@ -62,6 +62,8 @@ public abstract class XmppActivity extends Activity { protected int mColorOrange; protected int mColorGreen; protected int mPrimaryColor; + + protected boolean mUseSubject = true; private DisplayMetrics metrics; @@ -207,12 +209,17 @@ public abstract class XmppActivity extends Activity { if (getPreferences().getBoolean("use_larger_font", false)) { setTheme(R.style.ConversationsTheme_LargerText); } + mUseSubject = getPreferences().getBoolean("use_subject", true); } protected SharedPreferences getPreferences() { return PreferenceManager .getDefaultSharedPreferences(getApplicationContext()); } + + public boolean useSubjectToIdentifyConference() { + return mUseSubject; + } public void switchToConversation(Conversation conversation) { switchToConversation(conversation, null, false); diff --git a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index bfcba135..e40723f4 100644 --- a/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -52,7 +52,11 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { } TextView convName = (TextView) view .findViewById(R.id.conversation_name); - convName.setText(conv.getName()); + if (conv.getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) { + convName.setText(conv.getName()); + } else { + convName.setText(conv.getContactJid().split("/")[0]); + } TextView convLastMsg = (TextView) view .findViewById(R.id.conversation_lastmsg); ImageView imagePreview = (ImageView) view |