use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class OverviewActivity method setupActionBar.
@Override
protected void setupActionBar() {
super.setupActionBar();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class BaseOAuthActivity method setupActionBar.
@Override
protected void setupActionBar() {
super.setupActionBar();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class BaseTopActivity method setupActionBar.
@Override
protected void setupActionBar() {
super.setupActionBar();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class MoviesSearchActivity method setSearchViewVisible.
private void setSearchViewVisible(boolean visible) {
containerSearchBar.setVisibility(visible ? View.VISIBLE : View.GONE);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayShowTitleEnabled(!visible);
}
}
use of android.support.v7.app.ActionBar in project SeriesGuide by UweTrottmann.
the class MoviesSearchActivity method setupActionBar.
private void setupActionBar(MoviesDiscoverLink link) {
super.setupActionBar();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
// set title for screen readers
if (showSearchView) {
setTitle(R.string.search);
} else {
setTitle(link.titleRes);
}
setSearchViewVisible(showSearchView);
// setup search box
searchView.setThreshold(1);
searchView.setOnClickListener(searchViewClickListener);
searchView.setOnItemClickListener(searchViewItemClickListener);
searchView.setOnEditorActionListener(searchViewActionListener);
searchView.setHint(R.string.movies_search_hint);
// set in code as XML is overridden
searchView.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
searchView.setInputType(EditorInfo.TYPE_CLASS_TEXT);
// manually retrieve the auto complete view popup background to override the theme
TypedValue outValue = new TypedValue();
getTheme().resolveAttribute(android.R.attr.autoCompleteTextViewStyle, outValue, true);
int[] attributes = new int[] { android.R.attr.popupBackground };
TypedArray a = getTheme().obtainStyledAttributes(outValue.data, attributes);
if (a.hasValue(0)) {
searchView.setDropDownBackgroundDrawable(a.getDrawable(0));
}
a.recycle();
// setup search history
searchHistory = new SearchHistory(this, SearchSettings.KEY_SUFFIX_TMDB);
searchHistoryAdapter = new ArrayAdapter<>(this, R.layout.item_dropdown, searchHistory.getSearchHistory());
searchView.setAdapter(searchHistoryAdapter);
// drop-down is auto-shown on config change, ensure it is hidden when recreating views
searchView.dismissDropDown();
// setup clear button
clearButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
searchView.setText(null);
searchView.requestFocus();
}
});
}
Aggregations