检测两个手指触摸并缩小图像

时间:2016-01-26 15:57:24

标签: android

美好的一天,我是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;
    }
});

无论如何,谢谢!

0 个答案:

没有答案