Home
last modified time | relevance | path

Searched refs:ratio (Results 1 – 25 of 65) sorted by relevance

123

/packages/apps/DeskClock/src/com/android/alarmclock/
DWidgetUtils.java49 float ratio = (density * minWidth) / res.getDimension(R.dimen.min_digital_widget_width); in getScaleRatio() local
50 ratio = Math.min(ratio, getHeightScaleRatio(context, options, id)); in getScaleRatio()
51 ratio *= .83f; in getScaleRatio()
54 return (ratio > 1f) ? 1f : ratio; in getScaleRatio()
57 ratio = Math.min(ratio, 1.6f); in getScaleRatio()
59 ratio = Math.max(ratio, .71f); in getScaleRatio()
62 ratio = Math.max(ratio, .45f); in getScaleRatio()
64 return ratio; in getScaleRatio()
87 float ratio = density * minHeight / res.getDimension(R.dimen.min_digital_widget_height); in getHeightScaleRatio() local
89 return ratio * 1.75f; in getHeightScaleRatio()
[all …]
/packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/common/
DLogoUtils.java86 int ratio = Math.max(streamWidth / maxDesiredWidth, streamHeight / maxDesiredHeight); in getBitmapPartiallyResized() local
87 if (ratio > 1) { in getBitmapPartiallyResized()
91 bounds.inSampleSize = ratio; in getBitmapPartiallyResized()
106 double ratio = Math.max((double) width / maxWidth, (double) height / maxHeight); in resizeBitmap() local
108 if (ratio > 1) { in resizeBitmap()
109 width /= ratio; in resizeBitmap()
110 height /= ratio; in resizeBitmap()
/packages/apps/LegacyCamera/src/com/android/camera/
DPreviewFrameLayout.java43 public void setAspectRatio(double ratio) { in setAspectRatio() argument
44 if (ratio <= 0.0) throw new IllegalArgumentException(); in setAspectRatio()
48 ratio = 1 / ratio; in setAspectRatio()
51 if (mAspectRatio != ratio) { in setAspectRatio()
52 mAspectRatio = ratio; in setAspectRatio()
DUtil.java399 double ratio = (double) size.width / size.height; in getOptimalPreviewSize() local
400 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; in getOptimalPreviewSize()
433 double ratio = (double) size.width / size.height; in getOptimalVideoSnapshotPictureSize() local
434 if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; in getOptimalVideoSnapshotPictureSize()
/packages/apps/Camera2/src/com/android/camera/
DVideoUI.java151 public void setAspectRatio(float ratio) { in setAspectRatio() argument
152 if (ratio <= 0) { in setAspectRatio()
155 float aspectRatio = ratio > 1 ? ratio : 1 / ratio; in setAspectRatio()
262 public void onZoomValueChanged(float ratio) { in onZoomValueChanged() argument
263 mController.onZoomChanged(ratio); in onZoomValueChanged()
/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/
DPhotoSource.java180 float ratio = (outsideRatio / insideRatio < mMaxCropRatio ? in load() local
183 while (ratio < 0.5) { in load()
185 ratio *= 2; in load()
203 ratio = Math.max((float) longSide / (float) rawLongSide, in load()
206 if (Math.abs(ratio - 1.0f) > 0.001) { in load()
207 log(TAG, "still too big, scaling down by " + ratio); in load()
208 options.outWidth = (int) (ratio * options.outWidth); in load()
209 options.outHeight = (int) (ratio * options.outHeight); in load()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/
DKeyDrawParams.java136 final int dimens, final float ratio, final int defaultDimens) { in selectTextSizeFromDimensionOrRatio() argument
140 if (ResourceUtils.isValidFraction(ratio)) { in selectTextSizeFromDimensionOrRatio()
141 return (int)(keyHeight * ratio); in selectTextSizeFromDimensionOrRatio()
146 private static int selectTextSize(final int keyHeight, final float ratio, in selectTextSize() argument
148 if (ResourceUtils.isValidFraction(ratio)) { in selectTextSize()
149 return (int)(keyHeight * ratio); in selectTextSize()
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/
DGLES11Canvas.java449 int toColor, float ratio, int x, int y, int w, int h) { in drawMixed() argument
450 drawMixed(from, toColor, ratio, x, y, w, h, mAlpha); in drawMixed()
469 private void setMixedColor(int toColor, float ratio, float alpha) { in setMixedColor() argument
480 float combo = alpha * (1 - ratio); in setMixedColor()
481 float scale = alpha * ratio / (1 - combo); in setMixedColor()
511 public void drawMixed(BasicTexture from, int toColor, float ratio, in drawMixed() argument
515 if (ratio <= 0.01f) { in drawMixed()
518 } else if (ratio >= 1) { in drawMixed()
538 setMixedColor(toColor, ratio, alpha); in drawMixed()
546 float ratio, int x, int y, int width, int height, float alpha) { in drawMixed() argument
[all …]
DGLCanvas.java112 float ratio, int x, int y, int w, int h); in drawMixed() argument
119 float ratio, RectF src, RectF target); in drawMixed() argument
/packages/apps/Camera2/src/com/android/camera/data/
DGlideFilmstripManager.java202 double ratio = Math.min(Math.sqrt(maxArea / original.area()), 1.0f); in clampSize() local
203 int width = (int) Math.round(original.width() * ratio); in clampSize()
204 int height = (int) Math.round(original.height() * ratio); in clampSize()
219 double ratio = widthRatio > heightRatio ? heightRatio : widthRatio; in computeFitWithinSize() local
224 Math.min((int) Math.round(original.width() * ratio), maxSize.width()), in computeFitWithinSize()
225 Math.min((int) Math.round(original.height() * ratio), maxSize.height())); in computeFitWithinSize()
/packages/apps/Dialer/java/com/android/incallui/answer/impl/classifier/
DEndPointRatioClassifier.java35 float ratio; in getFalseTouchEvaluation() local
37 ratio = 1.0f; in getFalseTouchEvaluation()
39 ratio = stroke.getEndPointLength() / stroke.getTotalLength(); in getFalseTouchEvaluation()
41 return EndPointRatioEvaluator.evaluate(ratio); in getFalseTouchEvaluation()
/packages/apps/Dialer/java/com/android/dialer/callcomposer/util/
DBitmapResizer.java48 float ratio = width / (float) MAX_OUTPUT_RESOLUTION; in resizeForEnrichedCalling() local
50 height = (int) (height / ratio); in resizeForEnrichedCalling()
53 float ratio = height / (float) MAX_OUTPUT_RESOLUTION; in resizeForEnrichedCalling() local
55 width = (int) (width / ratio); in resizeForEnrichedCalling()
/packages/apps/TV/src/com/android/tv/util/
DUtils.java445 for (AspectRatio ratio: AspectRatio.values()) { in getAspectRatioString()
446 if (Math.abs((float) ratio.height / ratio.width - (float) height / width) < 0.05f) { in getAspectRatioString()
447 return ratio.toString(); in getAspectRatioString()
458 for (AspectRatio ratio : AspectRatio.values()) { in getAspectRatioString()
459 if (Math.abs((float) ratio.width / ratio.height - videoDisplayAspectRatio) < 0.05f) { in getAspectRatioString()
460 return ratio.toString(); in getAspectRatioString()
DBitmapUtils.java60 final double ratio = maxHeight / (double) maxWidth; in calculateNewSize() local
63 if (ratio > bmRatio) { in calculateNewSize()
163 int ratio = Math.max(width / reqWidth, height / reqHeight); in calculateInSampleSize() local
164 return Math.max(1, Integer.highestOneBit(ratio)); in calculateInSampleSize()
/packages/apps/Contacts/src/com/android/contacts/widget/
DMultiShrinkScroller.java199 void onTransparentViewHeightChange(float ratio); in onTransparentViewHeightChange() argument
1077 final float ratio = (toolbarHeight - mMinimumHeaderHeight) in updateHeaderTextSizeAndMargin() local
1080 float bezierOutput = mTextSizePathInterpolator.getInterpolation(ratio); in updateHeaderTextSizeAndMargin()
1183 final float ratio = calculateHeightRatioToBlendingStartHeight(toolbarHeight); in updatePhotoTintAndDropShadow() local
1184 final float alpha = 1.0f - (float) Math.min(Math.pow(ratio, 1.5f) * 2f, 1f); in updatePhotoTintAndDropShadow()
1185 final float tint = (float) Math.min(Math.pow(ratio, 1.5f) * 3f, 1f); in updatePhotoTintAndDropShadow()
1199 final float ratio = calculateHeightRatioToFullyOpen(toolbarHeight); in updatePhotoTintAndDropShadow() local
1205 float linearBeforeIntermediate = Math.max(1 - (1 - ratio) / intermediateRatio in updatePhotoTintAndDropShadow()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/cube/
DCubeRenderer.java97 float ratio = (float) width / height; in onSurfaceChanged() local
100 gl.glFrustumf(-ratio, ratio, -1, 1, 1, 10); in onSurfaceChanged()
/packages/apps/PhoneCommon/src/com/android/phone/common/util/
DViewUtil.java100 float ratio = width / paint.measureText(textView.getText().toString()); in resizeText() local
101 if (ratio <= 1.0f) { in resizeText()
103 Math.max(minTextSize, originalTextSize * ratio)); in resizeText()
/packages/apps/Dialer/java/com/android/dialer/util/
DViewUtil.java81 float ratio = width / paint.measureText(textView.getText().toString()); in resizeText() local
82 if (ratio <= 1.0f) { in resizeText()
84 TypedValue.COMPLEX_UNIT_PX, Math.max(minTextSize, originalTextSize * ratio)); in resizeText()
/packages/apps/LegacyCamera/src/com/android/camera/ui/
DRotateImageView.java128 float ratio = Math.min((float) width / w, (float) height / h); in onDraw() local
129 canvas.scale(ratio, ratio, width / 2.0f, height / 2.0f); in onDraw()
/packages/services/Telecomm/src/com/android/server/telecom/
DContactsAsyncHelper.java168 float ratio = ((float) longerEdge) / iconSize; in getPhotoIconWhenAppropriate() local
169 int newWidth = (int) (orgWidth / ratio); in getPhotoIconWhenAppropriate()
170 int newHeight = (int) (orgHeight / ratio); in getPhotoIconWhenAppropriate()
/packages/apps/Dialer/java/com/android/incallui/
DContactsAsyncHelper.java251 float ratio = ((float) longerEdge) / iconSize; in getPhotoIconWhenAppropriate() local
252 int newWidth = (int) (orgWidth / ratio); in getPhotoIconWhenAppropriate()
253 int newHeight = (int) (orgHeight / ratio); in getPhotoIconWhenAppropriate()
/packages/apps/Launcher2/src/com/android/launcher2/
DUtilities.java121 final float ratio = (float) sourceWidth / sourceHeight; in createIconBitmap() local
123 height = (int) (width / ratio); in createIconBitmap()
125 width = (int) (height * ratio); in createIconBitmap()
/packages/apps/Camera2/src/com/android/camera/ui/
DPreviewOverlay.java100 void onZoomValueChanged(float ratio); // only for immediate zoom in onZoomValueChanged() argument
322 public void setZoom(float ratio) { in setZoom() argument
323 mCurrentRatio = ratio; in setZoom()
/packages/apps/DocumentsUI/src/com/android/documentsui/ui/
DViewAutoScroller.java126 private float smoothOutOfBoundsRatio(float ratio) { in smoothOutOfBoundsRatio() argument
127 return (float) Math.pow(ratio, 10); in smoothOutOfBoundsRatio()
/packages/apps/Camera2/src/com/android/camera/ui/focus/
DFocusController.java132 public void setFocusRatio(final float ratio) { in setFocusRatio() argument
138 mFocusRing.setRadiusRatio(ratio); in setFocusRatio()

123