Skip to content

Commit

Permalink
Merge pull request #32 from SubhamTyagi/master
Browse files Browse the repository at this point in the history
set the alpha value via setColor()
  • Loading branch information
rtugeek committed May 8, 2020
2 parents 43579fe + ac288d0 commit 8ca0416
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -623,6 +623,12 @@ public void setBarHeightPx(int px) {
private void setAlphaValue() {
mAlpha = 255 - mAlphaBarPosition;
}

private void setAlphaValue(int value) {
mAlpha = value;
mAlphaBarPosition = 255 - mAlpha;
// invalidate();
}

public void setAlphaBarPosition(int position) {
setPosition(mColorBarPosition,position);
Expand Down Expand Up @@ -695,6 +701,9 @@ public void setColor(int color) {

if (mInit) {
int value = mCachedColors.indexOf(withoutAlphaColor);
if (mIsShowAlphaBar) {
setAlphaValue(Color.alpha(color));
}
setColorBarPosition(value);
} else {
mColorsToInvoke = color;
Expand Down

0 comments on commit 8ca0416

Please sign in to comment.