當前位置: 首頁>>代碼示例>>Java>>正文


Java ScaleGestureDetector.SimpleOnScaleGestureListener方法代碼示例

本文整理匯總了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;
        }
    });
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:10,代碼來源:VersionedGestureDetector.java

示例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;
        }
    });
}
 
開發者ID:achenglike,項目名稱:imageviewer,代碼行數:31,代碼來源:ImageViewerView.java


注:本文中的android.view.ScaleGestureDetector.SimpleOnScaleGestureListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。