KTX 확장 목록

androidx.activity

종속 항목

Groovy

dependencies {
    implementation "androidx.activity:activity-ktx:1.9.0"
}

Kotlin

dependencies {
    implementation("androidx.activity:activity-ktx:1.9.0")
}

확장 함수

OnBackPressedDispatcher:
OnBackPressedCallback OnBackPressedDispatcher.addCallback(owner: LifecycleOwner? = null, enabled: Boolean = true, onBackPressed: OnBackPressedCallback.() -> Unit)

OnBackPressedCallback.handleOnBackPressed에서 onBackPressed를 호출하는 새로운 OnBackPressedCallback을 생성하여 추가합니다.

ComponentActivity:
Lazy<VM> ComponentActivity.viewModels(noinline factoryProducer: () -> ViewModelProvider.Factory = null)

Lazy 위임을 반환하여 ComponentActivity의 ViewModel에 액세스하며 factoryProducer가 지정되면 반환된 ViewModelProvider.Factory가 사용되어 처음으로 ViewModel을 생성합니다.

androidx.benchmark

종속 항목

Groovy

dependencies {
    implementation "androidx.benchmark:benchmark-junit4:1.2.4"
}

Kotlin

dependencies {
    implementation("androidx.benchmark:benchmark-junit4:1.2.4")
}

최상위 함수

Unit beginTraceSection(sectionName: String)

Unit endTraceSection()

androidx.benchmark.junit4

종속 항목

Groovy

dependencies {
    implementation "androidx.benchmark:benchmark-junit4:1.2.4"
}

Kotlin

dependencies {
    implementation("androidx.benchmark:benchmark-junit4:1.2.4")
}

확장 함수

BenchmarkRule:
Unit BenchmarkRule.measureRepeated(crossinline block: BenchmarkRule.Scope.() -> Unit)

코드 블록을 벤치마킹합니다.

androidx.collection

종속 항목

Groovy

dependencies {
    implementation "androidx.collection:collection-ktx:1.4.0"
}

Kotlin

dependencies {
    implementation("androidx.collection:collection-ktx:1.4.0")
}

확장 함수

