Skip to content

Commit

Permalink
Add fix for AutoComplete & MultiAutoComplete TextView
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron Cai committed Jun 7, 2015
1 parent 96d01e7 commit a75c149
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ protected void onDraw(@NonNull Canvas canvas) {
if (floatingLabelEnabled && !TextUtils.isEmpty(floatingLabelText)) {
textPaint.setTextSize(floatingLabelTextSize);
// calculate the text color
textPaint.setColor((Integer) focusEvaluator.evaluate(focusFraction, floatingLabelTextColor != -1 ? floatingLabelTextColor : (baseColor & 0x00ffffff | 0x44000000), primaryColor));
textPaint.setColor((Integer) focusEvaluator.evaluate(focusFraction * (isEnabled() ? 1 : 0), floatingLabelTextColor != -1 ? floatingLabelTextColor : (baseColor & 0x00ffffff | 0x44000000), primaryColor));

// calculate the horizontal position
float floatingLabelWidth = textPaint.measureText(floatingLabelText.toString());
Expand All @@ -1375,7 +1375,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 + 0.26f) * (floatingLabelTextColor != -1 ? 1 : Color.alpha(floatingLabelTextColor) / 256f)));
int alpha = ((int) ((floatingLabelAlwaysShown ? 1 : floatingLabelFraction) * 0xff * (0.74f * focusFraction * (isEnabled() ? 1 : 0) + 0.26f) * (floatingLabelTextColor != -1 ? 1 : Color.alpha(floatingLabelTextColor) / 256f)));
textPaint.setAlpha(alpha);

// draw the floating label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ protected void onDraw(@NonNull Canvas canvas) {
if (floatingLabelEnabled && !TextUtils.isEmpty(floatingLabelText)) {
textPaint.setTextSize(floatingLabelTextSize);
// calculate the text color
textPaint.setColor((Integer) focusEvaluator.evaluate(focusFraction, floatingLabelTextColor != -1 ? floatingLabelTextColor : (baseColor & 0x00ffffff | 0x44000000), primaryColor));
textPaint.setColor((Integer) focusEvaluator.evaluate(focusFraction * (isEnabled() ? 1 : 0), floatingLabelTextColor != -1 ? floatingLabelTextColor : (baseColor & 0x00ffffff | 0x44000000), primaryColor));

// calculate the horizontal position
float floatingLabelWidth = textPaint.measureText(floatingLabelText.toString());
Expand All @@ -1372,7 +1372,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 + 0.26f) * (floatingLabelTextColor != -1 ? 1 : Color.alpha(floatingLabelTextColor) / 256f)));
int alpha = ((int) ((floatingLabelAlwaysShown ? 1 : floatingLabelFraction) * 0xff * (0.74f * focusFraction * (isEnabled() ? 1 : 0) + 0.26f) * (floatingLabelTextColor != -1 ? 1 : Color.alpha(floatingLabelTextColor) / 256f)));
textPaint.setAlpha(alpha);

// draw the floating label
Expand Down

0 comments on commit a75c149

Please sign in to comment.