mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
Merge "Fix TextInputLayout clearing the EditText tint" into mnc-ub-dev
am: 403e480 * commit '403e4802cae0b5354cac650f26e1a4f5e74b696c': Fix TextInputLayout clearing the EditText tint GitOrigin-RevId=5b52850af5eb41669b8b741518d316b40be9d676 PiperOrigin-RevId: 140560422
This commit is contained in:
parent
638d6ab685
commit
0dd6fc7b1e
@ -25,6 +25,7 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.DrawableContainer;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
@ -719,6 +720,11 @@ public class TextInputLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
private void ensureBackgroundDrawableStateWorkaround() {
|
||||
final int sdk = Build.VERSION.SDK_INT;
|
||||
if (sdk != 21 || sdk != 22) {
|
||||
// The workaround is only required on API 21-22
|
||||
return;
|
||||
}
|
||||
final Drawable bg = mEditText.getBackground();
|
||||
if (bg == null) {
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user