【发布时间】:2017-12-17 11:18:03
【问题描述】:
我有一个片段class FlipFragment : Fragment()
其中包括圆形。当我按下 CircleShape 时,我调用了一些动画来改变它的资源的方法。我需要这样做,当动画工作时 - onTouch 被禁用。我该怎么做?
class FlipFragment : Fragment() {
private var layout = R.layout.view_flip
private lateinit var CircleShape: ImageView
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
var view: View = inflater!!.inflate(layout, container, false)
CircleShape = view.findViewById<ImageView>(R.id.fShapeView)
Log.i("TAG", CircleShape.isClickable.toString())
CircleShape.setOnClickLiastener { mechanics() }
return view
}
private fun mechanics() {
var mechanics = Mechanics(context, this.CircleShape, R.drawable.front_circle,
R.drawable.back_circle,
fCircleShapeView)
mechanics.animation() ///when this method is working - onTouch should be disable
mechanics.random()
}
【问题讨论】:
标签: android kotlin fragment ontouchlistener touch-event