Aidan Follestad 9 年之前
父節點
當前提交
c41e076ead
共有 1 個文件被更改,包括 1 次插入2 次删除
  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);