美好的一天,我是Android的新手,我想在我的应用程序中添加一项功能,但我不知道该怎么做。
我想通过Two-finger touch
Zoom Out
成像
我使用Subsampling Scale Image View library实现了Zoom In
功能,但我不知道如何添加Zoom Out
。
我现在拥有什么?我必须在Toast
下添加ImageView
正常状态?
ImageView mImageView;
mImageView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
int action = motionEvent.getAction();
int fingersCount = motionEvent.getPointerCount();
if((action == MotionEvent.ACTION_POINTER_UP) && (fingersCount == 2)){
Toast.makeText(getActivity(), "Double tap", Toast.LENGTH_SHORT).show();
}
return false;
}
});
无论如何,谢谢!