Skip to content

Commit

Permalink
set the alpha value via setColor()
Browse files Browse the repository at this point in the history
set the alpha bar  via setColor(int color) when alpha bar is shown
  • Loading branch information
SubhamTyagi committed May 8, 2020
1 parent 43579fe commit ac288d0
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 ac288d0

Please sign in to comment.