瀏覽代碼

Removed unused variable, fixed light theme on Gingerbread for #410

Aidan Follestad 10 年之前
父節點
當前提交
4e64d810ec

+ 9 - 9
library/src/main/java/com/afollestad/materialdialogs/DialogInit.java

@@ -250,15 +250,6 @@ class DialogInit {
             dialog.neutralButton.setVisibility(View.VISIBLE);
         }
 
-        // Load default list item text color
-        if (builder.itemColorSet) {
-            dialog.defaultItemColor = builder.itemColor;
-        } else if (builder.theme == Theme.LIGHT) {
-            dialog.defaultItemColor = Color.BLACK;
-        } else {
-            dialog.defaultItemColor = Color.WHITE;
-        }
-
         // Setup list dialog stuff
         if (builder.listCallbackMultiChoice != null)
             dialog.selectedIndicesList = new ArrayList<>();
@@ -338,6 +329,15 @@ class DialogInit {
         dialog.invalidateList();
         dialog.setViewInternal(dialog.view);
         dialog.checkIfListInitScroll();
+
+        // API 10 compatibility stuff
+        if (builder.theme == Theme.LIGHT && Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
+            dialog.setInverseBackgroundForced(true);
+//            if (!builder.titleColorSet)
+//                title.setTextColor(Color.BLACK);
+//            if (!builder.contentColorSet)
+//                content.setTextColor(Color.BLACK);
+        }
     }
 
     private static void setupProgressDialog(final MaterialDialog dialog) {

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

@@ -70,7 +70,6 @@ public class MaterialDialog extends DialogBase implements
     protected MDButton positiveButton;
     protected MDButton neutralButton;
     protected MDButton negativeButton;
-    protected int defaultItemColor;
     protected ListType listType;
     protected List<Integer> selectedIndicesList;