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


Java R类代码示例

本文整理汇总了Java中com.akexorcist.roundcornerprogressbar.R的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: setupStyleable

import com.akexorcist.roundcornerprogressbar.R; //导入依赖的package包/类
public void setupStyleable(Context context, AttributeSet attrs) {
    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundCornerProgress);

    radius = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcRadius, dp2px(DEFAULT_PROGRESS_RADIUS));
    padding = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcBackgroundPadding, dp2px(DEFAULT_BACKGROUND_PADDING));

    isReverse = typedArray.getBoolean(R.styleable.RoundCornerProgress_rcReverse, false);

    max = typedArray.getFloat(R.styleable.RoundCornerProgress_rcMax, DEFAULT_MAX_PROGRESS);
    progress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcProgress, DEFAULT_PROGRESS);
    secondaryProgress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcSecondaryProgress, DEFAULT_SECONDARY_PROGRESS);

    int colorBackgroundDefault = context.getResources().getColor(R.color.round_corner_progress_bar_background_default);
    colorBackground = typedArray.getColor(R.styleable.RoundCornerProgress_rcBackgroundColor, colorBackgroundDefault);
    int colorProgressDefault = context.getResources().getColor(R.color.round_corner_progress_bar_progress_default);
    colorProgress = typedArray.getColor(R.styleable.RoundCornerProgress_rcProgressColor, colorProgressDefault);
    int colorSecondaryProgressDefault = context.getResources().getColor(R.color.round_corner_progress_bar_secondary_progress_default);
    colorSecondaryProgress = typedArray.getColor(R.styleable.RoundCornerProgress_rcSecondaryProgressColor, colorSecondaryProgressDefault);
    typedArray.recycle();

    initStyleable(context, attrs);
}
 
开发者ID:Karim94,项目名称:IIFYM,代码行数:23,代码来源:BaseRoundCornerProgressBar.java

示例2: setup

import com.akexorcist.roundcornerprogressbar.R; //导入依赖的package包/类
public void setup(Context context, AttributeSet attrs) {
    setupStyleable(context, attrs);

    removeAllViews();
    // Setup layout for sub class
    LayoutInflater.from(context).inflate(initLayout(), this);
    // Initial default view
    layoutBackground = (LinearLayout) findViewById(R.id.layout_background);
    layoutProgress = (LinearLayout) findViewById(R.id.layout_progress);
    layoutSecondaryProgress = (LinearLayout) findViewById(R.id.layout_secondary_progress);

    initView();
}
 
开发者ID:Karim94,项目名称:IIFYM,代码行数:14,代码来源:BaseRoundCornerProgressBar.java

示例3: setup

import com.akexorcist.roundcornerprogressbar.R; //导入依赖的package包/类
protected void setup(Context context, AttributeSet attrs) {
    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundCornerProgress);

    DisplayMetrics metrics = getContext().getResources().getDisplayMetrics();
    radius = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, radius, metrics);
    radius = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcBackgroundRadius, DEFAULT_PROGRESS_RADIUS);

    padding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, padding, metrics);
    padding = (int) typedArray.getDimension(R.styleable.RoundCornerProgress_rcBackgroundPadding, DEFAULT_PROGRESS_PADDING);

    layoutBackground = (LinearLayout) findViewById(R.id.round_corner_progress_background);
    layoutBackground.setPadding(padding, padding, padding, padding);
    if (!isBackgroundColorSetBeforeDraw) {
        setBackgroundLayoutColor(typedArray.getColor(R.styleable.RoundCornerProgress_rcBackgroundColor, DEFAULT_BACKGROUND_COLOR));
    }

    layoutProgress = (LinearLayout) findViewById(R.id.round_corner_progress_progress);
    layoutSecondaryProgress = (LinearLayout) findViewById(R.id.round_corner_progress_secondary_progress);
    if (!isProgressColorSetBeforeDraw) {
        setProgressColor(
                typedArray.getColor(R.styleable.RoundCornerProgress_rcProgressColor, DEFAULT_PROGRESS_COLOR),
                typedArray.getColor(R.styleable.RoundCornerProgress_rcSecondaryProgressColor, DEFAULT_SECONDARY_PROGRESS_COLOR)
        );
    }

    if (!isMaxProgressSetBeforeDraw) {
        max = typedArray.getFloat(R.styleable.RoundCornerProgress_rcMax, DEFAULT_MAX_PROGRESS);
    }

    if (!isProgressSetBeforeDraw) {
        progress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcProgress, DEFAULT_CURRENT_PROGRESS);
        secondaryProgress = typedArray.getFloat(R.styleable.RoundCornerProgress_rcSecondaryProgress, DEFAULT_SECONDARY_PROGRESS);
    }

    setup(typedArray, metrics);
    typedArray.recycle();
}
 
开发者ID:SamuelGjk,项目名称:BPic,代码行数:38,代码来源:BaseRoundCornerProgressBar.java


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