// 文字轮播
private fun initTextFlipper() {
textFlipper = findViewById(R.id.text_flipper)
val list = listOf(“文字轮播测试0”, “文字轮播测试02…”)
textFlipper?.adapter = TextFlipperAdapter(this, list)
textFlipper?.setInAnimation(this, R.animator.text_flipper_in_from_bottom)
textFlipper?.setOutAnimation(this, R.animator.text_flipper_out_to_top)
// textFlipper?.flipInterval
// textFlipper?.startFlipping()
}
// 图片轮播
private fun initImgFlipper() {
imgFlipper = findViewById(R.id.img_flipper)
val list = listOf(“http://www.nicesoso.com/test/file/img/test.jpg”, “http://www.nicesoso.com/test/file/img/test_h_1.jpg”,
“http://www.nicesoso.com/test/file/img/test_h_2.jpg”)
imgFlipper?.adapter = ImgFlipperAdapter(this, list)
imgFlipper?.setInAnimation(this, R.animator.img_flipper_in)
preBtn = findViewById(R.id.prev_btn)
nextBtn = findViewById(R.id.next_btn) as