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

Add enable or disabled touch mode or add busy mode with an icon #69

Open
mahbub-java opened this issue Oct 17, 2020 · 3 comments
Open

Comments

@mahbub-java
Copy link

After selected a day, we may need to add a network request that work asynchronously to pull some data from database for selected day. So we have to wait some time to load. Suppose, If user can again select another day in that period in single mode, we can't properly predict which day select previously or which data actually come, unless manually checking with some variable. It will be smart, if we manually disable selection for some time or a loading an icon and enable again manually when task was complete. Currently system setEnabled does not work.

@gantonious
Copy link
Owner

You should be able to disable selection using the following method:

materialDayPicker.disableAllDays()

When the network request finishes you can re-enable selection using:

materialDayPicker.enableAllDays()

If you want to only enable specific days you can do this instead:

materialDayPicker.enabledDays(daysToEnable = listOf(...))

@mahbub-java
Copy link
Author

Ok thanks for quick response. But in my scenario, I already disable Sunday, when first load day picker. Because weekly off day has to matter in my app. I already set disabled Sunday color RED to understand the user. User can select other 6 day, But in every selection they have to wait network data. I can't disable by materialDayPicker.disableAllDays(), because it will showed all RED color. So they will confuse with weekly off day. So I need a loading symbol or anything to wait in particularly selected day.

@gantonious
Copy link
Owner

Thanks for explaining. I see the issue you have for your use-case. I suppose we would want a way to disable the entire control and darken each toogle using the setEnabled method like you're suggesting.

I'm not actively working on enhancements to this library right now however if you would like to add this feature I would be happy to review your pull request and release a new version of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants