diff --git a/main/java/com/google/android/setupcompat/template/FooterBarMixin.java b/main/java/com/google/android/setupcompat/template/FooterBarMixin.java
index 85972f5..a0bb65b 100644
--- a/main/java/com/google/android/setupcompat/template/FooterBarMixin.java
+++ b/main/java/com/google/android/setupcompat/template/FooterBarMixin.java
@@ -103,7 +103,7 @@
           Button button = buttonContainer.findViewById(id);
           if (button != null) {
             button.setEnabled(enabled);
-            if (applyPartnerResources) {
+            if (applyPartnerResources && !applyDynamicColor) {
               updateButtonTextColorWithEnabledState(
                   button,
                   (id == primaryButtonId || isSecondaryButtonInPrimaryStyle)
@@ -358,6 +358,10 @@
 
     onFooterButtonInflated(button, footerBarPrimaryBackgroundColor);
     onFooterButtonApplyPartnerResource(button, footerButtonPartnerConfig);
+    // Sets the primary button background to a light accent color
+    if (applyDynamicColor) {
+      FooterButtonStyleUtils.applyDynamicColorOnPrimaryButton(context, button);
+    }
 
     // Make sure the position of buttons are correctly and prevent primary button create twice or
     // more.
diff --git a/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java b/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
index 5fd4d96..ca4d56b 100644
--- a/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
+++ b/main/java/com/google/android/setupcompat/template/FooterButtonStyleUtils.java
@@ -148,12 +148,33 @@
         context, button, footerButtonPartnerConfig.getButtonIconConfig(), isButtonIconAtEnd);
   }
 
+  @TargetApi(VERSION_CODES.S)
+  static void applyDynamicColorOnPrimaryButton(Context context, Button button) {
+    // only update the text color of enable state
+    if (button.isEnabled()) {
+      FooterButtonStyleUtils.updateButtonTextEnabledColor(
+          button, context.getResources().getColor(R.color.suc_system_neutral1_900));
+    }
+    FooterButtonStyleUtils.updateButtonBackgroundTintList(
+        context,
+        button,
+        context.getResources().getColor(R.color.suc_system_accent1_100),
+        /* disabledAlpha=*/ 0f,
+        /* disabledColor=*/ 0);
+    FooterButtonStyleUtils.updateButtonRippleColor(
+        button, context.getResources().getColor(R.color.suc_system_neutral1_900));
+  }
+
   static void updateButtonTextEnabledColorWithPartnerConfig(
       Context context, Button button, PartnerConfig buttonEnableTextColorConfig) {
     @ColorInt
     int color = PartnerConfigHelper.get(context).getColor(context, buttonEnableTextColorConfig);
-    if (color != Color.TRANSPARENT) {
-      button.setTextColor(ColorStateList.valueOf(color));
+    updateButtonTextEnabledColor(button, color);
+  }
+
+  static void updateButtonTextEnabledColor(Button button, @ColorInt int textColor) {
+    if (textColor != Color.TRANSPARENT) {
+      button.setTextColor(ColorStateList.valueOf(textColor));
     }
   }
 
@@ -174,17 +195,27 @@
     Preconditions.checkArgument(
         Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q,
         "Update button background only support on sdk Q or higher");
-    @ColorInt int disabledColor;
-    float disabledAlpha;
-    int[] DISABLED_STATE_SET = {-android.R.attr.state_enabled};
-    int[] ENABLED_STATE_SET = {};
     @ColorInt
     int color = PartnerConfigHelper.get(context).getColor(context, buttonBackgroundConfig);
-    disabledAlpha =
+    float disabledAlpha =
         PartnerConfigHelper.get(context).getFraction(context, buttonDisableAlphaConfig, 0f);
-    disabledColor =
+    @ColorInt
+    int disabledColor =
         PartnerConfigHelper.get(context).getColor(context, buttonDisableBackgroundConfig);
 
+    updateButtonBackgroundTintList(context, button, color, disabledAlpha, disabledColor);
+  }
+
+  @TargetApi(VERSION_CODES.Q)
+  static void updateButtonBackgroundTintList(
+      Context context,
+      Button button,
+      @ColorInt int color,
+      float disabledAlpha,
+      @ColorInt int disabledColor) {
+    int[] DISABLED_STATE_SET = {-android.R.attr.state_enabled};
+    int[] ENABLED_STATE_SET = {};
+
     if (color != Color.TRANSPARENT) {
       if (disabledAlpha <= 0f) {
         // if no partner resource, fallback to theme disable alpha
@@ -247,6 +278,27 @@
     }
   }
 
+  static void updateButtonRippleColor(Button button, @ColorInt int rippleColor) {
+    // RippleDrawable is available after sdk 21. And because on lower sdk the RippleDrawable is
+    // unavailable. Since Stencil customization provider only works on Q+, there is no need to
+    // perform any customization for versions 21.
+    if (Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
+      RippleDrawable rippleDrawable = getRippleDrawable(button);
+      if (rippleDrawable == null) {
+        return;
+      }
+
+      int[] pressedState = {android.R.attr.state_pressed};
+
+      // Set text color for ripple.
+      ColorStateList colorStateList =
+          new ColorStateList(
+              new int[][] {pressedState, StateSet.NOTHING},
+              new int[] {rippleColor, Color.TRANSPARENT});
+      rippleDrawable.setColor(colorStateList);
+    }
+  }
+
   static void updateButtonTextSizeWithPartnerConfig(
       Context context, Button button, PartnerConfig buttonTextSizeConfig) {
     float size = PartnerConfigHelper.get(context).getDimension(context, buttonTextSizeConfig);
@@ -349,6 +401,9 @@
         LayerDrawable layerDrawable = (LayerDrawable) ((InsetDrawable) drawable).getDrawable();
         return (GradientDrawable) layerDrawable.getDrawable(0);
       } else if (drawable instanceof RippleDrawable) {
+        if (((RippleDrawable) drawable).getDrawable(0) instanceof GradientDrawable) {
+          return (GradientDrawable) ((RippleDrawable) drawable).getDrawable(0);
+        }
         InsetDrawable insetDrawable = (InsetDrawable) ((RippleDrawable) drawable).getDrawable(0);
         return (GradientDrawable) insetDrawable.getDrawable();
       }
diff --git a/main/res/values-v31/colors.xml b/main/res/values-v31/colors.xml
new file mode 100644
index 0000000..da7f1e8
--- /dev/null
+++ b/main/res/values-v31/colors.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+    Copyright (C) 2021 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<resources>
+  <color name="suc_system_accent1_100">@android:color/system_accent1_100</color>
+  <color name="suc_system_neutral1_900">@android:color/system_neutral1_900</color>
+</resources>
\ No newline at end of file
diff --git a/main/res/values/colors.xml b/main/res/values/colors.xml
index f472b35..e9f25a5 100644
--- a/main/res/values/colors.xml
+++ b/main/res/values/colors.xml
@@ -23,4 +23,7 @@
 
     <color name="suc_customization_button_highlight_default">#ff1a73e8</color>
 
+    <color name="suc_system_accent1_100">#8DF5E3</color>
+
+    <color name="suc_system_neutral1_900">#1b1b1b</color>
 </resources>
\ No newline at end of file
