Esempio n. 1
0
 private void initParams(Context context, AttributeSet attrs) {
   TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ProgressView);
   targetNum = typedArray.getInt(R.styleable.ProgressView_targetNum, targetNum);
   currentStep = typedArray.getInt(R.styleable.ProgressView_currentStep, currentStep);
   showdesc = typedArray.getBoolean(R.styleable.ProgressView_showdesc, showdesc);
   textSize =
       DimenHelper.sp(
           typedArray.getDimension(R.styleable.ProgressView_stepSize, textSize), context);
   descSize =
       DimenHelper.sp(
           typedArray.getDimension(R.styleable.ProgressView_descSize, descSize), context);
   pickedColor = typedArray.getColor(R.styleable.ProgressView_pickedColor, pickedColor);
   unPickColor = typedArray.getColor(R.styleable.ProgressView_unPickColor, unPickColor);
   stepTextColor = typedArray.getColor(R.styleable.ProgressView_stepTextColor, stepTextColor);
   descColor = typedArray.getColor(R.styleable.ProgressView_descColor, descColor);
   typedArray.recycle();
 }
Esempio n. 2
0
 public void setTextSize(float textSize) {
   this.textSize = DimenHelper.sp(textSize, getContext());
   stepTextPaint.setTextSize(textSize);
   invalidate();
 }
Esempio n. 3
0
  public void setDescSize(float descSize) {

    this.descSize = DimenHelper.sp(descSize, getContext());
    descPaint.setTextSize(descSize);
    invalidate();
  }