Bläddra i källkod

Release 0.5.5

Aidan Follestad 10 år sedan
förälder
incheckning
2408e6d8ef

+ 8 - 8
library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

@@ -894,19 +894,19 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener {
             ThemeSingleton s = ThemeSingleton.get();
             theme(s.darkTheme ? Theme.DARK : Theme.LIGHT);
             if (s.titleColor != -1)
-                titleColorRes(s.titleColor);
+                titleColor(s.titleColor);
             if (s.contentColor != -1)
-                contentColorRes(s.contentColor);
+                contentColor(s.contentColor);
             if (s.accentColor != -1)
-                accentColorRes(s.accentColor);
+                accentColor(s.accentColor);
             if (s.itemColor != -1)
-                itemColorRes(s.itemColor);
-            if (s.icon != -1)
-                iconRes(s.icon);
+                itemColor(s.itemColor);
+            if (s.icon != null)
+                icon(s.icon);
             if (s.backgroundColor != -1)
-                backgroundColorRes(s.backgroundColor);
+                backgroundColor(s.backgroundColor);
             if (s.dividerColor != -1)
-                dividerColorRes(s.dividerColor);
+                dividerColor(s.dividerColor);
         }
 
         public Builder title(@StringRes int titleRes) {

+ 2 - 10
library/src/main/java/com/afollestad/materialdialogs/ThemeSingleton.java

@@ -1,7 +1,6 @@
 package com.afollestad.materialdialogs;
 
-import android.support.annotation.ColorRes;
-import android.support.annotation.DrawableRes;
+import android.graphics.drawable.Drawable;
 
 /**
  * Use of this is discouraged for now; for internal use only. See the Global Theming section of the README.
@@ -30,18 +29,11 @@ public class ThemeSingleton {
 //    <attr name="md_divider_color" format="color" />
 
     public boolean darkTheme = false;
-    @ColorRes
     public int titleColor = -1;
-    @ColorRes
     public int contentColor = -1;
-    @ColorRes
     public int accentColor = -1;
-    @ColorRes
     public int itemColor = -1;
-    @DrawableRes
-    public int icon = -1;
-    @ColorRes
+    public Drawable icon = null;
     public int backgroundColor = -1;
-    @ColorRes
     public int dividerColor = -1;
 }