本文整理匯總了Java中android.view.ScaleGestureDetector.isInProgress方法的典型用法代碼示例。如果您正苦於以下問題:Java ScaleGestureDetector.isInProgress方法的具體用法?Java ScaleGestureDetector.isInProgress怎麽用?Java ScaleGestureDetector.isInProgress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.ScaleGestureDetector
的用法示例。
在下文中一共展示了ScaleGestureDetector.isInProgress方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onScale
import android.view.ScaleGestureDetector; //導入方法依賴的package包/類
@Override
public boolean onScale( ScaleGestureDetector detector )
{
// Check if the detector is in progress in order to proceed
if(detector!=null && detector.isInProgress() ){
try{
// Grab the scale
float targetScale = getScale() * detector.getScaleFactor();
// Correct for the min scale
targetScale = Math.min( maxZoom(), Math.max( targetScale, 1.0f) );
// Zoom and invalidate the view
zoomTo( targetScale, detector.getFocusX(), detector.getFocusY() );
invalidate();
return true;
}catch(IllegalArgumentException e){
e.printStackTrace();
}
}
return false;
}
示例2: onScale
import android.view.ScaleGestureDetector; //導入方法依賴的package包/類
@Override
public boolean onScale( ScaleGestureDetector detector )
{
// Check if the detector is in progress in order to proceed
if(detector!=null && detector.isInProgress() ){
try{
// Grab the scale
float targetScale = getScale() * detector.getScaleFactor();
// Correct for the min scale
targetScale = Math.min( maxZoom(), Math.max( targetScale, 1.0f) );
// Zoom and invalidate the view
zoomTo( targetScale, detector.getFocusX(), detector.getFocusY() );
invalidate();
scaleRecognized = true;
return true;
}catch(IllegalArgumentException e){
e.printStackTrace();
}
}
return false;
}