Tabnine Logo
MaterialRatingBar
Code IndexAdd Tabnine to your IDE (free)

How to use
MaterialRatingBar
in
me.zhanghai.android.materialratingbar

Best Java code snippets using me.zhanghai.android.materialratingbar.MaterialRatingBar (Showing top 18 results out of 315)

origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setIndeterminateTintMode(PorterDuff.Mode)
 */
public void setSupportIndeterminateTintMode(@Nullable PorterDuff.Mode tintMode) {
  mProgressTintInfo.mIndeterminateTintMode = tintMode;
  mProgressTintInfo.mHasIndeterminateTintMode = true;
  applyIndeterminateTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

private void applyProgressTints() {
  if (getProgressDrawable() == null) {
    return;
  }
  applyPrimaryProgressTint();
  applyProgressBackgroundTint();
  applySecondaryProgressTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

private void applyPrimaryProgressTint() {
  if (getProgressDrawable() == null) {
    return;
  }
  if (mProgressTintInfo.mHasProgressTintList || mProgressTintInfo.mHasProgressTintMode) {
    Drawable target = getTintTargetFromProgressDrawable(android.R.id.progress, true);
    if (target != null) {
      applyTintForDrawable(target, mProgressTintInfo.mProgressTintList,
          mProgressTintInfo.mHasProgressTintList, mProgressTintInfo.mProgressTintMode,
          mProgressTintInfo.mHasProgressTintMode);
    }
  }
}
origin: DreaminginCodeZH/MaterialRatingBar

private void applyIndeterminateTint() {
  Drawable indeterminateDrawable = getIndeterminateDrawable();
  if (indeterminateDrawable == null) {
    return;
  }
  if (mProgressTintInfo.mHasIndeterminateTintList
      || mProgressTintInfo.mHasIndeterminateTintMode) {
    indeterminateDrawable.mutate();
    applyTintForDrawable(indeterminateDrawable, mProgressTintInfo.mIndeterminateTintList,
        mProgressTintInfo.mHasIndeterminateTintList,
        mProgressTintInfo.mIndeterminateTintMode,
        mProgressTintInfo.mHasIndeterminateTintMode);
  }
}
origin: DreaminginCodeZH/MaterialRatingBar

@SuppressWarnings("RestrictedApi")
private void init(AttributeSet attrs, int defStyleAttr) {
  Context context = getContext();
  TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs,
      R.styleable.MaterialRatingBar, defStyleAttr, 0);
      R.styleable.MaterialRatingBar_mrb_fillBackgroundStars, isIndicator());
  a.recycle();
  mDrawable = new MaterialRatingDrawable(getContext(), fillBackgroundStars);
  mDrawable.setStarCount(getNumStars());
  setProgressDrawable(mDrawable);
origin: DreaminginCodeZH/MaterialRatingBar

@Override
protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  super.onMeasure(widthMeasureSpec, heightMeasureSpec);
  int height = getMeasuredHeight();
  int width = Math.round(height * mDrawable.getTileRatio() * getNumStars());
  setMeasuredDimension(View.resolveSizeAndState(width, widthMeasureSpec, 0), height);
}
origin: DreaminginCodeZH/MaterialRatingBar

  logDrawableTintWarning();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    drawable.setTintList(tintList);
  logDrawableTintWarning();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    drawable.setTintMode(tintMode);
drawable.setState(getDrawableState());
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setProgressTintMode(PorterDuff.Mode)
 */
