diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-09-15 20:04:27 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-15 20:04:27 +0200 |
commit | cad83b3d9ed0791c2924a366be4bae2c45fcac82 (patch) | |
tree | 9fb38aae6f669c95e9cd26f0c002698e445df034 /src | |
parent | 578857f40a509d86539e26eb97a9045af567c41e (diff) |
show emojis in actionbar in contact and conference details
Diffstat (limited to 'src')
3 files changed, 31 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 0708bac6b..2ca287c96 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -1,5 +1,6 @@ package de.pixart.messenger.ui; +import android.app.ActionBar; import android.app.AlertDialog; import android.app.PendingIntent; import android.content.Context; @@ -506,6 +507,18 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } else { account = mConversation.getAccount().getJid().toBareJid().toString(); } + if (getActionBar() != null) { + final ActionBar ab = getActionBar(); + ab.setCustomView(R.layout.ab_title); + ab.setDisplayShowCustomEnabled(true); + TextView abtitle = (TextView) findViewById(android.R.id.text1); + TextView absubtitle = (TextView) findViewById(android.R.id.text2); + abtitle.setText(mConversation.getName()); + abtitle.setSelected(true); + abtitle.setClickable(false); + absubtitle.setVisibility(View.GONE); + absubtitle.setClickable(false); + } mAccountJid.setText(getString(R.string.using_account, account)); mYourPhoto.setImageBitmap(avatarService().get(mConversation.getAccount(), getPixel(48))); setTitle(mConversation.getName()); diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java index c919955a8..d1880ea3b 100644 --- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java @@ -1,5 +1,6 @@ package de.pixart.messenger.ui; +import android.app.ActionBar; import android.app.AlertDialog; import android.app.PendingIntent; import android.content.Context; @@ -53,6 +54,7 @@ import de.pixart.messenger.xmpp.OnUpdateBlocklist; import de.pixart.messenger.xmpp.XmppConnection; import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; +import github.ankushsachdeva.emojicon.EmojiconTextView; public class ContactDetailsActivity extends XmppActivity implements OnAccountUpdate, OnRosterUpdate, OnUpdateBlocklist, OnKeyStatusUpdated { public static final String ACTION_VIEW_CONTACT = "view_contact"; @@ -314,6 +316,19 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd if (contact == null) { return; } + if (getActionBar() != null) { + final ActionBar ab = getActionBar(); + ab.setCustomView(R.layout.ab_title); + ab.setDisplayShowCustomEnabled(true); + TextView abtitle = (TextView) findViewById(android.R.id.text1); + TextView absubtitle = (TextView) findViewById(android.R.id.text2); + abtitle.setText(contact.getDisplayName()); + abtitle.setSelected(true); + abtitle.setClickable(false); + absubtitle.setVisibility(View.GONE); + absubtitle.setClickable(false); + } + invalidateOptionsMenu(); setTitle(contact.getDisplayName()); if (contact.showInRoster()) { diff --git a/src/main/res/layout/ab_title.xml b/src/main/res/layout/ab_title.xml index 476a489e2..2d08ab3a3 100644 --- a/src/main/res/layout/ab_title.xml +++ b/src/main/res/layout/ab_title.xml @@ -2,7 +2,7 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" - android:gravity="left|center_vertical"> + android:gravity="start|center_vertical"> <github.ankushsachdeva.emojicon.EmojiconTextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" @@ -13,7 +13,7 @@ android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" - android:gravity="center_vertical" + android:gravity="start|center_vertical" android:textColor="@color/grey200" android:clickable="true" android:onClick="onClick" @@ -30,7 +30,7 @@ android:layout_below="@android:id/text1" android:textSize="12sp" android:textColor="@color/grey50" - android:gravity="center_vertical" + android:gravity="start|center_vertical" android:onClick="onClick" android:clickable="true" android:paddingBottom="1dp" /> |