HaloPinView


A library for entering pins through wiggle animator based on circle shapes


License Platform API Profile


Sample Gif

Installation

dependencies {
  implementation 'com.github.halilozcan:HaloPinView:1.0'
}

XML

<com.halilozcan.halopinlib.HaloPinView
        android:id="@+id/pin_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:activePinColor="@color/design_default_color_secondary_variant"
        app:activePinRadius="8dp"
        app:animationDuration="1000"
        app:correctPin="1967"
        app:inActivePinColor="@color/design_default_color_primary_variant"
        app:inActivePinRadius="4dp"
        app:isAnimationActive="true"
        app:pinCount="4" />

Listen pin entering

pin_view.setOnPinFilledListener {
  // Do whatever you want
}

Enter pin (You can listen input changes)

pin_view.enterPin("1")

Delete pin

pin_view.deletePin()

Programatically Adding

val pinView = HaloPinView(context)
val pinConfig = PinConfig.Builder()
                  .inActivePinRadius(10f)
                  .activePinRadius(20f)
                  .animationDuration(1000L)
                  .animationActivationState(true)
                  .pinCount(4)
                  .inActivePinColor(Color.DKGRAY)
                  .activePinColor(Color.WHITE)
                  .correctPin("1967")
                  .build()
                  
pinView.setPinConfig(pinConfig)

Find this repository useful? ❤️

follow me for my next creations! 🤩

License

Designed and developed by 2020 halilozcan (Halil ÖZCAN)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.