Skip to content

Commit

Permalink
Merge pull request #24 from manuelffc/patch-1
Browse files Browse the repository at this point in the history
Update ColorSeekBar.java
  • Loading branch information
rtugeek committed Oct 12, 2018
2 parents 557cbd8 + 9defc16 commit fd39f2f
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -308,6 +308,13 @@ public boolean onTouchEvent(MotionEvent event) {
case MotionEvent.ACTION_DOWN:
if (isOnBar(mColorRect, x, y)) {
mMovingColorBar = true;
float value = (x - realLeft) / mBarWidth * mMaxPosition;
mColorBarPosition = (int) value;
if (mColorBarPosition < 0)
mColorBarPosition = 0;
if (mColorBarPosition > mMaxPosition)
mColorBarPosition = mMaxPosition;
invalidate();
} else if (mIsShowAlphaBar) {
if (isOnBar(mAlphaRect, x, y)) {
mMovingAlphaBar = true;
Expand Down Expand Up @@ -723,4 +730,4 @@ public interface OnInitDoneListener {
public int getColorBarPosition() {
return mColorBarPosition;
}
}
}

0 comments on commit fd39f2f

Please sign in to comment.