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

采用 CallBack 构造Fragment的时候 切换动画无效 #58

Open
showwiki opened this issue Sep 22, 2021 · 3 comments
Open

采用 CallBack 构造Fragment的时候 切换动画无效 #58

showwiki opened this issue Sep 22, 2021 · 3 comments

Comments

@showwiki
Copy link

showwiki commented Sep 22, 2021

官方Demo中 CheckListFragment 中 加入切换页面的动画,发现无效果
private val _adapter by lazy {
CheckListAdapter { id, checked ->
navigator.push {
navOptions {
navOptions().applySlideInOut()
}
CheckItemFragment(id, checked, _cb)
}
}
}

@showwiki
Copy link
Author

直接把demo 中的SplashFragment 中的跳转改为如下的,popSelf = true 也不管用
navigator.push {
navOptions {
popSelf = true
applySlideInOut()
}
HomeFragment()
}

@qdsfdhvh
Copy link
Collaborator

qdsfdhvh commented Nov 15, 2021

push的{}是(Bundle) -> Fragment,所以在里面使用navOptions{}并没有起到作用,需要这样使用:

navigator.push({
  popSelf = true
  applySlideInOut()
}) {
  HomeFragment()
}

不过现在的用法我也打算改改,两次{}有点不美观,打算简化成一个{},可以加一下这种写法。

@showwiki
Copy link
Author

好的,谢谢!

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

No branches or pull requests

2 participants