Tabnine Logo
SubsamplingScaleImageView.setMinimumScaleType
Code IndexAdd Tabnine to your IDE (free)

How to use
setMinimumScaleType
method
in
com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView

Best Java code snippets using com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView.setMinimumScaleType (Showing top 5 results out of 315)

origin: Piasy/BigImageViewer

public void setInitScaleType(int initScaleType) {
  if (mSSIV == null) {
    return;
  }
  mInitScaleType = initScaleType;
  switch (initScaleType) {
    case INIT_SCALE_TYPE_CENTER_CROP:
      mSSIV.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
      break;
    case INIT_SCALE_TYPE_CUSTOM:
      mSSIV.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CUSTOM);
      break;
    case INIT_SCALE_TYPE_START:
      mSSIV.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_START);
      break;
    case INIT_SCALE_TYPE_CENTER_INSIDE:
    default:
      mSSIV.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_INSIDE);
      break;
  }
  if (mDisplayOptimizeListener != null) {
    mDisplayOptimizeListener.setInitScaleType(initScaleType);
  }
}
origin: leftcoding/GankLy

@Override
protected void initValues() {
  sliderIv.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
  sliderIv.setDoubleTapZoomStyle(SubsamplingScaleImageView.ZOOM_FOCUS_CENTER);
  Bundle bundle = getArguments();
  if (bundle != null) {
    mUrl = bundle.getString(URL);
    mWidth = bundle.getInt(SIZE_WIDTH);
    mHeight = bundle.getInt(SIZE_HEIGHT);
  }
  KLog.d("mUrl:" + mUrl);
  loadImageBitmap(mUrl);
}
origin: Awent/PhotoPick-Master

private SubsamplingScaleImageView getLongImageView(ImageSource imageSource, File file, int orientation, float hScale) {
  SubsamplingScaleImageView imageView = new SubsamplingScaleImageView(this);
  if (orientation == 1) {//纵向图
    imageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
    imageView.setImage(imageSource, new ImageViewState(0, new PointF(0, 0), SubsamplingScaleImageView.ORIENTATION_0));
  } else {//横向长图
    if (file != null) {
      //因为这里展示的是原图,不是经过fresco压缩的bitmap,这里拿到图片的原始宽高,从新计算最大缩放比
      hScale = screenHeight / BitmapUtil.getImageSize(file.getAbsolutePath())[1];
    }
    imageView.setMaxScale(hScale);
    imageView.setImage(imageSource);
  }
  imageView.setOnClickListener(onClickListener);
  //图片下载完成并且开启图片保存才给长按保存
  imageView.setOnLongClickListener(this);
  return imageView;
}
origin: Awent/PhotoPick-Master

/**
 * 加载超长图
 */
private SubsamplingScaleImageView loadLongPhoto(File file, int orientation, int hScale) {
  SubsamplingScaleImageView imageView = new SubsamplingScaleImageView(this);
  imageView.setOnClickListener(onClickListener);
  imageView.setBackgroundColor(getResources().getColor(android.R.color.black));
  if (file != null && file.exists()) {
    if (orientation == 1) {//纵向图
      imageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
      imageView.setImage(ImageSource.uri(file.getAbsolutePath()), new ImageViewState(0, new PointF(0, 0), SubsamplingScaleImageView.ORIENTATION_0));
    } else {
      imageView.setMaxScale(hScale);
      imageView.setImage(ImageSource.uri(file.getAbsolutePath()));
    }
  } else {
    imageView.setImage(ImageSource.resource(R.mipmap.failure_image));
  }
  return imageView;
}
origin: kollerlukas/Camera-Roll-Android-App

imageView.setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_CENTER_CROP);
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewsetMinimumScaleType

Javadoc

Set the minimum scale type. See static fields. Normally #SCALE_TYPE_CENTER_INSIDE is best, for image galleries.

Popular methods of SubsamplingScaleImageView

  • setImage
    Set the image source from a bitmap, resource, asset, file or other URI, starting with a given orient
  • setDoubleTapZoomScale
    Set the scale the image will zoom in to when double tapped. This also the scale point where a double
  • setMaxScale
    Set the maximum scale allowed. A value of 1 means 1:1 pixels at maximum scale. You may wish to set t
  • setMinimumDpi
    This is a screen density aware alternative to #setMaxScale(float); it allows you to express the maxi
  • setScaleAndCenter
    Externally change the scale and translation of the source image. This may be used with getCenter() a
  • getWidth
  • setDoubleTapZoomDpi
    A density aware alternative to #setDoubleTapZoomScale(float); this allows you to express the scale t
  • setMinimumTileDpi
    By default, image tiles are at least as high resolution as the screen. For a retina screen this may
  • setPanEnabled
    Enable or disable pan gesture detection. Disabling pan causes the image to be centered.
  • setZoomEnabled
    Enable or disable zoom gesture detection. Disabling zoom locks the the current scale.
  • <init>
  • getCenter
    Returns the source point at the center of the view.
  • <init>,
  • getCenter,
  • getContext,
  • getHeight,
  • getOrientation,
  • getScale,
  • isReady,
  • onDraw,
  • onImageLoaded

Popular in Java

  • Finding current android device location
  • getExternalFilesDir (Context)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JOptionPane (javax.swing)
  • JTable (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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