From 578857f40a509d86539e26eb97a9045af567c41e Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 14 Sep 2016 22:47:05 +0200 Subject: scroll actionbar titles if they are too long --- .../de/pixart/messenger/ui/ConversationActivity.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main/java/de/pixart/messenger/ui') diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 6d03cb5d6..935b245a4 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -470,48 +470,49 @@ public class ConversationActivity extends XmppActivity ab.setDisplayShowTitleEnabled(false); ab.setDisplayShowCustomEnabled(true); ab.setCustomView(R.layout.ab_title); + TextView abtitle = (TextView) findViewById(android.R.id.text1); + TextView absubtitle = (TextView) findViewById(android.R.id.text2); if (conversation.getMode() == Conversation.MODE_SINGLE || useSubjectToIdentifyConference()) { - TextView abtitle = (TextView) findViewById(android.R.id.text1); abtitle.setText(conversation.getName()); abtitle.setOnClickListener(this); + abtitle.setSelected(true); if (conversation.getMode() == Conversation.MODE_SINGLE && !this.getSelectedConversation().withSelf()) { if (conversation.getContact().getShownStatus() == Presence.Status.OFFLINE) { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(getString(R.string.account_status_offline)); + absubtitle.setSelected(true); absubtitle.setOnClickListener(this); } else { ChatState state = conversation.getIncomingChatState(); if (state == ChatState.COMPOSING) { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(getString(R.string.is_typing)); absubtitle.setTypeface(null, Typeface.BOLD_ITALIC); + absubtitle.setSelected(true); absubtitle.setOnClickListener(this); } else if (state == ChatState.PAUSED) { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(UIHelper.lastseen(getApplicationContext(), conversation.getContact().isActive(), conversation.getContact().getLastseen())); + absubtitle.setSelected(true); absubtitle.setOnClickListener(this); } else { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(UIHelper.lastseen(getApplicationContext(), conversation.getContact().isActive(), conversation.getContact().getLastseen())); + absubtitle.setSelected(true); absubtitle.setOnClickListener(this); } } } else if (useSubjectToIdentifyConference()) { if (conversation.getParticipants() != null) { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(conversation.getParticipants()); + absubtitle.setSelected(true); absubtitle.setOnClickListener(this); } else { - TextView absubtitle = (TextView) findViewById(android.R.id.text2); absubtitle.setText(R.string.no_participants); + abtitle.setSelected(true); absubtitle.setOnClickListener(this); } } } else { - TextView abtitle = (TextView) findViewById(android.R.id.text1); abtitle.setText(conversation.getJid().toBareJid().toString()); abtitle.setOnClickListener(this); - TextView absubtitle = (TextView) findViewById(android.R.id.text2); + abtitle.setSelected(true); absubtitle.setText(null); absubtitle.setOnClickListener(this); } -- cgit v1.2.3