Convenience views and functions for Android written in Kotlin
- Add the JitPack repository to your project's build.gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
- Add a dependency to android-kotlin-kit
dependencies {
implementation 'com.github.marcbaldwin:android-kotlin-kit:1.0.0'
}
val dpInPixels = 16.dpToPixels(context)
val spInPixels = 20.spToPixels(context)
A ViewPager
that allows you to disable swiping between pages
<xyb.marcb.android.view.CustomViewPager
android:id="@+id/my_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Your view pages here -->
</xyb.marcb.android.view.CustomViewPager>
// Prevent swiping between pages
my_view_pager.isUserInteractionEnabled = false // false by default
- Marc Baldwin @marcbaldwin