From 78686e9bce44d6279cb1475945309325888f0fc3 Mon Sep 17 00:00:00 2001 From: Alethea Butler Date: Fri, 30 May 2014 23:18:50 -0400 Subject: [PATCH] Disabled the Home button when it's not the Up button --- src/eu/siacs/conversations/ui/ConversationActivity.java | 2 ++ src/eu/siacs/conversations/ui/ConversationFragment.java | 1 + src/eu/siacs/conversations/ui/ManageAccountActivity.java | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index c696fa45f..232d46f80 100644 --- a/src/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/eu/siacs/conversations/ui/ConversationActivity.java @@ -262,6 +262,7 @@ public class ConversationActivity extends XmppActivity { public void onPanelOpened(View arg0) { paneShouldBeOpen = true; getActionBar().setDisplayHomeAsUpEnabled(false); + getActionBar().setHomeButtonEnabled(false); getActionBar().setTitle(R.string.app_name); invalidateOptionsMenu(); hideKeyboard(); @@ -273,6 +274,7 @@ public class ConversationActivity extends XmppActivity { if ((conversationList.size() > 0) && (getSelectedConversation() != null)) { getActionBar().setDisplayHomeAsUpEnabled(true); + getActionBar().setHomeButtonEnabled(true); getActionBar().setTitle( getSelectedConversation().getName(useSubject)); invalidateOptionsMenu(); diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java index a3cecfd48..3e1909d83 100644 --- a/src/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/eu/siacs/conversations/ui/ConversationFragment.java @@ -527,6 +527,7 @@ public class ConversationFragment extends Fragment { if (!activity.shouldPaneBeOpen()) { activity.getSlidingPaneLayout().closePane(); activity.getActionBar().setDisplayHomeAsUpEnabled(true); + activity.getActionBar().setHomeButtonEnabled(true); activity.getActionBar().setTitle( conversation.getName(useSubject)); activity.invalidateOptionsMenu(); diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java index d1c9c7f72..eae1196b7 100644 --- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java +++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java @@ -380,6 +380,7 @@ public class ManageAccountActivity extends XmppActivity { accountListViewAdapter.notifyDataSetChanged(); if ((this.accountList.size() == 0)&&(this.firstrun)) { getActionBar().setDisplayHomeAsUpEnabled(false); + getActionBar().setHomeButtonEnabled(false); addAccount(); this.firstrun = false; } @@ -429,6 +430,7 @@ public class ManageAccountActivity extends XmppActivity { public void onAccountEdited(Account account) { xmppConnectionService.createAccount(account); activity.getActionBar().setDisplayHomeAsUpEnabled(true); + activity.getActionBar().setHomeButtonEnabled(true); } }); dialog.show(getFragmentManager(), "add_account");