Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Fixed alpha based on this fix: rengwuxian#275
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Rietschlin authored and Aaron Rietschlin committed May 25, 2016
1 parent f6e9fa4 commit 5494400
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ protected void onDraw(@NonNull Canvas canvas) {
int floatingLabelStartY = (int) (innerPaddingTop + floatingLabelTextSize + floatingLabelPadding - distance * (floatingLabelAlwaysShown ? 1 : floatingLabelFraction) + getScrollY());

// calculate the alpha
int alpha = ((int) ((floatingLabelAlwaysShown ? 1 : floatingLabelFraction) * 0xff * (0.74f * focusFraction * (isEnabled() ? 1 : 0) + 0.26f) * (floatingLabelTextColor != -1 ? 1 : Color.alpha(floatingLabelTextColor) / 256f)));
int alpha = ((int) ((floatingLabelAlwaysShown ? 1 : floatingLabelFraction) * (0.74f * floatingLabelFraction * (isEnabled() ? 1 : 0) + 0.26f) * (floatingLabelTextColor != -1 ? 0xff : Color.alpha(floatingLabelTextColor))));
textPaint.setAlpha(alpha);

// draw the floating label
Expand Down Expand Up @@ -1525,4 +1525,4 @@ private int checkLength(CharSequence text) {
if (lengthChecker==null) return text.length();
return lengthChecker.getLength(text);
}
}
}

1 comment on commit 5494400

@vadymhimself
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't just merge the pull request?

Please sign in to comment.