private void setScaleType() { for (ScaleType stValue : ImageView.ScaleType.values()) { ItemSpinner item = new ItemSpinner(stValue, stValue.toString()); this.ListSpinner.add(item); } ArrayAdapter adapterSelectDetail = new ArrayAdapter(this, android.R.layout.simple_spinner_item, this.ListSpinner); adapterSelectDetail.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); this.spScaleType.setAdapter(adapterSelectDetail); }
/** * Creates a cache key for use with the L1 cache. * * @param url The URL of the request. * @param maxWidth The max-width of the output. * @param maxHeight The max-height of the output. * @param scaleType The scaleType of the imageView. */ private static String getCacheKey(String url, int maxWidth, int maxHeight, ScaleType scaleType) { return new StringBuilder(url.length() + 12) .append("#W") .append(maxWidth) .append("#H") .append(maxHeight) .append("#S") .append(scaleType.ordinal()) .append(url) .toString(); }
/** @return true if the ScaleType is supported. */ private static boolean isSupportedScaleType(final ScaleType scaleType) { if (null == scaleType) { return false; } switch (scaleType) { case MATRIX: throw new IllegalArgumentException(scaleType.name() + " is not supported in PhotoView"); default: return true; } }
void setScaleMode(ScaleType value) { setScaleModeAsString(value.toString()); }
ScaleType getScaleMode() { return ScaleType.valueOf(getScaleModeAsString()); }