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

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

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

origin: davemorrissey/subsampling-scale-image-view

/**
 * Given a requested source center and scale, calculate what the actual center will have to be to keep the image in
 * pan limits, keeping the requested center as near to the middle of the screen as allowed.
 */
@NonNull
private PointF limitedSCenter(float sCenterX, float sCenterY, float scale, @NonNull PointF sTarget) {
  PointF vTranslate = vTranslateForSCenter(sCenterX, sCenterY, scale);
  int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
  int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
  float sx = (vxCenter - vTranslate.x)/scale;
  float sy = (vyCenter - vTranslate.y)/scale;
  sTarget.set(sx, sy);
  return sTarget;
}
origin: davemorrissey/subsampling-scale-image-view

/**
 * Get the translation required to place a given source coordinate at the center of the screen, with the center
 * adjusted for asymmetric padding. Accepts the desired scale as an argument, so this is independent of current
 * translate and scale. The result is fitted to bounds, putting the image point as near to the screen center as permitted.
 */
@NonNull
private PointF vTranslateForSCenter(float sCenterX, float sCenterY, float scale) {
  int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
  int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
  if (satTemp == null) {
    satTemp = new ScaleAndTranslate(0, new PointF(0, 0));
  }
  satTemp.scale = scale;
  satTemp.vTranslate.set(vxCenter - (sCenterX * scale), vyCenter - (sCenterY * scale));
  fitToBounds(true, satTemp);
  return satTemp.vTranslate;
}
origin: davemorrissey/subsampling-scale-image-view

int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
float targetScale = limitedScale(this.targetScale);
origin: davemorrissey/subsampling-scale-image-view

float xPaddingRatio = getPaddingLeft() > 0 || getPaddingRight() > 0 ? getPaddingLeft()/(float)(getPaddingLeft() + getPaddingRight()) : 0.5f;
float yPaddingRatio = getPaddingTop() > 0 || getPaddingBottom() > 0 ? getPaddingTop()/(float)(getPaddingTop() + getPaddingBottom()) : 0.5f;
origin: davemorrissey/subsampling-scale-image-view

/**
 * Returns the minimum allowed scale.
 */
private float minScale() {
  int vPadding = getPaddingBottom() + getPaddingTop();
  int hPadding = getPaddingLeft() + getPaddingRight();
  if (minimumScaleType == SCALE_TYPE_CENTER_CROP || minimumScaleType == SCALE_TYPE_START) {
    return Math.max((getWidth() - hPadding) / (float) sWidth(), (getHeight() - vPadding) / (float) sHeight());
  } else if (minimumScaleType == SCALE_TYPE_CUSTOM && minScale > 0) {
    return minScale;
  } else {
    return Math.min((getWidth() - hPadding) / (float) sWidth(), (getHeight() - vPadding) / (float) sHeight());
  }
}
origin: mozilla-tw/Rocket

/**
 * Given a requested source center and scale, calculate what the actual center will have to be to keep the image in
 * pan limits, keeping the requested center as near to the middle of the screen as allowed.
 */
private PointF limitedSCenter(float sCenterX, float sCenterY, float scale, PointF sTarget) {
  PointF vTranslate = vTranslateForSCenter(sCenterX, sCenterY, scale);
  int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
  int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
  float sx = (vxCenter - vTranslate.x)/scale;
  float sy = (vyCenter - vTranslate.y)/scale;
  sTarget.set(sx, sy);
  return sTarget;
}
origin: mozilla-tw/Rocket

/**
 * Get the translation required to place a given source coordinate at the center of the screen, with the center
 * adjusted for asymmetric padding. Accepts the desired scale as an argument, so this is independent of current
 * translate and scale. The result is fitted to bounds, putting the image point as near to the screen center as permitted.
 */
private PointF vTranslateForSCenter(float sCenterX, float sCenterY, float scale) {
  int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
  int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
  if (satTemp == null) {
    satTemp = new ScaleAndTranslate(0, new PointF(0, 0));
  }
  satTemp.scale = scale;
  satTemp.vTranslate.set(vxCenter - (sCenterX * scale), vyCenter - (sCenterY * scale));
  fitToBounds(true, satTemp);
  return satTemp.vTranslate;
}
origin: mozilla-tw/Rocket

int vxCenter = getPaddingLeft() + (getWidth() - getPaddingRight() - getPaddingLeft())/2;
int vyCenter = getPaddingTop() + (getHeight() - getPaddingBottom() - getPaddingTop())/2;
float targetScale = limitedScale(this.targetScale);
origin: mozilla-tw/Rocket

float xPaddingRatio = getPaddingLeft() > 0 || getPaddingRight() > 0 ? getPaddingLeft()/(float)(getPaddingLeft() + getPaddingRight()) : 0.5f;
float yPaddingRatio = getPaddingTop() > 0 || getPaddingBottom() > 0 ? getPaddingTop()/(float)(getPaddingTop() + getPaddingBottom()) : 0.5f;
origin: mozilla-tw/Rocket

/**
 * Returns the minimum allowed scale.
 */
private float minScale() {
  int vPadding = getPaddingBottom() + getPaddingTop();
  int hPadding = getPaddingLeft() + getPaddingRight();
  if (minimumScaleType == SCALE_TYPE_CENTER_CROP) {
    return Math.max((getWidth() - hPadding) / (float) sWidth(), (getHeight() - vPadding) / (float) sHeight());
  } else if (minimumScaleType == SCALE_TYPE_CUSTOM && minScale > 0) {
    return minScale;
  } else {
    return Math.min((getWidth() - hPadding) / (float) sWidth(), (getHeight() - vPadding) / (float) sHeight());
  }
}
com.davemorrissey.labs.subscaleviewSubsamplingScaleImageViewgetPaddingLeft

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

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onCreateOptionsMenu (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top Sublime Text plugins
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