Skip to content

Commit

Permalink
fix channel back button if searchview is expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Jul 27, 2016
1 parent 61f9be4 commit ea40365
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -93,7 +92,7 @@ protected void onCreate(Bundle savedInstanceState) {
drawer.addDrawerListener(_navToggle);
_navToggle.syncState();

Stetho.initializeWithDefaults(getApplicationContext()); //DEBUG
//Stetho.initializeWithDefaults(getApplicationContext()); //DEBUG

initConnectionManager();
initService();
Expand Down
3 changes: 2 additions & 1 deletion android/TriblerApp/app/src/main/res/menu/menu_channel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

<item
android:id="@+id/btn_filter"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search_in_channel"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="always" />
app:showAsAction="always|collapseActionView" />

</menu>
4 changes: 2 additions & 2 deletions android/TriblerApp/app/version.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ea40365

Please sign in to comment.