單手模式用例圖如下
單手模式主要流程
主要控制點在SurfaceControlWithBackground.java這個文件裏
1、控制位置
@Override
public void setPosition(float x, float y) {
super.setPosition(x, y);
if (mBackgroundControl == null) {
return;
}
mLastX = x;
mLastY = y;
updateBgPosition();
}
2、控制大小
@Override
public void setMatrix(float dsdx, float dtdx, float dtdy, float dsdy) {
super.setMatrix(dsdx, dtdx, dtdy, dsdy);
if (mBackgroundControl == null) {
return;
}
mBackgroundControl.setMatrix(dsdx, dtdx, dtdy, dsdy);
mLastDsDx = dsdx;
mLastDsDy = dsdy;
updateBgPosition();
}