Search in sources :

Example 16 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 17 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 18 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 19 with ActionBar

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);
    }
}
Also used : ActionBar(android.support.v7.app.ActionBar)

Example 20 with ActionBar

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();
        }
    });
}
Also used : TypedArray(android.content.res.TypedArray) SearchHistory(com.battlelancer.seriesguide.util.SearchHistory) BindView(butterknife.BindView) View(android.view.View) AdapterView(android.widget.AdapterView) AutoCompleteTextView(android.widget.AutoCompleteTextView) TextView(android.widget.TextView) ActionBar(android.support.v7.app.ActionBar) TypedValue(android.util.TypedValue)

Aggregations

ActionBar (android.support.v7.app.ActionBar)400 View (android.view.View)117 Toolbar (android.support.v7.widget.Toolbar)98 TextView (android.widget.TextView)63 AppCompatActivity (android.support.v7.app.AppCompatActivity)31 ImageView (android.widget.ImageView)31 Intent (android.content.Intent)29 RecyclerView (android.support.v7.widget.RecyclerView)27 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)23 AdapterView (android.widget.AdapterView)21 ViewPager (android.support.v4.view.ViewPager)15 ArrayList (java.util.ArrayList)15 Bundle (android.os.Bundle)14 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)14 SuppressLint (android.annotation.SuppressLint)13 ListView (android.widget.ListView)13 FragmentManager (android.app.FragmentManager)12 Fragment (android.support.v4.app.Fragment)12 ColorDrawable (android.graphics.drawable.ColorDrawable)10 NavigationView (android.support.design.widget.NavigationView)10