mukeshsolanki / android-otpview-pinview

A custom view to enter otp of different sizes used usually in cases of authentication.
MIT License
699 stars 207 forks source link

How to run it using gradle.kts #158

Closed Nanech closed 10 months ago

Nanech commented 10 months ago

Issue topic

How to run this using gradle.kts

Steps to play

Create a project with grade.kts

Nanech commented 10 months ago

All right I`ve fixed it.

For gradle kts its looks like that:

build.gradle.kts(:app)

implementation("com.github.mukeshsolanki.android-otpview-pinview:otpview:3.1.0")

settings.gradle.kts (Project settings)

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { setUrl("https://jitpack.io") }
    }
}

Don`t forget

In the XML file where these lines are located:

  app:OtpHideLineWhenFilled="true"
            app:OtpItemCount="6"
            app:OtpItemSpacing="6dp"
            app:OtpLineColor="@color/otp_item_state"
            app:OtpState_filled="true"
            app:OtpViewType="line"

Use Alt+Enter for "create namespace declaration"