Search in sources :

Example 6 with MenuView

use of android.support.v7.internal.view.menu.MenuView in project material by rey5137.

the class ToolbarManager method onGlobalLayout.

private void onGlobalLayout() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
        mToolbar.getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
    else
        mToolbar.getViewTreeObserver().removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
    ActionMenuView menuView = getMenuView();
    for (int i = 0, count = menuView == null ? 0 : menuView.getChildCount(); i < count; i++) {
        View child = menuView.getChildAt(i);
        if (mRippleStyle != 0) {
            if (child.getBackground() == null || !(child.getBackground() instanceof ToolbarRippleDrawable))
                ViewUtil.setBackground(child, getBackground());
        }
    }
    if (mGroupChanged) {
        animateIn();
        mGroupChanged = false;
    }
}
Also used : ToolbarRippleDrawable(com.rey.material.drawable.ToolbarRippleDrawable) ActionMenuView(android.support.v7.widget.ActionMenuView) View(android.view.View) ActionMenuView(android.support.v7.widget.ActionMenuView)

Aggregations

View (android.view.View)4 ActionMenuView (android.support.v7.widget.ActionMenuView)3 Animation (android.view.animation.Animation)2 TranslateAnimation (android.view.animation.TranslateAnimation)2 SuppressLint (android.annotation.SuppressLint)1 TypedArray (android.content.res.TypedArray)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 ActionMenuPresenter (android.support.v7.internal.view.menu.ActionMenuPresenter)1 ActionMenuView (android.support.v7.internal.view.menu.ActionMenuView)1 ListMenuPresenter (android.support.v7.internal.view.menu.ListMenuPresenter)1 MenuBuilder (android.support.v7.internal.view.menu.MenuBuilder)1 SubMenuBuilder (android.support.v7.internal.view.menu.SubMenuBuilder)1 SearchView (android.support.v7.widget.SearchView)1 ViewGroup (android.view.ViewGroup)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 ArrayAdapter (android.widget.ArrayAdapter)1 ListView (android.widget.ListView)1 PopupWindow (android.widget.PopupWindow)1 ToolbarRippleDrawable (com.rey.material.drawable.ToolbarRippleDrawable)1