From f26a57ced482785ef0e8147760065d204e948d50 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 15 Feb 2019 14:07:39 +0100 Subject: [PATCH] fixed regression of search hint not updating in StartConversation screen --- .../conversations/ui/StartConversationActivity.java | 9 ++++++++- .../res/menu/muc_users_activity.xml | 0 src/main/res/values/strings.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) rename src/{conversations => main}/res/menu/muc_users_activity.xml (100%) diff --git a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java index 946037bd5..2a0066e1b 100644 --- a/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/StartConversationActivity.java @@ -19,6 +19,7 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v4.view.PagerAdapter; +import android.support.v4.view.ViewPager; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.ActionBar; import android.support.v7.app.AlertDialog; @@ -264,6 +265,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne binding.speedDial.inflate(R.menu.start_conversation_fab_submenu); binding.tabLayout.setupWithViewPager(binding.startConversationViewPager); + binding.startConversationViewPager.addOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { + @Override + public void onPageSelected(int position) { + updateSearchViewHint(); + } + }); mListPagerAdapter = new ListPagerAdapter(getSupportFragmentManager()); binding.startConversationViewPager.setAdapter(mListPagerAdapter); @@ -603,7 +610,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne if (binding.startConversationViewPager.getCurrentItem() == 0) { mSearchEditText.setHint(R.string.search_contacts); } else { - mSearchEditText.setHint(R.string.search_groups); + mSearchEditText.setHint(R.string.search_bookmarks); } } diff --git a/src/conversations/res/menu/muc_users_activity.xml b/src/main/res/menu/muc_users_activity.xml similarity index 100% rename from src/conversations/res/menu/muc_users_activity.xml rename to src/main/res/menu/muc_users_activity.xml diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 6dcffdf6f..19ff26960 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -442,7 +442,7 @@ Most recently used Choose quick action Search contacts - Search group chats + Search bookmarks Send private message %1$s has left the group chat! Username