Exemplo n.º 1
0
  private void moveView(View v, float pitch, float roll) {
    float top = v.getTop();
    if (v.getBottom() + v.getHeight() - pitch < metrics.heightPixels && v.getTop() - pitch > 0) {
      top = v.getTop() - pitch;
    }
    float left = v.getLeft();
    if (v.getLeft() - roll > 0 && v.getRight() - roll - 1 < metrics.widthPixels) {
      left = v.getLeft() - roll;
    }
    float width = v.getWidth();
    float height = v.getHeight();

    AbsoluteLayout.LayoutParams lp =
        new AbsoluteLayout.LayoutParams((int) width, (int) height, (int) left, (int) top);
    //	        lp.x = touchX - mRegistrationX;
    //	        lp.y = touchY - mRegistrationY;

    absLayout.updateViewLayout(v, lp);
  }