@Test public void isRenderingPossibleTest() { CoachmarkViewLayout layoutMock = Mockito.mock(CoachmarkViewLayout.class); Mockito.when(layoutMock.calcScreenRectF()).thenReturn(new RectF(0, 0, 300, 300)); Mockito.when(layoutMock.calcCircleRectF()).thenReturn(new RectF(50, 50, 75, 75)); Mockito.when(layoutMock.calcActionDescriptionRect()).thenReturn(new RectF(0, 0, 39, 20)); Mockito.when(layoutMock.calcActionArrowRect()).thenReturn(new RectF(0, 0, 10, 10)); Assert.assertTrue(new LeftOfCircleActionDescriptionRenderer().isRenderingPossible(layoutMock)); }
@Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; }
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; } }
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; }  }
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; }  @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout); }
LeftOfCircleActionDescriptionRenderer implements ActionDescriptionRenderer { @Override public boolean isRenderingPossible(CoachmarkViewLayout layout) { RectF circleRectangle = layout.calcCircleRectF(); RectF actionDescriptionRectangle = layout.calcActionDescriptionRect(); RectF actionArrowRectangle = layout.calcActionArrowRect(); return (actionDescriptionRectangle.width() + actionArrowRectangle.width()) < circleRectangle.left; }  @Override void render(CoachmarkViewLayout layout, View actionDescription, View actionArrow); @Override boolean isRenderingPossible(CoachmarkViewLayout layout);  }