Browse Source

Switched progressColor() to widgetColor(), it will apply to check boxes and radio buttons in choice lists. Added default light or dark theme detection based on Activity's primary text color. Completely redid the Theming section in the README.

Aidan Follestad 10 years ago
parent
commit
4b93e50c2d

+ 107 - 28
README.md

@@ -245,6 +245,16 @@ unless auto dismiss is turned off.
 If you make a call to `alwaysCallSingleChoiceCallback()`, the single choice callback will be called
 every time the user selects an item.
 
+##### Coloring Radio Buttons
+
+Like action buttons and many other elements of the Material dialog, you can customize the color of a 
+ dialog's radio buttons. The `Builder` class contains a `widgetColor()`, `widgetColorRes()`,
+ and `widgetColorAttr()` method. Their names and parameter annotations make them self explanatory.
+ Note that by default, check boxes will be colored with the color held in `colorAccent` (for AppCompat)
+ or `android:colorAccent` (for the Material theme) in your Activity's theme.
+ 
+There's also a global theming attribute as shown in the Global Theming section of this README: `md_widget_color`.
+
 ---
 
 ### Multi Choice List Dialogs
@@ -283,6 +293,16 @@ unless auto dismiss is turned off.
 If you make a call to `alwaysCallMultiChoiceCallback()`, the multi choice callback will be called
 every time the user selects an item.
 
+##### Coloring Check Boxes
+
+Like action buttons and many other elements of the Material dialog, you can customize the color of a 
+ dialog's check boxes. The `Builder` class contains a `widgetColor()`, `widgetColorRes()`,
+ and `widgetColorAttr()` method. Their names and parameter annotations make them self explanatory. 
+ Note that by default, check boxes will be colored with the color held in `colorAccent` (for AppCompat)
+ or `android:colorAccent` (for the Material theme) in your Activity's theme.
+ 
+There's also a global theming attribute as shown in the Global Theming section of this README: `md_widget_color`.
+
 ---
 
 ### Custom List Dialogs
@@ -401,47 +421,104 @@ Setting an action button's text to null will cause it to be hidden. Do not manua
 Before Lollipop, theming AlertDialogs was basically impossible without using reflection and custom drawables.
 Since KitKat, Android became more color neutral but AlertDialogs continued to use Holo Blue for the title and
 title divider. Lollipop has improved even more, with no colors in the dialog by default other than the action
-buttons. This library makes theming even easier. Here's a basic example:
+buttons. This library makes theming even easier.
+
+###### Basics
+
+By default, Material Dialogs will apply a light theme or dark theme based on the `?android:textColorPrimary` 
+attribute retrieved from the context creating the dialog. If the color is light (e.g. more white), it will
+guess the Activity is using a dark theme and it will use the dialog's dark theme. You can manually set the theme 
+used from the `Builder#theme()` method:
+
+```java
+new MaterialDialog.Builder(this)
+        .content("Hi")
+        .theme(Theme.DARK)
+        .show();
+```
+
+Or you can use the global theming attribute, which is discussed in the section below. Global theming 
+avoids having to constantly call theme setters for every dialog you show.
+
+###### Colors
+
+Pretty much every aspect of a dialog created with this library can be colored:
 
 ```java
 new MaterialDialog.Builder(this)
-        .title(R.string.title)
-        .content(R.string.content)
-        .positiveText(R.string.positive)
-        .neutralText(R.string.neutral)
-        .negativeText(R.string.negative)
-        .positiveColorRes(R.color.material_red_500)
-        .neutralColorRes(R.color.material_red_500)
-        .negativeColorRes(R.color.material_red_500)
-        .progressColorRes(R.color.material_red_500)
-        .titleGravity(GravityEnum.CENTER_HORIZONTAL)
-        .contentGravity(GravityEnum.CENTER_HORIZONTAL)
-        .btnStackedGravity(GravityEnum.START)
-        .buttonsGravity(GravityEnum.END)
-        .itemsGravity(GravityEnum.END)
         .titleColorRes(R.color.material_red_500)
         .contentColorRes(Color.WHITE)
         .dividerColorRes(R.color.material_pink_500)
         .backgroundColorRes(R.color.material_blue_grey_800)
-        .btnSelectorStacked(R.drawable.custom_btn_selector_stacked)
+        .positiveColorRes(R.color.material_red_500)
+        .neutralColorRes(R.color.material_red_500)
+        .negativeColorRes(R.color.material_red_500)
+        .widgetColorRes(R.color.material_red_500)
+        .show();
+```
+
+The names are self explanatory for the most part. The `widgetColor` method is discussed in a few other
+sections of this tutorial, it applies to progress bars, check boxes, and radio buttons. Also note
+that each of these methods have 3 variations for setting a color directly, using color resources, and
+using color attributes.
+
+###### Selectors
+
+Theming selectors allows you to change colors for pressable things:
+
+```java
+new MaterialDialog.Builder(this)
         .btnSelector(R.drawable.custom_btn_selector)
         .btnSelector(R.drawable.custom_btn_selector_primary, DialogAction.POSITIVE)
+        .btnSelectorStacked(R.drawable.custom_btn_selector_stacked)
         .listSelector(R.drawable.custom_list_and_stackedbtn_selector)
-        .theme(Theme.DARK)
         .show();
 ```
 
