Search in sources :

Example 1 with RotationButtonController

use of com.android.systemui.shared.rotation.RotationButtonController in project android_packages_apps_Launcher3 by AOSPA.

the class NavigationBarRotationContextTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    Context mTargetContext = InstrumentationRegistry.getTargetContext();
    final View view = new View(mTargetContext);
    RotationButton rotationButton = mock(RotationButton.class);
    mRotationButtonController = new RotationButtonController(mTargetContext, 0, 0, 0, 0, 0, 0, () -> 0);
    mRotationButtonController.setRotationButton(rotationButton, null);
    // Due to a mockito issue, only spy the object after setting the initial state
    mRotationButtonController = spy(mRotationButtonController);
    final AnimatedVectorDrawable kbd = mock(AnimatedVectorDrawable.class);
    doReturn(view).when(rotationButton).getCurrentView();
    doReturn(true).when(rotationButton).acceptRotationProposal();
}
Also used : Context(android.content.Context) RotationButton(com.android.systemui.shared.rotation.RotationButton) View(android.view.View) RotationButtonController(com.android.systemui.shared.rotation.RotationButtonController) AnimatedVectorDrawable(android.graphics.drawable.AnimatedVectorDrawable) Before(org.junit.Before)

Example 2 with RotationButtonController

use of com.android.systemui.shared.rotation.RotationButtonController in project android_packages_apps_Launcher3 by ArrowOS.

the class NavigationBarRotationContextTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    Context mTargetContext = InstrumentationRegistry.getTargetContext();
    final View view = new View(mTargetContext);
    RotationButton rotationButton = mock(RotationButton.class);
    mRotationButtonController = new RotationButtonController(mTargetContext, 0, 0, 0, 0, 0, 0, () -> 0);
    mRotationButtonController.setRotationButton(rotationButton, null);
    // Due to a mockito issue, only spy the object after setting the initial state
    mRotationButtonController = spy(mRotationButtonController);
    final AnimatedVectorDrawable kbd = mock(AnimatedVectorDrawable.class);
    doReturn(view).when(rotationButton).getCurrentView();
    doReturn(true).when(rotationButton).acceptRotationProposal();
}
Also used : Context(android.content.Context) RotationButton(com.android.systemui.shared.rotation.RotationButton) View(android.view.View) RotationButtonController(com.android.systemui.shared.rotation.RotationButtonController) AnimatedVectorDrawable(android.graphics.drawable.AnimatedVectorDrawable) Before(org.junit.Before)

Example 3 with RotationButtonController

use of com.android.systemui.shared.rotation.RotationButtonController in project android_packages_apps_404Launcher by P-404.

the class NavigationBarRotationContextTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    Context mTargetContext = InstrumentationRegistry.getTargetContext();
    final View view = new View(mTargetContext);
    RotationButton rotationButton = mock(RotationButton.class);
    mRotationButtonController = new RotationButtonController(mTargetContext, 0, 0, 0, 0, 0, 0, () -> 0);
    mRotationButtonController.setRotationButton(rotationButton, null);
    // Due to a mockito issue, only spy the object after setting the initial state
    mRotationButtonController = spy(mRotationButtonController);
    final AnimatedVectorDrawable kbd = mock(AnimatedVectorDrawable.class);
    doReturn(view).when(rotationButton).getCurrentView();
    doReturn(true).when(rotationButton).acceptRotationProposal();
}
Also used : Context(android.content.Context) RotationButton(com.android.systemui.shared.rotation.RotationButton) View(android.view.View) RotationButtonController(com.android.systemui.shared.rotation.RotationButtonController) AnimatedVectorDrawable(android.graphics.drawable.AnimatedVectorDrawable) Before(org.junit.Before)

Example 4 with RotationButtonController

use of com.android.systemui.shared.rotation.RotationButtonController in project android_packages_apps_Launcher3 by ProtonAOSP.

the class NavigationBarRotationContextTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    Context mTargetContext = InstrumentationRegistry.getTargetContext();
    final View view = new View(mTargetContext);
    RotationButton rotationButton = mock(RotationButton.class);
    mRotationButtonController = new RotationButtonController(mTargetContext, 0, 0, 0, 0, 0, 0, () -> 0);
    mRotationButtonController.setRotationButton(rotationButton, null);
    // Due to a mockito issue, only spy the object after setting the initial state
    mRotationButtonController = spy(mRotationButtonController);
    final AnimatedVectorDrawable kbd = mock(AnimatedVectorDrawable.class);
    doReturn(view).when(rotationButton).getCurrentView();
    doReturn(true).when(rotationButton).acceptRotationProposal();
}
Also used : Context(android.content.Context) RotationButton(com.android.systemui.shared.rotation.RotationButton) View(android.view.View) RotationButtonController(com.android.systemui.shared.rotation.RotationButtonController) AnimatedVectorDrawable(android.graphics.drawable.AnimatedVectorDrawable) Before(org.junit.Before)

Aggregations

Context (android.content.Context)4 AnimatedVectorDrawable (android.graphics.drawable.AnimatedVectorDrawable)4 View (android.view.View)4 RotationButton (com.android.systemui.shared.rotation.RotationButton)4 RotationButtonController (com.android.systemui.shared.rotation.RotationButtonController)4 Before (org.junit.Before)4