Home
last modified time | relevance | path

Searched refs:constrain (Results 1 – 25 of 64) sorted by relevance

123

/frameworks/base/core/java/com/android/internal/widget/
DAutoScrollHelper.java555 return constrain(value * targetVelocity, minimumVelocity, maximumVelocity); in computeTargetVelocity()
557 return -constrain(-value * targetVelocity, minimumVelocity, maximumVelocity); in computeTargetVelocity()
606 final float edgeSize = constrain(relativeValue * size, NO_MIN, maxValue); in getEdgeValue()
619 return constrain(interpolated, -1, 1); in getEdgeValue()
651 private static int constrain(int value, int min, int max) { in constrain() method in AutoScrollHelper
661 private static float constrain(float value, float min, float max) { in constrain() method in AutoScrollHelper
775 mEffectiveRampDown = constrain((int) (currentTime - mStartTime), 0, mRampDownDuration); in requestStop()
790 return 0.5f * constrain(elapsedSinceStart / (float) mRampUpDuration, 0, 1); in getValueAt()
794 * constrain(elapsedSinceEnd / (float) mEffectiveRampDown, 0, 1); in getValueAt()
/frameworks/base/core/java/com/android/internal/graphics/
DColorUtils.java250 outHsl[0] = constrain(h, 0f, 360f); in RGBToHSL()
251 outHsl[1] = constrain(s, 0f, 1f); in RGBToHSL()
252 outHsl[2] = constrain(l, 0f, 1f); in RGBToHSL()
330 r = constrain(r, 0, 255); in HSLToColor()
331 g = constrain(g, 0, 255); in HSLToColor()
332 b = constrain(b, 0, 255); in HSLToColor()
560 constrain((int) Math.round(r * 255), 0, 255), in XYZToColor()
561 constrain((int) Math.round(g * 255), 0, 255), in XYZToColor()
562 constrain((int) Math.round(b * 255), 0, 255)); in XYZToColor()
591 private static float constrain(float amount, float low, float high) { in constrain() method
[all …]
/frameworks/base/core/java/android/util/
DMathUtils.java40 public static int constrain(int amount, int low, int high) { in constrain() method in MathUtils
44 public static long constrain(long amount, long low, long high) { in constrain() method in MathUtils
49 public static float constrain(float amount, float low, float high) { in constrain() method in MathUtils
180 return constrain(value, 0.0f, 1.0f); in saturate()
255 return constrain((x - start) / (end - start), 0f, 1f); in smoothStep()
/frameworks/base/core/java/com/android/internal/util/
DContrastColorUtil.java902 constrain((int) Math.round(r * 255), 0, 255), in XYZToColor()
903 constrain((int) Math.round(g * 255), 0, 255), in XYZToColor()
904 constrain((int) Math.round(b * 255), 0, 255)); in XYZToColor()
924 private static int constrain(int amount, int low, int high) { in constrain() method in ContrastColorUtil.ColorUtilsFromCompat
928 private static float constrain(float amount, float low, float high) { in constrain() method in ContrastColorUtil.ColorUtilsFromCompat
1007 r = constrain(r, 0, 255); in HSLToColor()
1008 g = constrain(g, 0, 255); in HSLToColor()
1009 b = constrain(b, 0, 255); in HSLToColor()
1076 outHsl[0] = constrain(h, 0f, 360f); in RGBToHSL()
1077 outHsl[1] = constrain(s, 0f, 1f); in RGBToHSL()
[all …]
DProgressReporter.java147 + MathUtils.constrain((n * mSegmentRange[1]) / m, 0, mSegmentRange[1]); in setProgress()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/display/
DDisplayDensityUtils.java110 final int numLarger = (int) MathUtils.constrain((maxScale - 1) / MIN_SCALE_INTERVAL, in DisplayDensityUtils()
112 final int numSmaller = (int) MathUtils.constrain((1 - minScale) / MIN_SCALE_INTERVAL, in DisplayDensityUtils()
DBrightnessUtils.java88 final float normalizedRet = MathUtils.constrain(ret, 0, 12); in convertGammaToLinearFloat()
/frameworks/base/core/java/android/hardware/display/
DBrightnessCorrection.java219 mScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in ScaleAndTranslateLog()
220 mTranslate = MathUtils.constrain(translate, MIN_TRANSLATE, MAX_TRANSLATE); in ScaleAndTranslateLog()
/frameworks/base/packages/SystemUI/src/com/android/systemui/accessibility/
DMirrorWindowControl.java167 point.x = MathUtils.constrain(point.x, mDraggableBound.left, mDraggableBound.right); in constrainFrameToDraggableBound()
168 point.y = MathUtils.constrain(point.y, mDraggableBound.top, mDraggableBound.bottom); in constrainFrameToDraggableBound()
DMagnificationModeSwitch.java346 mParams.x = MathUtils.constrain(mParams.x, mDraggableWindowBounds.left, in updateButtonViewLayoutIfNeeded()
348 mParams.y = MathUtils.constrain(mParams.y, mDraggableWindowBounds.top, in updateButtonViewLayoutIfNeeded()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/screenshot/
DFakeSession.java19 import static android.util.MathUtils.constrain;
124 mScrollDelta = constrain(mScrollDelta, mAvailableTop.top, mAvailableTop.bottom); in requestTile()
/frameworks/base/services/core/java/com/android/server/display/
DBrightnessMappingStrategy.java405 float newBrightness = MathUtils.constrain( in smoothCurve()
421 float newBrightness = MathUtils.constrain( in smoothCurve()
460 adjustment = MathUtils.constrain(adjustment, -1, +1); in inferAutoBrightnessAdjustment()
477 adjustment = MathUtils.constrain(adjustment, -1, 1); in getAdjustedCurve()
583 adjustment = MathUtils.constrain(adjustment, -1, 1); in setAutoBrightnessAdjustment()
799 adjustment = MathUtils.constrain(adjustment, -1, 1); in setAutoBrightnessAdjustment()
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/
DTouchAnimator.java57 float t = MathUtils.constrain((fraction - mStartDelay) / mSpan, 0, 1); in setPosition()
213 int i = MathUtils.constrain((int) Math.ceil(fraction / mFrameWidth), 1, mSize - 1); in setValue()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/
DNotificationShadeDepthController.kt177 val normalizedBlurRadius = MathUtils.constrain(shadeAnimation.radius, in <lambda>()
323 deltaTime = MathUtils.constrain( in <lambda>()
329 val shadeVelocity = MathUtils.constrain( in <lambda>()
/frameworks/base/core/java/android/widget/
DTextInputTimePickerView.java236 MathUtils.constrain(hour, minHour, maxHour))); in parseAndSetHourInternal()
252 mListener.onValueChanged(MINUTES, MathUtils.constrain(minutes, 0, 59)); in parseAndSetMinuteInternal()
DDayPickerView.java161 final long setDateMillis = MathUtils.constrain( in DayPickerView()
388 return MathUtils.constrain(diffMonth, 0, diffMonthMax);
DTimePicker.java186 mDelegate.setHour(MathUtils.constrain(hour, 0, 23)); in setHour()
207 mDelegate.setMinute(MathUtils.constrain(minute, 0, 59)); in setMinute()
DSimpleMonthView.java540 row = MathUtils.constrain(row, 0, maxRows); in findClosestRow()
557 MathUtils.constrain(centerX / mCellWidth, 0, DAYS_IN_WEEK - 1); in findClosestColumn()
828 mEnabledDayStart = MathUtils.constrain(enabledDayStart, 1, mDaysInMonth); in setMonthParams()
829 mEnabledDayEnd = MathUtils.constrain(enabledDayEnd, mEnabledDayStart, mDaysInMonth); in setMonthParams()
DFastScroller.java1010 final int exactSection = MathUtils.constrain( in scrollTo()
1078 targetIndex = MathUtils.constrain(targetIndex, 0, count - 1); in scrollTo()
1091 final int index = MathUtils.constrain((int) (position * count), 0, count - 1); in scrollTo()
1235 final float previewMiddle = MathUtils.constrain(previewPos, minP, maxP); in setThumbPos()
1250 return MathUtils.constrain((y - mThumbOffset) / mThumbRange, 0f, 1f); in getPosFromMotionEvent()
/frameworks/base/packages/SystemUI/src/com/android/systemui/util/animation/
DTransitionLayoutController.kt102 remappedProgress = MathUtils.constrain(remappedProgress, 0.0f, 1.0f) in getGoneState()
120 alpha = MathUtils.constrain(alphaProgress, 0.0f, 1.0f) in getGoneState()
/frameworks/base/packages/SystemUI/src/com/android/systemui/
DImageWallpaper.java280 imgArea.left = MathUtils.constrain( in pageToImgRect()
282 imgArea.right = MathUtils.constrain( in pageToImgRect()
/frameworks/base/services/accessibility/java/com/android/server/accessibility/magnification/
DFullScreenMagnificationController.java473 scale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in setScale()
541 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in updateMagnificationSpecLocked()
584 final float offsetX = MathUtils.constrain( in updateCurrentSpecWithOffsetsLocked()
590 final float offsetY = MathUtils.constrain( in updateCurrentSpecWithOffsetsLocked()
DWindowMagnificationManager.java596 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in enableWindowMagnificationInternal()
627 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in setScale()
/frameworks/base/packages/SystemUI/src/com/android/systemui/media/
DIlluminationDrawable.kt166 tmpHsl[2] = MathUtils.constrain(if (L < 1f - highlight) { in animateBackground()
/frameworks/base/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/
DAccessibilityFloatingMenuView.java20 import static android.util.MathUtils.constrain;
284 constrain(newWindowX, getMinWindowX(), getMaxWindowX()); in onInterceptTouchEvent()
285 mCurrentLayoutParams.y = constrain(newWindowY, MIN_WINDOW_Y, getMaxWindowY()); in onInterceptTouchEvent()

123