Browse Source

Fixed title in search screen (search query on larger screens, site selector only on smaller screens). Fixes #248.

pull/280/head
Eric Kok 9 years ago
parent
commit
a2a8f1960d
  1. 8
      app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java

8
app/src/main/java/org/transdroid/core/gui/search/SearchActivity.java

@ -142,6 +142,8 @@ public class SearchActivity extends AppCompatActivity { @@ -142,6 +142,8 @@ public class SearchActivity extends AppCompatActivity {
}
} else {
// Use the action bar spinner to select sites
if (getSupportActionBar() != null)
getSupportActionBar().setTitle("");
sitesSpinner.setVisibility(View.VISIBLE);
sitesSpinner.setAdapter(new SearchSettingsDropDownAdapter(searchToolbar.getContext(), searchSites));
sitesSpinner.setOnItemSelectedListener(onSearchSiteSelected);
@ -293,9 +295,9 @@ public class SearchActivity extends AppCompatActivity { @@ -293,9 +295,9 @@ public class SearchActivity extends AppCompatActivity {
// Save the search site currently used to search for future usage
applicationSettings.setLastUsedSearchSite(lastUsedSite);
// Update the activity title (only shown on large devices)
if (sitesSpinner != null)
searchToolbar.setTitle(
NavigationHelper.buildCondensedFontString(getString(R.string.search_queryonsite, lastUsedQuery, lastUsedSite.getName())));
if (sitesSpinner == null && getSupportActionBar() != null)
getSupportActionBar()
.setTitle(NavigationHelper.buildCondensedFontString(getString(R.string.search_queryonsite, lastUsedQuery, lastUsedSite.getName())));
// Ask the results fragment to start a search for the specified query
fragmentResults.startSearch(lastUsedQuery, (SearchSite) lastUsedSite);

Loading…
Cancel
Save