mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 03:32:15 -05:00
Merge pull request #164 from alethea/development
Fix home button up navigation
This commit is contained in:
commit
1ffba8bd62
@ -262,6 +262,7 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
public void onPanelOpened(View arg0) {
|
public void onPanelOpened(View arg0) {
|
||||||
paneShouldBeOpen = true;
|
paneShouldBeOpen = true;
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(false);
|
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||||
|
getActionBar().setHomeButtonEnabled(false);
|
||||||
getActionBar().setTitle(R.string.app_name);
|
getActionBar().setTitle(R.string.app_name);
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
hideKeyboard();
|
hideKeyboard();
|
||||||
@ -273,6 +274,7 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
if ((conversationList.size() > 0)
|
if ((conversationList.size() > 0)
|
||||||
&& (getSelectedConversation() != null)) {
|
&& (getSelectedConversation() != null)) {
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(true);
|
getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
getActionBar().setHomeButtonEnabled(true);
|
||||||
getActionBar().setTitle(
|
getActionBar().setTitle(
|
||||||
getSelectedConversation().getName(useSubject));
|
getSelectedConversation().getName(useSubject));
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
|
@ -527,6 +527,7 @@ public class ConversationFragment extends Fragment {
|
|||||||
if (!activity.shouldPaneBeOpen()) {
|
if (!activity.shouldPaneBeOpen()) {
|
||||||
activity.getSlidingPaneLayout().closePane();
|
activity.getSlidingPaneLayout().closePane();
|
||||||
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
activity.getActionBar().setHomeButtonEnabled(true);
|
||||||
activity.getActionBar().setTitle(
|
activity.getActionBar().setTitle(
|
||||||
conversation.getName(useSubject));
|
conversation.getName(useSubject));
|
||||||
activity.invalidateOptionsMenu();
|
activity.invalidateOptionsMenu();
|
||||||
|
@ -380,6 +380,7 @@ public class ManageAccountActivity extends XmppActivity {
|
|||||||
accountListViewAdapter.notifyDataSetChanged();
|
accountListViewAdapter.notifyDataSetChanged();
|
||||||
if ((this.accountList.size() == 0)&&(this.firstrun)) {
|
if ((this.accountList.size() == 0)&&(this.firstrun)) {
|
||||||
getActionBar().setDisplayHomeAsUpEnabled(false);
|
getActionBar().setDisplayHomeAsUpEnabled(false);
|
||||||
|
getActionBar().setHomeButtonEnabled(false);
|
||||||
addAccount();
|
addAccount();
|
||||||
this.firstrun = false;
|
this.firstrun = false;
|
||||||
}
|
}
|
||||||
@ -397,6 +398,12 @@ public class ManageAccountActivity extends XmppActivity {
|
|||||||
case R.id.action_add_account:
|
case R.id.action_add_account:
|
||||||
addAccount();
|
addAccount();
|
||||||
break;
|
break;
|
||||||
|
case android.R.id.home:
|
||||||
|
if (xmppConnectionService.getConversations().size() == 0) {
|
||||||
|
startActivity(new Intent(getApplicationContext(),
|
||||||
|
ContactsActivity.class));
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -429,6 +436,7 @@ public class ManageAccountActivity extends XmppActivity {
|
|||||||
public void onAccountEdited(Account account) {
|
public void onAccountEdited(Account account) {
|
||||||
xmppConnectionService.createAccount(account);
|
xmppConnectionService.createAccount(account);
|
||||||
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
activity.getActionBar().setHomeButtonEnabled(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.show(getFragmentManager(), "add_account");
|
dialog.show(getFragmentManager(), "add_account");
|
||||||
|
Loading…
Reference in New Issue
Block a user