diff options
author | Setup Wizard Team <android-setup-team-eng@google.com> | 2021-02-01 11:46:32 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-02-01 11:46:32 +0000 |
commit | e8251b5bac99036ecc1138f60c1b41a439b1a2c4 (patch) | |
tree | 8b184fcabae2ecf239aff8469bbe6e309ec00b08 | |
parent | 3ddbe9bee73c8fd63ee3978a4b3b7700fc011903 (diff) | |
parent | 72d13daad5e02d314caca8be0378761b057fe878 (diff) | |
download | setupcompat-e8251b5bac99036ecc1138f60c1b41a439b1a2c4.tar.gz |
Import updated Android SetupCompat Library 353709689 am: 72d13daad5
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/setupcompat/+/13413710
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I519bbbbd6e8df0120874bd2d77b1c6531432fad4
5 files changed, 83 insertions, 3 deletions
diff --git a/exempting_lint_checks.txt b/exempting_lint_checks.txt index e69de29..f875ad3 100644 --- a/exempting_lint_checks.txt +++ b/exempting_lint_checks.txt @@ -0,0 +1,4 @@ +third_party/java_src/android_libs/setupcompat/main/java/com/google/android/setupcompat/PartnerCustomizationLayout.java: CustomViewStyleable: attrs, R.styleable.SucPartnerCustomizationLayout, defStyleAttr, 0); +third_party/java_src/android_libs/setupcompat/main/java/com/google/android/setupcompat/internal/TemplateLayout.java: CustomViewStyleable: getContext().obtainStyledAttributes(attrs, R.styleable.SucTemplateLayout, defStyleAttr, 0); +third_party/java_src/android_libs/setupcompat/main/java/com/google/android/setupcompat/PartnerCustomizationLayout.java: CustomViewStyleable: attrs, R.styleable.SucPartnerCustomizationLayout, defStyleAttr, 0); +third_party/java_src/android_libs/setupcompat/main/java/com/google/android/setupcompat/internal/TemplateLayout.java: CustomViewStyleable: getContext().obtainStyledAttributes(attrs, R.styleable.SucTemplateLayout, defStyleAttr, 0); diff --git a/main/java/com/google/android/setupcompat/internal/FooterButtonPartnerConfig.java b/main/java/com/google/android/setupcompat/internal/FooterButtonPartnerConfig.java index 39b50cf..94101fb 100644 --- a/main/java/com/google/android/setupcompat/internal/FooterButtonPartnerConfig.java +++ b/main/java/com/google/android/setupcompat/internal/FooterButtonPartnerConfig.java @@ -27,6 +27,7 @@ public class FooterButtonPartnerConfig { private final PartnerConfig buttonIconConfig; private final PartnerConfig buttonTextColorConfig; private final PartnerConfig buttonTextSizeConfig; + private final PartnerConfig buttonMinHeightConfig; private final PartnerConfig buttonTextTypeFaceConfig; private final PartnerConfig buttonRadiusConfig; private final PartnerConfig buttonRippleColorAlphaConfig; @@ -40,6 +41,7 @@ public class FooterButtonPartnerConfig { PartnerConfig buttonIconConfig, PartnerConfig buttonTextColorConfig, PartnerConfig buttonTextSizeConfig, + PartnerConfig buttonMinHeightConfig, PartnerConfig buttonTextTypeFaceConfig, PartnerConfig buttonRadiusConfig, PartnerConfig buttonRippleColorAlphaConfig) { @@ -47,6 +49,7 @@ public class FooterButtonPartnerConfig { this.buttonTextColorConfig = buttonTextColorConfig; this.buttonTextSizeConfig = buttonTextSizeConfig; + this.buttonMinHeightConfig = buttonMinHeightConfig; this.buttonTextTypeFaceConfig = buttonTextTypeFaceConfig; this.buttonBackgroundConfig = buttonBackgroundConfig; this.buttonDisableAlphaConfig = buttonDisableAlphaConfig; @@ -80,6 +83,10 @@ public class FooterButtonPartnerConfig { return buttonTextColorConfig; } + public PartnerConfig getButtonMinHeightConfig() { + return buttonMinHeightConfig; + } + public PartnerConfig getButtonTextSizeConfig() { return buttonTextSizeConfig; } @@ -105,6 +112,7 @@ public class FooterButtonPartnerConfig { private PartnerConfig buttonIconConfig = null; private PartnerConfig buttonTextColorConfig = null; private PartnerConfig buttonTextSizeConfig = null; + private PartnerConfig buttonMinHeight = null; private PartnerConfig buttonTextTypeFaceConfig = null; private PartnerConfig buttonRadiusConfig = null; private PartnerConfig buttonRippleColorAlphaConfig = null; @@ -146,6 +154,11 @@ public class FooterButtonPartnerConfig { return this; } + public Builder setButtonMinHeight(PartnerConfig buttonMinHeightConfig) { + this.buttonMinHeight = buttonMinHeightConfig; + return this; + } + public Builder setTextTypeFaceConfig(PartnerConfig buttonTextTypeFaceConfig) { this.buttonTextTypeFaceConfig = buttonTextTypeFaceConfig; return this; @@ -175,6 +188,7 @@ public class FooterButtonPartnerConfig { buttonIconConfig, buttonTextColorConfig, buttonTextSizeConfig, + buttonMinHeight, buttonTextTypeFaceConfig, buttonRadiusConfig, buttonRippleColorAlphaConfig); diff --git a/main/java/com/google/android/setupcompat/template/FooterBarMixin.java b/main/java/com/google/android/setupcompat/template/FooterBarMixin.java index 973b8f1..5852548 100644 --- a/main/java/com/google/android/setupcompat/template/FooterBarMixin.java +++ b/main/java/com/google/android/setupcompat/template/FooterBarMixin.java @@ -310,6 +310,7 @@ public class FooterBarMixin implements Mixin { .setButtonRippleColorAlphaConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_RIPPLE_COLOR_ALPHA) .setTextColorConfig(PartnerConfig.CONFIG_FOOTER_PRIMARY_BUTTON_TEXT_COLOR) .setTextSizeConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_TEXT_SIZE) + .setButtonMinHeight(PartnerConfig.CONFIG_FOOTER_BUTTON_MIN_HEIGHT) .setTextTypeFaceConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_FONT_FAMILY) .build(); @@ -366,6 +367,7 @@ public class FooterBarMixin implements Mixin { .setButtonRippleColorAlphaConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_RIPPLE_COLOR_ALPHA) .setTextColorConfig(PartnerConfig.CONFIG_FOOTER_SECONDARY_BUTTON_TEXT_COLOR) .setTextSizeConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_TEXT_SIZE) + .setButtonMinHeight(PartnerConfig.CONFIG_FOOTER_BUTTON_MIN_HEIGHT) .setTextTypeFaceConfig(PartnerConfig.CONFIG_FOOTER_BUTTON_FONT_FAMILY) .build(); @@ -548,6 +550,8 @@ public class FooterBarMixin implements Mixin { button, footerButtonPartnerConfig.getButtonTextColorConfig()); updateButtonTextSizeWithPartnerConfig( button, footerButtonPartnerConfig.getButtonTextSizeConfig()); + updateButtonMinHeightWithPartnerConfig( + button, footerButtonPartnerConfig.getButtonMinHeightConfig()); updateButtonTypeFaceWithPartnerConfig( button, footerButtonPartnerConfig.getButtonTextTypeFaceConfig()); updateButtonBackgroundWithPartnerConfig( @@ -583,6 +587,16 @@ public class FooterBarMixin implements Mixin { } } + private void updateButtonMinHeightWithPartnerConfig( + Button button, PartnerConfig buttonMinHeightConfig) { + if (PartnerConfigHelper.get(context).isPartnerConfigAvailable(buttonMinHeightConfig)) { + float size = PartnerConfigHelper.get(context).getDimension(context, buttonMinHeightConfig); + if (size > 0) { + button.setMinHeight((int) size); + } + } + } + private void updateButtonTypeFaceWithPartnerConfig( Button button, PartnerConfig buttonTextTypeFaceConfig) { String fontFamilyName = diff --git a/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfig.java b/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfig.java index 49fb0ca..15fc513 100644 --- a/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfig.java +++ b/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfig.java @@ -93,10 +93,14 @@ public enum PartnerConfig { CONFIG_FOOTER_BUTTON_RIPPLE_COLOR_ALPHA( PartnerConfigKey.KEY_FOOTER_BUTTON_RIPPLE_ALPHA, ResourceType.FRACTION), - // Text size of the primary footer button + // Text size of the footer buttons CONFIG_FOOTER_BUTTON_TEXT_SIZE( PartnerConfigKey.KEY_FOOTER_BUTTON_TEXT_SIZE, ResourceType.DIMENSION), + // The min height of the footer buttons + CONFIG_FOOTER_BUTTON_MIN_HEIGHT( + PartnerConfigKey.KEY_FOOTER_BUTTON_MIN_HEIGHT, ResourceType.DIMENSION), + // Disabled background alpha of the footer buttons CONFIG_FOOTER_BUTTON_DISABLED_ALPHA( PartnerConfigKey.KEY_FOOTER_BUTTON_DISABLED_ALPHA, ResourceType.FRACTION), @@ -269,6 +273,26 @@ public enum PartnerConfig { CONFIG_PROGRESS_ILLUSTRATION_DISPLAY_MINIMUM_MS( PartnerConfigKey.KEY_PROGRESS_ILLUSTRATION_DISPLAY_MINIMUM_MS, ResourceType.INTEGER), + // The animation for S+ devices used in those screens waiting for non of below type. + CONFIG_LOADING_LOTTIE_DEFAULT( + PartnerConfigKey.KEY_LOADING_LOTTIE_DEFAULT, ResourceType.ILLUSTRATION), + + // The animation for S+ devices used in those screens which is processing account info or related + // functions. + // For example:com.google.android.setupwizard.LOAD_ADD_ACCOUNT_INTENT + CONFIG_LOADING_LOTTIE_ACCOUNT( + PartnerConfigKey.KEY_LOADING_LOTTIE_ACCOUNT, ResourceType.ILLUSTRATION), + + // The animation for S+ devices used in those screens which is processing data connection. + // For example:com.android.setupwizard.CAPTIVE_PORTAL + CONFIG_LOADING_LOTTIE_CONNECTION( + PartnerConfigKey.KEY_LOADING_LOTTIE_CONNECTION, ResourceType.ILLUSTRATION), + + // The animation for S+ devices used in those screens which is updating devices. + // For example:com.google.android.setupwizard.COMPAT_EARLY_UPDATE + CONFIG_LOADING_LOTTIE_UPDATE( + PartnerConfigKey.KEY_LOADING_LOTTIE_UPDATE, ResourceType.ILLUSTRATION), + // The transition type to decide the transition between activities or fragments. CONFIG_TRANSITION_TYPE(PartnerConfigKey.KEY_TRANSITION_TYPE, ResourceType.INTEGER); diff --git a/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfigKey.java b/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfigKey.java index a7ae415..e604e45 100644 --- a/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfigKey.java +++ b/partnerconfig/java/com/google/android/setupcompat/partnerconfig/PartnerConfigKey.java @@ -44,6 +44,7 @@ import java.lang.annotation.RetentionPolicy; PartnerConfigKey.KEY_FOOTER_BUTTON_RADIUS, PartnerConfigKey.KEY_FOOTER_BUTTON_RIPPLE_ALPHA, PartnerConfigKey.KEY_FOOTER_BUTTON_TEXT_SIZE, + PartnerConfigKey.KEY_FOOTER_BUTTON_MIN_HEIGHT, PartnerConfigKey.KEY_FOOTER_BUTTON_DISABLED_ALPHA, PartnerConfigKey.KEY_FOOTER_BUTTON_DISABLED_BG_COLOR, PartnerConfigKey.KEY_FOOTER_PRIMARY_BUTTON_BG_COLOR, @@ -92,6 +93,10 @@ import java.lang.annotation.RetentionPolicy; PartnerConfigKey.KEY_PROGRESS_ILLUSTRATION_CONNECTION, PartnerConfigKey.KEY_PROGRESS_ILLUSTRATION_UPDATE, PartnerConfigKey.KEY_PROGRESS_ILLUSTRATION_DISPLAY_MINIMUM_MS, + PartnerConfigKey.KEY_LOADING_LOTTIE_ACCOUNT, + PartnerConfigKey.KEY_LOADING_LOTTIE_CONNECTION, + PartnerConfigKey.KEY_LOADING_LOTTIE_DEFAULT, + PartnerConfigKey.KEY_LOADING_LOTTIE_UPDATE, PartnerConfigKey.KEY_TRANSITION_TYPE, }) // TODO: can be removed and always reference PartnerConfig.getResourceName()? @@ -154,12 +159,15 @@ public @interface PartnerConfigKey { // Corner radius of the footer buttons String KEY_FOOTER_BUTTON_RADIUS = "setup_compat_footer_button_radius"; - // Ripple color alpha of the footer button + // Ripple color alpha of the footer buttons String KEY_FOOTER_BUTTON_RIPPLE_ALPHA = "setup_compat_footer_button_ripple_alpha"; - // Text size of the footer button + // Text size of the footer buttons String KEY_FOOTER_BUTTON_TEXT_SIZE = "setup_compat_footer_button_text_size"; + // The min height of the footer buttons + String KEY_FOOTER_BUTTON_MIN_HEIGHT = "setup_compat_footer_button_min_height"; + // Disabled background alpha of the footer buttons String KEY_FOOTER_BUTTON_DISABLED_ALPHA = "setup_compat_footer_button_disabled_alpha"; @@ -310,6 +318,22 @@ public @interface PartnerConfigKey { // The minimum illustration display time, set to 0 may cause the illustration stuck String KEY_PROGRESS_ILLUSTRATION_DISPLAY_MINIMUM_MS = "progress_illustration_display_minimum_ms"; + // The animation for S+ devices used in those screens waiting for non of below type. + String KEY_LOADING_LOTTIE_DEFAULT = "loading_animation_custom_default"; + + // The animation for S+ devices used in those screens which is processing account info or related + // functions. + // For example:com.google.android.setupwizard.LOAD_ADD_ACCOUNT_INTENT + String KEY_LOADING_LOTTIE_ACCOUNT = "loading_animation_custom_account"; + + // The animation for S+ devices used in those screens which is processing data connection. + // For example:com.android.setupwizard.CAPTIVE_PORTAL + String KEY_LOADING_LOTTIE_CONNECTION = "loading_animation_custom_connection"; + + // The animation for S+ devices used in those screens which is updating devices. + // For example:com.google.android.setupwizard.COMPAT_EARLY_UPDATE + String KEY_LOADING_LOTTIE_UPDATE = "loading_animation_custom_update"; + // The transition type between activities String KEY_TRANSITION_TYPE = "setup_design_transition_type"; } |