Home
last modified time | relevance | path

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

12

/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.java248 outHsl[0] = constrain(h, 0f, 360f); in RGBToHSL()
249 outHsl[1] = constrain(s, 0f, 1f); in RGBToHSL()
250 outHsl[2] = constrain(l, 0f, 1f); in RGBToHSL()
328 r = constrain(r, 0, 255); in HSLToColor()
329 g = constrain(g, 0, 255); in HSLToColor()
330 b = constrain(b, 0, 255); in HSLToColor()
529 constrain((int) Math.round(r * 255), 0, 255), in XYZToColor()
530 constrain((int) Math.round(g * 255), 0, 255), in XYZToColor()
531 constrain((int) Math.round(b * 255), 0, 255)); in XYZToColor()
560 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.java899 constrain((int) Math.round(r * 255), 0, 255), in XYZToColor()
900 constrain((int) Math.round(g * 255), 0, 255), in XYZToColor()
901 constrain((int) Math.round(b * 255), 0, 255)); in XYZToColor()
921 private static int constrain(int amount, int low, int high) { in constrain() method in ContrastColorUtil.ColorUtilsFromCompat
925 private static float constrain(float amount, float low, float high) { in constrain() method in ContrastColorUtil.ColorUtilsFromCompat
1004 r = constrain(r, 0, 255); in HSLToColor()
1005 g = constrain(g, 0, 255); in HSLToColor()
1006 b = constrain(b, 0, 255); in HSLToColor()
1073 outHsl[0] = constrain(h, 0f, 360f); in RGBToHSL()
1074 outHsl[1] = constrain(s, 0f, 1f); in RGBToHSL()
[all …]
DProgressReporter.java147 + MathUtils.constrain((n * mSegmentRange[1]) / m, 0, mSegmentRange[1]); in setProgress()
/frameworks/base/services/core/java/com/android/server/display/
DBrightnessMappingStrategy.java280 brightness = MathUtils.constrain(brightness, in normalizeAbsoluteBrightness()
338 float newBrightness = MathUtils.constrain( in smoothCurve()
354 float newBrightness = MathUtils.constrain( in smoothCurve()
394 adjustment = MathUtils.constrain(adjustment, -1, +1); in inferAutoBrightnessAdjustment()
411 adjustment = MathUtils.constrain(adjustment, -1, 1); in getAdjustedCurve()
504 adjustment = MathUtils.constrain(adjustment, -1, 1); in setAutoBrightnessAdjustment()
700 adjustment = MathUtils.constrain(adjustment, -1, 1); in setAutoBrightnessAdjustment()
DDisplayPowerController.java1285 return MathUtils.constrain(
1290 return MathUtils.constrain(
1868 return MathUtils.constrain(value, PowerManager.BRIGHTNESS_OFF, PowerManager.BRIGHTNESS_ON); in clampAbsoluteBrightness()
1872 return MathUtils.constrain(value, -1.0f, 1.0f); in clampAutoBrightnessAdjustment()
/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()
/frameworks/base/core/java/android/hardware/display/
DBrightnessCorrection.java225 mScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in ScaleAndTranslateLog()
226 mTranslate = MathUtils.constrain(translate, MIN_TRANSLATE, MAX_TRANSLATE); in ScaleAndTranslateLog()
/frameworks/base/packages/SystemUI/src/com/android/systemui/qs/
DTouchAnimator.java56 float t = MathUtils.constrain((fraction - mStartDelay) / mSpan, 0, 1); in setPosition()
212 int i = MathUtils.constrain((int) Math.ceil(fraction / mFrameWidth), 1, mSize - 1); in setValue()
/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()
DTimePicker.java186 mDelegate.setHour(MathUtils.constrain(hour, 0, 23)); in setHour()
207 mDelegate.setMinute(MathUtils.constrain(minute, 0, 59)); in setMinute()
DDayPickerView.java165 final long setDateMillis = MathUtils.constrain( in DayPickerView()
392 return MathUtils.constrain(diffMonth, 0, diffMonthMax);
DSimpleMonthView.java538 row = MathUtils.constrain(row, 0, maxRows); in findClosestRow()
555 MathUtils.constrain(centerX / mCellWidth, 0, DAYS_IN_WEEK - 1); in findClosestColumn()
826 mEnabledDayStart = MathUtils.constrain(enabledDayStart, 1, mDaysInMonth); in setMonthParams()
827 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/services/accessibility/java/com/android/server/accessibility/
DMagnificationController.java429 scale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in setScale()
496 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE); in updateMagnificationSpecLocked()
539 final float offsetX = MathUtils.constrain( in updateCurrentSpecWithOffsetsLocked()
545 final float offsetY = MathUtils.constrain( in updateCurrentSpecWithOffsetsLocked()
/frameworks/base/graphics/java/android/graphics/drawable/
DColorStateListDrawable.java151 color = (color & 0xFFFFFF) | MathUtils.constrain(mState.mAlpha, 0, 255) << 24; in onStateChange()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/
DDozeParameters.java217 return MathUtils.constrain(value, 0, MAX_DURATION); in getInt()
DKeyguardBouncer.java386 mKeyguardView.setAlpha(MathUtils.constrain(alpha, 0f, 1f)); in setExpansion()
DEdgeBackGestureHandler.java407 mEdgePanelLp.y = MathUtils.constrain((int) position, 0, mDisplaySize.y); in updateEdgePanelPosition()
/frameworks/base/services/core/java/com/android/server/
DRescueParty.java198 final int level = MathUtils.constrain( in incrementRescueLevel()
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
DActivityLaunchAnimator.java332 return MathUtils.constrain((linearProgress * ANIMATION_DURATION - delay) in getProgress()
/frameworks/base/core/java/android/content/res/
DColorStateList.java514 final int alpha = MathUtils.constrain((int) (baseAlpha * alphaMod + 0.5f), 0, 255); in modulateColorAlpha()
/frameworks/base/services/core/java/com/android/server/net/
DNetworkStatsRecorder.java137 mPersistThresholdBytes = MathUtils.constrain( in setPersistThreshold()
/frameworks/base/core/java/android/net/
DNetworkStatsHistory.java268 return MathUtils.constrain(index, 0, bucketCount - 1); in getIndexBefore()
282 return MathUtils.constrain(index, 0, bucketCount - 1); in getIndexAfter()

12