public void setSupportProgressTintMode(@Nullable PorterDuff.Mode tintMode) {
  mProgressTintInfo.mProgressTintMode = tintMode;
  mProgressTintInfo.mHasProgressTintMode = true;
  applyPrimaryProgressTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setProgressBackgroundTintList(ColorStateList)
 */
public void setSupportProgressBackgroundTintList(@Nullable ColorStateList tint) {
  mProgressTintInfo.mProgressBackgroundTintList = tint;
  mProgressTintInfo.mHasProgressBackgroundTintList = true;
  applyProgressBackgroundTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setSecondaryProgressTintMode(PorterDuff.Mode)
 */
public void setSupportSecondaryProgressTintMode(@Nullable PorterDuff.Mode tintMode) {
  mProgressTintInfo.mSecondaryProgressTintMode = tintMode;
  mProgressTintInfo.mHasSecondaryProgressTintMode = true;
  applySecondaryProgressTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

@Override
public void setProgressDrawable(Drawable d) {
  super.setProgressDrawable(d);
  // mProgressTintInfo can be null during super class initialization.
  if (mProgressTintInfo != null) {
    applyProgressTints();
  }
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setProgressTintList(ColorStateList)
 */
public void setSupportProgressTintList(@Nullable ColorStateList tint) {
  mProgressTintInfo.mProgressTintList = tint;
  mProgressTintInfo.mHasProgressTintList = true;
  applyPrimaryProgressTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setProgressBackgroundTintMode(PorterDuff.Mode)
 */
public void setSupportProgressBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
  mProgressTintInfo.mProgressBackgroundTintMode = tintMode;
  mProgressTintInfo.mHasProgressBackgroundTintMode = true;
  applyProgressBackgroundTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setSecondaryProgressTintList(ColorStateList)
 */
public void setSupportSecondaryProgressTintList(@Nullable ColorStateList tint) {
  mProgressTintInfo.mSecondaryProgressTintList = tint;
  mProgressTintInfo.mHasSecondaryProgressTintList = true;
  applySecondaryProgressTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

private void applySecondaryProgressTint() {
  if (getProgressDrawable() == null) {
    return;
  }
  if (mProgressTintInfo.mHasSecondaryProgressTintList
      || mProgressTintInfo.mHasSecondaryProgressTintMode) {
    Drawable target = getTintTargetFromProgressDrawable(android.R.id.secondaryProgress,
        false);
    if (target != null) {
      applyTintForDrawable(target, mProgressTintInfo.mSecondaryProgressTintList,
          mProgressTintInfo.mHasSecondaryProgressTintList,
          mProgressTintInfo.mSecondaryProgressTintMode,
          mProgressTintInfo.mHasSecondaryProgressTintMode);
    }
  }
}
origin: DreaminginCodeZH/MaterialRatingBar

/**
 * @see RatingBar#setIndeterminateTintList(ColorStateList)
 */
public void setSupportIndeterminateTintList(@Nullable ColorStateList tint) {
  mProgressTintInfo.mIndeterminateTintList = tint;
  mProgressTintInfo.mHasIndeterminateTintList = true;
  applyIndeterminateTint();
}
origin: DreaminginCodeZH/MaterialRatingBar

private void applyProgressBackgroundTint() {
  if (getProgressDrawable() == null) {
    return;
  }
  if (mProgressTintInfo.mHasProgressBackgroundTintList
      || mProgressTintInfo.mHasProgressBackgroundTintMode) {
    Drawable target = getTintTargetFromProgressDrawable(android.R.id.background, false);
    if (target != null) {
      applyTintForDrawable(target, mProgressTintInfo.mProgressBackgroundTintList,
          mProgressTintInfo.mHasProgressBackgroundTintList,
          mProgressTintInfo.mProgressBackgroundTintMode,
          mProgressTintInfo.mHasProgressBackgroundTintMode);
    }
  }
}
origin: DreaminginCodeZH/MaterialRatingBar

@Override
public void setIndeterminateDrawable(Drawable d) {
  super.setIndeterminateDrawable(d);
  // mProgressTintInfo can be null during super class initialization.
  if (mProgressTintInfo != null) {
    applyIndeterminateTint();
  }
}
me.zhanghai.android.materialratingbarMaterialRatingBar

Most used methods

  • applyIndeterminateTint
  • applyPrimaryProgressTint
  • applyProgressBackgroundTint
  • applyProgressTints
  • applySecondaryProgressTint
  • applyTintForDrawable
  • getContext
  • getDrawableState
  • getIndeterminateDrawable
  • getMeasuredHeight
  • getNumStars
  • getProgressDrawable
  • getNumStars,
  • getProgressDrawable,
  • getRating,
  • getSupportIndeterminateTintList,
  • getSupportIndeterminateTintMode,
  • getSupportProgressBackgroundTintList,
  • getSupportProgressBackgroundTintMode,
  • getSupportProgressTintList,
  • getSupportProgressTintMode,
  • getSupportSecondaryProgressTintList

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Kernel (java.awt.image)
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now