From ea4036524c6d31016e373e8803f8f5d22e098323 Mon Sep 17 00:00:00 2001 From: Paul Brussee Date: Wed, 27 Jul 2016 22:03:49 +0200 Subject: [PATCH] fix channel back button if searchview is expanded --- .../org/tribler/android/ChannelActivity.java | 17 +++-------------- .../java/org/tribler/android/MainActivity.java | 3 +-- .../app/src/main/res/menu/menu_channel.xml | 3 ++- android/TriblerApp/app/version.properties | 4 ++-- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/android/TriblerApp/app/src/main/java/org/tribler/android/ChannelActivity.java b/android/TriblerApp/app/src/main/java/org/tribler/android/ChannelActivity.java index 8307ed6f136..0ee54017b16 100644 --- a/android/TriblerApp/app/src/main/java/org/tribler/android/ChannelActivity.java +++ b/android/TriblerApp/app/src/main/java/org/tribler/android/ChannelActivity.java @@ -71,6 +71,9 @@ public boolean onCreateOptionsMenu(Menu menu) { MenuItem btnFilter = menu.findItem(R.id.btn_filter); SearchView searchView = (SearchView) btnFilter.getActionView(); + // Set search hint + searchView.setQueryHint(getText(R.string.action_search_in_channel)); + // Get list filter final Filter filter = _fragment.getAdapter().getFilter(); @@ -92,18 +95,4 @@ public void onError(Throwable e) { return true; } - - /** - * {@inheritDoc} - */ - @Override - public void onBackPressed() { - // Close search if open - SearchView searchView = (SearchView) findViewById(R.id.btn_filter); - if (!searchView.isIconified()) { - searchView.setIconified(true); - } else { - super.onBackPressed(); - } - } } diff --git a/android/TriblerApp/app/src/main/java/org/tribler/android/MainActivity.java b/android/TriblerApp/app/src/main/java/org/tribler/android/MainActivity.java index a5483bc4f89..a9938ccbbb2 100644 --- a/android/TriblerApp/app/src/main/java/org/tribler/android/MainActivity.java +++ b/android/TriblerApp/app/src/main/java/org/tribler/android/MainActivity.java @@ -23,7 +23,6 @@ import android.widget.Toast; import com.cantrowitz.rxbroadcast.RxBroadcast; -import com.facebook.stetho.Stetho; import org.tribler.android.restapi.IRestApi; import org.tribler.android.restapi.TriblerService; @@ -93,7 +92,7 @@ protected void onCreate(Bundle savedInstanceState) { drawer.addDrawerListener(_navToggle); _navToggle.syncState(); - Stetho.initializeWithDefaults(getApplicationContext()); //DEBUG + //Stetho.initializeWithDefaults(getApplicationContext()); //DEBUG initConnectionManager(); initService(); diff --git a/android/TriblerApp/app/src/main/res/menu/menu_channel.xml b/android/TriblerApp/app/src/main/res/menu/menu_channel.xml index 7aed6c4a7fa..32585eca443 100644 --- a/android/TriblerApp/app/src/main/res/menu/menu_channel.xml +++ b/android/TriblerApp/app/src/main/res/menu/menu_channel.xml @@ -6,8 +6,9 @@ + app:showAsAction="always|collapseActionView" /> \ No newline at end of file diff --git a/android/TriblerApp/app/version.properties b/android/TriblerApp/app/version.properties index f33205c752b..866393c9e12 100644 --- a/android/TriblerApp/app/version.properties +++ b/android/TriblerApp/app/version.properties @@ -1,2 +1,2 @@ -#Wed Jul 27 21:43:02 CEST 2016 -VERSION_CODE=494 +#Wed Jul 27 22:17:54 CEST 2016 +VERSION_CODE=507