本文整理匯總了Java中android.view.ScaleGestureDetector.SimpleOnScaleGestureListener方法的典型用法代碼示例。如果您正苦於以下問題:Java ScaleGestureDetector.SimpleOnScaleGestureListener方法的具體用法?Java ScaleGestureDetector.SimpleOnScaleGestureListener怎麽用?Java ScaleGestureDetector.SimpleOnScaleGestureListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.ScaleGestureDetector
的用法示例。
在下文中一共展示了ScaleGestureDetector.SimpleOnScaleGestureListener方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: FroyoDetector
import android.view.ScaleGestureDetector; //導入方法依賴的package包/類
public FroyoDetector(Context context) {
mDetector = new ScaleGestureDetector(context,
new ScaleGestureDetector.SimpleOnScaleGestureListener() {
@Override public boolean onScale(ScaleGestureDetector detector) {
mListener.onScale(detector.getScaleFactor());
return true;
}
});
}
示例2: init
import android.view.ScaleGestureDetector; //導入方法依賴的package包/類
private void init() {
inflate(getContext(), R.layout.image_viewer, this);
backgroundView = findViewById(R.id.backgroundView);
pager = (MultiTouchViewPager) findViewById(R.id.pager);
dismissContainer = (ViewGroup) findViewById(R.id.container);
swipeDismissListener = new SwipeToDismissListener(findViewById(R.id.dismissView), this, this);
dismissContainer.setOnTouchListener(swipeDismissListener);
directionDetector = new SwipeDirectionDetector(getContext()) {
@Override
public void onDirectionDetected(Direction direction) {
ImageViewerView.this.direction = direction;
}
};
scaleDetector = new ScaleGestureDetector(getContext(),
new ScaleGestureDetector.SimpleOnScaleGestureListener());
gestureDetector = new GestureDetectorCompat(getContext(), new GestureDetector.SimpleOnGestureListener() {
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
if (pager.isScrolled()) {
onClick(e, isOverlayWasClicked);
}
return false;
}
});
}