This commit is contained in:
iNPUTmice 2014-09-22 13:23:35 +02:00
parent bb065020ff
commit 45aede14bd
6 changed files with 30 additions and 4 deletions

View File

@ -259,5 +259,7 @@
<string name="pref_use_indicate_received_summary">Received masseges will be marked with a green tick. Be aware that this might no work in every case.</string> <string name="pref_use_indicate_received_summary">Received masseges will be marked with a green tick. Be aware that this might no work in every case.</string>
<string name="pref_use_send_button_to_indicate_status_summary">Colorize send button to indicate contact status</string> <string name="pref_use_send_button_to_indicate_status_summary">Colorize send button to indicate contact status</string>
<string name="pref_expert_options_other">Other</string> <string name="pref_expert_options_other">Other</string>
<string name="pref_conference_name">Conference name</string>
<string name="pref_conference_name_summary">Use rooms subject instead of JID to identify conferences</string>
</resources> </resources>

View File

@ -63,6 +63,11 @@
android:title="@string/pref_notification_grace_period" /> android:title="@string/pref_notification_grace_period" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory android:title="@string/pref_ui_options" > <PreferenceCategory android:title="@string/pref_ui_options" >
<CheckBoxPreference
android:defaultValue="true"
android:key="use_subject"
android:summary="@string/pref_conference_name_summary"
android:title="@string/pref_conference_name" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="use_larger_font" android:key="use_larger_font"

View File

@ -154,7 +154,11 @@ public class ConversationActivity extends XmppActivity implements
if (ab != null) { if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true); ab.setDisplayHomeAsUpEnabled(true);
ab.setHomeButtonEnabled(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(); invalidateOptionsMenu();
if (!getSelectedConversation().isRead()) { if (!getSelectedConversation().isRead()) {

View File

@ -380,7 +380,11 @@ public class ConversationFragment extends Fragment {
activity.getSlidingPaneLayout().closePane(); activity.getSlidingPaneLayout().closePane();
activity.getActionBar().setDisplayHomeAsUpEnabled(true); activity.getActionBar().setDisplayHomeAsUpEnabled(true);
activity.getActionBar().setHomeButtonEnabled(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(); activity.invalidateOptionsMenu();
} }
} }

View File

@ -62,6 +62,8 @@ public abstract class XmppActivity extends Activity {
protected int mColorOrange; protected int mColorOrange;
protected int mColorGreen; protected int mColorGreen;
protected int mPrimaryColor; protected int mPrimaryColor;
protected boolean mUseSubject = true;
private DisplayMetrics metrics; private DisplayMetrics metrics;
@ -207,12 +209,17 @@ public abstract class XmppActivity extends Activity {
if (getPreferences().getBoolean("use_larger_font", false)) { if (getPreferences().getBoolean("use_larger_font", false)) {
setTheme(R.style.ConversationsTheme_LargerText); setTheme(R.style.ConversationsTheme_LargerText);
} }
mUseSubject = getPreferences().getBoolean("use_subject", true);
} }
protected SharedPreferences getPreferences() { protected SharedPreferences getPreferences() {
return PreferenceManager return PreferenceManager
.getDefaultSharedPreferences(getApplicationContext()); .getDefaultSharedPreferences(getApplicationContext());
} }
public boolean useSubjectToIdentifyConference() {
return mUseSubject;
}
public void switchToConversation(Conversation conversation) { public void switchToConversation(Conversation conversation) {
switchToConversation(conversation, null, false); switchToConversation(conversation, null, false);

View File

@ -52,7 +52,11 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
} }
TextView convName = (TextView) view TextView convName = (TextView) view
.findViewById(R.id.conversation_name); .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 TextView convLastMsg = (TextView) view
.findViewById(R.id.conversation_lastmsg); .findViewById(R.id.conversation_lastmsg);
ImageView imagePreview = (ImageView) view ImageView imagePreview = (ImageView) view