How can I scale textviews using shared element transitions?

后端 未结 5 1278
广开言路
广开言路 2020-12-07 17:58

I am able to get TextViews to transition perfectly between two activities using ActivityOptions.makeSceneTransitionAnimation. However I want to make the text sc

5条回答
  •  -上瘾入骨i
    2020-12-07 18:42

    This was covered in one of the Google I/O 2016 talks. The source for the transition which you can copy into your code is found here. If your IDE complains the addTarget(TextView.class); requires API 21, just remove the constructor and add the target either dynamically or in your xml.

    i.e. (note this is in Kotlin)

    val textResizeTransition = TextResize().addTarget(view.findViewById(R.id.text_view))
    

提交回复
热议问题