Android:混合轮播视频和图片
这里使用的是@lakebobo的hbanner框架,原作者的github地址:https://github.com/lakehubo/HBanner
本文通过hbanner框架实现本地及网络视频图片的混合轮播
引入依赖
implementation 'com.lakehubo:hbanner:1.0.3'
##创建activity_main布局文件
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/tip1"
android:text="图片视频混播模式"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.lake.banner.HBanner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="250dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tip1" />
</androidx.constraintlayout.widget.ConstraintLayout>