public interface

DecorToolbar

 androidx.appcompat.widget.DecorToolbar

Subclasses:

ToolbarWidgetWrapper

Gradle dependencies

compile group: 'androidx.appcompat', name: 'appcompat', version: '1.7.0'

  • groupId: androidx.appcompat
  • artifactId: appcompat
  • version: 1.7.0

Artifact androidx.appcompat:appcompat:1.7.0 it located at Google repository (https://maven.google.com/)

Androidx artifact mapping:

androidx.appcompat:appcompat com.android.support:appcompat-v7

Androidx class mapping:

androidx.appcompat.widget.DecorToolbar android.support.v7.widget.DecorToolbar

Overview

Common interface for a toolbar that sits as part of the window decor. Layouts that control window decor use this as a point of interaction with different bar implementations.

Summary

Methods
public voidanimateToVisibility(int visibility)

public booleancanShowOverflowMenu()

public voidcollapseActionView()

public voiddismissPopupMenus()

public ContextgetContext()

public ViewgetCustomView()

public intgetDisplayOptions()

public intgetDropdownItemCount()

public intgetDropdownSelectedPosition()

public intgetHeight()

public MenugetMenu()

public intgetNavigationMode()

public java.lang.CharSequencegetSubtitle()

public java.lang.CharSequencegetTitle()

public ViewGroupgetViewGroup()

public intgetVisibility()

public booleanhasEmbeddedTabs()

public booleanhasExpandedActionView()

public booleanhasIcon()

public booleanhasLogo()

public booleanhideOverflowMenu()

public voidinitIndeterminateProgress()

public voidinitProgress()

public booleanisOverflowMenuShowing()

public booleanisOverflowMenuShowPending()

public booleanisTitleTruncated()

public voidrestoreHierarchyState(<any> toolbarStates)

public voidsaveHierarchyState(<any> toolbarStates)

public voidsetBackgroundDrawable(Drawable d)

public voidsetCollapsible(boolean collapsible)

public voidsetCustomView(View view)

public voidsetDefaultNavigationContentDescription(int defaultNavigationContentDescription)

public voidsetDefaultNavigationIcon(Drawable icon)

public voidsetDisplayOptions(int opts)

public voidsetDropdownParams(SpinnerAdapter adapter, AdapterView.OnItemSelectedListener listener)

public voidsetDropdownSelectedPosition(int position)

public voidsetEmbeddedTabView(ScrollingTabContainerView tabView)

public voidsetHomeButtonEnabled(boolean enable)

public voidsetIcon(Drawable d)

public voidsetIcon(int resId)

public voidsetLogo(Drawable d)

public voidsetLogo(int resId)

public voidsetMenu(Menu menu, MenuPresenter.Callback cb)

public voidsetMenuCallbacks(MenuPresenter.Callback presenterCallback, MenuBuilder.Callback menuBuilderCallback)

public voidsetMenuPrepared()

public voidsetNavigationContentDescription(java.lang.CharSequence description)

public voidsetNavigationContentDescription(int resId)

public voidsetNavigationIcon(Drawable icon)

public voidsetNavigationMode(int mode)

public voidsetSubtitle(java.lang.CharSequence subtitle)

public voidsetTitle(java.lang.CharSequence title)

public ViewPropertyAnimatorCompatsetupAnimatorToVisibility(int visibility, long duration)

public voidsetVisibility(int visible)

public voidsetWindowCallback(Window.Callback cb)

public voidsetWindowTitle(java.lang.CharSequence title)

public booleanshowOverflowMenu()

Methods

public ViewGroup getViewGroup()

public Context getContext()

public boolean hasExpandedActionView()

public void collapseActionView()

public void setWindowCallback(Window.Callback cb)

public void setWindowTitle(java.lang.CharSequence title)

public java.lang.CharSequence getTitle()

public void setTitle(java.lang.CharSequence title)

public java.lang.CharSequence getSubtitle()

public void setSubtitle(java.lang.CharSequence subtitle)

public void initProgress()

public void initIndeterminateProgress()

public boolean hasIcon()

public boolean hasLogo()

public void setIcon(int resId)

public void setIcon(Drawable d)

public void setLogo(int resId)

public void setLogo(Drawable d)

public boolean canShowOverflowMenu()

public boolean isOverflowMenuShowing()

public boolean isOverflowMenuShowPending()

public boolean showOverflowMenu()

public boolean hideOverflowMenu()

public void setMenuPrepared()

public void setMenu(Menu menu, MenuPresenter.Callback cb)

public void dismissPopupMenus()

public int getDisplayOptions()

public void setDisplayOptions(int opts)

public void setEmbeddedTabView(ScrollingTabContainerView tabView)

public boolean hasEmbeddedTabs()

public boolean isTitleTruncated()

public void setCollapsible(boolean collapsible)

public void setHomeButtonEnabled(boolean enable)

public int getNavigationMode()

public void setNavigationMode(int mode)

public void setDropdownParams(SpinnerAdapter adapter, AdapterView.OnItemSelectedListener listener)

public void setDropdownSelectedPosition(int position)

public int getDropdownSelectedPosition()

public int getDropdownItemCount()

public void setCustomView(View view)

public View getCustomView()

public void animateToVisibility(int visibility)

public ViewPropertyAnimatorCompat setupAnimatorToVisibility(int visibility, long duration)

public void setNavigationIcon(Drawable icon)

public void setNavigationContentDescription(java.lang.CharSequence description)

public void setNavigationContentDescription(int resId)

public void setDefaultNavigationContentDescription(int defaultNavigationContentDescription)

public void setDefaultNavigationIcon(Drawable icon)

public void saveHierarchyState(<any> toolbarStates)

public void restoreHierarchyState(<any> toolbarStates)

public void setBackgroundDrawable(Drawable d)

public int getHeight()

public void setVisibility(int visible)

public int getVisibility()

public void setMenuCallbacks(MenuPresenter.Callback presenterCallback, MenuBuilder.Callback menuBuilderCallback)

public Menu getMenu()

Source

/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package androidx.appcompat.widget;

import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Parcelable;
import android.util.SparseArray;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.SpinnerAdapter;

import androidx.annotation.RestrictTo;
import androidx.appcompat.view.menu.MenuBuilder;
import androidx.appcompat.view.menu.MenuPresenter;
import androidx.core.view.ViewPropertyAnimatorCompat;

/**
 * Common interface for a toolbar that sits as part of the window decor.
 * Layouts that control window decor use this as a point of interaction with different
 * bar implementations.
 *
 */
@RestrictTo(LIBRARY_GROUP_PREFIX)
public interface DecorToolbar {
    ViewGroup getViewGroup();
    Context getContext();
    boolean hasExpandedActionView();
    void collapseActionView();
    void setWindowCallback(Window.Callback cb);
    void setWindowTitle(CharSequence title);
    CharSequence getTitle();
    void setTitle(CharSequence title);
    CharSequence getSubtitle();
    void setSubtitle(CharSequence subtitle);
    void initProgress();
    void initIndeterminateProgress();
    boolean hasIcon();
    boolean hasLogo();
    void setIcon(int resId);
    void setIcon(Drawable d);
    void setLogo(int resId);
    void setLogo(Drawable d);
    boolean canShowOverflowMenu();
    boolean isOverflowMenuShowing();
    boolean isOverflowMenuShowPending();
    boolean showOverflowMenu();
    boolean hideOverflowMenu();
    void setMenuPrepared();
    void setMenu(Menu menu, MenuPresenter.Callback cb);
    void dismissPopupMenus();

    int getDisplayOptions();
    void setDisplayOptions(int opts);
    void setEmbeddedTabView(ScrollingTabContainerView tabView);
    boolean hasEmbeddedTabs();
    boolean isTitleTruncated();
    void setCollapsible(boolean collapsible);
    void setHomeButtonEnabled(boolean enable);
    int getNavigationMode();
    void setNavigationMode(int mode);
    void setDropdownParams(SpinnerAdapter adapter, AdapterView.OnItemSelectedListener listener);
    void setDropdownSelectedPosition(int position);
    int getDropdownSelectedPosition();
    int getDropdownItemCount();
    void setCustomView(View view);
    View getCustomView();
    void animateToVisibility(int visibility);
    ViewPropertyAnimatorCompat setupAnimatorToVisibility(int visibility, long duration);
    void setNavigationIcon(Drawable icon);
    void setNavigationIcon(int resId);
    void setNavigationContentDescription(CharSequence description);
    void setNavigationContentDescription(int resId);
    void setDefaultNavigationContentDescription(int defaultNavigationContentDescription);
    void setDefaultNavigationIcon(Drawable icon);
    void saveHierarchyState(SparseArray<Parcelable> toolbarStates);
    void restoreHierarchyState(SparseArray<Parcelable> toolbarStates);
    void setBackgroundDrawable(Drawable d);
    int getHeight();
    void setVisibility(int visible);
    int getVisibility();
    void setMenuCallbacks(MenuPresenter.Callback presenterCallback,
            MenuBuilder.Callback menuBuilderCallback);
    Menu getMenu();
}