Skip to content

kevintorch/Kandroid-ktx

Repository files navigation

Kandroid Kotlin Extensions

Common view-based Kotlin extensions to used in Android projects.

Latest Version 👉

Installation

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    implementation "com.github.kevintorch:Kandroid-ktx:$latest_version"
}

Usage

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)


        // animation
        someView.animate {
            isVisible = true
        }

        // individual padding with "dp" extension (returns px as Int in view-based system)
        someView.padding(top = 16.dp)
        someView.padding(vertical = 24.dp)

        //

    }
}

About

Common view-based Kotlin extensions used on android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages