2626import android .support .annotation .DimenRes ;
2727import android .support .annotation .NonNull ;
2828import android .support .v4 .content .ContextCompat ;
29+ import android .support .v7 .widget .AppCompatButton ;
2930import android .util .AttributeSet ;
3031import android .util .DisplayMetrics ;
3132import android .view .KeyEvent ;
3738
3839import java .lang .ref .WeakReference ;
3940
40- public final class SignInButton extends Button {
41+ public final class SignInButton extends AppCompatButton {
4142
4243 private int mSizeIcon ;
4344 private int mSizeNormal ;
@@ -155,7 +156,7 @@ private void setBtnTheme(int theme) {
155156 case 0 :
156157 mDrawable = ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_logo_black );
157158 if (android .os .Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
158- setBackgroundTintList (getContext (). getResources (). getColorStateList (R .color .sign_in_button_bg_white , null ));
159+ setBackgroundTintList (ContextCompat . getColorStateList (getContext (), R .color .sign_in_button_bg_white ));
159160 } else {
160161 setBackground (ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_bg_white ));
161162 }
@@ -164,7 +165,7 @@ private void setBtnTheme(int theme) {
164165 case 1 :
165166 mDrawable = ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_logo_white );
166167 if (android .os .Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
167- setBackgroundTintList (getContext (). getResources (). getColorStateList (R .color .sign_in_button_bg_grey , null ));
168+ setBackgroundTintList (ContextCompat . getColorStateList (getContext (), R .color .sign_in_button_bg_grey ));
168169 } else {
169170 setBackground (ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_bg_grey ));
170171 }
@@ -173,7 +174,7 @@ private void setBtnTheme(int theme) {
173174 case 2 :
174175 mDrawable = ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_logo_white );
175176 if (android .os .Build .VERSION .SDK_INT >= Build .VERSION_CODES .LOLLIPOP ) {
176- setBackgroundTintList (getContext (). getResources (). getColorStateList (R .color .sign_in_button_bg_green , null ));
177+ setBackgroundTintList (ContextCompat . getColorStateList (getContext (), R .color .sign_in_button_bg_green ));
177178 } else {
178179 setBackground (ContextCompat .getDrawable (getContext (), R .drawable .xee_auth_btn_bg_green ));
179180 }
0 commit comments