mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
fixed #452
This commit is contained in:
parent
bb065020ff
commit
45aede14bd
@ -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_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_conference_name">Conference name</string>
|
||||
<string name="pref_conference_name_summary">Use room’s subject instead of JID to identify conferences</string>
|
||||
|
||||
</resources>
|
@ -63,6 +63,11 @@
|
||||
android:title="@string/pref_notification_grace_period" />
|
||||
</PreferenceCategory>
|
||||
<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
|
||||
android:defaultValue="false"
|
||||
android:key="use_larger_font"
|
||||
|
@ -154,7 +154,11 @@ public class ConversationActivity extends XmppActivity implements
|
||||
if (ab != null) {
|
||||
ab.setDisplayHomeAsUpEnabled(true);
|
||||
ab.setHomeButtonEnabled(true);
|
||||
if (getSelectedConversation().getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) {
|
||||
ab.setTitle(getSelectedConversation().getName());
|
||||
} else {
|
||||
ab.setTitle(getSelectedConversation().getContactJid().split("/")[0]);
|
||||
}
|
||||
}
|
||||
invalidateOptionsMenu();
|
||||
if (!getSelectedConversation().isRead()) {
|
||||
|
@ -380,7 +380,11 @@ public class ConversationFragment extends Fragment {
|
||||
activity.getSlidingPaneLayout().closePane();
|
||||
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
activity.getActionBar().setHomeButtonEnabled(true);
|
||||
if (conversation.getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) {
|
||||
activity.getActionBar().setTitle(conversation.getName());
|
||||
} else {
|
||||
activity.getActionBar().setTitle(conversation.getContactJid().split("/")[0]);
|
||||
}
|
||||
activity.invalidateOptionsMenu();
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,8 @@ public abstract class XmppActivity extends Activity {
|
||||
protected int mColorGreen;
|
||||
protected int mPrimaryColor;
|
||||
|
||||
protected boolean mUseSubject = true;
|
||||
|
||||
private DisplayMetrics metrics;
|
||||
|
||||
protected interface OnValueEdited {
|
||||
@ -207,6 +209,7 @@ 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() {
|
||||
@ -214,6 +217,10 @@ public abstract class XmppActivity extends Activity {
|
||||
.getDefaultSharedPreferences(getApplicationContext());
|
||||
}
|
||||
|
||||
public boolean useSubjectToIdentifyConference() {
|
||||
return mUseSubject;
|
||||
}
|
||||
|
||||
public void switchToConversation(Conversation conversation) {
|
||||
switchToConversation(conversation, null, false);
|
||||
}
|
||||
|
@ -52,7 +52,11 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
||||
}
|
||||
TextView convName = (TextView) view
|
||||
.findViewById(R.id.conversation_name);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user