Skip to content

Instantly share code, notes, and snippets.

@realpacific
Created May 22, 2019 17:58
Show Gist options
  • Save realpacific/fc0d975057ee3c274a580f7f335632d5 to your computer and use it in GitHub Desktop.
Save realpacific/fc0d975057ee3c274a580f7f335632d5 to your computer and use it in GitHub Desktop.
The Fragment that will exit with circular reveal animation implements the ExitWithAnimation Interface
class OneFragment : Fragment(), ExitWithAnimation {
override var posX: Int? = null
override var posY: Int? = null
override fun isToBeExitedWithAnimation(): Boolean = true
companion object {
@JvmStatic
fun newInstance(exit: IntArray? = null): OneFragment = OneFragment().apply {
if (exit != null && exit.size == 2) {
posX = exit[0]
posY = exit[1]
}
}
}
//... onCreateView
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
view.startCircularReveal(false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment