當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionMenuView.getChildAt方法代碼示例

本文整理匯總了Java中android.support.v7.widget.ActionMenuView.getChildAt方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMenuView.getChildAt方法的具體用法?Java ActionMenuView.getChildAt怎麽用?Java ActionMenuView.getChildAt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.widget.ActionMenuView的用法示例。


在下文中一共展示了ActionMenuView.getChildAt方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onGlobalLayout

import android.support.v7.widget.ActionMenuView; //導入方法依賴的package包/類
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;
    }
}
 
開發者ID:XhinLiang,項目名稱:MDPreference,代碼行數:21,代碼來源:ToolbarManager.java

示例2: onPrepareOptionsMenu

import android.support.v7.widget.ActionMenuView; //導入方法依賴的package包/類
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
    //fixing toolbar icons after changing theme
    //should be fixed in next support release
    Toolbar t = (Toolbar) findViewById(R.id.toolbar);
    for (int i = 0; i < t.getChildCount(); i++) {
        if (t.getChildAt(i) instanceof ActionMenuView) {
            ActionMenuView v = (ActionMenuView) t.getChildAt(i);
            for (int j = 0; j < v.getChildCount(); j++) {
                if (v.getChildAt(j) instanceof TintImageView) {
                    TintImageView v1 = (TintImageView) v.getChildAt(j);
                    v1.setImageResource(R.drawable.abc_ic_menu_moreoverflow_mtrl_alpha);
                }
            }
        }
    }
    return super.onPrepareOptionsMenu(menu);
}
 
開發者ID:pbednarz,項目名稱:MaterialColors,代碼行數:19,代碼來源:MainActivity.java

示例3: animateIn

import android.support.v7.widget.ActionMenuView; //導入方法依賴的package包/類
private void animateIn(){
    ActionMenuView menuView = getMenuView();

    for(int i = 0, count = menuView == null ? 0 : menuView.getChildCount(); i < count; i++){
        View child = menuView.getChildAt(i);
        Animation anim = mAnimator.getInAnimation(child, i);
        if(anim != null)
            child.startAnimation(anim);
    }
}
 
開發者ID:XhinLiang,項目名稱:MDPreference,代碼行數:11,代碼來源:ToolbarManager.java

示例4: setButtonTextColor

import android.support.v7.widget.ActionMenuView; //導入方法依賴的package包/類
private void setButtonTextColor() {
    final ActionMenuView buttonsContainer = ViewUtils.findChildByClass(this, ActionMenuView.class);
    if (buttonsContainer != null) {
        for (int i = 0; i < buttonsContainer.getChildCount(); i++) {
            if (buttonsContainer.getChildAt(i) instanceof TextView) {
                ((TextView) buttonsContainer.getChildAt(i)).setTextColor(getButton(i).getColor().getColor());
            }
        }
    }
}
 
開發者ID:wix,項目名稱:react-native-navigation,代碼行數:11,代碼來源:TitleBar.java


注:本文中的android.support.v7.widget.ActionMenuView.getChildAt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。