congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
com.oginotihiro.cropview.scrollerproxy
Code IndexAdd Tabnine to your IDE (free)

How to use com.oginotihiro.cropview.scrollerproxy

Best Java code snippets using com.oginotihiro.cropview.scrollerproxy (Showing top 10 results out of 315)

origin: oginotihiro/cropview

public static ScrollerProxy getScroller(Context context) {
  if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
    return new PreGingerScroller(context);
  } else if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) {
    return new GingerScroller(context);
  } else {
    return new IcsScroller(context);
  }
}
origin: oginotihiro/cropview

public void cancelFling() {
  mScroller.forceFinished(true);
}
origin: wangyisll/TessTwoDemo

public FlingRunnable(Context context) {
  mScroller = ScrollerProxy.getScroller(context);
}
origin: wangyisll/TessTwoDemo

  @Override
  public void run() {
    if (mScroller.isFinished()) {
      return;
    }
    if (mScroller.computeScrollOffset()) {
      final int newX = mScroller.getCurrX();
      final int newY = mScroller.getCurrY();
      mSuppMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
      setImageMatrix(getDrawMatrix());
      mCurrentX = newX;
      mCurrentY = newY;
      Compat.postOnAnimation(CropView.this, this);
    }
  }
}
origin: wangyisll/TessTwoDemo

public void fling(int velocityX, int velocityY) {
  final RectF rect = getDisplayRect(getDrawMatrix());
  if (rect == null) return;
  final int startX = Math.round((mCropRect.left - rect.left));
  final int startY = Math.round((mCropRect.top - rect.top));
  final int minX = 0;
  final int minY = 0;
  final int maxX = Math.round(rect.width() - mCropRect.width());
  final int maxY = Math.round(rect.height() - mCropRect.height());
  mCurrentX = startX;
  mCurrentY = startY;
  mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY, 0, 0);
}
origin: oginotihiro/cropview

  @Override
  public void run() {
    if (mScroller.isFinished()) {
      return;
    }
    if (mScroller.computeScrollOffset()) {
      final int newX = mScroller.getCurrX();
      final int newY = mScroller.getCurrY();
      mSuppMatrix.postTranslate(mCurrentX - newX, mCurrentY - newY);
      setImageMatrix(getDrawMatrix());
      mCurrentX = newX;
      mCurrentY = newY;
      Compat.postOnAnimation(CropView.this, this);
    }
  }
}
origin: wangyisll/TessTwoDemo

public static ScrollerProxy getScroller(Context context) {
  if (VERSION.SDK_INT < VERSION_CODES.GINGERBREAD) {
    return new PreGingerScroller(context);
  } else if (VERSION.SDK_INT < VERSION_CODES.ICE_CREAM_SANDWICH) {
    return new GingerScroller(context);
  } else {
    return new IcsScroller(context);
  }
}
origin: wangyisll/TessTwoDemo

public void cancelFling() {
  mScroller.forceFinished(true);
}
origin: oginotihiro/cropview

public FlingRunnable(Context context) {
  mScroller = ScrollerProxy.getScroller(context);
}
origin: oginotihiro/cropview

public void fling(int velocityX, int velocityY) {
  final RectF rect = getDisplayRect(getDrawMatrix());
  if (rect == null) return;
  final int startX = Math.round((mCropRect.left - rect.left));
  final int startY = Math.round((mCropRect.top - rect.top));
  final int minX = 0;
  final int minY = 0;
  final int maxX = Math.round(rect.width() - mCropRect.width());
  final int maxY = Math.round(rect.height() - mCropRect.height());
  mCurrentX = startX;
  mCurrentY = startY;
  mScroller.fling(startX, startY, velocityX, velocityY, minX, maxX, minY, maxY, 0, 0);
}
com.oginotihiro.cropview.scrollerproxy

Most used classes

  • GingerScroller
  • IcsScroller
  • PreGingerScroller
  • ScrollerProxy
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now