GithubHelp home page GithubHelp logo

yogeshpaliyal / speld Goto Github PK

View Code? Open in Web Editor NEW
36.0 2.0 6.0 299 KB

PIN View or OTP View for Jetpack compose

License: Apache License 2.0

Kotlin 100.00%
android jetpack-compose compose-android kotlin pin-view otp-view hacktoberfest

speld's Introduction

SPELD

buildStatus latestVersion Twitter: yogeshpaliyal

Android Compose OTP/PIN View

Implementation

implementation 'com.yogeshpaliyal:speld:1.0.1'

Default / Solid Pin View

val text = remember { mutableStateOf("") }
PinInput(value = text.value, obscureText = null) {
    text.value = it
}

Bordered Pin View

val text = remember { mutableStateOf("") }
PinInput(
    cellModifier = Modifier.border(
        BorderStroke(2.dp, Color.Red),
        shape = RoundedCornerShape(3.dp)
    ), value = text.value,
    obscureText = "*",
    length = 6,
    disableKeypad = false // Optional
) {
    text.value = it
}

✍️ Author

👤 Yogesh Choudhary Paliyal

Feel free to ping me 😉

🤝 Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Open an issue first to discuss what you would like to change.
  2. Fork the Project
  3. Create your feature branch (git checkout -b feature/amazing-feature)
  4. Commit your changes (git commit -m 'Add some amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a pull request

Please make sure to update tests as appropriate.

❤ Show your support

Give a ⭐️ if this project helped you!

Patron Link Buy Me A Coffee Donation

☑️ TODO

  • Solid PIN View
  • Bordered PIN View

📝 License

Copyright © 2023 - Yogesh Choudhary Paliyal

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.

This README was generated by readgen

speld's People

Contributors

bharathkmalviya avatar imshub10 avatar xali-shx avatar yogeshpaliyal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

speld's Issues

Crash after updating compose libraries

Device - one plus 10r
Android - 13

const val composeUi = "1.4.3"
const val composeFoundation = "1.4.3"
const val composeCompiler = "1.4.7"

`FATAL EXCEPTION: main
                                                                                                Process: com.zealsoftsol.medico.dev, PID: 6936
                                                                                                java.lang.IllegalStateException: Expected BringIntoViewRequester to not be used before parents are placed.
                                                                                                	at androidx.compose.foundation.gestures.ContentInViewModifier.calculateRectForParent(ContentInViewModifier.kt:117)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$parentRect$1.invoke(BringIntoViewResponder.kt:152)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$parentRect$1.invoke(BringIntoViewResponder.kt:152)
                                                                                                	at androidx.compose.foundation.relocation.AndroidBringIntoViewParent.bringChildIntoView(BringIntoViewResponder.android.kt:43)
                                                                                                	at androidx.compose.foundation.relocation.BringIntoViewResponderModifier$bringChildIntoView$2$2.invokeSuspend(BringIntoViewResponder.kt:171)
                                                                                                	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
                                                                                                	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
                                                                                                	at android.os.Handler.handleCallback(Handler.java:942)
                                                                                                	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                	at android.os.Looper.loopOnce(Looper.java:240)
                                                                                                	at android.os.Looper.loop(Looper.java:351)
                                                                                                	at android.app.ActivityThread.main(ActivityThread.java:8416)
                                                                                                	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
                                                                                                	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
                                                                                                	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@16ff7b7, androidx.compose.runtime.BroadcastFrameClock@8b06b24, StandaloneCoroutine{Cancelling}@59ac68d, AndroidUiDispatcher@973b042]`

Allow for disabling of android keypad

Hey man, I admire and appreciate your work. it is great.

However, I realised that developers somethings create a Keypad view for a PINView in their design, I wanted to allow the user to be able to disable the android keypad which the user gets when the PINView is clicked.
Screenshot 2022-05-19 091449

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.