[taxi][passenger]
[音乐播放]
This commit is contained in:
yangyakun
2024-03-06 19:25:52 +08:00
parent 29913b6eee
commit 6d2deed800
36 changed files with 1842 additions and 250 deletions

View File

@@ -127,6 +127,14 @@ object FunctionBuildConfig {
@JvmField
var mediaUrlConfig = ""
/**
* 各车型宣传音频本地配置
* 广告json
*/
@Volatile
@JvmField
var musicUrlConfig = ""
/**
* 配置连接工控机的IP地址

View File

@@ -8,6 +8,7 @@
<dimen name="dp_m_30">-30dp</dimen>
<dimen name="dp_m_27">-27dp</dimen>
<dimen name="dp_m_20">-20dp</dimen>
<dimen name="dp_m_17">-17dp</dimen>
<dimen name="dp_m_12">-12dp</dimen>
<dimen name="dp_m_10">-10dp</dimen>
<dimen name="dp_m_8">-8dp</dimen>

View File

@@ -56,4 +56,32 @@ object DownloadUtils {
}
.launchIn(scope)
}
fun downLoadNoUi(ctx: Context?, url: String, savePath: String, fileName: String, listener: IDownloadListener?) { // FileBean fileBean = new FileBean(0, savePath, fileName, url, 0);
val context = ctx ?: Utils.getApp() ?: throw AssertionError("context must not be null.")
if (!Downloader.hasInit()) {
Downloader.init(context)
Downloader.setLoggable(BuildConfig.DEBUG)
}
Downloader.setNetStatePoller(poller)
Downloader.download(url, File(savePath, fileName))
.onEach {
when(it) {
is DownloadStart ->
UiThreadHandler.post { listener?.onStart(url) }
is Downloading -> {
UiThreadHandler.post { listener?.onProgress(url, it.downloaded, it.total) }
}
is DownloadSuccess -> {
UiThreadHandler.post { listener?.onFinished(url, it.path)}
}
is DownloadFailed -> {
UiThreadHandler.post { listener?.onError(url, it.msg) }
}
}
}
.filter {
it.isComplete()
}
.launchIn(scope)
}
}