From a241ab66de50ad7fada548bdec1877b4b564f878 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 27 May 2016 19:17:57 +0200 Subject: [PATCH] use activity title 'choose participants' when doing that --- .../ui/ChooseContactActivity.java | 19 +++++++++++++++++++ .../ui/StartConversationActivity.java | 1 + 2 files changed, 20 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java index d930e2398..5156fcca4 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java @@ -1,8 +1,10 @@ package eu.siacs.conversations.ui; +import android.app.ActionBar; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.support.annotation.StringRes; import android.view.ActionMode; import android.view.Menu; import android.view.MenuInflater; @@ -32,6 +34,7 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity { private Set selected; private Set filterContacts; + public static final String EXTRA_TITLE_RES_ID = "extra_title_res_id"; @Override public void onCreate(final Bundle savedInstanceState) { @@ -131,6 +134,22 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity { } + @Override + public void onStart() { + super.onStart(); + Intent intent = getIntent(); + @StringRes + int res = intent != null ? intent.getIntExtra(EXTRA_TITLE_RES_ID,R.string.title_activity_choose_contact) : R.string.title_activity_choose_contact; + ActionBar bar = getActionBar(); + if (bar != null) { + try { + bar.setTitle(res); + } catch (Exception e) { + bar.setTitle(R.string.title_activity_choose_contact); + } + } + } + @Override public boolean onCreateOptionsMenu(final Menu menu) { super.onCreateOptionsMenu(menu); diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index df7b24987..9af83edd8 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -556,6 +556,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU intent.putExtra("show_enter_jid", true); intent.putExtra("subject", subject.getText().toString()); intent.putExtra(EXTRA_ACCOUNT, account.getJid().toBareJid().toString()); + intent.putExtra(ChooseContactActivity.EXTRA_TITLE_RES_ID,R.string.choose_participants); startActivityForResult(intent, REQUEST_CREATE_CONFERENCE); } });