当前位置: 首页>>代码示例>>Java>>正文


Java Utils.setAlpha方法代码示例

本文整理汇总了Java中it.neokree.materialnavigationdrawer.util.Utils.setAlpha方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.setAlpha方法的具体用法?Java Utils.setAlpha怎么用?Java Utils.setAlpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在it.neokree.materialnavigationdrawer.util.Utils的用法示例。


在下文中一共展示了Utils.setAlpha方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: select

import it.neokree.materialnavigationdrawer.util.Utils; //导入方法依赖的package包/类
public void select() {
    isSelected = true;
    if(!rippleAnimationSupport())
        view.setBackgroundColor(colorSelected);
    else
        ripple.setRippleBackground(colorSelected);

    if(hasSectionColor) {
        text.setTextColor(sectionColor);

        if(icon != null && !realColor) {
            icon.setColorFilter(sectionColor);
            Utils.setAlpha(icon, 1f);
        }
    }
}
 
开发者ID:GeorgeMe,项目名称:MaterialNavigationDrawer,代码行数:17,代码来源:MaterialSection.java

示例2: unSelect

import it.neokree.materialnavigationdrawer.util.Utils; //导入方法依赖的package包/类
public void unSelect() {
    isSelected = false;
    if(!rippleAnimationSupport()) {
        view.setBackgroundColor(colorUnpressed);
    }
    else {
        ripple.setRippleBackground(colorUnpressed);
    }

    if (hasSectionColor) {
        text.setTextColor(textColor);

        if (icon != null && !realColor) {
            icon.setColorFilter(iconColor);
            Utils.setAlpha(icon, 0.54f);
        }
    }
}
 
开发者ID:GeorgeMe,项目名称:MaterialNavigationDrawer,代码行数:19,代码来源:MaterialSection.java

示例3: afterClick

import it.neokree.materialnavigationdrawer.util.Utils; //导入方法依赖的package包/类
private void afterClick() {
    isSelected = true;

    if (hasSectionColor) {
        text.setTextColor(sectionColor);

        if (icon != null && !realColor) {
            icon.setColorFilter(sectionColor);
            Utils.setAlpha(icon, 1f);
        }
    }

    if (listener != null)
        listener.onClick(this);

    // se la sezione ha come target l'activity, dopo che questa viene avviata si deseleziona.
    if(this.getTarget() == TARGET_ACTIVITY)
        this.unSelect();

    // si fa arrivare il click anche allo sviluppatore
    if (this.getTarget() == TARGET_LISTENER && targetListener != null)
        this.targetListener.onClick(this);
}
 
开发者ID:GeorgeMe,项目名称:MaterialNavigationDrawer,代码行数:24,代码来源:MaterialSection.java

示例4: useRealColor

import it.neokree.materialnavigationdrawer.util.Utils; //导入方法依赖的package包/类
public MaterialSection useRealColor() {
    realColor = true;
    if(icon != null) {
        Utils.setAlpha(icon,1f);
    }

    return this;
}
 
开发者ID:GeorgeMe,项目名称:MaterialNavigationDrawer,代码行数:9,代码来源:MaterialSection.java

示例5: MaterialSubheader

import it.neokree.materialnavigationdrawer.util.Utils; //导入方法依赖的package包/类
public MaterialSubheader(Context ctx) {
    float density = ctx.getResources().getDisplayMetrics().density;

    // create layout
    LinearLayout layout = new LinearLayout(ctx);
    layout.setOrientation(LinearLayout.VERTICAL);

    // inflate the line
    View view = new View(ctx);
    view.setBackgroundColor(Color.parseColor("#8f8f8f"));
    LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,1);
    params.setMargins(0,(int) (8 * density), 0 , (int) (8 * density));
    layout.addView(view,params);

    // inflate the text
    text = new TextView(ctx);
    Utils.setAlpha(text,0.54f);
    text.setTextSize(TypedValue.COMPLEX_UNIT_SP,14);
    text.setGravity(Gravity.START);
    LinearLayout.LayoutParams paramsText = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
    paramsText.setMargins((int) (16 * density),0, (int) (16 * density) , (int) (4 * density));

    layout.addView(text,paramsText);
    this.view = layout;

    // get attributes from current theme
    Resources.Theme theme = ctx.getTheme();
    TypedValue typedValue = new TypedValue();
    theme.resolveAttribute(R.attr.sectionStyle,typedValue,true);
    TypedArray values = theme.obtainStyledAttributes(typedValue.resourceId,R.styleable.MaterialSection);
    try {
        titleColor = values.getColor(R.styleable.MaterialSubheader_subheaderTitleColor,0x000);


    }
    finally {
        values.recycle();
    }

    // set attributes to the view
    text.setTextColor(Color.BLACK);

}
 
开发者ID:GeorgeMe,项目名称:MaterialNavigationDrawer,代码行数:44,代码来源:MaterialSubheader.java


注:本文中的it.neokree.materialnavigationdrawer.util.Utils.setAlpha方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。