Skip to content

RecyclerViewAndAnimations Homework - #5

Open
prometey1936-dev wants to merge 2 commits into
Otus-Android:masterfrom
prometey1936-dev:master
Open

RecyclerViewAndAnimations Homework#5
prometey1936-dev wants to merge 2 commits into
Otus-Android:masterfrom
prometey1936-dev:master

Conversation

@prometey1936-dev

Copy link
Copy Markdown

Ссылка на видео:

https://disk.yandex.ru/i/Sef8ZB_Lgmoe9Q

class ScaleItemAnimator : DefaultItemAnimator() {

override fun animateAdd(holder: RecyclerView.ViewHolder): Boolean {
holder.itemView.apply {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно добавить dispatchAddStarting(holder)

}

override fun animateRemove(holder: RecyclerView.ViewHolder): Boolean {
holder.itemView.animate()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно добавить dispatchRemoveStarting(holder)

.alpha(1f)
.setDuration(addDuration)
.setInterpolator(OvershootInterpolator(1.5f))
.start()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а тут

                .withEndAction {
                    dispatchAddFinished(holder)
                }

.alpha(0f)
.setDuration(removeDuration)
.setInterpolator(AccelerateInterpolator())
.start()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и тут

            .withEndAction {
                dispatchRemoveFinished(holder)
            }

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants