maxkeppeler / sheets

⭐ ‎‎‎‏‏‎ ‎Offers a range of beautiful sheets (dialogs & bottom sheets) for quick use in your project. Includes many ways to customize sheets.
https://maxkeppeler.github.io/sheets/
Apache License 2.0
921 stars 77 forks source link

input bottomsheets auto dismiss need to be disable #21

Closed Yabaze closed 3 years ago

Yabaze commented 3 years ago

Is your feature request related to a problem? Please describe. I'm using input bottom sheet for change password functionality. If the user entered wrong details I'm able to validate and notify to the user. but Dialog automatically dismissing. again user has to enter the details again. so disable the dismiss will help me in ordered to rectify this problem.

Describe the solution you'd like remove the functionality of dismissing. and add those functionalities to the developer.

Yabaze commented 3 years ago

in the same input bottom sheet, I'm not able to find the type of the input edit text. like password number. can you help me in terms of that?

maxkeppeler commented 3 years ago

You can pass the android.text.InputType's to the InputEditText (e.g. InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) , so you can request only numbers, passwords or allow long description text inputs and more. In the future, I might add more specific components to the InputSheet to make this easier.

maxkeppeler commented 3 years ago

Regarding your main issue, you want to have a possibility to define when an (text) input is valid? If it is not, you want to display your own hint/error message?

Yabaze commented 3 years ago

Yes. I want that only. I'm able to show my custom Message. But Bottom Sheet Got Dismissed that time.

Yabaze commented 3 years ago

You can pass the android.text.InputType's to the InputEditText (e.g. InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) , so you can request only numbers, passwords or allow long description text inputs and more. In the future, I might add more specific components to the InputSheet to make this easier.

This one I tried already by your reference. But it is not working.

with(InputEditText { required() label("Old Password") hint("Enter Old Password") inputType(InputType.TYPE_TEXT_VARIATION_PASSWORD) })

this is my code. But It is not reflecting

maxkeppeler commented 3 years ago

Did you try InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD - both together? (Not just one of it)

maxkeppeler commented 3 years ago

Ok, it won't work. For some reason the inputType value changes until it's used in the adapter. I'm revising the text input option, with better usage for passwords and with material design. I will also offer the option for custom validation logic for a component.

maxkeppeler commented 3 years ago

With the coming version, check the sample setup - I added a password example with the InputSheet with custom validation logic. (And how to use a password as an input.)