LongSparseArray:
연산자 Boolean LongSparseArray<T>.contains(key: Long)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Unit LongSparseArray<T>.forEach(action: (key: Long, value: T) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

T LongSparseArray<T>.getOrDefault(key: Long, defaultValue: T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

T LongSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean LongSparseArray<T>.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

LongIterator LongSparseArray<T>.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 LongSparseArray<T> LongSparseArray<T>.plus(other: LongSparseArray<T>)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Boolean LongSparseArray<T>.remove(key: Long, value: T)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit LongSparseArray<T>.set(key: Long, value: T)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

Iterator<T> LongSparseArray<T>.valueIterator()

컬렉션의 값 반복자를 반환합니다.

SparseArrayCompat:
연산자 Boolean SparseArrayCompat<T>.contains(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Unit SparseArrayCompat<T>.forEach(action: (key: Int, value: T) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

T SparseArrayCompat<T>.getOrDefault(key: Int, defaultValue: T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

T SparseArrayCompat<T>.getOrElse(key: Int, defaultValue: () -> T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean SparseArrayCompat<T>.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

IntIterator SparseArrayCompat<T>.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 SparseArrayCompat<T> SparseArrayCompat<T>.plus(other: SparseArrayCompat<T>)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Boolean SparseArrayCompat<T>.remove(key: Int, value: T)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit SparseArrayCompat<T>.set(key: Int, value: T)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

Iterator<T> SparseArrayCompat<T>.valueIterator()

컬렉션의 값 반복자를 반환합니다.

확장 속성

LongSparseArray:
Int LongSparseArray<T>.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

SparseArrayCompat:
Int SparseArrayCompat<T>.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

최상위 함수

ArrayMap<K, V> arrayMapOf()

비어있는 새 ArrayMap을 반환합니다.

ArrayMap<K, V> arrayMapOf(vararg pairs: Pair<K, V>)

첫 번째 구성요소가 키이고 두 번째 구성요소가 값인 키-값 쌍 목록으로 지정된 특정 콘텐츠가 있는 새 ArrayMap을 반환합니다.

ArraySet<T> arraySetOf()

비어있는 새 ArraySet을 반환합니다.

ArraySet<T> arraySetOf(vararg values: T)

지정된 콘텐츠가 있는 새 ArraySet을 반환합니다.

LruCache<K, V> lruCache(maxSize: Int, crossinline sizeOf: (key: K, value: V) -> Int = { _, _ -> 1 }, crossinline create: (key: K) -> V? = { null as V? }, crossinline onEntryRemoved: (evicted: Boolean, key: K, oldValue: V, newValue: V?) -> Unit = { _, _, _, _ -> })

지정된 매개변수를 사용하여 LruCache를 생성합니다.

androidx.core.animation

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.animation.Animator:
AnimatorListener Animator.addListener(crossinline onEnd: (animator: Animator) -> Unit = {}, crossinline onStart: (animator: Animator) -> Unit = {}, crossinline onCancel: (animator: Animator) -> Unit = {}, crossinline onRepeat: (animator: Animator) -> Unit = {})

제공된 작업을 사용하여 이 Animator에 리스너를 추가합니다.

AnimatorPauseListener Animator.addPauseListener(crossinline onResume: (animator: Animator) -> Unit = {}, crossinline onPause: (animator: Animator) -> Unit = {})

제공된 작업을 사용하여 이 Animator에 일시중지 및 다시 시작 리스너를 추가합니다.

AnimatorListener Animator.doOnCancel(crossinline action: (animator: Animator) -> Unit)

애니메이션이 취소되었을 때 호출될 작업을 추가합니다.

AnimatorListener Animator.doOnEnd(crossinline action: (animator: Animator) -> Unit)

애니메이션이 종료되었을 때 호출될 작업을 추가합니다.

AnimatorPauseListener Animator.doOnPause(crossinline action: (animator: Animator) -> Unit)

애니메이션이 일시중지되었을 때 호출될 작업을 추가합니다.

AnimatorListener Animator.doOnRepeat(crossinline action: (animator: Animator) -> Unit)

애니메이션이 반복되었을 때 호출될 작업을 추가합니다.

AnimatorPauseListener Animator.doOnResume(crossinline action: (animator: Animator) -> Unit)

애니메이션이 일시중지 후 다시 시작되었을 때 호출될 작업을 추가합니다.

AnimatorListener Animator.doOnStart(crossinline action: (animator: Animator) -> Unit)

애니메이션이 시작되었을 때 호출될 작업을 추가합니다.

androidx.core.content

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.content.Context:
T? Context.getSystemService()

클래스별 시스템 수준 서비스에 핸들을 반환합니다.

Unit Context.withStyledAttributes(set: AttributeSet? = null, attrs: IntArray, @AttrRes defStyleAttr: Int = 0, @StyleRes defStyleRes: Int = 0, block: TypedArray.() -> Unit)

TypedArray 수신기에서 블록을 실행합니다.

Unit Context.withStyledAttributes(@StyleRes resourceId: Int, attrs: IntArray, block: TypedArray.() -> Unit)

TypedArray 수신기에서 블록을 실행합니다.

android.content.SharedPreferences:
Unit SharedPreferences.edit(commit: Boolean = false, action: Editor.() -> Unit)

호출을 통해 이 환경설정 인스턴스를 수정하여 변경사항을 적용 또는 커밋할 수 있도록 합니다.

최상위 함수

ContentValues contentValuesOf(vararg pairs: Pair<String, Any?>)

지정된 키-값 쌍을 요소로 사용하여 새 ContentValues를 반환합니다.

androidx.core.content.res

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.content.res.TypedArray:
Boolean TypedArray.getBooleanOrThrow(@StyleableRes index: Int)

index에서 속성의 불리언 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getColorOrThrow(@StyleableRes index: Int)

index에서 속성의 색상 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

ColorStateList TypedArray.getColorStateListOrThrow(@StyleableRes index: Int)

index에서 속성의 색상 상태 목록 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Float TypedArray.getDimensionOrThrow(@StyleableRes index: Int)

index에서 속성의 차원 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getDimensionPixelOffsetOrThrow(@StyleableRes index: Int)

index에서 속성의 차원 픽셀 오프셋 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getDimensionPixelSizeOrThrow(@StyleableRes index: Int)

index에서 속성의 차원 픽셀 크기 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Drawable TypedArray.getDrawableOrThrow(@StyleableRes index: Int)

index에서 속성의 드로어블 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Float TypedArray.getFloatOrThrow(@StyleableRes index: Int)

index에서 속성의 부동 소수점 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Typeface TypedArray.getFontOrThrow(@StyleableRes index: Int)

index에서 속성의 글꼴 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getIntOrThrow(@StyleableRes index: Int)

index에서 속성의 정수 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getIntegerOrThrow(@StyleableRes index: Int)

index에서 속성의 정수 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Int TypedArray.getResourceIdOrThrow(@StyleableRes index: Int)

index에서 속성의 리소스 식별자를 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

String TypedArray.getStringOrThrow(@StyleableRes index: Int)

index에서 속성의 문자열 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

Array<CharSequence> TypedArray.getTextArrayOrThrow(@StyleableRes index: Int)

index에서 속성의 텍스트 배열 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

CharSequence TypedArray.getTextOrThrow(@StyleableRes index: Int)

index에서 속성의 텍스트 값을 가져오며 정의되지 않았다면 IllegalArgumentException이 발생합니다.

R TypedArray.use(block: (TypedArray) -> R)

이 TypedArray에서 지정된 block 함수를 실행한 후 재활용합니다.

androidx.core.database

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.database.Cursor:
ByteArray? Cursor.getBlobOrNull(index: Int)

요청된 열의 값을 null이 허용되는 바이트 배열로 반환합니다.

Double? Cursor.getDoubleOrNull(index: Int)

요청된 열의 값을 null이 허용되는 Double로 반환합니다.

Float? Cursor.getFloatOrNull(index: Int)

요청된 열의 값을 null이 허용되는 부동 소수점으로 반환합니다.

Int? Cursor.getIntOrNull(index: Int)

요청된 열의 값을 null이 허용되는 정수로 반환합니다.

Long? Cursor.getLongOrNull(index: Int)

요청된 열의 값을 null이 허용되는 Long으로 반환합니다.

Short? Cursor.getShortOrNull(index: Int)

요청된 열의 값을 null이 허용되는 Short로 반환합니다.

String? Cursor.getStringOrNull(index: Int)

요청된 열의 값을 null이 허용되는 문자열로 반환합니다.

androidx.core.database.sqlite

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.database.sqlite.SQLiteDatabase:
T SQLiteDatabase.transaction(exclusive: Boolean = true, body: SQLiteDatabase.() -> T)

예외 없이 완료되었다면 성공적인 것으로 표시되는 트랜잭션의 body를 실행합니다.

androidx.core.graphics

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.graphics.Bitmap:
Bitmap Bitmap.applyCanvas(block: Canvas.() -> Unit)

이 비트맵에 그릴 새 캔버스를 만들고 새로 만든 캔버스에서 지정된 블록을 실행합니다.

연산자 Boolean Bitmap.contains(p: Point)

지정된 지점이 비트맵 내에 있으면 true를 반환합니다.

연산자 Boolean Bitmap.contains(p: PointF)

지정된 지점이 비트맵 내에 있으면 true를 반환합니다.

연산자 Int Bitmap.get(x: Int, y: Int)

지정된 위치에 있는 픽셀의 값을 반환합니다.

Bitmap Bitmap.scale(width: Int, height: Int, filter: Boolean = true)

가능하면 이 비트맵에서 크기가 조정된 새 비트맵을 만듭니다.

연산자 Unit Bitmap.set(x: Int, y: Int, color: Int)

지정된 color int를 지정된 (x, y) 좌표의 비트맵(변경 가능하다고 가정)에 씁니다.

android.graphics.Canvas:
Unit Canvas.withClip(clipRect: Rect, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.clipRectCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withClip(clipRect: RectF, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.clipRectCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withClip(left: Int, top: Int, right: Int, bottom: Int, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.clipRectCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withClip(left: Float, top: Float, right: Float, bottom: Float, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.clipRectCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withClip(clipPath: Path, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.clipPathCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withMatrix(matrix: Matrix = Matrix(), block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.concatCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withRotation(degrees: Float = 0.0f, pivotX: Float = 0.0f, pivotY: Float = 0.0f, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.rotateCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withSave(block: Canvas.() -> Unit)

지정된 블록Canvas.saveCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withScale(x: Float = 1.0f, y: Float = 1.0f, pivotX: Float = 0.0f, pivotY: Float = 0.0f, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.scaleCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withSkew(x: Float = 0.0f, y: Float = 0.0f, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.skewCanvas.restoreToCount의 호출로 래핑합니다.

Unit Canvas.withTranslation(x: Float = 0.0f, y: Float = 0.0f, block: Canvas.() -> Unit)

지정된 블록Canvas.save/Canvas.translateCanvas.restoreToCount의 호출로 래핑합니다.

android.graphics.Color:
연산자 Float Color.component1()

색상의 첫 번째 구성요소를 반환합니다.

연산자 Float Color.component2()

색상의 두 번째 구성요소를 반환합니다.

연산자 Float Color.component3()

색상의 세 번째 구성요소를 반환합니다.

연산자 Float Color.component4()

색상의 네 번째 구성요소를 반환합니다.

infix Color! Color.convertTo(colorSpace: Named)

색상 수신기를 지정된 색상 공간의 색상으로 변환합니다.

infix Color! Color.convertTo(colorSpace: ColorSpace)

색상 수신기를 지정된 색상 공간의 색상으로 변환합니다.

연산자 Color Color.plus(c: Color)

2개의 반투명한 색상을 합성합니다.

android.graphics.ImageDecoder.Source:
Bitmap Source.decodeBitmap(crossinline action: ImageDecoder.(info: ImageInfo, source: Source) -> Unit)

소스에서 비트맵을 만듭니다.

Drawable Source.decodeDrawable(crossinline action: ImageDecoder.(info: ImageInfo, source: Source) -> Unit)

소스에서 드로어블을 만듭니다.

android.graphics.Matrix:
연산자 Matrix Matrix.times(m: Matrix)

Matrix에 다른 행렬을 곱하고 결과를 새 행렬로 반환합니다.

FloatArray Matrix.values()

Matrix의 값 9개를 새로운 부동 소수점 배열로 반환합니다.

android.graphics.Paint:
Boolean Paint.setBlendMode(blendModeCompat: BlendModeCompat?)

이전 버전과 호환되는 방식으로 Paint의 BlendMode를 구성하는 편의 메서드입니다.

android.graphics.Path:
infix Path Path.and(p: Path)

두 경로의 교집합을 새 Path로 반환합니다.

Iterable<PathSegment> Path.flatten(error: Float = 0.5f)

일련의 선 세그먼트를 사용하여 Path를 평면화(또는 근사치로 계산)합니다.

연산자 Path Path.minus(p: Path)

두 경로의 차이를 새 Path로 반환합니다.

infix Path Path.or(p: Path)

두 경로의 합집합을 새 Path로 반환합니다.

연산자 Path Path.plus(p: Path)

두 경로의 합집합을 새 Path로 반환합니다.

infix Path Path.xor(p: Path)

두 경로의 합집합에서 교집합을 뺀 값을 새 Path로 반환합니다.

android.graphics.Picture:
Picture Picture.record(width: Int, height: Int, block: Canvas.() -> Unit)

Picture의 명령어를 기록할 새 Canvas를 만들고 새로 만든 캔버스에서 지정된 블록을 실행하여 이 Picture를 반환합니다.

android.graphics.Point:
연산자 Int Point.component1()

이 지점의 x 좌표를 반환합니다.

연산자 Int Point.component2()

이 지점의 y 좌표를 반환합니다.

연산자 Point Point.minus(p: Point)

지정된 지점의 부정으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 Point Point.minus(xy: Int)

X 축과 Y 축에서 모두 지정된 양의 부정으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 Point Point.plus(p: Point)

지정된 지점으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 Point Point.plus(xy: Int)

X 축과 Y 축에서 모두 지정된 양으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

PointF Point.toPointF()

이 지점의 PointF 표현을 반환합니다.

연산자 Point Point.unaryMinus()

이 지점의 부정을 나타내는 새 지점을 반환합니다.

android.graphics.PointF:
연산자 Float PointF.component1()

이 지점의 x 좌표를 반환합니다.

연산자 Float PointF.component2()

이 지점의 y 좌표를 반환합니다.

연산자 PointF PointF.minus(p: PointF)

지정된 지점의 부정으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 PointF PointF.minus(xy: Float)

X 축과 Y 축에서 모두 지정된 양의 부정으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 PointF PointF.plus(p: PointF)

지정된 지점으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

연산자 PointF PointF.plus(xy: Float)

X 축과 Y 축에서 모두 지정된 양으로 이 지점을 오프셋하고 결과를 새 지점으로 반환합니다.

Point PointF.toPoint()

이 지점의 Point 표현을 반환합니다.

연산자 PointF PointF.unaryMinus()

이 지점의 부정을 나타내는 새 지점을 반환합니다.

android.graphics.PorterDuff.Mode:
PorterDuffColorFilter Mode.toColorFilter(color: Int)

PorterDuff.Mode를 알파 합성 또는 블렌딩 모드로 사용하는 새 PorterDuffColorFilter 및 지정된 색상을 생성합니다.

PorterDuffXfermode Mode.toXfermode()

PorterDuff.Mode를 알파 합성 또는 블렌딩 모드로 사용하는 새 PorterDuffXfermode를 생성합니다.

android.graphics.Rect:
infix Rect Rect.and(r: Rect)

두 직사각형의 교집합을 새 직사각형으로 반환합니다.

연산자 Int Rect.component1()

직사각형의 첫 번째 구성요소인 'left'를 반환합니다.

연산자 Int Rect.component2()

직사각형의 두 번째 구성요소인 'top'을 반환합니다.

연산자 Int Rect.component3()

직사각형의 세 번째 구성요소인 'right'를 반환합니다.

연산자 Int Rect.component4()

직사각형의 네 번째 구성요소인 'bottom'을 반환합니다.

연산자 Boolean Rect.contains(p: Point)

지정된 지점이 직사각형 내에 있으면 true를 반환합니다.

연산자 Region Rect.minus(r: Rect)

이 직사각형과 지정된 직사각형의 차이를 새 지역으로 반환합니다.

연산자 Rect Rect.minus(xy: Int)

X 축과 Y 축에서 모두 지정된 양의 부정으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 Rect Rect.minus(xy: Point)

지정된 지점의 부정으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

infix Rect Rect.or(r: Rect)

두 직사각형의 합집합을 새 직사각형으로 반환합니다.

연산자 Rect Rect.plus(r: Rect)

이 직사각형과 지정된 직사각형의 합집합을 실행하고 결과를 새 직사각형으로 반환합니다.

연산자 Rect Rect.plus(xy: Int)

X 축과 Y 축에서 모두 지정된 양으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 Rect Rect.plus(xy: Point)

지정된 지점으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 Rect Rect.times(factor: Int)

factor에 의해 각각 조정된 이 직사각형의 구성요소를 나타내는 새 직사각형을 반환합니다.

RectF Rect.toRectF()

이 직사각형의 RectF 표현을 반환합니다.

지역 Rect.toRegion()

이 직사각형의 Region 표현을 반환합니다.

infix Region Rect.xor(r: Rect)

두 직사각형의 합집합에서 교집합을 뺀 값을 새 지역으로 반환합니다.

android.graphics.RectF:
infix RectF RectF.and(r: RectF)

두 직사각형의 교집합을 새 직사각형으로 반환합니다.

연산자 Float RectF.component1()

직사각형의 첫 번째 구성요소인 'left'를 반환합니다.

연산자 Float RectF.component2()

직사각형의 두 번째 구성요소인 'top'을 반환합니다.

연산자 Float RectF.component3()

직사각형의 세 번째 구성요소인 'right'를 반환합니다.

연산자 Float RectF.component4()

직사각형의 네 번째 구성요소인 'bottom'을 반환합니다.

연산자 Boolean RectF.contains(p: PointF)

지정된 지점이 직사각형 내에 있으면 true를 반환합니다.

연산자 Region RectF.minus(r: RectF)

이 직사각형과 지정된 직사각형의 차이를 새 지역으로 반환합니다.

연산자 RectF RectF.minus(xy: Float)

X 축과 Y 축에서 모두 지정된 양의 부정으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 RectF RectF.minus(xy: PointF)

지정된 지점의 부정으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

infix RectF RectF.or(r: RectF)

두 직사각형의 합집합을 새 직사각형으로 반환합니다.

연산자 RectF RectF.plus(r: RectF)

이 직사각형과 지정된 직사각형의 합집합을 실행하고 결과를 새 직사각형으로 반환합니다.

연산자 RectF RectF.plus(xy: Float)

X 축과 Y 축에서 모두 지정된 양으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 RectF RectF.plus(xy: PointF)

지정된 지점으로 이 직사각형 오프셋을 나타내는 새 직사각형을 반환합니다.

연산자 RectF RectF.times(factor: Int)

factor에 의해 각각 조정된 이 직사각형의 구성요소를 나타내는 새 직사각형을 반환합니다.

연산자 RectF RectF.times(factor: Float)

factor에 의해 각각 조정된 이 직사각형의 구성요소를 나타내는 새 직사각형을 반환합니다.

Rect RectF.toRect()

이 직사각형의 Rect 표현을 반환합니다.

지역 RectF.toRegion()

이 직사각형의 Region 표현을 반환합니다.

RectF RectF.transform(m: Matrix)

제공된 Matrix를 사용하여 준비되어 있는 이 직사각형을 변환하고 이 직사각형을 반환합니다.

infix Region RectF.xor(r: RectF)

두 직사각형의 합집합에서 교집합을 뺀 값을 새 지역으로 반환합니다.

android.graphics.Region:
infix Region Region.and(r: Rect)

이 지역과 지정된 Rect의 교집합을 새 지역으로 반환합니다.

infix Region Region.and(r: Region)

이 지역과 지정된 지역의 교집합을 새 지역으로 반환합니다.

연산자 Boolean Region.contains(p: Point)

지역에 지정된 Point가 포함되어 있다면 true를 반환합니다.

Unit Region.forEach(action: (rect: Rect) -> Unit)

이 지역의 각 Rect에서 지정된 작업을 실행합니다.

연산자 Iterator<Rect> Region.iterator()

이 지역의 직사각형 반복자를 반환합니다.

연산자 Region Region.minus(r: Rect)

이 지역과 지정된 Rect의 차이를 새 지역으로 반환합니다.

연산자 Region Region.minus(r: Region)

이 지역과 지정된 지역의 차이를 새 지역으로 반환합니다.

연산자 Region Region.not()

이 지역의 부정을 새 지역으로 반환합니다.

infix Region Region.or(r: Rect)

이 지역과 지정된 Rect의 합집합을 새 지역으로 반환합니다.

infix Region Region.or(r: Region)

이 지역과 지정된 지역의 합집합을 새 지역으로 반환합니다.

연산자 Region Region.plus(r: Rect)

이 지역과 지정된 Rect의 합집합을 새 지역으로 반환합니다.

연산자 Region Region.plus(r: Region)

이 지역과 지정된 지역의 합집합을 새 지역으로 반환합니다.

연산자 Region Region.unaryMinus()

이 지역의 부정을 새 지역으로 반환합니다.

infix Region Region.xor(r: Rect)

이 지역과 지정된 Rect의 합집합에서 교집합을 뺀 값을 새 지역으로 반환합니다.

infix Region Region.xor(r: Region)

이 지역과 지정된 지역의 합집합에서 교집합을 뺀 값을 새 지역으로 반환합니다.

android.graphics.Shader:
Unit Shader.transform(block: Matrix.() -> Unit)

지정된 블록Shader.getLocalMatrixShader.setLocalMatrix의 호출로 래핑합니다.

kotlin.Int:
연산자 Int Int.component1()

color int의 알파 구성요소를 반환합니다.

연산자 Int Int.component2()

color int의 빨간색 구성요소를 반환합니다.

연산자 Int Int.component3()

color int의 녹색 구성요소를 반환합니다.

연산자 Int Int.component4()

color int의 파란색 구성요소를 반환합니다.

infix Long Int.convertTo(colorSpace: Named)

color int 수신기를 지정된 색상 공간의 color long으로 변환합니다.

infix Long Int.convertTo(colorSpace: ColorSpace)

color int 수신기를 지정된 색상 공간의 color long으로 변환합니다.

Color Int.toColor()

color int에서 새 Color 인스턴스를 생성합니다.

Long Int.toColorLong()

지정된 ARGB color intsRGB 색상 공간의 RGBA color long으로 변환합니다.

kotlin.Long:
연산자 Float Long.component1()

색상의 첫 번째 구성요소를 반환합니다.

연산자 Float Long.component2()

색상의 두 번째 구성요소를 반환합니다.

연산자 Float Long.component3()

색상의 세 번째 구성요소를 반환합니다.

연산자 Float Long.component4()

색상의 네 번째 구성요소를 반환합니다.

infix Long Long.convertTo(colorSpace: Named)

color long 수신기를 지정된 색상 공간의 color long으로 변환합니다.

infix Long Long.convertTo(colorSpace: ColorSpace)

color long 수신기를 지정된 색상 공간의 color long으로 변환합니다.

Color Long.toColor()

color long에서 새 Color 인스턴스를 생성합니다.

Int Long.toColorInt()

지정된 color long을 ARGB color int로 변환합니다.

kotlin.String:
Int String.toColorInt()

String의 상응하는 color Int를 반환합니다.

확장 속성

kotlin.Int:
Int Int.alpha()

color int의 알파 구성요소를 반환합니다.

Int Int.blue()

color int의 파란색 구성요소를 반환합니다.

Int Int.green()

color int의 녹색 구성요소를 반환합니다.

Float Int.luminance()

sRGB 인코딩을 가정하여 color int의 상대 휘도를 반환합니다.

Int Int.red()

color int의 빨간색 구성요소를 반환합니다.

kotlin.Long:
Float Long.alpha()

color long의 알파 구성요소를 반환합니다.

Float Long.blue()

color long의 파란색 구성요소를 반환합니다.

ColorSpace Long.colorSpace()

지정된 color long으로 인코딩된 색상 공간을 반환합니다.

Float Long.green()

color long의 녹색 구성요소를 반환합니다.

Boolean Long.isSrgb()

색상이 sRGB 색상 공간에 있는지 나타냅니다.

Boolean Long.isWideGamut()

색상이 wide-gamut 색상 공간에 있는지 여부를 나타냅니다.

Float Long.luminance()

색상의 상대 휘도를 반환합니다.

Float Long.red()

color long의 빨간색 구성요소를 반환합니다.

최상위 함수

Bitmap createBitmap(width: Int, height: Int, config: Config = Bitmap.Config.ARGB_8888)

지정된 너비높이로 변경 가능한 비트맵을 반환합니다.

Bitmap createBitmap(width: Int, height: Int, config: Config = Bitmap.Config.ARGB_8888, hasAlpha: Boolean = true, colorSpace: ColorSpace = ColorSpace.get(ColorSpace.Named.SRGB))

지정된 너비높이로 변경 가능한 비트맵을 반환합니다.

Matrix rotationMatrix(degrees: Float, px: Float = 0.0f, py: Float = 0.0f)

좌표(px, py)에 있는 피벗 지점을 중심으로 한 회전 각도(도)로 정의된 회전 행렬을 만듭니다.

Matrix scaleMatrix(sx: Float = 1.0f, sy: Float = 1.0f)

xy 축에 각각 배율 인수 sxsy를 사용하여 크기 조정 행렬을 만듭니다.

Matrix translationMatrix(tx: Float = 0.0f, ty: Float = 0.0f)

xy 축에 각각 평행이동량 txty를 사용하여 평행이동 행렬을 만듭니다.

androidx.core.graphics.drawable

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.graphics.Bitmap:
Icon Bitmap.toAdaptiveIcon()

이 적응형 Bitmap에서 Icon을 생성합니다.

BitmapDrawable Bitmap.toDrawable(resources: Resources)

Bitmap에서 BitmapDrawable을 생성합니다.

Icon Bitmap.toIcon()

Bitmap에서 Icon을 생성합니다.

android.graphics.Color:
ColorDrawable Color.toDrawable()

Color에서 ColorDrawable을 생성합니다(Color.toArgb를 통해).

android.graphics.drawable.Drawable:
Bitmap Drawable.toBitmap(@Px width: Int = intrinsicWidth, @Px height: Int = intrinsicHeight, config: Config? = null)

DrawableBitmap 표현을 반환합니다.

Unit Drawable.updateBounds(@Px left: Int = bounds.left, @Px top: Int = bounds.top, @Px right: Int = bounds.right, @Px bottom: Int = bounds.bottom)

이 드로어블의 경계를 업데이트합니다.

android.net.Uri:
Icon Uri.toIcon()

Uri에서 Icon을 생성합니다.

kotlin.ByteArray:
Icon ByteArray.toIcon()

ByteArray에서 Icon을 생성합니다.

kotlin.Int:
ColorDrawable Int.toDrawable()

이 색상 값에서 ColorDrawable을 생성합니다.

androidx.core.location

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.location.Location:
연산자 Double Location.component1()

Location의 위도를 반환합니다.

연산자 Double Location.component2()

Location의 경도를 반환합니다.

androidx.core.net

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.net.Uri:
File Uri.toFile()

지정된 Uri에서 File을 생성합니다.

java.io.File:
Uri File.toUri()

지정된 파일에서 Uri를 생성합니다.

kotlin.String:
Uri String.toUri()

지정된 인코딩된 URI 문자열에서 Uri를 생성합니다.

androidx.core.os

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.os.Handler:
Runnable Handler.postAtTime(uptimeMillis: Long, token: Any? = null, crossinline action: () -> Unit)

매개변수를 재정렬하는 Handler.postAtTime 버전으로, 괄호 외부에 작업을 배치할 수 있게 합니다.

Runnable Handler.postDelayed(delayInMillis: Long, token: Any? = null, crossinline action: () -> Unit)

매개변수를 재정렬하는 Handler.postDelayed 버전으로, 괄호 외부에 작업을 배치할 수 있게 합니다.

최상위 함수

Bundle bundleOf(vararg pairs: Pair<String, Any?>)

지정된 키-값 쌍을 요소로 사용하여 새 Bundle을 반환합니다.

PersistableBundle persistableBundleOf(vararg pairs: Pair<String, Any?>)

지정된 키-값 쌍을 요소로 사용하여 새 PersistableBundle을 반환합니다.

T trace(sectionName: String, block: () -> T)

지정된 블록Trace.beginSection(제공된 sectionName과 함께) 및 Trace.endSection의 호출로 래핑합니다.

androidx.core.text

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.text.Spannable:
Unit Spannable.clearSpans()

이 텍스트에서 모든 스팬을 삭제합니다.

연산자 Unit Spannable.set(start: Int, end: Int, span: Any)

텍스트의 범위 start&hellip;end스팬을 추가합니다.

연산자 Unit Spannable.set(range: IntRange, span: Any)

텍스트의 범위스팬을 추가합니다.

android.text.SpannableStringBuilder:
SpannableStringBuilder SpannableStringBuilder.backgroundColor(color: Int, builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 BackgroundColorSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.bold(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 굵게 StyleSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.color(color: Int, builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 ForegroundColorSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.inSpans(vararg spans: Any, builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 spans로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.inSpans(span: Any, builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 span으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.italic(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 기울임꼴 StyleSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.scale(proportion: Float, builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 RelativeSizeSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.strikeThrough(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 StrikethroughSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.subscript(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 SubscriptSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.superscript(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 SuperscriptSpan으로 래핑합니다.

SpannableStringBuilder SpannableStringBuilder.underline(builderAction: SpannableStringBuilder.() -> Unit)

builderAction의 추가된 텍스트를 UnderlineSpan으로 래핑합니다.

android.text.Spanned:
Array<out T> Spanned.getSpans(start: Int = 0, end: Int = length)

T의 인스턴스인 스팬을 모두 가져옵니다.

String Spanned.toHtml(option: Int = TO_HTML_PARAGRAPH_LINES_CONSECUTIVE)

Spanned의 스팬에서 HTML 문자열을 반환합니다.

kotlin.CharSequence:
Boolean CharSequence.isDigitsOnly()

지정된 CharSequence에 숫자만 포함되어 있는지 여부를 반환합니다.

Spannable CharSequence.toSpannable()

CharSequence의 새 Spannable을 반환하거나 이미 SpannableString의 인스턴스라면 소스 자체를 반환합니다.

Spanned CharSequence.toSpanned()

CharSequence의 새 Spanned를 반환하거나 이미 SpannedString의 인스턴스라면 소스 자체를 반환합니다.

Int CharSequence.trimmedLength()

공백 및 ASCII 제어 문자가 String.trim에 의해 시작 및 끝에서 잘렸다면 지정된 CharSequence의 길이를 반환합니다.

kotlin.String:
String String.htmlEncode()

문자열을 HTML로 인코딩합니다.

Spanned String.parseAsHtml(flags: Int = FROM_HTML_MODE_LEGACY, imageGetter: ImageGetter? = null, tagHandler: TagHandler? = null)

이 문자열을 HTML로 파싱하여 Spanned를 반환합니다.

확장 속성

java.util.Locale:
Int Locale.layoutDirection()

지정된 언어의 레이아웃 방향을 반환합니다.

최상위 함수

SpannedString buildSpannedString(builderAction: SpannableStringBuilder.() -> Unit)

제공된 builderAction을 사용하여 새로 생성된 SpannableStringBuilder를 채운 다음 SpannedString으로 변환하여 새 문자열을 빌드합니다.

androidx.core.transition

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.transition.Transition:
TransitionListener Transition.addListener(crossinline onEnd: (transition: Transition) -> Unit = {}, crossinline onStart: (transition: Transition) -> Unit = {}, crossinline onCancel: (transition: Transition) -> Unit = {}, crossinline onResume: (transition: Transition) -> Unit = {}, crossinline onPause: (transition: Transition) -> Unit = {})

제공된 작업을 사용하여 이 Transition에 리스너를 추가합니다.

TransitionListener Transition.doOnCancel(crossinline action: (transition: Transition) -> Unit)

이 전환이 취소되었을 때 호출될 작업을 추가합니다.

TransitionListener Transition.doOnEnd(crossinline action: (transition: Transition) -> Unit)

이 전환이 종료되었을 때 호출될 작업을 추가합니다.

TransitionListener Transition.doOnPause(crossinline action: (transition: Transition) -> Unit)

이 전환이 일시중지되었을 때 호출될 작업을 추가합니다.

TransitionListener Transition.doOnResume(crossinline action: (transition: Transition) -> Unit)

이 전환이 일시중지 후 다시 시작되었을 때 호출될 작업을 추가합니다.

TransitionListener Transition.doOnStart(crossinline action: (transition: Transition) -> Unit)

이 전환이 시작되었을 때 호출될 작업을 추가합니다.

androidx.core.util

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.util.AtomicFile:
ByteArray AtomicFile.readBytes()

이 파일의 콘텐츠 전체를 바이트 배열로 가져옵니다.

String AtomicFile.readText(charset: Charset = Charsets.UTF_8)

UTF-8 또는 지정된 문자 집합을 사용하여 이 파일의 콘텐츠 전체를 문자열로 가져옵니다.

Unit AtomicFile.tryWrite(block: (out: FileOutputStream) -> Unit)

이 파일의 블록 내에서 쓰기 작업을 실행합니다.

Unit AtomicFile.writeBytes(array: ByteArray)

이 파일의 콘텐츠를 바이트 배열로 설정합니다.

Unit AtomicFile.writeText(text: String, charset: Charset = Charsets.UTF_8)

이 파일의 콘텐츠를 UTF-8 또는 지정된 문자 집합을 사용하여 인코딩된 텍스트로 설정합니다.

android.util.LongSparseArray:
연산자 Boolean LongSparseArray<T>.contains(key: Long)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean LongSparseArray<T>.containsKey(key: Long)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean LongSparseArray<T>.containsValue(value: T)

컬렉션에 이 포함되어 있다면 true를 반환합니다.

Unit LongSparseArray<T>.forEach(action: (key: Long, value: T) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

T LongSparseArray<T>.getOrDefault(key: Long, defaultValue: T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

T LongSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean LongSparseArray<T>.isEmpty()

컬렉션에 요소가 없으면 true를 반환합니다.

Boolean LongSparseArray<T>.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

LongIterator LongSparseArray<T>.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 LongSparseArray<T> LongSparseArray<T>.plus(other: LongSparseArray<T>)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Unit LongSparseArray<T>.putAll(other: LongSparseArray<T>)

other의 항목을 추가하거나 교체하여 이 컬렉션을 업데이트합니다.

Boolean LongSparseArray<T>.remove(key: Long, value: T)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit LongSparseArray<T>.set(key: Long, value: T)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

Iterator<T> LongSparseArray<T>.valueIterator()

컬렉션의 값 반복자를 반환합니다.

android.util.Pair:
연산자 F Pair<F, S>.component1()

쌍의 첫 번째 구성요소를 반환합니다.

연산자 S Pair<F, S>.component2()

쌍의 두 번째 구성요소를 반환합니다.

Pair<F, S> Pair<F, S>.toKotlinPair()

Pairkotlin.Pair로 반환합니다.

android.util.Range:
infix Range<T> Range<T>.and(other: Range<T>)

이 범위와 other의 교집합을 반환합니다.

연산자 Range<T> Range<T>.plus(value: T)

이 범위와 을 포함하는 최소 범위를 반환합니다.

연산자 Range<T> Range<T>.plus(other: Range<T>)

이 범위와 other를 포함하는 최소 범위를 반환합니다.

ClosedRange<T> Range<T>.toClosedRange()

RangeClosedRange로 반환합니다.

android.util.Size:
연산자 Int Size.component1()

Size의 첫 번째 구성요소인 '너비'를 반환합니다.

연산자 Int Size.component2()

Size의 두 번째 구성요소인 '높이'를 반환합니다.

android.util.SizeF:
연산자 Float SizeF.component1()

SizeF의 첫 번째 구성요소인 '너비'를 반환합니다.

연산자 Float SizeF.component2()

SizeF의 두 번째 구성요소인 '높이'를 반환합니다.

android.util.SparseArray:
연산자 Boolean SparseArray<T>.contains(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseArray<T>.containsKey(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseArray<T>.containsValue(value: T)

컬렉션에 이 포함되어 있다면 true를 반환합니다.

Unit SparseArray<T>.forEach(action: (key: Int, value: T) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

T SparseArray<T>.getOrDefault(key: Int, defaultValue: T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

T SparseArray<T>.getOrElse(key: Int, defaultValue: () -> T)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean SparseArray<T>.isEmpty()

컬렉션에 요소가 없으면 true를 반환합니다.

Boolean SparseArray<T>.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

IntIterator SparseArray<T>.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 SparseArray<T> SparseArray<T>.plus(other: SparseArray<T>)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Unit SparseArray<T>.putAll(other: SparseArray<T>)

other의 항목을 추가하거나 교체하여 이 컬렉션을 업데이트합니다.

Boolean SparseArray<T>.remove(key: Int, value: T)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit SparseArray<T>.set(key: Int, value: T)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

Iterator<T> SparseArray<T>.valueIterator()

컬렉션의 값 반복자를 반환합니다.

android.util.SparseBooleanArray:
연산자 Boolean SparseBooleanArray.contains(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseBooleanArray.containsKey(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseBooleanArray.containsValue(value: Boolean)

컬렉션에 이 포함되어 있다면 true를 반환합니다.

Unit SparseBooleanArray.forEach(action: (key: Int, value: Boolean) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

Boolean SparseBooleanArray.getOrDefault(key: Int, defaultValue: Boolean)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

Boolean SparseBooleanArray.getOrElse(key: Int, defaultValue: () -> Boolean)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean SparseBooleanArray.isEmpty()

컬렉션에 요소가 없으면 true를 반환합니다.

Boolean SparseBooleanArray.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

IntIterator SparseBooleanArray.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 SparseBooleanArray SparseBooleanArray.plus(other: SparseBooleanArray)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Unit SparseBooleanArray.putAll(other: SparseBooleanArray)

other의 항목을 추가하거나 교체하여 이 컬렉션을 업데이트합니다.

Boolean SparseBooleanArray.remove(key: Int, value: Boolean)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit SparseBooleanArray.set(key: Int, value: Boolean)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

BooleanIterator SparseBooleanArray.valueIterator()

컬렉션의 값 반복자를 반환합니다.

android.util.SparseIntArray:
연산자 Boolean SparseIntArray.contains(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseIntArray.containsKey(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseIntArray.containsValue(value: Int)

컬렉션에 이 포함되어 있다면 true를 반환합니다.

Unit SparseIntArray.forEach(action: (key: Int, value: Int) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

Int SparseIntArray.getOrDefault(key: Int, defaultValue: Int)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

Int SparseIntArray.getOrElse(key: Int, defaultValue: () -> Int)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean SparseIntArray.isEmpty()

컬렉션에 요소가 없으면 true를 반환합니다.

Boolean SparseIntArray.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

IntIterator SparseIntArray.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 SparseIntArray SparseIntArray.plus(other: SparseIntArray)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Unit SparseIntArray.putAll(other: SparseIntArray)

other의 항목을 추가하거나 교체하여 이 컬렉션을 업데이트합니다.

Boolean SparseIntArray.remove(key: Int, value: Int)

에 매핑되었을 때만 의 항목을 삭제합니다.

연산자 Unit SparseIntArray.set(key: Int, value: Int)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

IntIterator SparseIntArray.valueIterator()

컬렉션의 값 반복자를 반환합니다.

android.util.SparseLongArray:
연산자 Boolean SparseLongArray.contains(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseLongArray.containsKey(key: Int)

컬렉션에 가 포함되어 있다면 true를 반환합니다.

Boolean SparseLongArray.containsValue(value: Long)

컬렉션에 이 포함되어 있다면 true를 반환합니다.

Unit SparseLongArray.forEach(action: (key: Int, value: Long) -> Unit)

각 키-값 항목에 지정된 작업을 실행합니다.

Long SparseLongArray.getOrDefault(key: Int, defaultValue: Long)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue를 반환합니다.

Long SparseLongArray.getOrElse(key: Int, defaultValue: () -> Long)

에 상응하는 값을 반환하며, 키가 없다면 defaultValue에서 값을 반환합니다.

Boolean SparseLongArray.isEmpty()

컬렉션에 요소가 없으면 true를 반환합니다.

Boolean SparseLongArray.isNotEmpty()

컬렉션에 요소가 포함되어 있으면 true를 반환합니다.

IntIterator SparseLongArray.keyIterator()

컬렉션의 키 반복자를 반환합니다.

연산자 SparseLongArray SparseLongArray.plus(other: SparseLongArray)

other의 항목을 추가하거나 교체하여 새 컬렉션을 생성합니다.

Unit SparseLongArray.putAll(other: SparseLongArray)

other의 항목을 추가하거나 교체하여 이 컬렉션을 업데이트합니다.

Boolean SparseLongArray.remove(key: Int, value: Long)

으로 설정되었을 때만 의 항목을 삭제합니다.

연산자 Unit SparseLongArray.set(key: Int, value: Long)

컬렉션에 값을 저장하는 데 index 연산자를 사용할 수 있도록 합니다.

LongIterator SparseLongArray.valueIterator()

컬렉션의 값 반복자를 반환합니다.

kotlin.Double:
Half Double.toHalf()

지정된 Double을 나타내는 Half 인스턴스를 반환합니다.

kotlin.Float:
Half Float.toHalf()

지정된 Float를 나타내는 Half 인스턴스를 반환합니다.

kotlin.Pair:
Pair<F, S> Pair<F, S>.toAndroidPair()

kotlin.Pair를 Android Pair로 반환합니다.

kotlin.Short:
Half Short.toHalf()

지정된 Short을 나타내는 Half 인스턴스를 반환합니다.

kotlin.String:
Half String.toHalf()

지정된 String을 나타내는 Half 인스턴스를 반환합니다.

kotlin.ranges.ClosedRange:
Range<T> ClosedRange<T>.toRange()

ClosedRangeRange로 반환합니다.

확장 속성

android.util.LongSparseArray:
Int LongSparseArray<T>.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

android.util.SparseArray:
Int SparseArray<T>.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

android.util.SparseBooleanArray:
Int SparseBooleanArray.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

android.util.SparseIntArray:
Int SparseIntArray.size()

컬렉션에 있는 키-값 쌍의 수를 반환합니다.

android.util.SparseLongArray:
Int SparseLongArray.size()

컬렉션에 있는 키-값 항목의 수를 반환합니다.

최상위 함수

LruCache<K, V> lruCache(maxSize: Int, crossinline sizeOf: (key: K, value: V) -> Int = { _, _ -> 1 }, crossinline create: (key: K) -> V? = { null as V? }, crossinline onEntryRemoved: (evicted: Boolean, key: K, oldValue: V, newValue: V?) -> Unit = { _, _, _, _ -> })

지정된 매개변수를 사용하여 LruCache를 생성합니다.

infix Range<T> T.rangeTo(that: T)

Comparable 값에서 that에 범위를 생성합니다.

androidx.core.view

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.view.Menu:
연산자 Boolean Menu.contains(item: MenuItem)

항목이 이 메뉴에 있다면 true를 반환합니다.

Unit Menu.forEach(action: (item: MenuItem) -> Unit)

이 메뉴의 각 항목에 지정된 작업을 실행합니다.

Unit Menu.forEachIndexed(action: (index: Int, item: MenuItem) -> Unit)

이 메뉴의 각 항목에 지정된 작업을 실행하고 순차 색인을 제공합니다.

연산자 MenuItem Menu.get(index: Int)

색인의 메뉴를 반환합니다.

Boolean Menu.isEmpty()

이 메뉴에 항목이 없다면 true를 반환합니다.

Boolean Menu.isNotEmpty()

이 메뉴에 항목이 1개 이상 포함되어 있다면 true를 반환합니다.

연산자 MutableIterator<MenuItem> Menu.iterator()

이 메뉴에 있는 항목의 MutableIterator를 반환합니다.

연산자 Unit Menu.minusAssign(item: MenuItem)

이 메뉴에서 항목을 삭제합니다.

android.view.View:
Unit View.doOnAttach(crossinline action: (view: View) -> Unit)

이 뷰가 창에 연결될 때 지정된 작업을 실행합니다.

Unit View.doOnDetach(crossinline action: (view: View) -> Unit)

이 뷰가 창에서 분리될 때 지정된 작업을 실행합니다.

Unit View.doOnLayout(crossinline action: (view: View) -> Unit)

이 뷰가 배치될 때 지정된 작업을 실행합니다.

Unit View.doOnNextLayout(crossinline action: (view: View) -> Unit)

이 뷰가 다음에 배치될 때 지정된 작업을 실행합니다.

OneShotPreDrawListener View.doOnPreDraw(crossinline action: (view: View) -> Unit)

뷰 트리가 그려지려고 할 때 지정된 작업을 실행합니다.

Bitmap View.drawToBitmap(config: Config = Bitmap.Config.ARGB_8888)

ViewBitmap 표현을 반환합니다.

Runnable View.postDelayed(delayInMillis: Long, crossinline action: () -> Unit)

매개변수를 재정렬하는 View.postDelayed 버전으로, 괄호 외부에 작업을 배치할 수 있게 합니다.

Runnable View.postOnAnimationDelayed(delayInMillis: Long, crossinline action: () -> Unit)

매개변수를 재정렬하는 View.postOnAnimationDelayed 버전으로, 괄호 외부에 작업을 배치할 수 있게 합니다.

Unit View.setPadding(@Px size: Int)

뷰의 패딩을 설정합니다.

Unit View.updateLayoutParams(block: LayoutParams.() -> Unit)

뷰의 layoutParams로 블록을 실행하고 업데이트된 버전으로 layoutParams를 다시 할당합니다.

Unit View.updateLayoutParams(block: T.() -> Unit)

유형이 있는 버전의 뷰 layoutParams로 블록을 실행하고 업데이트된 버전으로 layoutParams를 다시 할당합니다.

Unit View.updatePadding(@Px left: Int = paddingLeft, @Px top: Int = paddingTop, @Px right: Int = paddingRight, @Px bottom: Int = paddingBottom)

이 뷰의 패딩을 업데이트합니다.

Unit View.updatePaddingRelative(@Px start: Int = paddingStart, @Px top: Int = paddingTop, @Px end: Int = paddingEnd, @Px bottom: Int = paddingBottom)

이 뷰의 상대 패딩을 업데이트합니다.

android.view.ViewGroup:
연산자 Boolean ViewGroup.contains(view: View)

가 이 뷰 그룹에 있다면 true를 반환합니다.

Unit ViewGroup.forEach(action: (view: View) -> Unit)

이 뷰 그룹의 각 뷰에서 지정된 작업을 실행합니다.

Unit ViewGroup.forEachIndexed(action: (index: Int, view: View) -> Unit)

이 뷰 그룹의 각 뷰에서 지정된 작업을 실행하고 순차 색인을 제공합니다.

연산자 View ViewGroup.get(index: Int)

색인의 뷰를 반환합니다.

Boolean ViewGroup.isEmpty()

이 뷰 그룹에 뷰가 없다면 true를 반환합니다.

Boolean ViewGroup.isNotEmpty()

이 뷰 그룹에 뷰가 1개 이상 포함되어 있다면 true를 반환합니다.

연산자 MutableIterator<View> ViewGroup.iterator()

이 뷰 그룹에 있는 뷰의 MutableIterator를 반환합니다.

연산자 Unit ViewGroup.minusAssign(view: View)

이 뷰 그룹에서 를 삭제합니다.

연산자 Unit ViewGroup.plusAssign(view: View)

이 뷰 그룹에 를 추가합니다.

android.view.ViewGroup.MarginLayoutParams:
Unit MarginLayoutParams.setMargins(@Px size: Int)

ViewGroup의 MarginLayoutParams에서 여백을 설정합니다.

Unit MarginLayoutParams.updateMargins(@Px left: Int = leftMargin, @Px top: Int = topMargin, @Px right: Int = rightMargin, @Px bottom: Int = bottomMargin)

ViewGroupViewGroup.MarginLayoutParams에서 여백을 업데이트합니다.

Unit MarginLayoutParams.updateMarginsRelative(@Px start: Int = marginStart, @Px top: Int = topMargin, @Px end: Int = marginEnd, @Px bottom: Int = bottomMargin)

ViewGroup의 MarginLayoutParams에서 상대 여백을 업데이트합니다.

확장 속성

android.view.Menu:
Sequence<MenuItem> Menu.children()

이 메뉴에 있는 항목의 Sequence를 반환합니다.

Int Menu.size()

이 메뉴에 있는 항목 수를 반환합니다.

android.view.View:
Boolean View.isGone()

이 뷰의 공개 상태가 View.GONE이면 true를 반환하고 그렇지 않으면 false를 반환합니다.

Boolean View.isInvisible()

이 뷰의 공개 상태가 View.INVISIBLE이면 true를 반환하고 그렇지 않으면 false를 반환합니다.

Boolean View.isVisible()

이 뷰의 공개 상태가 View.VISIBLE이면 true를 반환하고 그렇지 않으면 false를 반환합니다.

Int View.marginBottom()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 하단 여백을 반환하고 그렇지 않으면 0을 반환합니다.

Int View.marginEnd()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 끝 여백을 반환하고 그렇지 않으면 0을 반환합니다.

Int View.marginLeft()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 왼쪽 여백을 반환하고 그렇지 않으면 0을 반환합니다.

Int View.marginRight()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 오른쪽 여백을 반환하고 그렇지 않으면 0을 반환합니다.

Int View.marginStart()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 시작 여백을 반환하고 그렇지 않으면 0을 반환합니다.

Int View.marginTop()

이 뷰의 LayoutParamsViewGroup.MarginLayoutParams이면 상단 여백을 반환하고 그렇지 않으면 0을 반환합니다.

android.view.ViewGroup:
Sequence<View> ViewGroup.children()

이 뷰 그룹에 있는 하위 뷰의 Sequence를 반환합니다.

Int ViewGroup.size()

이 뷰 그룹에 있는 뷰의 수를 반환합니다.

androidx.core.widget

종속 항목

Groovy

dependencies {
    implementation "androidx.core:core-ktx:1.13.1"
}

Kotlin

dependencies {
    implementation("androidx.core:core-ktx:1.13.1")
}

확장 함수

android.widget.TextView:
TextWatcher TextView.addTextChangedListener(crossinline beforeTextChanged: (text: CharSequence?, start: Int, count: Int, after: Int) -> Unit = { _, _, _, _ -> }, crossinline onTextChanged: (text: CharSequence?, start: Int, count: Int, after: Int) -> Unit = { _, _, _, _ -> }, crossinline afterTextChanged: (text: Editable?) -> Unit = {})

제공된 작업을 사용하여 이 TextView에 텍스트 변경 리스너를 추가합니다.

TextWatcher TextView.doAfterTextChanged(crossinline action: (text: Editable?) -> Unit)

텍스트가 변경된 이후 호출될 작업을 추가합니다.

TextWatcher TextView.doBeforeTextChanged(crossinline action: (text: CharSequence?, start: Int, count: Int, after: Int) -> Unit)

텍스트가 변경되기 전에 호출될 작업을 추가합니다.

TextWatcher TextView.doOnTextChanged(crossinline action: (text: CharSequence?, start: Int, count: Int, after: Int) -> Unit)

텍스트가 변경될 때 호출될 작업을 추가합니다.

androidx.dynamicanimation.animation

종속 항목

Groovy

dependencies {
    implementation "androidx.dynamicanimation:dynamicanimation-ktx:1.1.0-alpha03"
}

Kotlin

dependencies {
    implementation("androidx.dynamicanimation:dynamicanimation-ktx:1.1.0-alpha03")
}

확장 함수

SpringAnimation:
SpringAnimation SpringAnimation.withSpringForceProperties(func: SpringForce.() -> Unit)

SpringAnimation의 SpringForce.mDampingRatio, SpringForce.mFinalPosition 및 강성과 같은 스프링력 속성을 업데이트하거나 적용합니다.

최상위 함수

FlingAnimation flingAnimationOf(setter: (Float) -> Unit, getter: () -> Float)

제공된 setter 및 getter를 통해 액세스할 수 있는 속성의 FlingAnimation을 생성합니다.

SpringAnimation springAnimationOf(setter: (Float) -> Unit, getter: () -> Float, finalPosition: Float = Float.NaN)

제공된 setter 및 getter를 통해 액세스할 수 있는 속성의 SpringAnimation을 생성합니다.

androidx.fragment.app

종속 항목

Groovy

dependencies {
    implementation "androidx.fragment:fragment-ktx:1.7.0"
}

Kotlin

dependencies {
    implementation("androidx.fragment:fragment-ktx:1.7.0")
}

확장 함수

android.view.View:
F View.findFragment()

View와 연결된 Fragment를 찾습니다.

Fragment:
Lazy<VM> Fragment.activityViewModels(noinline factoryProducer: () -> ViewModelProvider.Factory = null)

속성 위임을 반환하여 상위 활동의 ViewModel에 액세스하며 factoryProducer가 지정되면 반환된 ViewModelProvider.Factory가 사용되어 처음으로 ViewModel을 생성합니다.

Lazy<VM> Fragment.createViewModelLazy(viewModelClass: KClass<VM>, storeProducer: () -> ViewModelStore, factoryProducer: () -> ViewModelProvider.Factory = null)

ViewModelLazy 생성을 위한 도우미 메서드로, factoryProducer로 전달된 null을 공장 기본값으로 결정합니다.

Lazy<VM> Fragment.viewModels(noinline ownerProducer: () -> ViewModelStoreOwner = { this }, noinline factoryProducer: () -> ViewModelProvider.Factory = null)

속성 위임을 반환하여 기본적으로Fragment로 범위가 지정된 ViewModel에 액세스합니다.

FragmentTransaction:
FragmentTransaction FragmentTransaction.add(@IdRes containerViewId: Int, tag: String? = null, args: Bundle? = null)

연결된 FragmentManager에 프래그먼트를 추가하고 프래그먼트의 뷰를 containerViewId에 의해 지정된 컨테이너 뷰로 확장하여 나중에 FragmentManager.findFragmentById를 통해 검색합니다.

FragmentTransaction FragmentTransaction.add(tag: String, args: Bundle? = null)

어떤 컨테이너 뷰에도 프래그먼트를 추가하지 않고 관련 FragmentManager에 프래그먼트를 추가합니다.

FragmentTransaction FragmentTransaction.replace(@IdRes containerViewId: Int, tag: String? = null, args: Bundle? = null)

컨테이너에 추가된 기존 프래그먼트를 교체합니다.

FragmentManager:
Unit FragmentManager.commit(allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit)

예외 없이 완료되었다면 자동으로 커밋되는 FragmentTransactionbody를 실행합니다.

Unit FragmentManager.commitNow(allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit)

예외 없이 완료되었다면 자동으로 커밋되는 FragmentTransactionbody를 실행합니다.

Unit FragmentManager.transaction(now: Boolean = false, allowStateLoss: Boolean = false, body: FragmentTransaction.() -> Unit)

예외 없이 완료되었다면 자동으로 커밋되는 FragmentTransactionbody를 실행합니다.

androidx.fragment.app.testing

종속 항목

Groovy

dependencies {
    implementation "androidx.fragment:fragment-testing:1.7.0"
}

Kotlin

dependencies {
    implementation("androidx.fragment:fragment-testing:1.7.0")
}

최상위 함수

FragmentScenario<F!> launchFragment(fragmentArgs: Bundle? = null, @StyleRes themeResId: Int = R.style.FragmentScenarioEmptyFragmentActivityTheme, factory: FragmentFactory? = null)

지정된 FragmentFactory를 사용하여 빈 FragmentActivity에 의해 호스팅되는 지정된 인수로 프래그먼트를 실행하고 다시 시작된 상태에 도달할 때까지 기다립니다.

FragmentScenario<F!> launchFragment(fragmentArgs: Bundle? = null, @StyleRes themeResId: Int = R.style.FragmentScenarioEmptyFragmentActivityTheme, crossinline instantiate: () -> F)

instantiate를 사용해 프래그먼트를 생성하여 빈 FragmentActivity에 의해 호스팅되는 지정된 인수로 프래그먼트를 실행하고 다시 시작된 상태에 도달할 때까지 기다립니다.

FragmentScenario<F!> launchFragmentInContainer(fragmentArgs: Bundle? = null, @StyleRes themeResId: Int = R.style.FragmentScenarioEmptyFragmentActivityTheme, factory: FragmentFactory? = null)

FragmentActivity에 의해 호스팅되는 지정된 인수로 활동의 루트 뷰 컨테이너 android.R.id.content의 프래그먼트를 실행하고 다시 시작된 상태에 도달할 때까지 기다립니다.

FragmentScenario<F!> launchFragmentInContainer(fragmentArgs: Bundle? = null, @StyleRes themeResId: Int = R.style.FragmentScenarioEmptyFragmentActivityTheme, crossinline instantiate: () -> F)

instantiate를 사용해 프래그먼트를 생성하여 빈 FragmentActivity에 의해 호스팅되는 지정된 인수로 활동의 루트 뷰 컨테이너 android.R.id.content의 프래그먼트를 실행하고 다시 시작된 상태에 도달할 때까지 기다립니다.

androidx.lifecycle

종속 항목

Groovy

dependencies {
    implementation "androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.7.0"
    implementation "androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.7.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0"
}

Kotlin

dependencies {
    implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:2.7.0")
    implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")
    implementation("androidx.lifecycle:lifecycle-reactivestreams-ktx:2.7.0")
    implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
    implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
}

확장 함수

kotlinx.coroutines.flow.Flow:
LiveData<T> Flow<T>.asLiveData(context: CoroutineContext = EmptyCoroutineContext, timeoutInMs: Long = DEFAULT_TIMEOUT)

원래 Flow에서 수집된 값이 있는 LiveData를 생성합니다.

LiveData<T> Flow<T>.asLiveData(context: CoroutineContext = EmptyCoroutineContext, timeout: Duration)

원래 Flow에서 수집된 값이 있는 LiveData를 생성합니다.

org.reactivestreams.Publisher:
LiveData<T> Publisher<T>.toLiveData()

ReactiveStreams Publisher에서 식별 가능한 LiveData 스트림을 생성합니다.

LiveData:
Flow<T> LiveData<T>.asFlow()

시작 LiveData에 의해 전달된 값을 포함하는 Flow를 생성합니다. 시작 시 흐름 수집기는 LiveData가 보유한 최신 값을 수신한 후 LiveData 업데이트를 관찰합니다.

LiveData<X> LiveData<X>.distinctUntilChanged()

소스 this LiveData 값이 변경될 때까지 값을 내보내지 않는 새로운 LiveData 객체를 생성합니다.

LiveData<Y> LiveData<X>.map(crossinline transform: (X) -> Y)

this LiveData에 설정된 각 값에 변환을 적용하여 this LiveData에서 매핑된 LiveData를 반환합니다.

Observer<T> LiveData<T>.observe(owner: LifecycleOwner, crossinline onChanged: (T) -> Unit)

지정된 소유자의 수명 내에 지정된 onChanged 람다를 관찰자로 추가하고 관찰자 참조를 반환합니다.

LiveData<Y> LiveData<X>.switchMap(crossinline transform: (X) -> LiveData<Y>)

this에 설정된 각 값에 변환을 적용하여 입력 this LiveData에서 매핑된 LiveData를 반환합니다.

Publisher<T> LiveData<T>.toPublisher(lifecycle: LifecycleOwner)

ReactiveStreams Publisher에 맞춰 지정된 LiveData 스트림을 조정합니다.

ViewModelProvider:
VM ViewModelProvider.get()

기존 ViewModel을 반환하거나 이 ViewModelProvider와 연결된 범위(일반적으로 프래그먼트 또는 활동)에서 새 ViewModel을 생성합니다.

LifecycleOwner:
suspend T LifecycleOwner.whenCreated(block: suspend CoroutineScope.() -> T)

LifecycleOwnerLifecycle이 최소한 Lifecycle.State.CREATED 상태일 때 지정된 블록을 실행합니다.

suspend T LifecycleOwner.whenResumed(block: suspend CoroutineScope.() -> T)

LifecycleOwnerLifecycle이 최소한 Lifecycle.State.RESUMED 상태일 때 지정된 블록을 실행합니다.

suspend T LifecycleOwner.whenStarted(block: suspend CoroutineScope.() -> T)

LifecycleOwnerLifecycle이 최소한 Lifecycle.State.STARTED 상태일 때 지정된 블록을 실행합니다.

Lifecycle:
suspend T Lifecycle.whenCreated(block: suspend CoroutineScope.() -> T)

Lifecycle이 최소한 Lifecycle.State.CREATED 상태일 때 지정된 블록을 실행합니다.

suspend T Lifecycle.whenResumed(block: suspend CoroutineScope.() -> T)

Lifecycle이 최소한 Lifecycle.State.RESUMED 상태일 때 지정된 블록을 실행합니다.

suspend T Lifecycle.whenStarted(block: suspend CoroutineScope.() -> T)

Lifecycle이 최소한 Lifecycle.State.STARTED 상태일 때 지정된 블록을 실행합니다.

suspend T Lifecycle.whenStateAtLeast(minState: Lifecycle.State, block: suspend CoroutineScope.() -> T)

기본 스레드의 블록을 실행하며 Lifecycle의 상태가 최소한 minState가 아닌 한 실행을 정지하는 CoroutineDispatcher에서 지정된 블록을 실행합니다.

확장 속성

Lifecycle:
LifecycleCoroutineScope Lifecycle.coroutineScope()

Lifecycle에 연결된 CoroutineScope입니다.

LifecycleOwner:
LifecycleCoroutineScope LifecycleOwner.lifecycleScope()

LifecycleOwnerLifecycle에 연결된 CoroutineScope입니다.

ViewModel:
CoroutineScope ViewModel.viewModelScope()

ViewModel에 연결된 CoroutineScope입니다.

최상위 함수

LiveData<T> liveData(context: CoroutineContext = EmptyCoroutineContext, timeoutInMs: Long = DEFAULT_TIMEOUT, block: suspend LiveDataScope<T>.() -> Unit)

LiveDataScope에서 실행되는 지정된 블록에서 얻은 값이 있는 LiveData를 빌드합니다.

LiveData<T> liveData(context: CoroutineContext = EmptyCoroutineContext, timeout: Duration, block: suspend LiveDataScope<T>.() -> Unit)

LiveDataScope에서 실행되는 지정된 블록에서 얻은 값이 있는 LiveData를 빌드합니다.

androidx.navigation

종속 항목

Groovy

dependencies {
    implementation "androidx.navigation:navigation-runtime-ktx:2.7.7"
    implementation "androidx.navigation:navigation-fragment-ktx:2.7.7"
    implementation "androidx.navigation:navigation-ui-ktx:2.7.7"
}

Kotlin

dependencies {
    implementation("androidx.navigation:navigation-runtime-ktx:2.7.7")
    implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
    implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
}

확장 함수

android.app.Activity:
NavController Activity.findNavController(@IdRes viewId: Int)

뷰의 ID 및 이 뷰에 포함된 Activity가 지정된 NavController를 찾습니다.

NavArgsLazy<Args> Activity.navArgs()

Lazy 위임을 반환하여 활동의 엑스트라에 Args 인스턴스로 액세스합니다.

android.view.View:
NavController View.findNavController()

View와 연결된 NavController를 찾습니다.

NavGraphBuilder:
Unit NavGraphBuilder.activity(@IdRes id: Int, builder: ActivityNavigatorDestinationBuilder.() -> Unit)

ActivityNavigator.Destination을 구성합니다.

Unit NavGraphBuilder.navigation(@IdRes id: Int, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

중첩된 NavGraph를 구성합니다.

NavGraph:
연산자 Boolean NavGraph.contains(@IdRes id: Int)

id가 있는 대상이 이 탐색 그래프에 있다면 true를 반환합니다.

연산자 NavDestination NavGraph.get(@IdRes id: Int)

id가 있는 대상을 반환합니다.

연산자 Unit NavGraph.minusAssign(node: NavDestination)

이 탐색 그래프에서 node를 삭제합니다.

연산자 Unit NavGraph.plusAssign(node: NavDestination)

이 NavGraph에 대상을 추가합니다.

연산자 Unit NavGraph.plusAssign(other: NavGraph)

다른 컬렉션의 모든 대상을 이 컬렉션에 추가합니다.

NavController:
NavGraph NavController.createGraph(@IdRes id: Int = 0, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

NavGraph를 구성합니다.

NavHost:
NavGraph NavHost.createGraph(@IdRes id: Int = 0, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

NavGraph를 구성합니다.

NavigatorProvider:
연산자 T NavigatorProvider.get(name: String)

등록된 Navigator를 이름으로 검색합니다.

연산자 T NavigatorProvider.get(clazz: KClass<T>)

Navigator.Name annotation에서 제공하는 이름을 사용하여 등록된 Navigator를 검색합니다.

NavGraph NavigatorProvider.navigation(@IdRes id: Int = 0, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

NavGraph를 구성합니다.

연산자 Unit NavigatorProvider.plusAssign(navigator: Navigator<out NavDestination>)

Navigator.Name annotation에서 제공하는 이름을 사용하여 Navigator를 등록합니다.

연산자 Navigator<out NavDestination!>? NavigatorProvider.set(name: String, navigator: Navigator<out NavDestination>)

Navigator를 이름으로 등록합니다.

Fragment:
Lazy<VM> Fragment.navGraphViewModels(@IdRes navGraphId: Int, noinline factoryProducer: () -> ViewModelProvider.Factory = null)

속성 위임을 반환하여 {@link NavController} 백 스택에 있는 탐색 그래프로 범위가 지정된 ViewModel에 액세스합니다.

최상위 함수

ActivityNavigator.Extras ActivityNavigatorExtras(activityOptions: ActivityOptionsCompat? = null, flags: Int = 0)

특정 ActivityOptionsCompat 인스턴스 또는 Intent.FLAG_ACTIVITY_ 플래그를 사용하여 새 ActivityNavigator.Extras 인스턴스를 생성합니다.

NavOptions navOptions(optionsBuilder: NavOptionsBuilder.() -> Unit)

NavOptions를 구성합니다.

androidx.navigation.fragment

종속 항목

Groovy

dependencies {
    implementation "androidx.navigation:navigation-fragment-ktx:2.7.7"
}

Kotlin

dependencies {
    implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
}

확장 함수

NavGraphBuilder:
Unit NavGraphBuilder.dialog(@IdRes id: Int)

DialogFragmentNavigator.Destination을 구성합니다.

Unit NavGraphBuilder.dialog(@IdRes id: Int, builder: DialogFragmentNavigatorDestinationBuilder.() -> Unit)

DialogFragmentNavigator.Destination을 구성합니다.

Unit NavGraphBuilder.fragment(@IdRes id: Int)

FragmentNavigator.Destination을 구성합니다.

Unit NavGraphBuilder.fragment(@IdRes id: Int, builder: FragmentNavigatorDestinationBuilder.() -> Unit)

FragmentNavigator.Destination을 구성합니다.

Fragment:
NavController Fragment.findNavController()

Fragment가 지정된 NavController를 찾습니다.

NavArgsLazy<Args> Fragment.navArgs()

Lazy 위임을 반환하여 프래그먼트의 인수에 Args 인스턴스로 액세스합니다.

최상위 함수

FragmentNavigator.Extras FragmentNavigatorExtras(vararg sharedElements: Pair<View, String>)

지정된 공유 요소를 사용하여 새 FragmentNavigator.Extras 인스턴스를 생성합니다.

androidx.navigation.ui

종속 항목

Groovy

dependencies {
    implementation "androidx.navigation:navigation-ui-ktx:2.7.7"
}

Kotlin

dependencies {
    implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
}

확장 함수

android.view.MenuItem:
Boolean MenuItem.onNavDestinationSelected(navController: NavController)

MenuItem과 연결된 NavDestination을 탐색하려고 시도합니다.

androidx.appcompat.app.AppCompatActivity:
Unit AppCompatActivity.setupActionBarWithNavController(navController: NavController, drawerLayout: DrawerLayout?)

NavController와 함께 사용하기 위해 AppCompatActivity.getSupportActionBar에서 반환한 ActionBar를 설정합니다.

Unit AppCompatActivity.setupActionBarWithNavController(navController: NavController, configuration: AppBarConfiguration = AppBarConfiguration(navController.graph))

NavController와 함께 사용하기 위해 AppCompatActivity.getSupportActionBar에서 반환한 ActionBar를 설정합니다.

androidx.appcompat.widget.Toolbar:
Unit Toolbar.setupWithNavController(navController: NavController, drawerLayout: DrawerLayout?)

NavController와 함께 사용할 Toolbar를 설정합니다.

Unit Toolbar.setupWithNavController(navController: NavController, configuration: AppBarConfiguration = AppBarConfiguration(navController.graph))

NavController와 함께 사용할 Toolbar를 설정합니다.

com.google.android.material.appbar.CollapsingToolbarLayout:
Unit CollapsingToolbarLayout.setupWithNavController(toolbar: Toolbar, navController: NavController, drawerLayout: DrawerLayout?)

NavController와 함께 사용할 CollapsingToolbarLayoutToolbar를 설정합니다.

Unit CollapsingToolbarLayout.setupWithNavController(toolbar: Toolbar, navController: NavController, configuration: AppBarConfiguration = AppBarConfiguration(navController.graph))

NavController와 함께 사용할 CollapsingToolbarLayoutToolbar를 설정합니다.

com.google.android.material.bottomnavigation.BottomNavigationView:
Unit BottomNavigationView.setupWithNavController(navController: NavController)

NavController와 함께 사용할 BottomNavigationView를 설정합니다.

com.google.android.material.navigation.NavigationView:
Unit NavigationView.setupWithNavController(navController: NavController)

NavController와 함께 사용할 NavigationView를 설정합니다.

NavController:
Boolean NavController.navigateUp(drawerLayout: DrawerLayout?)

지정된 NavController에 동작을 위임하여 위로 버튼을 처리합니다.

Boolean NavController.navigateUp(appBarConfiguration: AppBarConfiguration)

지정된 NavController에 동작을 위임하여 위로 버튼을 처리합니다.

최상위 함수

AppBarConfiguration AppBarConfiguration(navGraph: NavGraph, drawerLayout: DrawerLayout? = null, noinline fallbackOnNavigateUpListener: () -> Boolean = { false })

android.support.v7.widget.Toolbar, android.support.design.widget.CollapsingToolbarLayoutandroid.support.v7.app.ActionBar와 같은 앱 바 패턴의 구현과 상호작용하는 NavigationUI 메서드의 구성 옵션입니다.

AppBarConfiguration AppBarConfiguration(topLevelMenu: Menu, drawerLayout: DrawerLayout? = null, noinline fallbackOnNavigateUpListener: () -> Boolean = { false })

android.support.v7.widget.Toolbar, android.support.design.widget.CollapsingToolbarLayoutandroid.support.v7.app.ActionBar와 같은 앱 바 패턴의 구현과 상호작용하는 NavigationUI 메서드의 구성 옵션입니다.

AppBarConfiguration AppBarConfiguration(topLevelDestinationIds: Set<Int>, drawerLayout: DrawerLayout? = null, noinline fallbackOnNavigateUpListener: () -> Boolean = { false })

android.support.v7.widget.Toolbar, android.support.design.widget.CollapsingToolbarLayoutandroid.support.v7.app.ActionBar와 같은 앱 바 패턴의 구현과 상호작용하는 NavigationUI 메서드의 구성 옵션입니다.

androidx.paging

종속 항목

Groovy

dependencies {
    implementation "androidx.paging:paging-common-ktx:2.1.2"
    implementation "androidx.paging:paging-runtime-ktx:2.1.2"
    implementation "androidx.paging:paging-rxjava2-ktx:2.1.2"
}

Kotlin

dependencies {
    implementation("androidx.paging:paging-common-ktx:2.1.2")
    implementation("androidx.paging:paging-runtime-ktx:2.1.2")
    implementation("androidx.paging:paging-rxjava2-ktx:2.1.2")
}

확장 함수

Factory:
Flowable<PagedList<Value>> DataSource.Factory<Key, Value>.toFlowable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

DataSource.Factory에서 RxPagedListBuilder의 편의성인 Flowable<PagedList>를 구성합니다.

Flowable<PagedList<Value>> DataSource.Factory<Key, Value>.toFlowable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null, backpressureStrategy: BackpressureStrategy = BackpressureStrategy.LATEST)

DataSource.Factory에서 RxPagedListBuilder의 편의성인 Flowable<PagedList>를 구성합니다.

LiveData<PagedList<Value>> DataSource.Factory<Key, Value>.toLiveData(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor())

DataSource.Factory에서 LivePagedListBuilder의 편의성인 LiveData<PagedList>를 구성합니다.

LiveData<PagedList<Value>> DataSource.Factory<Key, Value>.toLiveData(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchExecutor: Executor = ArchTaskExecutor.getIOThreadExecutor())

DataSource.Factory에서 LivePagedListBuilder의 편의성인 LiveData<PagedList>를 구성합니다.

Observable<PagedList<Value>> DataSource.Factory<Key, Value>.toObservable(config: PagedList.Config, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

DataSource.Factory에서 RxPagedListBuilder의 편의성인 Observable<PagedList>를 구성합니다.

Observable<PagedList<Value>> DataSource.Factory<Key, Value>.toObservable(pageSize: Int, initialLoadKey: Key? = null, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, fetchScheduler: Scheduler? = null, notifyScheduler: Scheduler? = null)

DataSource.Factory에서 RxPagedListBuilder의 편의성인 Observable<PagedList>를 구성합니다.

최상위 함수

PagedList.Config Config(pageSize: Int, prefetchDistance: Int = pageSize, enablePlaceholders: Boolean = true, initialLoadSizeHint: Int = pageSize * PagedList.Config.Builder.DEFAULT_INITIAL_PAGE_MULTIPLIER, maxSize: Int = PagedList.Config.MAX_SIZE_UNBOUNDED)

PagedList.Config.Builder의 편의성인 PagedList.Config를 구성합니다.

PagedList<Value> PagedList(dataSource: DataSource<Key, Value>, config: PagedList.Config, notifyExecutor: Executor, fetchExecutor: Executor, boundaryCallback: PagedList.BoundaryCallback<Value>? = null, initialKey: Key? = null)

PagedList.Builder의 편의성인 PagedList를 구성합니다.

androidx.palette.graphics

종속 항목

Groovy

dependencies {
    implementation "androidx.palette:palette-ktx:1.0.0"
}

Kotlin

dependencies {
    implementation("androidx.palette:palette-ktx:1.0.0")
}

확장 함수

Palette:
연산자 Palette.Swatch? Palette.get(target: Target)

Palette에서 지정된 타겟의 선택된 견본을 반환하거나 찾을 수 없다면 null을 반환합니다.

androidx.preference

종속 항목

Groovy

dependencies {
    implementation "androidx.preference:preference-ktx:1.2.1"
}

Kotlin

dependencies {
    implementation("androidx.preference:preference-ktx:1.2.1")
}

확장 함수

PreferenceGroup:
연산자 Boolean PreferenceGroup.contains(preference: Preference)

preference가 이 환경설정 그룹에 있다면 true를 반환합니다.

Unit PreferenceGroup.forEach(action: (preference: Preference) -> Unit)

이 환경설정 그룹의 각 환경설정에서 지정된 작업을 실행합니다.

Unit PreferenceGroup.forEachIndexed(action: (index: Int, preference: Preference) -> Unit)

이 환경설정 그룹의 각 환경설정에서 지정된 작업을 실행하고 순차 색인을 제공합니다.

연산자 T? PreferenceGroup.get(key: CharSequence)

key가 있는 환경설정을 반환하거나 key가 있는 환경설정을 찾을 수 없다면 null을 반환합니다.

연산자 Preference PreferenceGroup.get(index: Int)

index의 환경설정을 반환합니다.

Boolean PreferenceGroup.isEmpty()

이 환경설정 그룹에 환경설정이 없다면 true를 반환합니다.

Boolean PreferenceGroup.isNotEmpty()

이 환경설정 그룹에 환경설정이 1개 이상 포함되어 있다면 true를 반환합니다.

연산자 MutableIterator<Preference> PreferenceGroup.iterator()

이 환경설정 그룹에 있는 환경설정의 MutableIterator를 반환합니다.

연산자 Unit PreferenceGroup.minusAssign(preference: Preference)

이 환경설정 그룹에서 preference를 삭제합니다.

연산자 Unit PreferenceGroup.plusAssign(preference: Preference)

이 환경설정 그룹에 preference를 추가합니다.

확장 속성

PreferenceGroup:
Sequence<Preference> PreferenceGroup.children()

이 환경설정 그룹에 있는 환경설정의 Sequence를 반환합니다.

Int PreferenceGroup.size()

이 환경설정 그룹에 있는 환경설정의 수를 반환합니다.

androidx.room

종속 항목

Groovy

dependencies {
    implementation "androidx.room:room-ktx:2.6.1"
}

Kotlin

dependencies {
    implementation("androidx.room:room-ktx:2.6.1")
}

확장 함수

RoomDatabase:
suspend R RoomDatabase.withTransaction(block: suspend () -> R)

데이터베이스 트랜잭션에서 지정된 정지 블록을 호출합니다.

androidx.slice.builders

종속 항목

Groovy

dependencies {
    implementation "androidx.slice:slice-builders-ktx:1.0.0-alpha08"
}

Kotlin

dependencies {
    implementation("androidx.slice:slice-builders-ktx:1.0.0-alpha08")
}

확장 함수

GridRowBuilderDsl:
GridRowBuilder GridRowBuilderDsl.cell(buildCell: CellBuilderDsl.() -> Unit)

GridRowBuilder GridRowBuilderDsl.seeMoreCell(buildCell: CellBuilderDsl.() -> Unit)

ListBuilderDsl:
ListBuilder ListBuilderDsl.gridRow(buildGrid: GridRowBuilderDsl.() -> Unit)

ListBuilder ListBuilderDsl.header(buildHeader: HeaderBuilderDsl.() -> Unit)

ListBuilder ListBuilderDsl.inputRange(buildInputRange: InputRangeBuilderDsl.() -> Unit)

ListBuilder ListBuilderDsl.range(buildRange: RangeBuilderDsl.() -> Unit)

ListBuilder ListBuilderDsl.row(buildRow: RowBuilderDsl.() -> Unit)

ListBuilder ListBuilderDsl.seeMoreRow(buildRow: RowBuilderDsl.() -> Unit)

최상위 함수

Slice list(context: Context, uri: Uri, ttl: Long, addRows: ListBuilderDsl.() -> Unit)

Kotlin에서 슬라이스를 빌드하는 데 필요한 상세 정보를 줄입니다.

SliceAction tapSliceAction(pendingIntent: PendingIntent, icon: IconCompat, imageMode: Int = ICON_IMAGE, title: CharSequence)

탭 가능 SliceAction을 빌드하는 팩터리 메서드입니다.

SliceAction toggleSliceAction(pendingIntent: PendingIntent, icon: IconCompat? = null, title: CharSequence, isChecked: Boolean)

전환 가능 SliceAction을 빌드하는 팩터리 메서드입니다.

androidx.sqlite.db

종속 항목

Groovy

dependencies {
    implementation "androidx.sqlite:sqlite-ktx:2.4.0"
}

Kotlin

dependencies {
    implementation("androidx.sqlite:sqlite-ktx:2.4.0")
}

확장 함수

SupportSQLiteDatabase:
T SupportSQLiteDatabase.transaction(exclusive: Boolean = true, body: SupportSQLiteDatabase.() -> T)

예외 없이 완료되었다면 성공적인 것으로 표시되는 트랜잭션의 body를 실행합니다.

androidx.work

종속 항목

확장 함수

com.google.common.util.concurrent.ListenableFuture:
suspend R ListenableFuture<R>.await()

스레드를 차단하지 않고 ListenableFuture의 완료를 기다립니다.

Operation:
suspend Operation.State.SUCCESS! Operation.await()

스레드를 차단하지 않고 Operation을 기다립니다.

Data:
Boolean Data.hasKeyWithValueOfType(key: String)

Data 인스턴스에 예상 유형 T를 가진 지정된 에 상응하는 값이 있다면 true를 반환합니다.

Builder:
OneTimeWorkRequest.Builder OneTimeWorkRequest.Builder.setInputMerger(@NonNull inputMerger: KClass<out InputMerger>)

OneTimeWorkRequest.Builder에서 InputMerger를 설정합니다.

최상위 함수

OneTimeWorkRequest.Builder OneTimeWorkRequestBuilder()

지정된 ListenableWorker를 사용하여 OneTimeWorkRequest를 생성합니다.

PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit)

지정된 ListenableWorker를 사용하여 PeriodicWorkRequest.Builder를 생성합니다.

PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(repeatInterval: Duration)

지정된 ListenableWorker를 사용하여 PeriodicWorkRequest.Builder를 생성합니다.

PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(repeatInterval: Long, repeatIntervalTimeUnit: TimeUnit, flexTimeInterval: Long, flexTimeIntervalUnit: TimeUnit)

지정된 ListenableWorker를 사용하여 PeriodicWorkRequest.Builder를 생성합니다.

PeriodicWorkRequest.Builder PeriodicWorkRequestBuilder(repeatInterval: Duration, flexTimeInterval: Duration)

지정된 ListenableWorker를 사용하여 PeriodicWorkRequest.Builder를 생성합니다.

Data workDataOf(vararg pairs: Pair<String, Any?>)

쌍 목록을 Data 객체로 변환합니다.

androidx.work.testing

종속 항목

Groovy

dependencies {
    implementation "androidx.work:work-testing:2.9.0"
}

Kotlin

dependencies {
    implementation("androidx.work:work-testing:2.9.0")
}

최상위 함수

TestListenableWorkerBuilder<W> TestListenableWorkerBuilder(context: Context, inputData: Data = Data.EMPTY, tags: List<String> = emptyList(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = emptyList(), triggeredContentAuthorities: List<String> = emptyList())

TestListenableWorkerBuilder의 인스턴스를 빌드합니다.

TestWorkerBuilder<W> TestWorkerBuilder(context: Context, executor: Executor, inputData: Data = Data.EMPTY, tags: List<String> = emptyList(), runAttemptCount: Int = 1, triggeredContentUris: List<Uri> = emptyList(), triggeredContentAuthorities: List<String> = emptyList())

TestWorkerBuilder의 인스턴스를 빌드합니다.

com.google.android.play.core.ktx

종속 항목

Groovy

dependencies {
    implementation "com.google.android.play:core-ktx:1.8.1"
}

Kotlin

dependencies {
    implementation("com.google.android.play:core-ktx:1.8.1")
}

확장 함수

com.google.android.play.core.appupdate.AppUpdateManager:
suspend AppUpdateInfo AppUpdateManager.requestAppUpdateInfo()

현재 앱의 업데이트 사용 가능 여부를 요청합니다.

suspend Unit AppUpdateManager.requestCompleteUpdate()

유연한 업데이트 흐름을 위해 업데이트 완료를 트리거합니다.

Flow<AppUpdateResult> AppUpdateManager.requestUpdateFlow()

업데이트 사용 가능 여부 및 진행 상황을 모니터링하기 위한 진입점입니다.

Boolean AppUpdateManager.startUpdateFlowForResult(appUpdateInfo: AppUpdateInfo, appUpdateType: Int, fragment: Fragment, requestCode: Int)

결과를 반환하기 위해 AndroidX Fragment를 허용하는 AppUpdateManager.startUpdateFlowForResult 버전입니다.

com.google.android.play.core.splitinstall.SplitInstallManager:
suspend Unit SplitInstallManager.requestCancelInstall(sessionId: Int)

SplitInstallManager.cancelInstall 버전 정지

suspend Unit SplitInstallManager.requestDeferredInstall(moduleNames: List<String>)

SplitInstallManager.deferredInstall 버전 정지

suspend Unit SplitInstallManager.requestDeferredLanguageInstall(languages: List<Locale>)

SplitInstallManager.deferredLanguageInstall 버전 정지

suspend Unit SplitInstallManager.requestDeferredLanguageUninstall(languages: List<Locale>)

SplitInstallManager.deferredLanguageUninstall 버전 정지

suspend Unit SplitInstallManager.requestDeferredUninstall(moduleNames: List<String>)

SplitInstallManager.deferredUninstall 버전 정지

suspend Int SplitInstallManager.requestInstall(modules: List<String> = listOf(), languages: List<String> = listOf())

요청된 모듈/언어 설치를 시작합니다.

Flow<SplitInstallSessionState> SplitInstallManager.requestProgressFlow()

진행 중인 분할 설치의 모든 진행 상황 이벤트를 전달하는 버퍼링된 Flow를 생성하고 반환합니다.

suspend SplitInstallSessionState SplitInstallManager.requestSessionState(sessionId: Int)

SplitInstallManager.getSessionState 버전 정지

suspend List<SplitInstallSessionState> SplitInstallManager.requestSessionStates()

SplitInstallManager.getSessionStates 버전 정지

Boolean SplitInstallManager.startConfirmationDialogForResult(sessionState: SplitInstallSessionState, fragment: Fragment, requestCode: Int)

결과를 반환하기 위해 AndroidX Fragment를 허용하는 SplitInstallManager.startConfirmationDialogForResult 버전입니다.

확장 속성

com.google.android.play.core.appupdate.AppUpdateInfo:
Int AppUpdateInfo.installStatus()

업데이트 진행 상태를 반환합니다.

Boolean AppUpdateInfo.isFlexibleUpdateAllowed()

유연한 업데이트가 허용되면 true를 반환합니다.

Boolean AppUpdateInfo.isImmediateUpdateAllowed()

즉시 업데이트가 허용되면 true를 반환합니다.

com.google.android.play.core.install.InstallState:
Boolean InstallState.hasTerminalStatus()

종말 상태(더 이상 업데이트가 없음)이며 그에 따라 처리(성공, 취소 또는 실패)되어야 함을 나타냅니다.

Int InstallState.installErrorCode()

설치 오류 코드 또는 {@link InstallErrorCode#NO_ERROR}를 반환합니다.

Int InstallState.installStatus()

설치 상태를 반환합니다.

String! InstallState.packageName()

설치되고 있는 앱의 패키지 이름을 반환합니다.

com.google.android.play.core.splitinstall.SplitInstallSessionState:
Long SplitInstallSessionState.bytesDownloaded()

이 업데이트에서 다운로드한 바이트입니다.

Int SplitInstallSessionState.errorCode()

이 업데이트의 오류 코드입니다.

Boolean SplitInstallSessionState.hasTerminalStatus()

이 업데이트가 마지막임을 나타내며 이 세션의 업데이트가 더 이상 없음을 의미합니다.

List<String> SplitInstallSessionState.languages()

이 업데이트로 포함된 언어입니다.

List<String> SplitInstallSessionState.moduleNames()

이 업데이트로 포함된 모듈입니다.

Int SplitInstallSessionState.sessionId()

이 업데이트의 세션 ID입니다.

Int SplitInstallSessionState.status()

이 업데이트의 상태 코드입니다.

Long SplitInstallSessionState.totalBytesToDownload()

이 업데이트로 다운로드할 총 바이트 수입니다.

최상위 함수

SplitInstallStateUpdatedListener SplitInstallStateUpdatedListener(onRequiresConfirmation: (SplitInstallSessionState) -> Unit, onInstalled: (SplitInstallSessionState) -> Unit, onFailed: (SplitInstallSessionState) -> Unit = {}, onPending: (SplitInstallSessionState) -> Unit = {}, onDownloaded: (SplitInstallSessionState) -> Unit = {}, onDownloading: (SplitInstallSessionState) -> Unit = {}, onInstalling: (SplitInstallSessionState) -> Unit = {}, onCanceling: (SplitInstallSessionState) -> Unit = {}, onCanceled: (SplitInstallSessionState) -> Unit = {}, onNonTerminalStatus: (SplitInstallSessionState) -> Unit = {}, onTerminalStatus: (SplitInstallSessionState) -> Unit = {})

SplitInstallStateUpdatedListener를 생성하기 위한 편의 함수입니다.