Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Toast module for validation errors #18

Closed
wajahatkarim3 opened this Issue Sep 16, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@wajahatkarim3
Copy link
Owner

wajahatkarim3 commented Sep 16, 2018

Create Toast module for EasyValidation. This module will display validation errors from Failure Callback in Toasts.

@Z3nk

This comment has been minimized.

Copy link

Z3nk commented Oct 16, 2018

Can i have more details ? Do you want a generic method who call a toast ?

@wajahatkarim3

This comment has been minimized.

Copy link
Owner Author

wajahatkarim3 commented Oct 16, 2018

Well, the basic idea is to add a feature in Easy Validation library through which every time validation check fails, the Toast will be shown with the error message displayed.
At this moment, the library gives an error in the error callback and developers manually have to show Toast or any kind of error they want from that callback.
The purpose of this issue to provide a module which allows developers to show Toast without any additional code on their side.
The idea way to do is to override the callback and show the Toast in it.

@chikka

This comment has been minimized.

Copy link
Contributor

chikka commented Nov 14, 2018

@wajahatkarim3 Hi, I am interested to work on it. can i take it up? Also I want to know do we need some more advanced toast module which can provide settings to how toast would be shown like duration,toast position etc.

@wajahatkarim3

This comment has been minimized.

Copy link
Owner Author

wajahatkarim3 commented Nov 19, 2018

Thank you @chikka for your interest. Yes, you can do this. For you I have added another commit 737b53c to add some initial setups. I have added an EditTextKtx.kt class in Toast module with two nonEmptyToast() methods. You will have to copy all the methods from core.view_ktx package and add methods as I have done it.
Do let me know if you want to do this (I know this is late. I was out of town) and if you have any more questions, let me know 😄

@chikka

This comment has been minimized.

Copy link
Contributor

chikka commented Nov 19, 2018

@wajahatkarim3 I wan to do it :). Only one question is why we are using callback with message argument as we are already having errorMsg as second argument. or is there any other purpose?

@wajahatkarim3

This comment has been minimized.

Copy link
Owner Author

wajahatkarim3 commented Nov 19, 2018

Actually, the library has default messages for each validation. But, if the user wants to set a custom message, then that message will be passed in the callback. And if there's no custom message, then the callback will get the default message.

@chikka

This comment has been minimized.

Copy link
Contributor

chikka commented Nov 19, 2018

@wajahatkarim3 ok. will start working on it and will send PR once it is completed.Thanks!

wajahatkarim3 added a commit that referenced this issue Nov 20, 2018

Merge pull request #33 from chikka/master
Added extension for all view to show toast message. Fixes issue #18
@wajahatkarim3

This comment has been minimized.

Copy link
Owner Author

wajahatkarim3 commented Nov 20, 2018

Fixed in the pull request #33 by @chikka . Thank you again 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.