Aidan Follestad 9 years ago
parent
commit
77b27f5d71

+ 2 - 1
core/src/main/java/com/afollestad/materialdialogs/DialogInit.java

@@ -429,7 +429,8 @@ class DialogInit {
 
         if (builder.inputType != -1) {
             dialog.input.setInputType(builder.inputType);
-            if ((builder.inputType & InputType.TYPE_TEXT_VARIATION_PASSWORD) == InputType.TYPE_TEXT_VARIATION_PASSWORD) {
+            if (builder.inputType != InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD  &&
+                    (builder.inputType & InputType.TYPE_TEXT_VARIATION_PASSWORD) == InputType.TYPE_TEXT_VARIATION_PASSWORD) {
                 // If the flags contain TYPE_TEXT_VARIATION_PASSWORD, apply the password transformation method automatically
                 dialog.input.setTransformationMethod(PasswordTransformationMethod.getInstance());
             }

+ 7 - 2
core/src/main/java/com/afollestad/materialdialogs/internal/MDTintHelper.java

@@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable;
 import android.os.Build;
 import android.support.annotation.ColorInt;
 import android.support.annotation.NonNull;
+import android.support.graphics.drawable.VectorDrawableCompat;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.graphics.drawable.DrawableCompat;
 import android.support.v7.widget.AppCompatEditText;
@@ -38,7 +39,9 @@ public class MDTintHelper {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
             radioButton.setButtonTintList(sl);
         } else {
-            Drawable d = DrawableCompat.wrap(ContextCompat.getDrawable(radioButton.getContext(), R.drawable.abc_btn_radio_material));
+            Drawable radioVector = VectorDrawableCompat.create(radioButton.getContext().getResources(),
+                    R.drawable.abc_btn_radio_material, null);
+            Drawable d = DrawableCompat.wrap(radioVector);
             DrawableCompat.setTintList(d, sl);
             radioButton.setButtonDrawable(d);
         }
@@ -129,7 +132,9 @@ public class MDTintHelper {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
             box.setButtonTintList(sl);
         } else {
-            Drawable drawable = DrawableCompat.wrap(ContextCompat.getDrawable(box.getContext(), R.drawable.abc_btn_check_material));
+            Drawable checkVector = VectorDrawableCompat.create(box.getContext().getResources(),
+                    R.drawable.abc_btn_check_material, null);
+            Drawable drawable = DrawableCompat.wrap(checkVector);
             DrawableCompat.setTintList(drawable, sl);
             box.setButtonDrawable(drawable);
         }