Loading core/java/android/widget/flags/flags.aconfig 0 → 100644 +11 −0 Original line number Diff line number Diff line package: "android.widget.flags" container: "system" flag { name: "enable_fading_view_group" namespace: "system_performance" description: "FRP screen during OOBE must have fading and scaling animation in Wear Watches" bug: "348515581" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file core/java/com/android/internal/widget/ViewGroupFader.java +16 −7 Original line number Diff line number Diff line Loading @@ -16,12 +16,14 @@ package com.android.internal.widget; import android.content.res.Resources; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.MarginLayoutParams; import android.view.animation.BaseInterpolator; import android.view.animation.PathInterpolator; import android.widget.flags.Flags; /** * This class is ported from Loading @@ -36,7 +38,7 @@ import android.view.animation.PathInterpolator; * height of the child. When not in the top or bottom regions, children have their default alpha and * scale. */ class ViewGroupFader { public class ViewGroupFader { private static final float SCALE_LOWER_BOUND = 0.7f; private float mScaleLowerBound = SCALE_LOWER_BOUND; Loading Loading @@ -68,7 +70,7 @@ class ViewGroupFader { private BaseInterpolator mBottomInterpolator = new PathInterpolator(0.3f, 0f, 0.7f, 1f); /** Callback which is called when attempting to fade a view. */ interface AnimationCallback { public interface AnimationCallback { boolean shouldFadeFromTop(View view); boolean shouldFadeFromBottom(View view); Loading @@ -82,7 +84,7 @@ class ViewGroupFader { * of the current position. */ // TODO(b/182846214): Clean up the interface design to avoid exposing too much details to users. interface ChildViewBoundsProvider { public interface ChildViewBoundsProvider { /** * Provide the bounds of the child view. * Loading Loading @@ -168,7 +170,7 @@ class ViewGroupFader { } } ViewGroupFader( public ViewGroupFader( ViewGroup parent, AnimationCallback callback, ChildViewBoundsProvider childViewBoundsProvider) { Loading Loading @@ -212,7 +214,7 @@ class ViewGroupFader { this.mContainerBoundsProvider = boundsProvider; } void updateFade() { public void updateFade() { mContainerBoundsProvider.provideBounds(mParent, mContainerBounds); mTopBoundPixels = mContainerBounds.height() * mChainedBoundsTop; mBottomBoundPixels = mContainerBounds.height() * mChainedBoundsBottom; Loading @@ -221,13 +223,20 @@ class ViewGroupFader { } /** For each list element, calculate and adjust the scale and alpha based on its position */ private void updateListElementFades(ViewGroup parent, boolean shouldFade) { public void updateListElementFades(ViewGroup parent, boolean shouldFade) { for (int i = 0; i < parent.getChildCount(); i++) { View child = parent.getChildAt(i); if (child.getVisibility() != View.VISIBLE) { continue; } if (Flags.enableFadingViewGroup() && Resources.getSystem().getBoolean( com.android.internal.R.bool.config_enableViewGroupScalingFading)) { if (child instanceof ViewGroup) { updateListElementFades((ViewGroup) child, true); } } if (shouldFade) { fadeElement(parent, child); } Loading core/res/res/values-watch/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -96,4 +96,8 @@ <!-- True if the device supports system decorations on secondary displays. --> <bool name="config_supportsSystemDecorsOnSecondaryDisplays">false</bool> <!-- Whether to enable scaling and fading animation to scrollviews while scrolling. P.S this is a change only intended for wear devices. --> <bool name="config_enableViewGroupScalingFading">true</bool> </resources> core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -7121,4 +7121,8 @@ <!-- The maximum number of call log entries for each sim card that can be stored in the call log provider on the device. --> <integer name="config_maximumCallLogEntriesPerSim">500</integer> <!-- Whether to enable scaling and fading animation to scrollviews while scrolling. P.S this is a change only intended for wear devices. --> <bool name="config_enableViewGroupScalingFading">false</bool> </resources> core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5601,4 +5601,6 @@ <!-- Fingerprint loe notification string --> <java-symbol type="string" name="fingerprint_loe_notification_msg" /> <java-symbol type="bool" name="config_enableViewGroupScalingFading"/> </resources> Loading
core/java/android/widget/flags/flags.aconfig 0 → 100644 +11 −0 Original line number Diff line number Diff line package: "android.widget.flags" container: "system" flag { name: "enable_fading_view_group" namespace: "system_performance" description: "FRP screen during OOBE must have fading and scaling animation in Wear Watches" bug: "348515581" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
core/java/com/android/internal/widget/ViewGroupFader.java +16 −7 Original line number Diff line number Diff line Loading @@ -16,12 +16,14 @@ package com.android.internal.widget; import android.content.res.Resources; import android.graphics.Rect; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.MarginLayoutParams; import android.view.animation.BaseInterpolator; import android.view.animation.PathInterpolator; import android.widget.flags.Flags; /** * This class is ported from Loading @@ -36,7 +38,7 @@ import android.view.animation.PathInterpolator; * height of the child. When not in the top or bottom regions, children have their default alpha and * scale. */ class ViewGroupFader { public class ViewGroupFader { private static final float SCALE_LOWER_BOUND = 0.7f; private float mScaleLowerBound = SCALE_LOWER_BOUND; Loading Loading @@ -68,7 +70,7 @@ class ViewGroupFader { private BaseInterpolator mBottomInterpolator = new PathInterpolator(0.3f, 0f, 0.7f, 1f); /** Callback which is called when attempting to fade a view. */ interface AnimationCallback { public interface AnimationCallback { boolean shouldFadeFromTop(View view); boolean shouldFadeFromBottom(View view); Loading @@ -82,7 +84,7 @@ class ViewGroupFader { * of the current position. */ // TODO(b/182846214): Clean up the interface design to avoid exposing too much details to users. interface ChildViewBoundsProvider { public interface ChildViewBoundsProvider { /** * Provide the bounds of the child view. * Loading Loading @@ -168,7 +170,7 @@ class ViewGroupFader { } } ViewGroupFader( public ViewGroupFader( ViewGroup parent, AnimationCallback callback, ChildViewBoundsProvider childViewBoundsProvider) { Loading Loading @@ -212,7 +214,7 @@ class ViewGroupFader { this.mContainerBoundsProvider = boundsProvider; } void updateFade() { public void updateFade() { mContainerBoundsProvider.provideBounds(mParent, mContainerBounds); mTopBoundPixels = mContainerBounds.height() * mChainedBoundsTop; mBottomBoundPixels = mContainerBounds.height() * mChainedBoundsBottom; Loading @@ -221,13 +223,20 @@ class ViewGroupFader { } /** For each list element, calculate and adjust the scale and alpha based on its position */ private void updateListElementFades(ViewGroup parent, boolean shouldFade) { public void updateListElementFades(ViewGroup parent, boolean shouldFade) { for (int i = 0; i < parent.getChildCount(); i++) { View child = parent.getChildAt(i); if (child.getVisibility() != View.VISIBLE) { continue; } if (Flags.enableFadingViewGroup() && Resources.getSystem().getBoolean( com.android.internal.R.bool.config_enableViewGroupScalingFading)) { if (child instanceof ViewGroup) { updateListElementFades((ViewGroup) child, true); } } if (shouldFade) { fadeElement(parent, child); } Loading
core/res/res/values-watch/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -96,4 +96,8 @@ <!-- True if the device supports system decorations on secondary displays. --> <bool name="config_supportsSystemDecorsOnSecondaryDisplays">false</bool> <!-- Whether to enable scaling and fading animation to scrollviews while scrolling. P.S this is a change only intended for wear devices. --> <bool name="config_enableViewGroupScalingFading">true</bool> </resources>
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -7121,4 +7121,8 @@ <!-- The maximum number of call log entries for each sim card that can be stored in the call log provider on the device. --> <integer name="config_maximumCallLogEntriesPerSim">500</integer> <!-- Whether to enable scaling and fading animation to scrollviews while scrolling. P.S this is a change only intended for wear devices. --> <bool name="config_enableViewGroupScalingFading">false</bool> </resources>
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -5601,4 +5601,6 @@ <!-- Fingerprint loe notification string --> <java-symbol type="string" name="fingerprint_loe_notification_msg" /> <java-symbol type="bool" name="config_enableViewGroupScalingFading"/> </resources>