diff options
author | Setup Wizard Team <android-setup-team-eng@google.com> | 2021-05-04 08:22:45 +0800 |
---|---|---|
committer | Cn Chen <cnchen@google.com> | 2021-05-04 04:17:46 +0000 |
commit | e530e8b9c6d953bf281696a83dca37b03d212e8e (patch) | |
tree | e56ced367ca8fcbbc980a76241bb706201b680cf /main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java | |
parent | ff3cc9f2135c480fd66908bbe51c91ac8deb4645 (diff) | |
download | setupdesign-e530e8b9c6d953bf281696a83dca37b03d212e8e.tar.gz |
Import updated Android Setupdesign Library 371812065
Copied from google3/third_party/java_src/android_libs/setupdesign
Test: mm
Bug: 182870319
Bug: 185557130
Included changes:
- 371812065 Add replace rule to remove comment
- 371731255 Rollback the new layout of layout-v31 due to footer bar m...
- 371667272 Add API for ChimeraActivity
- 371663930 [GlifLoadingLayout] make the content area keep fixed size...
- 371648106 [GlifLoadingLayout] Add padding partner resources for con...
- 371647490 [Transition][fallback] adds animation resources files for...
- 371626793 [GlifLoadingLayout] Adds comment for functions and fixes ...
- 371102383 [ColorExtraction] Adds fix colors for color extraction.
- 371080909 [GlifLoadingLayout] Adds padding value for waiting screen...
- 371036943 Create theme for support full dynamic color
- 370881231 [GlifLoadingLayout] adjust the layout to follow spec to m...
- 370868945 It's hard to know the fail reason of trySetDynamicColor
PiperOrigin-RevId: 371812065
Change-Id: Ib9108999c9e53b4b8a9b21653bfe16788a6e3e22
Diffstat (limited to 'main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java')
-rw-r--r-- | main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java b/main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java index 2cde29e..d6eade8 100644 --- a/main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java +++ b/main/src/com/google/android/setupdesign/util/PartnerStyleHelper.java @@ -20,7 +20,6 @@ import android.app.Activity; import android.content.Context; import android.content.res.TypedArray; import android.os.Build; -import androidx.annotation.NonNull; import android.view.Gravity; import android.view.View; import com.google.android.setupcompat.PartnerCustomizationLayout; @@ -35,6 +34,7 @@ import java.util.Locale; /** The helper reads styles from the partner configurations. */ public final class PartnerStyleHelper { + private static final String TAG = "PartnerStyleHelper"; /** * Returns the partner configuration of layout gravity, usually apply to widgets in header area. */ @@ -120,39 +120,6 @@ public final class PartnerStyleHelper { return isSetupFlow || usePartnerResource; } - /** Returns {@code true} if the dynamic color is set. */ - static boolean trySetDynamicColor(@NonNull Context context, boolean isDayNightEnabled) { - if (!PartnerConfigHelper.shouldApplyDynamicColor(context)) { - return false; - } - - Activity activity = null; - try { - activity = PartnerCustomizationLayout.lookupActivityFromContext(context); - } catch (IllegalArgumentException ex) { - return false; - } - - // try best to get partner resource settings from attrs - boolean isSetupFlow = WizardManagerHelper.isAnySetupWizard(activity.getIntent()); - - if (isSetupFlow) { - // apply theme for inside setup flow - activity.setTheme( - isDayNightEnabled - ? R.style.SudDynamicColorThemeGlifV3_DayNight - : R.style.SudDynamicColorThemeGlifV3_Light); - } else { - // apply theme for outside setup flow - activity.setTheme( - isDayNightEnabled - ? R.style.SudFullDynamicColorThemeGlifV3_DayNight - : R.style.SudFullDynamicColorThemeGlifV3_Light); - } - - return true; - } - /** * Returns if the current layout/activity applies heavy partner customized configurations or not. * |