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

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

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

origin: Piasy/BigImageViewer

void clear() {
  SubsamplingScaleImageView ssiv = itemImage.getSSIV();
  if (ssiv != null) {
    ssiv.recycle();
  }
}
origin: kollerlukas/Camera-Roll-Android-App

@Override
public void onDestroy() {
  final SubsamplingScaleImageView imageView = itemView.findViewById(R.id.subsampling);
  if (imageView != null) {
    imageView.recycle();
  }
  super.onDestroy();
}
origin: Awent/PhotoPick-Master

@Override
public void destroyItem(ViewGroup container, int position, Object object) {
  if (photos != null && photos.size() > 0 && position < photos.size()) {
    Photo photo = photos.get(position);
    if (photo.isLongPhoto()) {
      SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) object;
      if (imageView != null) {
        imageView.recycle();
      }
    }
    FrescoImageLoader.evictFromMemoryCache(photo.getPath());
  }
  container.removeView((View) object);
}
origin: Awent/PhotoPick-Master

@Override
public void destroyItem(ViewGroup container, int position, Object object) {
  if (wkRequest != null && wkRequest.containsKey(position)) {
    wkRequest.remove(position);
  }
  if (photoPagerBean != null && photoPagerBean.getBigImgUrls().size() > 0 && position < photoPagerBean.getBigImgUrls().size()) {
    View view = ((FrameLayout) object).findViewWithTag(position);
    if (view != null && view instanceof SubsamplingScaleImageView) {
      SubsamplingScaleImageView imageView = (SubsamplingScaleImageView) view;
      imageView.recycle();
    }
    FrescoImageLoader.evictFromMemoryCache(photoPagerBean.getBigImgUrls().get(position));
  }
  container.removeView((View) object);
}
origin: kollerlukas/Camera-Roll-Android-App

private void setWallpaper(int which) {
  try {
    WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
    InputStream inputStream = getContentResolver().openInputStream(imageUri);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      Rect croppedRect = getCroppedRect();
      switch (which) {
        case HOME_SCREEN:
          wallpaperManager.setStream(inputStream, croppedRect, true, WallpaperManager.FLAG_SYSTEM);
          break;
        case LOCK_SCREEN:
          wallpaperManager.setStream(inputStream, croppedRect, true, WallpaperManager.FLAG_LOCK);
          break;
        case BOTH:
          wallpaperManager.setStream(inputStream, croppedRect, true);
          break;
      }
    } else {
      wallpaperManager.setStream(inputStream);
    }
    SubsamplingScaleImageView imageView = findViewById(R.id.imageView);
    imageView.recycle();
    this.finish();
  } catch (IOException | IllegalArgumentException e) {
    e.printStackTrace();
    Toast.makeText(this, R.string.error, Toast.LENGTH_SHORT).show();
  }
}
origin: kollerlukas/Camera-Roll-Android-App

public static void bindSubsamplingImageView(SubsamplingScaleImageView imageView, Photo photo,
                      SubsamplingScaleImageView.DefaultOnImageEventListener onImageEventListener) {
  imageView.recycle();
  ImageViewState imageViewState = null;
  if (photo.getImageViewSavedState() != null) {
    imageViewState = (ImageViewState) photo.getImageViewSavedState();
    photo.putImageViewSavedState(null);
  }
  imageView.setImage(
      ImageSource.uri(photo.getUri(imageView.getContext())),
      imageViewState);
  if (onImageEventListener != null) {
    imageView.setOnImageEventListener(onImageEventListener);
  }
}
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewrecycle

Javadoc

Releases all resources the view is using and resets the state, nulling any fields that use significant memory. After you have called this method, the view can be re-used by setting a new image. Settings are remembered but state (scale and center) is forgotten. You can restore these yourself if required.

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

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSharedPreferences (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
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