Преглед на файлове

Changed colour of disabled button text to be a faded version of its enabled colour instead of the dark grey that can currently be seen. This behaviour can be seen in original Lollipop system dialogues, e.g., in the Add Network dialogue of the Settings app (faded/disabled SAVE button)

Patrick Geselbracht преди 10 години
родител
ревизия
b0b3a1059d
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

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

@@ -868,14 +868,14 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener,
 
 
     private ColorStateList getActionTextStateList(int newPrimaryColor) {
-        final int buttonColor = DialogUtils.resolveColor(getContext(), android.R.attr.textColorPrimary);
-        if (newPrimaryColor == 0) newPrimaryColor = buttonColor;
+        final int fallBackButtonColor = DialogUtils.resolveColor(getContext(), android.R.attr.textColorPrimary);
+        if (newPrimaryColor == 0) newPrimaryColor = fallBackButtonColor;
         int[][] states = new int[][]{
                 new int[]{-android.R.attr.state_enabled}, // disabled
                 new int[]{} // enabled
         };
         int[] colors = new int[]{
-                DialogUtils.adjustAlpha(buttonColor, 0.6f),
+                DialogUtils.adjustAlpha(newPrimaryColor, 0.4f),
                 newPrimaryColor
         };
         return new ColorStateList(states, colors);