This site requires javascript.
Android Code Search
file:androidx/compose/ui/unit/Constraints.kt function:constrain
search
close
info_outline
more_vert
Result 1 of 1
content_copy
Search Result Root
androidx/platform/frameworks/support
keyboard_arrow_right
Branch
Branch
androidx-main
keyboard_arrow_right
Search Result Path
compose/ui/ui-unit/src/commonMain/kotlin/androidx/compose/ui/unit/
Constraints.kt
content_copy
Preview
260:
261:
262:
@Stable
fun
restrict
Constrain
ts(
minWidth: Int,
399:
400:
401:
// Keep internal for codegen
internal
fun
throwInvalid
Constrain
tException(widthVal: Int, heightVal: Int) {
throw
IllegalArgumentException(
406:
407:
408:
// Keep internal for codegen
internal
fun
throwInvalid
Constrain
tsSizeException(size: Int): Nothing {
throw
IllegalArgumentException(
"Can't represent a size of
$
size
in Constraints"
)
411:
412:
413:
/** Creates a [Constraints], only checking that the values fit in the packed Long. */
internal
fun
create
Constrain
ts(
minWidth: Int,
479:
480:
481:
@Stable
fun
Constrain
ts(
minWidth: Int =
0
,
507:
508:
509:
*/
fun
Constraints.
constrain
(otherConstraints: Constraints): Constraints {
val
minWidth = minWidth
522:
523:
524:
@Stable
fun
Constraints.
constrain
(size: IntSize) =
IntSize(
529:
530:
531:
532:
533:
534:
/** Takes a width and returns the closest size to it that satisfies the constraints. */
@Stable
fun
Constraints.
constrain
Width(width: Int) = width.fastCoerceIn(minWidth, maxWidth)
/** Takes a height and returns the closest size to it that satisfies the constraints. */
@Stable
fun
Constraints.
constrain
Height(height: Int) = height.fastCoerceIn(minHeight, maxHeight)
chevron_left
1
chevron_right
Results per page
10
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Got it
Help
Open branch androidx-main