diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:18:24 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-22 20:49:04 +0100 |
commit | 472a08daad551e312ca7ca3b3bf30957f7f99b35 (patch) | |
tree | 13272b1845f4f92f65785ce8265d1d835b3366f8 /src/main | |
parent | 13222d1b6a326b8477f2b80bfe583e41b2e33686 (diff) |
only change actionbar display options when changed
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index 8a1076ab5..029d0c86c 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -234,9 +234,9 @@ public class ConversationActivity extends XmppActivity this.listAdapter = new ConversationAdapter(this, conversationList); listView.setAdapter(this.listAdapter); - if (getActionBar() != null) { - getActionBar().setDisplayHomeAsUpEnabled(false); - getActionBar().setHomeButtonEnabled(false); + final ActionBar actionBar = getActionBar(); + if (actionBar != null) { + actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE); } listView.setOnItemClickListener(new OnItemClickListener() { @@ -415,8 +415,9 @@ public class ConversationActivity extends XmppActivity final Conversation conversation = getSelectedConversation(); if (ab != null) { if (titleShouldBeName && conversation != null) { - ab.setDisplayHomeAsUpEnabled(true); - ab.setHomeButtonEnabled(true); + if ((ab.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) != ActionBar.DISPLAY_HOME_AS_UP) { + ab.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE); + } ab.setDisplayShowTitleEnabled(false); ab.setDisplayShowCustomEnabled(true); ab.setCustomView(R.layout.ab_title); @@ -475,8 +476,9 @@ public class ConversationActivity extends XmppActivity absubtitle.setOnClickListener(this); } } else { - ab.setDisplayHomeAsUpEnabled(false); - ab.setHomeButtonEnabled(false); + if ((ab.getDisplayOptions() & ActionBar.DISPLAY_HOME_AS_UP) == ActionBar.DISPLAY_HOME_AS_UP) { + ab.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE); + } ab.setDisplayShowTitleEnabled(true); ab.setDisplayShowCustomEnabled(false); ab.setTitle(R.string.app_name); |