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

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

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

origin: davemorrissey/subsampling-scale-image-view

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  SubsamplingScaleImageView imageView = findViewById(id.imageView);
  imageView.setImage(ImageSource.asset("sanmartino.jpg"));
  imageView.setOnClickListener(new View.OnClickListener() {
    @Override public void onClick(View v) { Toast.makeText(v.getContext(), "Clicked", Toast.LENGTH_SHORT).show(); }
  });
  imageView.setOnLongClickListener(new View.OnLongClickListener() {
    @Override public boolean onLongClick(View v) { Toast.makeText(v.getContext(), "Long clicked", Toast.LENGTH_SHORT).show(); return true; }
  });
}
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;
}
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewsetOnLongClickListener

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
  • setMinimumScaleType
    Set the minimum scale type. See static fields. Normally #SCALE_TYPE_CENTER_INSIDE is best, for image
  • 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>
  • setZoomEnabled,
  • <init>,
  • getCenter,
  • getContext,
  • getHeight,
  • getOrientation,
  • getScale,
  • isReady,
  • onDraw,
  • onImageLoaded

Popular in Java

  • Finding current android device location
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ImageIO (javax.imageio)
  • 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