我在两个活动之间使用共享元素转换。第二个活动由包含片段的视图寻呼机组成。我想在共享元素过渡结束时进行进一步的更改。这是回调:
setEnterSharedElementCallback(
object : SharedElementCallback() {
override fun onMapSharedElements(
names: MutableList<String>,
sharedElements: MutableMap<String, View>
) {
val keySharedElementView = sharedElements[videoPath[currentPosition]]
if (keySharedElementView != null) {
Log.i("KSEV", "Not Null")
ViewCompat.animate(keySharedElementView)
.setListener(object : ViewPropertyAnimatorListenerAdapter() {
override fun onAnimationEnd(view: View?) {
super.onAnimationEnd(view)
Log.i("KSEV","Ended")
runOnUiThread { k
videoThumb.visibility = GONE
if (videoThumb.visibility == GONE) {
Log.i("SEV", "GONE")
}
}
}
}).start()
}
}
})
打印最后的日志语句 GONE。但视图仍然在屏幕上可见。如何改变其可见性?