浏览代码

Fixed https://github.com/afollestad/material-dialogs/issues/771

Aidan Follestad 9 年之前
父节点
当前提交
68fd646664
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      commons/src/main/java/com/afollestad/materialdialogs/color/ColorChooserDialog.java

+ 4 - 5
commons/src/main/java/com/afollestad/materialdialogs/color/ColorChooserDialog.java

@@ -329,14 +329,13 @@ public class ColorChooserDialog extends DialogFragment implements View.OnClickLi
             mCustomSeekGValue = (TextView) v.findViewById(R.id.colorGValue);
             mCustomSeekB = (SeekBar) v.findViewById(R.id.colorB);
             mCustomSeekBValue = (TextView) v.findViewById(R.id.colorBValue);
+            if (!foundPreselectColor) {
+                // If color wasn't found in the preset colors, it must be custom
+                toggleCustom(dialog);
+            }
         }
 
         invalidate();
-        if (!foundPreselectColor) {
-            // If color wasn't found in the preset colors, it must be custom
-            toggleCustom(dialog);
-        }
-
         return dialog;
     }