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

Fade into the background? #7

Open
KennyGoers opened this issue Mar 21, 2019 · 4 comments
Open

Fade into the background? #7

KennyGoers opened this issue Mar 21, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@KennyGoers
Copy link

I noticed that depending on colors chosen and time spent waiting, showOriginal() can be quite jarring. Thoughts on how hard or easy it would be to add a fade in or out animation?

@Faltenreich
Copy link
Owner

A fade in is a very good idea and something I have thought about since the creation of this library.

Currently this is not supported but could be achieved by altering the View toggling behind showOriginal() and showSkeleton().

Things are different for the RecyclerView, since I am creating a separate adapter for the skeleton that replaces the original one when calling showSkeleton() in order to keep the library as unintrusive as possible.

I will think about a solution and of course you are free to create a pull request which I would gladly review if you are in a hurry.

@KennyGoers
Copy link
Author

Been reviewing the code and looking at adding this for both the mask types. In the process I've noticed that in the current implementation set the VISIBLE/INVISIBLE state of all the views within the parent. Am I reading that correctly? If so it causes havoc with views that are initially set to anything other than VISIBLE. If this is the case (and I think it is) more needs to be checked in that pass and original visibility state maintained. Agree?

@Faltenreich
Copy link
Owner

You are absolutely right. The original view state should be cached in order to maintain the original visibilities. I created a new issue for this bug which may be fixed by me in the near future or by someone other if it is of high priority: #9

@Faltenreich Faltenreich added the enhancement New feature or request label Jun 20, 2019
@mhettig
Copy link

mhettig commented Oct 7, 2020

A workaround can be achieved with:

// Example callback that hides skeleton
private fun onDataLoaded() {
    TransitionManager.beginDelayedTransition(skeleton)
    skeleton.showOriginal()
}

(Kotlin demo code from start page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants