Aidan Follestad 9 jaren geleden
bovenliggende
commit
c41e076ead
1 gewijzigde bestanden met toevoegingen van 1 en 2 verwijderingen
  1. 1 2
      sample/src/main/java/com/afollestad/materialdialogssample/MainActivity.java

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

@@ -575,8 +575,7 @@ public class MainActivity extends AppCompatActivity implements
     public void onColorSelection(@StringRes int dialogTitle, int topLevelColor, int subLevelColor) {
         this.topLevelColor = topLevelColor;
         this.subLevelColor = subLevelColor;
-        int color = topLevelColor;
-        if (subLevelColor != 0) color = subLevelColor;
+        int color = subLevelColor != 0 ? subLevelColor : topLevelColor;
         //noinspection ConstantConditions
         getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
         ThemeSingleton.get().positiveColor = DialogUtils.getActionTextStateList(this, color);