新增软解码切换功能
This commit is contained in:
parent
1c2cdacadb
commit
a361a2c11c
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -21,8 +21,8 @@ android {
|
|||
applicationId "net.sysolution.taxiapp"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 29
|
||||
versionCode 249
|
||||
versionName "3.3.3-beta26.4.0.8-debug"
|
||||
versionCode 251
|
||||
versionName "3.3.3-beta26.4.0.9-release"
|
||||
|
||||
//alphaxx - 预览版本,不会对外发布,由测试人员测试,会有很多bug
|
||||
//Betaxx - 公开测试版本,会发给其他工作人员,会有较多版本
|
||||
|
|
|
@ -454,6 +454,14 @@ public class Configurations {
|
|||
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putInt("logInterval", logInterval).apply();
|
||||
}
|
||||
|
||||
public String progressList(){
|
||||
return context.getSharedPreferences("config", Context.MODE_PRIVATE).getString("progressList", "");
|
||||
}
|
||||
|
||||
public void progressListSave(String s){
|
||||
context.getSharedPreferences("config", Context.MODE_PRIVATE).edit().putString("progressList", s).apply();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import cn.trans88.taxiappkotlin.logic.dao.DaoSession
|
|||
import cn.trans88.taxiappkotlin.logic.dao.HelperDaoDB
|
||||
import cn.trans88.taxiappkotlin.logic.exception.CrashHandler
|
||||
import cn.trans88.taxiappkotlin.logic.model.Advertise
|
||||
import cn.trans88.taxiappkotlin.logic.model.AdvertiseProcess
|
||||
import cn.trans88.taxiappkotlin.logic.model.BackgroundType
|
||||
import cn.trans88.taxiappkotlin.logic.model.Regions
|
||||
import cn.trans88.taxiappkotlin.logic.network.JoeyDownloadManager
|
||||
|
@ -39,6 +40,7 @@ import java.util.*
|
|||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import kotlin.collections.ArrayList
|
||||
import kotlin.collections.HashMap
|
||||
import kotlin.collections.HashSet
|
||||
|
||||
class TaxiApp:Application() {
|
||||
|
||||
|
@ -67,6 +69,8 @@ class TaxiApp:Application() {
|
|||
val timerTaskMap = HashMap<String,kotlin.collections.ArrayList<TimerTask>>()
|
||||
//存储定时广告的列表
|
||||
var timedAds:ArrayList<Advertise> = ArrayList()
|
||||
//存储未上传成功的下载进度
|
||||
var processList:HashSet<AdvertiseProcess> = HashSet()
|
||||
var activity:PlayActivity? = null
|
||||
|
||||
//gps日志定时器
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package cn.trans88.taxiappkotlin.logic.model;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class AdvertiseProcess {
|
||||
private String type = "notify_download_ad_progress";
|
||||
private String ad_id;
|
||||
|
@ -20,4 +22,19 @@ public class AdvertiseProcess {
|
|||
public void setProgress(String progress) {
|
||||
this.progress = progress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AdvertiseProcess that = (AdvertiseProcess) o;
|
||||
return Objects.equals(type, that.type) &&
|
||||
Objects.equals(ad_id, that.ad_id) &&
|
||||
Objects.equals(progress, that.progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(type, ad_id, progress);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@ public class JoeyDownloadManager {
|
|||
downloadListener = new JoeyDownloadListener() {
|
||||
@Override
|
||||
protected void completed(BaseDownloadTask task) {
|
||||
YoungUtil.YoungLog("下载完成 --》 completed");
|
||||
YoungUtil.YoungLog("Download "
|
||||
+ task.getUrl()
|
||||
+ " successful, [Size/Speed ==> "
|
||||
|
@ -226,7 +227,7 @@ public class JoeyDownloadManager {
|
|||
advertiseProcess.setProgress(String.valueOf(100));
|
||||
String progressJson = new Gson().toJson(advertiseProcess);
|
||||
YoungUtil.YoungLog("广告:"+task.getTag()+",下载完成进度100");
|
||||
WsManager.INSTANCE.send(progressJson);
|
||||
// WsManager.INSTANCE.send(progressJson);
|
||||
|
||||
try {
|
||||
RefreshPlayer.refresh();
|
||||
|
@ -313,11 +314,12 @@ public class JoeyDownloadManager {
|
|||
advertiseProcess.setProgress(String.valueOf(100));
|
||||
String progressJson = new Gson().toJson(advertiseProcess);
|
||||
YoungUtil.YoungLog("广告:"+task.getTag().toString()+",下载完成进度100");
|
||||
WsManager.INSTANCE.send(progressJson);
|
||||
try{
|
||||
Thread.sleep(500);
|
||||
}catch (Exception e){}
|
||||
WsManager.INSTANCE.send(progressJson);
|
||||
// WsManager.INSTANCE.send(progressJson);
|
||||
|
||||
// try{
|
||||
// Thread.sleep(500);
|
||||
// }catch (Exception e){}
|
||||
// WsManager.INSTANCE.send(progressJson);
|
||||
}
|
||||
// if (progress%5==0){
|
||||
// AdvertiseProcess advertiseProcess =new AdvertiseProcess();
|
||||
|
|
|
@ -22,6 +22,7 @@ import cn.trans88.taxiappkotlin.ui.play.isOverdue
|
|||
import cn.trans88.taxiappkotlin.util.YoungUtil
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.JsonParser
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import com.trs88.kurolibrary.execute.KuroExecutor
|
||||
import com.trs88.kurolibrary.file.KuroFileUtil
|
||||
import java.io.*
|
||||
|
@ -298,6 +299,7 @@ object ProcessingCommands {
|
|||
//edit by ljh @2024/3/14
|
||||
Configurations.config(TaxiApp.instance()).isSoftDecodeSave(loggerSwitch.isSoftDeCode)
|
||||
taxiApp.isSoftDecode = loggerSwitch.isSoftDeCode
|
||||
"是否软解码:${taxiApp.isSoftDecode}".logd()
|
||||
|
||||
baseResponse.type = type
|
||||
val response = gson.toJson(baseResponse)
|
||||
|
@ -356,6 +358,7 @@ object ProcessingCommands {
|
|||
beatTimer!!.cancel()
|
||||
beatTimer!!.purge()
|
||||
beatTimer = null
|
||||
|
||||
}
|
||||
|
||||
beatTimer = Timer()
|
||||
|
@ -395,9 +398,25 @@ object ProcessingCommands {
|
|||
}
|
||||
|
||||
/**
|
||||
*发送所有广告信息
|
||||
* 发送所有广告信息
|
||||
*/
|
||||
private fun sendAllAdvertiseInfo(task: String, type: String) {
|
||||
//提交未上传成功的下载进度
|
||||
try {
|
||||
val progressListJson = Configurations.config(taxiApp).progressList()
|
||||
if (!progressListJson.isNullOrEmpty()){
|
||||
"progressListJson:$progressListJson".logd()
|
||||
val progressList = gson.fromJson<AdvertiseProcess>(progressListJson,object : TypeToken<Set<AdvertiseProcess>>(){}.type) as HashSet<AdvertiseProcess>
|
||||
for (advertiseProcess in progressList) {
|
||||
send(gson.toJson(advertiseProcess))
|
||||
}
|
||||
Configurations.config(taxiApp).progressListSave("")
|
||||
taxiApp.processList.clear()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
"exception:${e?.message}".loge()
|
||||
}
|
||||
|
||||
val baseResponse = gson.fromJson<BaseResponse>(task)
|
||||
|
||||
val positionAdvertises = DaoUtil.getPositionAdvertise().loadAll()
|
||||
|
@ -593,7 +612,7 @@ object ProcessingCommands {
|
|||
|
||||
val sanleResponse = SanleResponse()
|
||||
sanleResponse.task_id = taskId
|
||||
sanleResponse.id =id
|
||||
sanleResponse.id = id
|
||||
sanleResponse.type = type
|
||||
val response = gson.toJson(sanleResponse)
|
||||
send(response)
|
||||
|
@ -826,6 +845,12 @@ object ProcessingCommands {
|
|||
sanleResponse.type = type
|
||||
val response = gson.toJson(sanleResponse)
|
||||
send(response)
|
||||
|
||||
val advertiseProcess = AdvertiseProcess()
|
||||
advertiseProcess.ad_id = positionAdvertise.task_id
|
||||
advertiseProcess.progress = 100.toString()
|
||||
val progressJson = Gson().toJson(advertiseProcess)
|
||||
send(progressJson)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1042,6 +1067,12 @@ object ProcessingCommands {
|
|||
sanleResponse.type = type
|
||||
val response = gson.toJson(sanleResponse)
|
||||
send(response)
|
||||
|
||||
val advertiseProcess = AdvertiseProcess()
|
||||
advertiseProcess.ad_id = sanleAdvertise.task_id
|
||||
advertiseProcess.progress = 100.toString()
|
||||
val progressJson = Gson().toJson(advertiseProcess)
|
||||
send(progressJson)
|
||||
// send("服务器日志 ${Xixun.getCardId()} 添加广告 id =${sanleAdvertise.id}")
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import cn.trans88.taxiappkotlin.ext.logd
|
|||
import cn.trans88.taxiappkotlin.ext.loge
|
||||
import cn.trans88.taxiappkotlin.logic.Repository
|
||||
import cn.trans88.taxiappkotlin.logic.dao.DaoUtil
|
||||
import cn.trans88.taxiappkotlin.logic.model.AdvertiseProcess
|
||||
import cn.trans88.taxiappkotlin.logic.model.CurrentPlayAdvertises
|
||||
import cn.trans88.taxiappkotlin.util.KuroTimer
|
||||
import cn.trans88.taxiappkotlin.util.KuroTimerTask
|
||||
|
@ -357,7 +358,22 @@ object WsManager {
|
|||
// if(!(heartbeatContext.equals(msg))){
|
||||
// Repository.taxiApp.saveLog("回复服务器 $msg")
|
||||
// }
|
||||
|
||||
if (msg.contains("notify_download_ad_progress")) {
|
||||
"notify_download_ad_progress ----> $msg".logd()
|
||||
if (mWebSocket == null) {
|
||||
try {
|
||||
val process = Repository.taxiApp.gson.fromJson<AdvertiseProcess>(
|
||||
msg,
|
||||
AdvertiseProcess::class.java
|
||||
)
|
||||
Repository.taxiApp.processList.add(process)
|
||||
val json = Repository.taxiApp.gson.toJson(Repository.taxiApp.processList)
|
||||
Configurations.config(Repository.taxiApp).progressListSave(json)
|
||||
} catch (e:Exception){
|
||||
"exception:${e?.message}".loge()
|
||||
}
|
||||
}
|
||||
}
|
||||
mWebSocket?.send(msg)
|
||||
// mWebSocket?.send(msg) ?: throw IllegalArgumentException("mWebSocket is null not send!")
|
||||
}
|
||||
|
|
|
@ -35,11 +35,11 @@ fun Advertise.isReady(): Boolean {
|
|||
|
||||
if(media_type != MaterialType.Text.ordinal){
|
||||
/* 这里exist判断不准,文件存在被判定为不存在 略作改动
|
||||
if (!File(this.pathName).exists()) {
|
||||
YoungUtil.YoungLog("${this.pathName}的广告本地不存在,重新下载 ready返回false")
|
||||
downloadFile()
|
||||
ready = false
|
||||
}
|
||||
if (!File(this.pathName).exists()) {
|
||||
YoungUtil.YoungLog("${this.pathName}的广告本地不存在,重新下载 ready返回false")
|
||||
downloadFile()
|
||||
ready = false
|
||||
}
|
||||
*/
|
||||
//edit by yzd @20211222
|
||||
val file = File(this.pathName)
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
# Location of the SDK. This is only used by Gradle.
|
||||
# For customization when using a Version Control System, please read the
|
||||
# header note.
|
||||
#Mon Mar 18 15:40:17 GMT+08:00 2024
|
||||
#Thu Mar 21 16:48:54 GMT+08:00 2024
|
||||
sdk.dir=D\:\\Android\\sdk
|
||||
|
|
|
@ -1 +1 @@
|
|||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":249,"versionName":"3.3.3-beta26.4.0.8-debug","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.4.0.8-debug{249}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.4.0.8-debug{249}.apk","properties":{}}]
|
||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":251,"versionName":"3.3.3-beta26.4.0.9-release","enabled":true,"outputFile":"TaxiApp_v3.3.3-beta26.4.0.9-release{251}.apk","fullName":"release","baseName":"release","dirName":""},"path":"TaxiApp_v3.3.3-beta26.4.0.9-release{251}.apk","properties":{}}]
|
Loading…
Reference in New Issue
Block a user