-To see more colors that fit the Material design palette, see this page: http://www.google.com/design/spec/style/color.html#color-color-palette
+The first `btnSelector` line sets a selector drawable used for all action buttons. The second `btnSelector`
+line overwrites the drawable used only for the positive button. This results in the positive button having
+a different selector than the neutral and negative buttons. `btnSelectorStacked` sets a selector drawable
+used when the buttons become stacked, either because there's not enough room to fit them all on one line,
+or because you used `forceStacked(true)` on the `Builder`. `listSelector` is used for list items, when
+you are NOT using a custom adapter.
 
 ***An important note related to using custom action button selectors***: make sure your selector drawable references
 inset drawables like the default ones do, this is important for correct action button padding.
 
+###### Gravity
+
+It's probably unlikely you'd want to change gravity of elements in a dialog, but it's possible.
+
+```java
+new MaterialDialog.Builder(this)
+        .titleGravity(GravityEnum.CENTER_HORIZONTAL)
+        .contentGravity(GravityEnum.CENTER_HORIZONTAL)
+        .btnStackedGravity(GravityEnum.START)
+        .itemsGravity(GravityEnum.END)
+        .buttonsGravity(GravityEnum.END)
+        .show();
+```
+
+These are pretty self explanatory. `titleGravity` sets the gravity for the dialog title, `contentGravity`
+sets the gravity for the dialog content, `btnStackedGravity` sets the gravity for stacked action buttons, 
+`itemsGravity` sets the gravity for list items (when you're NOT using a custom adapter). However, `buttonsGravity` 
+is a little less intuitive: think of it like it's changing the gravity of the neutral button. When you use START, 
+this is the normal configuration. The neutral button will be on the left (or right for RTL), the positive button 
+will be on the far right (or left for RTL), and the neutral button will be to the left of the positive button 
+(or right for RTL). Using END would result in the exact opposite. Using CENTER will put the neutral button
+in the center, the negative button on the left, and the positive button on the right (the negative and positive 
+positions switch for RTL).
+
+###### Material Palette
+
+To see colors that fit the Material design palette, see this page: http://www.google.com/design/spec/style/color.html#color-color-palette
+
 ---
 
 ### Global Theming
 
-By default, the dialog inherits and extracts theme colors from other attributes and theme colors of the app
-or operating system. This behavior can be overridden in your Activity themes:
+Most of the theming aspects discussed in the above section can be automatically applied to all dialogs
+you show from an Activity which has a theme containing any these attributes:
 
 ```xml
 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
@@ -509,11 +586,11 @@ or operating system. This behavior can be overridden in your Activity themes:
     <item name="md_negative_color">#673AB7</item>
 
     <!--
-        By default, a progress dialog's progress indicator color is derived
-        from the colorAccent attribute of AppCompat or android:colorAccent
-        attribute of the Material theme.
+        By default, a progress dialog's progress bar, check boxes, and radio buttons 
+        have a color is derived from the colorAccent attribute of AppCompat or 
+        android:colorAccent attribute of the Material theme.
     -->
-    <item name="md_progress_color">#673AB7</item>
+    <item name="md_widget_color">#673AB7</item>
 
     <!--
         By default, the list item text color is black for the light
@@ -679,13 +756,15 @@ dialog.setContent(getString(R.string.done));
 
 See the sample project for this dialog in action, with the addition of threading.
 
-##### Coloring
+##### Coloring the Progress Bar
 
 Like action buttons and many other elements of the Material dialog, you can customize the color of a 
- progress dialog's progress indicator. The `Builder` class contains a `progressColor()`, `progressColorRes()`,
- and `progressColorAttr()` method. Their names and parameter annotations make them self explanatory.
+ progress dialog's progress bar. The `Builder` class contains a `widgetColor()`, `widgetColorRes()`,
+ and `widgetColorAttr()` method. Their names and parameter annotations make them self explanatory.
+ Note that by default, check boxes will be colored with the color held in `colorAccent` (for AppCompat)
+ or `android:colorAccent` (for the Material theme) in your Activity's theme.
  
-There's also a global theming attribute as shown in the Global Theming section of this README: `md_progress_color`.
+There's also a global theming attribute as shown in the Global Theming section of this README: `md_widget_color`.
 
 ---
 

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

@@ -85,7 +85,7 @@ class DialogInit {
         builder.positiveColor = DialogUtils.resolveColor(builder.context, R.attr.md_positive_color, builder.positiveColor);
         builder.neutralColor = DialogUtils.resolveColor(builder.context, R.attr.md_neutral_color, builder.neutralColor);
         builder.negativeColor = DialogUtils.resolveColor(builder.context, R.attr.md_negative_color, builder.negativeColor);
-        builder.progressColor = DialogUtils.resolveColor(builder.context, R.attr.md_progress_color, builder.progressColor);
+        builder.widgetColor = DialogUtils.resolveColor(builder.context, R.attr.md_widget_color, builder.widgetColor);
 
         // Retrieve default title/content colors
         if (!builder.titleColorSet) {
@@ -154,10 +154,8 @@ class DialogInit {
         }
 
         // Setup divider color in case content scrolls
-        if (builder.dividerColor == 0)
-            builder.dividerColor = DialogUtils.resolveColor(builder.context, R.attr.md_divider_color);
-        if (builder.dividerColor == 0)
-            builder.dividerColor = DialogUtils.resolveColor(dialog.getContext(), R.attr.md_divider);
+        final int dividerFallback = DialogUtils.resolveColor(dialog.getContext(), R.attr.md_divider);
+        builder.dividerColor = DialogUtils.resolveColor(builder.context, R.attr.md_divider_color, dividerFallback);
         dialog.view.setDividerColor(builder.dividerColor);
 
         // Setup title and title frame
@@ -338,12 +336,12 @@ class DialogInit {
             // Color the progress bar
             Drawable indDraw = dialog.mProgress.getIndeterminateDrawable();
             if (indDraw != null) {
-                indDraw.setColorFilter(builder.progressColor, PorterDuff.Mode.SRC_ATOP);
+                indDraw.setColorFilter(builder.widgetColor, PorterDuff.Mode.SRC_ATOP);
                 dialog.mProgress.setIndeterminateDrawable(indDraw);
             }
             Drawable regDraw = dialog.mProgress.getProgressDrawable();
             if (regDraw != null) {
-                regDraw.setColorFilter(builder.progressColor, PorterDuff.Mode.SRC_ATOP);
+                regDraw.setColorFilter(builder.widgetColor, PorterDuff.Mode.SRC_ATOP);
                 dialog.mProgress.setProgressDrawable(regDraw);
             }
 

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

@@ -8,6 +8,7 @@ public enum GravityEnum {
     START, CENTER, END;
 
     private static final boolean HAS_RTL = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
+
     public int getGravityInt() {
         switch (this) {
             case START:

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

@@ -337,7 +337,7 @@ public class MaterialDialog extends DialogBase implements
         protected CharSequence neutralText;
         protected CharSequence negativeText;
         protected View customView;
-        protected int progressColor;
+        protected int widgetColor;
         protected int positiveColor;
         protected int negativeColor;
         protected int neutralColor;
@@ -397,17 +397,21 @@ public class MaterialDialog extends DialogBase implements
             // Retrieve default accent colors, which are used on the action buttons and progress bars
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                 final int fallback = DialogUtils.resolveColor(context, R.attr.colorAccent, materialBlue);
-                this.progressColor = DialogUtils.resolveColor(context, android.R.attr.colorAccent, fallback);
-                this.positiveColor = this.progressColor;
-                this.negativeColor = this.progressColor;
-                this.neutralColor = this.progressColor;
+                this.widgetColor = DialogUtils.resolveColor(context, android.R.attr.colorAccent, fallback);
+                this.positiveColor = this.widgetColor;
+                this.negativeColor = this.widgetColor;
+                this.neutralColor = this.widgetColor;
             } else {
-                this.progressColor = DialogUtils.resolveColor(context, R.attr.colorAccent, materialBlue);
-                this.positiveColor = this.progressColor;
-                this.negativeColor = this.progressColor;
-                this.neutralColor = this.progressColor;
+                this.widgetColor = DialogUtils.resolveColor(context, R.attr.colorAccent, materialBlue);
+                this.positiveColor = this.widgetColor;
+                this.negativeColor = this.widgetColor;
+                this.neutralColor = this.widgetColor;
             }
 
+            // Set the default theme based on the Activity theme's primary color darkness (more white or more black)
+            final int primaryTextColor = DialogUtils.resolveColor(context, android.R.attr.textColorPrimary);
+            this.theme = DialogUtils.isColorDark(primaryTextColor) ? Theme.LIGHT : Theme.DARK;
+
             // Load theme values from the ThemeSingleton if needed
             checkSingleton();
 
@@ -451,8 +455,8 @@ public class MaterialDialog extends DialogBase implements
                 this.btnSelectorNeutral = s.btnSelectorNeutral;
             if (s.btnSelectorNegative != 0)
                 this.btnSelectorNegative = s.btnSelectorNegative;
-            if (s.progressColor != 0)
-                this.progressColor = s.progressColor;
+            if (s.widgetColor != 0)
+                this.widgetColor = s.widgetColor;
             this.titleGravity = s.titleGravity;
             this.contentGravity = s.contentGravity;
             this.btnStackedGravity = s.btnStackedGravity;
@@ -840,17 +844,17 @@ public class MaterialDialog extends DialogBase implements
             return progress(indeterminate, max);
         }
 
-        public Builder progressColor(int color) {
-            this.progressColor = color;
+        public Builder widgetColor(int color) {
+            this.widgetColor = color;
             return this;
         }
 
-        public Builder progressColorRes(@ColorRes int colorRes) {
-            return progressColor(this.context.getResources().getColor(colorRes));
+        public Builder widgetColorRes(@ColorRes int colorRes) {
+            return widgetColor(this.context.getResources().getColor(colorRes));
         }
 
-        public Builder progressColorAttr(@AttrRes int colorAttr) {
-            return progressColorRes(DialogUtils.resolveColor(this.context, colorAttr));
+        public Builder widgetColorAttr(@AttrRes int colorAttr) {
+            return widgetColorRes(DialogUtils.resolveColor(this.context, colorAttr));
         }
 
         public Builder dividerColor(int color) {

+ 6 - 5
library/src/main/java/com/afollestad/materialdialogs/MaterialDialogAdapter.java

@@ -8,13 +8,12 @@ import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
-import android.widget.CheckBox;
 import android.widget.CompoundButton;
 import android.widget.LinearLayout;
-import android.widget.RadioButton;
 import android.widget.TextView;
 
-import com.afollestad.materialdialogs.util.DialogUtils;
+import com.afollestad.materialdialogs.internal.MDCheckBox;
+import com.afollestad.materialdialogs.internal.MDRadioButton;
 
 class MaterialDialogAdapter extends ArrayAdapter<CharSequence> {
 
@@ -45,14 +44,16 @@ class MaterialDialogAdapter extends ArrayAdapter<CharSequence> {
         switch (dialog.listType) {
             case SINGLE: {
                 @SuppressLint("CutPasteId")
-                RadioButton radio = (RadioButton) view.findViewById(R.id.control);
+                MDRadioButton radio = (MDRadioButton) view.findViewById(R.id.control);
                 radio.setChecked(dialog.mBuilder.selectedIndex == index);
+                radio.setColorFilter(dialog.mBuilder.widgetColor);
                 break;
             }
             case MULTI: {
                 @SuppressLint("CutPasteId")
-                CheckBox checkbox = (CheckBox) view.findViewById(R.id.control);
+                MDCheckBox checkbox = (MDCheckBox) view.findViewById(R.id.control);
                 checkbox.setChecked(dialog.selectedIndicesList.contains(index));
+                checkbox.setColorFilter(dialog.mBuilder.widgetColor);
                 break;
             }
         }

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

@@ -26,7 +26,7 @@ public class ThemeSingleton {
     public int positiveColor = 0;
     public int neutralColor = 0;
     public int negativeColor = 0;
-    public int progressColor = 0;
+    public int widgetColor = 0;
     public int itemColor = 0;
     public Drawable icon = null;
     public int backgroundColor = 0;

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

@@ -96,5 +96,4 @@ public class MDButton extends TextView {
             }
         }
     }
-
 }

+ 47 - 0
library/src/main/java/com/afollestad/materialdialogs/internal/MDCheckBox.java

@@ -0,0 +1,47 @@
+package com.afollestad.materialdialogs.internal;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.widget.CheckBox;
+
+/**
+ * @author Aidan Follestad (afollestad)
+ */
+public class MDCheckBox extends CheckBox {
+
+    public MDCheckBox(Context context) {
+        super(context);
+    }
+
+    public MDCheckBox(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MDCheckBox(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+    public MDCheckBox(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    private int color;
+
+    @Override
+    protected boolean verifyDrawable(Drawable who) {
+        boolean val = super.verifyDrawable(who);
+        if (who != null)
+            who.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
+        return val;
+    }
+
+    public void setColorFilter(int color) {
+        this.color = color;
+//        invalidate();
+    }
+}

+ 47 - 0
library/src/main/java/com/afollestad/materialdialogs/internal/MDRadioButton.java

@@ -0,0 +1,47 @@
+package com.afollestad.materialdialogs.internal;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.widget.CheckBox;
+
+/**
+ * @author Aidan Follestad (afollestad)
+ */
+public class MDRadioButton extends CheckBox {
+
+    public MDRadioButton(Context context) {
+        super(context);
+    }
+
+    public MDRadioButton(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public MDRadioButton(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+    }
+
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+    public MDRadioButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+    }
+
+    private int color;
+
+    @Override
+    protected boolean verifyDrawable(Drawable who) {
+        boolean val = super.verifyDrawable(who);
+        if (who != null)
+            who.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
+        return val;
+    }
+
+    public void setColorFilter(int color) {
+        this.color = color;
+//        invalidate();
+    }
+}

+ 12 - 12
library/src/main/java/com/afollestad/materialdialogs/internal/MDRootLayout.java

@@ -22,12 +22,12 @@ import com.afollestad.materialdialogs.util.RecyclerUtil;
 
 /**
  * @author Kevin Barry (teslacoil) 4/02/2015
- *
- * This is the top level view for all MaterialDialogs
- * It handles the layout of:
- *  titleFrame (md_stub_titleframe)
- *  content (text, custom view, listview, etc)
- *  buttonDefault... (either stacked or horizontal)
+ *         <p/>
+ *         This is the top level view for all MaterialDialogs
+ *         It handles the layout of:
+ *         titleFrame (md_stub_titleframe)
+ *         content (text, custom view, listview, etc)
+ *         buttonDefault... (either stacked or horizontal)
  */
 public class MDRootLayout extends ViewGroup {
     private static final String TAG = "MD.RootView";
@@ -161,8 +161,8 @@ public class MDRootLayout extends ViewGroup {
         if (hasButtons) {
             if (mIsStacked) {
                 availableHeight -= stackedHeight;
-                fullPadding += 2*mButtonPaddingFull;
-                minPadding += 2*mButtonPaddingFull;
+                fullPadding += 2 * mButtonPaddingFull;
+                minPadding += 2 * mButtonPaddingFull;
             } else {
                 availableHeight -= mButtonBarHeight;
                 fullPadding += 2 * mButtonPaddingFull;
@@ -170,7 +170,7 @@ public class MDRootLayout extends ViewGroup {
             }
         } else {
             /* Content has 8dp, we add 16dp and get 24dp, the frame margin */
-            fullPadding += 2*mButtonPaddingFull;
+            fullPadding += 2 * mButtonPaddingFull;
         }
 
         if (mTitleBar != null && mTitleBar.getVisibility() != View.GONE) {
@@ -191,9 +191,9 @@ public class MDRootLayout extends ViewGroup {
             } else {
                 mUseFullPadding = false;
                 availableHeight = 0;
-                mDrawTopDivider =  mTitleBar != null && mTitleBar.getVisibility() != View.GONE &&
+                mDrawTopDivider = mTitleBar != null && mTitleBar.getVisibility() != View.GONE &&
                         canViewOrChildScroll(mContent, false);
-                mDrawBottomDivider =  hasButtons &&
+                mDrawBottomDivider = hasButtons &&
                         canViewOrChildScroll(mContent, true);
             }
 
@@ -315,7 +315,7 @@ public class MDRootLayout extends ViewGroup {
                     } else if (neutralRight == -1 && neutralLeft != -1) {
                         neutralRight = neutralLeft + mButtons[INDEX_NEUTRAL].getMeasuredWidth();
                     } else if (neutralRight == -1 && neutralLeft == -1) {
-                        neutralLeft = (r - l)/2 - mButtons[INDEX_NEUTRAL].getMeasuredWidth()/2;
+                        neutralLeft = (r - l) / 2 - mButtons[INDEX_NEUTRAL].getMeasuredWidth() / 2;
                         neutralRight = neutralLeft + mButtons[INDEX_NEUTRAL].getMeasuredWidth();
                     }
                     bl = neutralLeft;

+ 1 - 1
library/src/main/res/layout-ldrtl/md_listitem_multichoice.xml

@@ -22,7 +22,7 @@
         android:paddingEnd="@dimen/md_listitem_control_margin"
         tools:ignore="RtlSymmetry" />
 
-    <CheckBox
+    <com.afollestad.materialdialogs.internal.MDCheckBox
         android:id="@+id/control"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 1 - 1
library/src/main/res/layout-ldrtl/md_listitem_singlechoice.xml

@@ -22,7 +22,7 @@
         android:paddingEnd="@dimen/md_listitem_control_margin"
         tools:ignore="RtlSymmetry" />
 
-    <RadioButton
+    <com.afollestad.materialdialogs.internal.MDRadioButton
         android:id="@+id/control"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 1 - 1
library/src/main/res/layout/md_listitem_multichoice.xml

@@ -10,7 +10,7 @@
     android:paddingRight="@dimen/md_dialog_frame_margin"
     android:paddingEnd="@dimen/md_dialog_frame_margin">
 
-    <CheckBox
+    <com.afollestad.materialdialogs.internal.MDCheckBox
         android:id="@+id/control"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 1 - 1
library/src/main/res/layout/md_listitem_singlechoice.xml

@@ -10,7 +10,7 @@
     android:paddingRight="@dimen/md_dialog_frame_margin"
     android:paddingEnd="@dimen/md_dialog_frame_margin">
 
-    <RadioButton
+    <com.afollestad.materialdialogs.internal.MDRadioButton
         android:id="@+id/control"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"

+ 1 - 1
library/src/main/res/values/attrs.xml

@@ -18,7 +18,7 @@
     <attr name="md_positive_color" format="color" />
     <attr name="md_neutral_color" format="color" />
     <attr name="md_negative_color" format="color" />
-    <attr name="md_progress_color" format="color" />
+    <attr name="md_widget_color" format="color" />
 
     <attr name="md_item_color" format="color" />
     <attr name="md_divider_color" format="color" />

+ 1 - 1
sample/src/main/java/com/afollestad/materialdialogssample/MainActivity.java

@@ -489,7 +489,7 @@ public class MainActivity extends ActionBarActivity implements
         ThemeSingleton.get().positiveColor = color;
         ThemeSingleton.get().neutralColor = color;
         ThemeSingleton.get().negativeColor = color;
-        ThemeSingleton.get().progressColor = color;
+        ThemeSingleton.get().widgetColor = color;
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
             getWindow().setStatusBarColor(darker);
     }