コード例 #1
0
  public void testScreenElementAutoResizeWithChild() throws InterruptedException {
    int oldX = screenElement.getRightBottom().getX();
    solo.enterText((EditText) textElement.getTextView(), "newnewasdfasdadfadsfasdfnewnewll");

    solo.waitForView(textElement.getTextView()); // better check?
    assertTrue(screenElement.getRightBottom().getX() > oldX);
  }
コード例 #2
0
  private PictureElement getDummyScreenElement() {
    PictureElement screenElement =
        new PictureElement(
            graphicsView.getRootDrawableElement(),
            graphicsView,
            new BitmapDrawable(
                drawActivity.getResources(),
                BitmapFactory.decodeResource(drawActivity.getResources(), R.raw.test)));

    int left = 30, top = 35;
    PixelPoint tl = (PixelPoint) screenElement.getTopLeft();
    tl.setOffsetX(left);
    tl.setOffsetY(35);
    int width = 20, height = 24;
    screenElement.setSize(width, height);

    return screenElement;
  }