android-ktx icon indicating copy to clipboard operation
android-ktx copied to clipboard

A set of Kotlin extensions for Android app development.

Results 87 android-ktx issues
Sort by recently updated
recently updated
newest added

Calculating dimensions, such as, SP and DP require the `DisplayMetrics`, so you can't do something too simple without - say - adding Extensions inside of `Activity` and such directly. But...

Closes https://github.com/android/android-ktx/issues/296 @JakeWharton @NightlyNexus

Sorry for opening a PR straight away, but it was so simple I just wrote it. This is a method I add to every one of my Kotlin projects. The...

```kotlin val Context.defaultSharedPreferences get() = PreferenceManager.getDefaultSharedPreferences(this) ```

Closes #382 Decided to go for the same approach for multi-callback listener as it was done for `Animator` listener extensions. Not sure that this is the best option, looking forward...

Kotlin stdlib uses lambdas to build different types of complex objects: [buildString](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/build-string.html) [buildSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines.experimental/build-sequence.html) [List builder](https://github.com/JetBrains/kotlin/blob/1.2.20/libraries/stdlib/src/kotlin/collections/Collections.kt#L152) I propose to add intent builder to ktx. That will work like: ```kotlin buildIntent {...

Request: abstract with a properties delegate how to get and update the data stored in the `SharedPreferences` It's not merely about "reducing boilerplate" but also more importantly about decoupling the...

I'd like to propose an extension to get a camera by direction. the implementation would be something like that : ``` enum class FACING(val direction: Int) { FRONT_CAMERA(CameraCharacteristics.LENS_FACING_FRONT), REAR_CAMERA(CameraCharacteristics.LENS_FACING_BACK) }...

Resolves #554 **Signature** ```kotlin inline fun Context.scheduleJob( jobId: Int, buildSequence: JobInfo.Builder.() -> Unit ): Int ``` **Before** ```kotlin val serviceComponent = ComponentName(this, MyService::class.java) val builder = JobInfo.Builder(jobId++, serviceComponent) if (wiFiConnectivityRadioButton.isChecked)...