mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-25 00:06:08 +00:00
Reset the action bar subtitle when the back button is pressed
This commit is contained in:
parent
239d8740be
commit
3b1035b5e1
1 changed files with 9 additions and 8 deletions
|
@ -14,7 +14,6 @@ import android.view.KeyEvent;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
@ -526,6 +525,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
|
||||
collapseSearchView();
|
||||
setTitle(R.string.app_name);
|
||||
getSupportActionBar().setSubtitle(null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -546,8 +546,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
saveAndBackupVault();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
_menu = menu;
|
||||
|
@ -581,8 +579,6 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String s) {
|
||||
if (_submittedSearchSubtitle == null) {
|
||||
|
@ -593,6 +589,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
_searchView.setOnSearchClickListener(v -> {
|
||||
if (_submittedSearchSubtitle != null) {
|
||||
_entryListView.setSearchFilter(null);
|
||||
|
@ -600,16 +597,20 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
|
|||
_submittedSearchSubtitle = null;
|
||||
}
|
||||
});
|
||||
if(_submittedSearchSubtitle != null) {
|
||||
|
||||
if (_submittedSearchSubtitle != null) {
|
||||
getSupportActionBar().setSubtitle(_submittedSearchSubtitle);
|
||||
}
|
||||
if(_activeSearchFilter != null) {
|
||||
|
||||
if (_activeSearchFilter != null) {
|
||||
_entryListView.setSearchFilter(_activeSearchFilter);
|
||||
}
|
||||
if(_searchQueryInputText != null) {
|
||||
|
||||
if (_searchQueryInputText != null) {
|
||||
_searchView.setQuery(_searchQueryInputText, false);
|
||||
_searchView.setIconified(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue