| | |
| | | import android.widget.ImageView |
| | | import androidx.constraintlayout.motion.widget.MotionLayout |
| | | import androidx.constraintlayout.widget.ConstraintLayout |
| | | import cn.sinata.xldutils.activity.ImagePagerActivity |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.dollearn.student.R |
| | |
| | | import kotlinx.android.synthetic.main.fragment_listen.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.dip |
| | | import org.jetbrains.anko.startActivity |
| | | import java.util.ArrayList |
| | | |
| | | class GameAdapter(list: ArrayList<Subject>):HFRecyclerAdapter<Subject>(list, R.layout.item_game_1) { |
| | |
| | | val act = context as SuperListenActivity |
| | | holder.bind<SimpleDraweeView>(R.id.iv_img).setImageURI(data.img) |
| | | val view = holder.bind<View>(R.id.cl_voice_end_1) |
| | | val iv_full = holder.bind<View>(R.id.iv_full) |
| | | iv_full.setOnClickListener { |
| | | act.showFullImage = true |
| | | act.startActivity<ImagePagerActivity>("url" to arrayListOf(data.img)) |
| | | } |
| | | val motion = holder.bind<MotionLayout>(R.id.motion) |
| | | motion.progress = 0f |
| | | val ivResult = holder.bind<ImageView>(R.id.result_1) |
| | | view.visibility = if (data.right) View.VISIBLE else View.GONE |
| | | view.visibility = if (data.right) View.VISIBLE else View.INVISIBLE |
| | | view.clickDelay { |
| | | // (context as SuperListenActivity) |
| | | } |
| | |
| | | act.handler?.sendEmptyMessage(act.PLAY_RIGHT) |
| | | act.rightCount++ |
| | | subject.right = true |
| | | notifyItemChanged(position) |
| | | act.transAnimation(view) |
| | | }else{ |
| | | act.handler?.sendEmptyMessage(act.PLAY_ERROR) //选择答案后,停止倒计时 |
| | | ivResult.setImageResource(R.mipmap.zhifushibai) |