diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2014-05-31 11:55:17 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2014-05-31 11:55:17 +0200 |
commit | 1ffba8bd62d34e43611896b12c1cb6f3fa0542d8 (patch) | |
tree | b115c0a21207366fd6f4e5a041c1fbebe634b591 /src/eu/siacs/conversations/ui | |
parent | 4cf7a845767f04b8a4a3c09f756e06e31c041eba (diff) | |
parent | 0edfd3619530f3ded673746d252b766c3001134e (diff) |
Merge pull request #164 from alethea/development
Fix home button up navigation
Diffstat (limited to 'src/eu/siacs/conversations/ui')
3 files changed, 11 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java index c696fa45..232d46f8 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 a3cecfd4..3e1909d8 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 d1c9c7f7..6fd87473 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; } @@ -397,6 +398,12 @@ public class ManageAccountActivity extends XmppActivity { case R.id.action_add_account: addAccount(); break; + case android.R.id.home: + if (xmppConnectionService.getConversations().size() == 0) { + startActivity(new Intent(getApplicationContext(), + ContactsActivity.class)); + } + break; default: break; } @@ -429,6 +436,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"); |