Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bf2ed2b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Deflag enable_fading_view_group" into main

parents cce3fb1c a990b8fe
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
package: "android.widget.flags"
container: "system"
flag {
  name: "enable_fading_view_group"
  namespace: "wear_systems"
  description: "FRP screen during OOBE must have fading and scaling animation in Wear Watches"
  bug: "348515581"
  metadata {
      purpose: PURPOSE_BUGFIX
    }
}

flag {
  name: "use_wear_material3_ui"
  namespace: "wear_frameworks"
+1 −2
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ 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
@@ -230,7 +229,7 @@ public class ViewGroupFader {
                continue;
            }

            if (Flags.enableFadingViewGroup() && Resources.getSystem().getBoolean(
            if (Resources.getSystem().getBoolean(
                    com.android.internal.R.bool.config_enableViewGroupScalingFading)) {
                if (child instanceof ViewGroup) {
                    updateListElementFades((ViewGroup) child, true);
+2 −22
Original line number Diff line number Diff line
@@ -20,12 +20,9 @@ import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentat

import android.content.Context;
import android.content.res.Resources;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.flag.junit.SetFlagsRule;
import android.test.AndroidTestCase;
import android.view.View;
import android.view.ViewGroup;
import android.widget.flags.Flags;

import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -59,8 +56,6 @@ public class ViewGroupFaderTest extends AndroidTestCase {
    @Mock
    private ViewGroupFader.ChildViewBoundsProvider mChildViewBoundsProvider;

    @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
@@ -77,11 +72,10 @@ public class ViewGroupFaderTest extends AndroidTestCase {
    }

    /** This test checks that for each child of the parent viewgroup,
     * updateListElementFades is called for each of its child, when the Flag is set to true
     * updateListElementFades is called for each of its child
     */
    @Test
    @EnableFlags(Flags.FLAG_ENABLE_FADING_VIEW_GROUP)
    public void testFadingAndScrollingAnimationWorking_FlagOn() {
    public void testFadingAndScrollingAnimationWorking() {
        mViewGroup.addView(mViewGroup1);
        mViewGroupFader.updateFade();

@@ -90,18 +84,4 @@ public class ViewGroupFaderTest extends AndroidTestCase {
            verify(mockViewGroupFader).updateListElementFades((ViewGroup)child,true);
        }
    }

    /** This test checks that for each child of the parent viewgroup,
     * updateListElementFades is never called for each of its child, when the Flag is set to false
     */
    @Test
    public void testFadingAndScrollingAnimationNotWorking_FlagOff() {
        mViewGroup.addView(mViewGroup1);
        mViewGroupFader.updateFade();

        for (int i = 0; i < mViewGroup.getChildCount(); i++) {
            View child = mViewGroup.getChildAt(i);
            verify(mockViewGroupFader,never()).updateListElementFades((ViewGroup)child,true);
        }
    }
}
 No newline at end of file