Commit f8fa5323 by yichen

1、增加100个渠道

2、增加3个SDK集成
3、增加若干功能和修复BUG
parent e1734fea
...@@ -37,6 +37,9 @@ android { ...@@ -37,6 +37,9 @@ android {
// //'x86' 'armeabi-v7a' 'x86_64' 'arm64-v8a' // //'x86' 'armeabi-v7a' 'x86_64' 'arm64-v8a'
// abiFilters 'x86' // abiFilters 'x86'
} }
//在app module级别的build.gradle中,添加url scheme,后续用作实时埋点检测,现写死即可:
// 在android的defaultConfig中添加
manifestPlaceholders.put("APPLOG_SCHEME","rangersapplog.byAx6uYt".toLowerCase())
} }
flavorDimensions "version" flavorDimensions "version"
...@@ -60,6 +63,16 @@ android { ...@@ -60,6 +63,16 @@ android {
UMENG_CHANNEL_VALUE: "qj_02"] UMENG_CHANNEL_VALUE: "qj_02"]
} }
qj_bianxianmao {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "18",
UMENG_CHANNEL_VALUE: "bianxianmao"]
}
qj_meizu { qj_meizu {
def myAppName = "球聚体育" def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu" def myAppNamePY = "qiujutiyu"
...@@ -70,13 +83,24 @@ android { ...@@ -70,13 +83,24 @@ android {
UMENG_CHANNEL_VALUE: "qj_meizu" UMENG_CHANNEL_VALUE: "qj_meizu"
] ]
} }
qj_mubaotoutiao {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubaotoutiao"
]
}
qj_mubao { qj_mubao {
def myAppName = "球聚体育" def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu" def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [ manifestPlaceholders = [
myAppName : "${myAppName}", myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}", myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "0", API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao" UMENG_CHANNEL_VALUE: "mubao"
] ]
} }
...@@ -120,6 +144,103 @@ android { ...@@ -120,6 +144,103 @@ android {
UMENG_CHANNEL_VALUE: "mubao4" UMENG_CHANNEL_VALUE: "mubao4"
] ]
} }
qj_mubao5 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao5"
]
}
qj_mubao6 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao6"
]
}
qj_mubao7 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao7"
]
}
qj_mubao8 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao8"
]
}
qj_mubao9 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao9"
]
}
qj_mubao10 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao10"
]
}
qj_mubao11 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao11"
]
}
qj_mubao12 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao12"
]
}
qj_mubao13 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao13"
]
}
qj_exe1 { qj_exe1 {
def myAppName = "球聚体育" def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu" def myAppNamePY = "qiujutiyu"
...@@ -171,6 +292,68 @@ android { ...@@ -171,6 +292,68 @@ android {
] ]
} }
qj_exe6 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe6"
]
}
qj_exe7 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe7"
]
}
qj_exe8 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe8"
]
}
qj_exe9 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe9"
]
}
qj_exe10 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe10"
]
}
qj_exe11 {
def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu"
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "15",
UMENG_CHANNEL_VALUE: "exe11"
]
}
qj_1001 { qj_1001 {
def myAppName = "球聚体育" def myAppName = "球聚体育"
def myAppNamePY = "qiujutiyu" def myAppNamePY = "qiujutiyu"
...@@ -238,7 +421,7 @@ android { ...@@ -238,7 +421,7 @@ android {
manifestPlaceholders = [ manifestPlaceholders = [
myAppName : "${myAppName}", myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}", myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "6", API_CHANNEL_ID : "16",
UMENG_CHANNEL_VALUE: "qj_yingyongbao" UMENG_CHANNEL_VALUE: "qj_yingyongbao"
] ]
} }
...@@ -1238,76 +1421,1456 @@ android { ...@@ -1238,76 +1421,1456 @@ android {
] ]
} }
} A_001{
sourceSets { def myAppName = "30tv体育直播"
main { def myAppNamePY = "30tvtiyu"
manifest.srcFile 'src/main/AndroidManifest.xml' manifestPlaceholders = [
java.srcDirs = ['src/main/java'] myAppName : "${myAppName}",
resources.srcDirs = ['src/main/resources'] myAppNamePY : "${myAppNamePY}",
aidl.srcDirs = ['src/main/aidl'] API_CHANNEL_ID : "10",
renderscript.srcDirs = ['src/maom'] UMENG_CHANNEL_VALUE: "mubao"
res.srcDirs = ['src/main/res'] ]
assets.srcDirs = ['src/main/assets']
jniLibs.srcDirs = ['libs']
}
qj_yuyan {
res.srcDirs = ['src/main/X-YUYAN/res']
}
qj_boboqiu {
res.srcDirs = ['src/main/X-BOBOQIU/res']
}
qj_chaojidianshi {
res.srcDirs = ['src/main/X-CHAOJIDIANSHI/res']
}
qj_jiebao {
res.srcDirs = ['src/main/X-JIEBAO/res']
} }
qj_jrs { A_002{
res.srcDirs = ['src/main/X-JRS/res'] def myAppName = "67体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_uu_qiu {
res.srcDirs = ['src/main/X-UUQIU/res'] A_003{
def myAppName = "88直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_daishu { A_004{
res.srcDirs = ['src/main/X-DAISHU/res'] def myAppName = "91体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_NBAchaojizhibo { A_005{
res.srcDirs = ['src/main/X-NBACHAOJIZHIBO/res'] def myAppName = "365体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_lebo {
res.srcDirs = ['src/main/X-LEBO/res'] A_006{
def myAppName = "599比分"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_guangqiujie { A_007{
res.srcDirs = ['src/main/X-GUANGQIUJIE/res'] def myAppName = "白鲨直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_huanqiutiyu { A_008{
res.srcDirs = ['src/main/X-HUANQIU/res'] def myAppName = "百狐体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_jikezuqiu { A_009{
res.srcDirs = ['src/main/X-JIKE/res'] def myAppName = "波波球"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_jiaoqiu { A_010{
res.srcDirs = ['src/main/X-JIAOQIU/res'] def myAppName = "猜球吧"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
} }
qj_kanqiubao { A_011{
def myAppName = "袋鼠直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_012{
def myAppName = "低调看"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_013{
def myAppName = "懂球帝"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_014{
def myAppName = "斗球直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_015{
def myAppName = "斗鱼直播官方版app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_016{
def myAppName = "福7体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_017{
def myAppName = "广东体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_018{
def myAppName = "逛球街"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_019{
def myAppName = "逛球街官方版"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_020{
def myAppName = "逛球街体育直播app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_021{
def myAppName = "嗨直播体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_022{
def myAppName = "海豹体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_023{
def myAppName = "河豚直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_024{
def myAppName = "黑白体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_025{
def myAppName = "黑白体育NBA直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_026{
def myAppName = "虎扑直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_027{
def myAppName = "虎牙直播平台"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_028{
def myAppName = "环球体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_029{
def myAppName = "环球体育专业版"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_030{
def myAppName = "即刻足球"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_031{
def myAppName = "极光体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_032{
def myAppName = "极速体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_033{
def myAppName = "骄英体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_034{
def myAppName = "角球之家"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_035{
def myAppName = "捷报比分"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_036{
def myAppName = "精球体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_037{
def myAppName = "精球体育官网版"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_038{
def myAppName = "聚球迷"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_039{
def myAppName = "看个球app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_040{
def myAppName = "看球宝"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_041{
def myAppName = "看球宝正版"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_042{
def myAppName = "看球宝app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_043{
def myAppName = "快鱼直播体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_044{
def myAppName = "蓝鲸体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_045{
def myAppName = "乐博体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_046{
def myAppName = "乐米体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_047{
def myAppName = "乐视体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_048{
def myAppName = "乐鱼"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_049{
def myAppName = "雷速体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_050{
def myAppName = "溜溜体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_051{
def myAppName = "绿茵体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_052{
def myAppName = "绿茵中国"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_053{
def myAppName = "咪咕咪咕"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_054{
def myAppName = "咪咕直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_055{
def myAppName = "欧宝体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_056{
def myAppName = "盘球吧"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_057{
def myAppName = "企鹅体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_058{
def myAppName = "球半体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_059{
def myAppName = "球会体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_060{
def myAppName = "球客体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_061{
def myAppName = "球探比分"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_062{
def myAppName = "球友直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_063{
def myAppName = "人人体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_064{
def myAppName = "日球体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_065{
def myAppName = "山猫体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_066{
def myAppName = "说球帝"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_067{
def myAppName = "速雷快讯"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_068{
def myAppName = "腾讯体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_069{
def myAppName = "王者体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_070{
def myAppName = "纬来体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_071{
def myAppName = "我奥篮球"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_072{
def myAppName = "五楼直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_073{
def myAppName = "五星体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_074{
def myAppName = "西瓜视频"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_075{
def myAppName = "新浪体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_076{
def myAppName = "新余体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_077{
def myAppName = "星轨体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_078{
def myAppName = "星星体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_079{
def myAppName = "央视体育5直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_080{
def myAppName = "易球成名"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_081{
def myAppName = "盈球大师"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_082{
def myAppName = "雨燕体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_083{
def myAppName = "云图体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_084{
def myAppName = "章鱼tv体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_085{
def myAppName = "掌球者"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_086{
def myAppName = "直播8"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_087{
def myAppName = "直播吧"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_088{
def myAppName = "中国体育直播tv"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_089{
def myAppName = "抓饭直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_090{
def myAppName = "A8体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_091{
def myAppName = "A8体育直播app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_092{
def myAppName = "ESPN"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_093{
def myAppName = "Jrs直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_094{
def myAppName = "Nba黑白直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_095{
def myAppName = "Nba雨燕直播app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_096{
def myAppName = "now直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_097{
def myAppName = "OB欧宝体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_098{
def myAppName = "OB欧宝体育app"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_099{
def myAppName = "UU球直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_100{
def myAppName = "极速体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_101{
def myAppName = "篮箭比赛"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_102{
def myAppName = "乐鱼"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_103{
def myAppName = "雷速体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_104{
def myAppName = "溜溜体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_105{
def myAppName = "企鹅体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_106{
def myAppName = "山猫体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_107{
def myAppName = "山猫直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_108{
def myAppName = "山猫直播体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_109{
def myAppName = "速雷快讯"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_110{
def myAppName = "腾讯体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_111{
def myAppName = "王者体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_112{
def myAppName = "纬来体育"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_113{
def myAppName = "西瓜视频"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_114{
def myAppName = "易球成名CLUB"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
A_115{
def myAppName = "章鱼tv体育直播"
def myAppNamePY = ""
manifestPlaceholders = [
myAppName : "${myAppName}",
myAppNamePY : "${myAppNamePY}",
API_CHANNEL_ID : "10",
UMENG_CHANNEL_VALUE: "mubao"
]
}
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java']
resources.srcDirs = ['src/main/resources']
aidl.srcDirs = ['src/main/aidl']
renderscript.srcDirs = ['src/maom']
res.srcDirs = ['src/main/res']
assets.srcDirs = ['src/main/assets']
jniLibs.srcDirs = ['libs']
}
qj_yuyan {
res.srcDirs = ['src/main/X-YUYAN/res']
}
qj_boboqiu {
res.srcDirs = ['src/main/X-BOBOQIU/res']
}
qj_chaojidianshi {
res.srcDirs = ['src/main/X-CHAOJIDIANSHI/res']
}
qj_jiebao {
res.srcDirs = ['src/main/X-JIEBAO/res']
}
qj_jrs {
res.srcDirs = ['src/main/X-JRS/res']
}
qj_uu_qiu {
res.srcDirs = ['src/main/X-UUQIU/res']
}
qj_daishu {
res.srcDirs = ['src/main/X-DAISHU/res']
}
qj_NBAchaojizhibo {
res.srcDirs = ['src/main/X-NBACHAOJIZHIBO/res']
}
qj_lebo {
res.srcDirs = ['src/main/X-LEBO/res']
}
qj_guangqiujie {
res.srcDirs = ['src/main/X-GUANGQIUJIE/res']
}
qj_huanqiutiyu {
res.srcDirs = ['src/main/X-HUANQIU/res']
}
qj_jikezuqiu {
res.srcDirs = ['src/main/X-JIKE/res']
}
qj_jiaoqiu {
res.srcDirs = ['src/main/X-JIAOQIU/res']
}
qj_kanqiubao {
res.srcDirs = ['src/main/X-KANQIUBAO/res'] res.srcDirs = ['src/main/X-KANQIUBAO/res']
} }
...@@ -1607,8 +3170,470 @@ android { ...@@ -1607,8 +3170,470 @@ android {
} }
A_001{
res.srcDirs = ['src/main/A_001/res']
}
A_002{
res.srcDirs = ['src/main/A_002/res']
}
A_003{
res.srcDirs = ['src/main/A_003/res']
}
A_004{
res.srcDirs = ['src/main/A_004/res']
}
A_005{
res.srcDirs = ['src/main/A_005/res']
}
A_006{
res.srcDirs = ['src/main/A_006/res']
}
A_007{
res.srcDirs = ['src/main/A_007/res']
}
A_008{
res.srcDirs = ['src/main/A_008/res']
}
A_009{
res.srcDirs = ['src/main/A_009/res']
}
A_010{
res.srcDirs = ['src/main/A_010/res']
}
A_011{
res.srcDirs = ['src/main/A_011/res']
}
A_012{
res.srcDirs = ['src/main/A_012/res']
}
A_013{
res.srcDirs = ['src/main/A_013/res']
}
A_014{
res.srcDirs = ['src/main/A_014/res']
}
A_015{
res.srcDirs = ['src/main/A_015/res']
}
A_016{
res.srcDirs = ['src/main/A_016/res']
}
A_017{
res.srcDirs = ['src/main/A_017/res']
}
A_018{
res.srcDirs = ['src/main/A_018/res']
}
A_019{
res.srcDirs = ['src/main/A_019/res']
}
A_020{
res.srcDirs = ['src/main/A_020/res']
}
A_021{
res.srcDirs = ['src/main/A_021/res']
}
A_022{
res.srcDirs = ['src/main/A_022/res']
}
A_023{
res.srcDirs = ['src/main/A_023/res']
}
A_024{
res.srcDirs = ['src/main/A_024/res']
}
A_025{
res.srcDirs = ['src/main/A_025/res']
}
A_026{
res.srcDirs = ['src/main/A_026/res']
}
A_027{
res.srcDirs = ['src/main/A_027/res']
}
A_028 {
res.srcDirs = ['src/main/A_028/res']
}
A_029{
res.srcDirs = ['src/main/A_029/res']
}
A_030{
res.srcDirs = ['src/main/A_030/res']
}
A_031{
res.srcDirs = ['src/main/A_031/res']
}
A_032{
res.srcDirs = ['src/main/A_032/res']
}
A_033{
res.srcDirs = ['src/main/A_033/res']
}
A_034{
res.srcDirs = ['src/main/A_034/res']
}
A_035{
res.srcDirs = ['src/main/A_035/res']
}
A_036{
res.srcDirs = ['src/main/A_036/res']
}
A_037{
res.srcDirs = ['src/main/A_037/res']
}
A_038{
res.srcDirs = ['src/main/A_038/res']
}
A_039{
res.srcDirs = ['src/main/A_039/res']
}
A_040{
res.srcDirs = ['src/main/A_040/res']
}
A_041{
res.srcDirs = ['src/main/A_041/res']
}
A_042{
res.srcDirs = ['src/main/A_042/res']
}
A_043{
res.srcDirs = ['src/main/A_043/res']
}
A_044{
res.srcDirs = ['src/main/A_044/res']
}
A_045{
res.srcDirs = ['src/main/A_045/res']
}
A_046{
res.srcDirs = ['src/main/A_046/res']
}
A_047{
res.srcDirs = ['src/main/A_047/res']
}
A_048 {
res.srcDirs = ['src/main/A_048/res']
}
A_049{
res.srcDirs = ['src/main/A_049/res']
}
A_050{
res.srcDirs = ['src/main/A_050/res']
}
A_051{
res.srcDirs = ['src/main/A_051/res']
}
A_052{
res.srcDirs = ['src/main/A_052/res']
}
A_053{
res.srcDirs = ['src/main/A_053/res']
}
A_054{
res.srcDirs = ['src/main/A_054/res']
}
A_055{
res.srcDirs = ['src/main/A_055/res']
}
A_056{
res.srcDirs = ['src/main/A_056/res']
}
A_057{
res.srcDirs = ['src/main/A_057/res']
}
A_058{
res.srcDirs = ['src/main/A_058/res']
}
A_059{
res.srcDirs = ['src/main/A_059/res']
}
A_060{
res.srcDirs = ['src/main/A_060/res']
}
A_061{
res.srcDirs = ['src/main/A_061/res']
}
A_062{
res.srcDirs = ['src/main/A_062/res']
}
A_063{
res.srcDirs = ['src/main/A_063/res']
}
A_064{
res.srcDirs = ['src/main/A_064/res']
}
A_065{
res.srcDirs = ['src/main/A_065/res']
}
A_066{
res.srcDirs = ['src/main/A_066/res']
}
A_067{
res.srcDirs = ['src/main/A_067/res']
}
A_068 {
res.srcDirs = ['src/main/A_068/res']
}
A_069{
res.srcDirs = ['src/main/A_069/res']
}
A_070{
res.srcDirs = ['src/main/A_070/res']
}
A_071{
res.srcDirs = ['src/main/A_071/res']
}
A_072{
res.srcDirs = ['src/main/A_072/res']
}
A_073{
res.srcDirs = ['src/main/A_073/res']
}
A_074{
res.srcDirs = ['src/main/A_074/res']
}
A_075{
res.srcDirs = ['src/main/A_075/res']
}
A_076{
res.srcDirs = ['src/main/A_076/res']
}
A_077{
res.srcDirs = ['src/main/A_077/res']
}
A_078{
res.srcDirs = ['src/main/A_078/res']
}
A_079{
res.srcDirs = ['src/main/A_079/res']
}
A_080{
res.srcDirs = ['src/main/A_080/res']
}
A_081{
res.srcDirs = ['src/main/A_081/res']
}
A_082{
res.srcDirs = ['src/main/A_082/res']
}
A_083{
res.srcDirs = ['src/main/A_083/res']
}
A_084{
res.srcDirs = ['src/main/A_084/res']
}
A_085{
res.srcDirs = ['src/main/A_085/res']
}
A_086{
res.srcDirs = ['src/main/A_086/res']
}
A_087{
res.srcDirs = ['src/main/A_087/res']
}
A_088 {
res.srcDirs = ['src/main/A_088/res']
}
A_089{
res.srcDirs = ['src/main/A_089/res']
}
A_090{
res.srcDirs = ['src/main/A_090/res']
}
A_091{
res.srcDirs = ['src/main/A_091/res']
}
A_092{
res.srcDirs = ['src/main/A_092/res']
}
A_093{
res.srcDirs = ['src/main/A_093/res']
}
A_094{
res.srcDirs = ['src/main/A_094/res']
}
A_095{
res.srcDirs = ['src/main/A_095/res']
}
A_096{
res.srcDirs = ['src/main/A_096/res']
}
A_097{
res.srcDirs = ['src/main/A_097/res']
}
A_098{
res.srcDirs = ['src/main/A_098/res']
}
A_099{
res.srcDirs = ['src/main/A_099/res']
}
A_100{
res.srcDirs = ['src/main/A_100/res']
}
A_101{
res.srcDirs = ['src/main/A_101/res']
}
A_102{
res.srcDirs = ['src/main/A_102/res']
}
A_103{
res.srcDirs = ['src/main/A_103/res']
}
A_104 {
res.srcDirs = ['src/main/A_104res']
}
A_105{
res.srcDirs = ['src/main/A_105/res']
}
A_106{
res.srcDirs = ['src/main/A_106/res']
}
A_107{
res.srcDirs = ['src/main/A_107/res']
}
A_108{
res.srcDirs = ['src/main/A_108/res']
}
A_109{
res.srcDirs = ['src/main/A_109/res']
}
A_110{
res.srcDirs = ['src/main/A_110/res']
}
A_111{
res.srcDirs = ['src/main/A_111/res']
}
A_112{
res.srcDirs = ['src/main/A_112/res']
}
A_113{
res.srcDirs = ['src/main/A_113/res']
}
A_114{
res.srcDirs = ['src/main/A_114/res']
}
A_115{
res.srcDirs = ['src/main/A_115/res']
}
} }
...@@ -1618,7 +3643,7 @@ android { ...@@ -1618,7 +3643,7 @@ android {
applicationVariants.all { variant -> applicationVariants.all { variant ->
variant.outputs.all { variant.outputs.all {
// outputFileName = "A_v${variant.versionName}_${variant.buildType.name}_id_0_250.apk" // outputFileName = "A_v${variant.versionName}_${variant.buildType.name}_id_0_250.apk"
outputFileName = "qjLive_v${variant.versionName}_${variant.buildType.name}_${variant.productFlavors[0].name}_${releaseTime()}.apk" outputFileName = "qjLive_${variant.productFlavors[0].name}_v${variant.versionName}_${variant.buildType.name}_${releaseTime()}.apk"
} }
} }
...@@ -1677,7 +3702,7 @@ android { ...@@ -1677,7 +3702,7 @@ android {
} }
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
//support //support
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.material:material:1.2.1'
...@@ -1689,6 +3714,7 @@ dependencies { ...@@ -1689,6 +3714,7 @@ dependencies {
api project(':FlycoTabLayout_Lib') api project(':FlycoTabLayout_Lib')
api project(':baselibrary') api project(':baselibrary')
api project(':indexlib') api project(':indexlib')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'jp.wasabeef:glide-transformations:4.0.1' implementation 'jp.wasabeef:glide-transformations:4.0.1'
implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1' implementation 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
...@@ -1696,6 +3722,9 @@ dependencies { ...@@ -1696,6 +3722,9 @@ dependencies {
//七牛 //七牛
// implementation files('src\\lib\\pldroid-player-2.1.9.jar') // implementation files('src\\lib\\pldroid-player-2.1.9.jar')
implementation files('src\\lib\\core-3.3.0.jar') implementation files('src\\lib\\core-3.3.0.jar')
implementation files('src\\lib\\GDTActionSDK.min.1.8.2.aar')
implementation files('src\\lib\\monitorsdk-1.0.10.aar')
// implementation files('src\\lib\\humesdk-1.0.0.aar')
implementation library.flexbox implementation library.flexbox
implementation 'com.github.yhaolpz:FloatWindow:1.0.9' implementation 'com.github.yhaolpz:FloatWindow:1.0.9'
...@@ -1761,6 +3790,8 @@ dependencies { ...@@ -1761,6 +3790,8 @@ dependencies {
implementation 'com.github.lihangleo2:ShadowLayout:3.2.4' implementation 'com.github.lihangleo2:ShadowLayout:3.2.4'
implementation 'com.bytedance.applog:RangersAppLog-Lite-cn:5.3.0'
} }
repositories { repositories {
......
...@@ -428,6 +428,37 @@ ...@@ -428,6 +428,37 @@
# ==================gdt start===================
-dontwarn com.qq.gdt.action.**
-keep class com.qq.gdt.action.** {*;}
-keep public class com.tencent.turingfd.sdk.**
-keepclasseswithmembers class * {
native <methods>;
}
# ==================gdt end===================
# ==================gdt start===================
-keep class com.kwai.monitor.** {*;}
-keepclasseswithmembers class * {
native <methods>;
}
# ==================gdt end===================
# <<<<<<<<<<<<<<<----------2.第三方包----------<<<<<<<<<<<<<<< # <<<<<<<<<<<<<<<----------2.第三方包----------<<<<<<<<<<<<<<<
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application <application
android:name="com.hupu.tv.player.app.app.App" android:name="com.hupu.tv.player.app.app.App"
android:allowBackup="true" android:allowBackup="true"
android:configChanges="locale|layoutDirection" android:configChanges="locale|layoutDirection"
...@@ -55,6 +56,7 @@ ...@@ -55,6 +56,7 @@
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:sharedUserId="android.uid.system" android:sharedUserId="android.uid.system"
android:supportsRtl="true" android:supportsRtl="true"
android:extractNativeLibs="true"
tools:replace="android:label" tools:replace="android:label"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
......
...@@ -57,17 +57,17 @@ interface HostUrl { ...@@ -57,17 +57,17 @@ interface HostUrl {
/** /**
* 登录注册接口 * 登录注册接口
*/ */
const val POST_LOGIN_LIVE = "user/register" const val POST_LOGIN_LIVE = "V2/user/loginBySms"
/** /**
* 注册接口 * 注册接口
*/ */
const val USER_REGISTER = "user/registerByPc" const val USER_REGISTER = "V2/user/onlyRegister"
/** /**
* 密码登录 * 密码登录
*/ */
const val POST_LOGIN_PASSWORD = "user/loginByPc" const val POST_LOGIN_PASSWORD = "V1/user/loginByAccount"
/** /**
* 反馈 * 反馈
...@@ -578,6 +578,16 @@ interface HostUrl { ...@@ -578,6 +578,16 @@ interface HostUrl {
const val POST_GET_CHAT_HISTORY_MESSAGE = "room/getChatHistoryMessage" const val POST_GET_CHAT_HISTORY_MESSAGE = "room/getChatHistoryMessage"
/** /**
* 获取房间信息
*/
const val POST_GET_ROOM_BASE_INFO = "room/getRoomBasicsInfo"
/**
* 获取用户信息和聊天室信息
*/
const val POST_GET_ROOM_CHAT_INFO = "room/getRoomChatInfo"
/**
* 根据红榜 ID 获取详情 * 根据红榜 ID 获取详情
*/ */
const val POST_RED_DETAIL = "match/getHotRankInfoById" const val POST_RED_DETAIL = "match/getHotRankInfoById"
......
...@@ -150,6 +150,7 @@ public class LoggingInterceptor implements Interceptor { ...@@ -150,6 +150,7 @@ public class LoggingInterceptor implements Interceptor {
builder.addHeader(Constants.DEVICE_ID, (String) SPUtil.Companion.get(Constants.DEVICE_ID, "")); builder.addHeader(Constants.DEVICE_ID, (String) SPUtil.Companion.get(Constants.DEVICE_ID, ""));
builder.addHeader(Constants.TOKEN, (String) SPUtil.Companion.get(Constants.TOKEN, "")); builder.addHeader(Constants.TOKEN, (String) SPUtil.Companion.get(Constants.TOKEN, ""));
builder.addHeader(Constants.API_CHANNEL, String.valueOf( ProductFlavors.INSTANCE.getInt(ProductFlavors.API_CHANNEL))); builder.addHeader(Constants.API_CHANNEL, String.valueOf( ProductFlavors.INSTANCE.getInt(ProductFlavors.API_CHANNEL)));
builder.addHeader(Constants.UMENG_CHANGE_VALUE, ProductFlavors.INSTANCE.getString(ProductFlavors.UM_CHANNEL_ID));
builder.addHeader(Constants.APP_NAME, (String) ProductFlavors.INSTANCE.getString(ProductFlavors.APP_NAME_PY)); builder.addHeader(Constants.APP_NAME, (String) ProductFlavors.INSTANCE.getString(ProductFlavors.APP_NAME_PY));
builder.header("Connection","close").header("Accept-Encoding", "identity"); builder.header("Connection","close").header("Accept-Encoding", "identity");
request = builder.build(); request = builder.build();
......
...@@ -697,6 +697,18 @@ interface RetrofitService {/*@Field("is_new") int is_new*/ ...@@ -697,6 +697,18 @@ interface RetrofitService {/*@Field("is_new") int is_new*/
fun getHistoryMessage(@Body requestBody: RequestBody): Observable<BaseBean<List<HistoryMessageEntity>>> fun getHistoryMessage(@Body requestBody: RequestBody): Observable<BaseBean<List<HistoryMessageEntity>>>
/** /**
* 获取房间信息
*/
@POST(HostUrl.Companion.POST_GET_ROOM_BASE_INFO)
fun getRoomBaseInfo(@Body requestBody: RequestBody): Observable<BaseBean<RoomInfoEntity>>
/**
* 获取房间信息
*/
@POST(HostUrl.Companion.POST_GET_ROOM_CHAT_INFO)
fun getRoomChatInfo(@Body requestBody: RequestBody): Observable<BaseBean<RoomInfoEntity>>
/**
* 获取赛事列表 * 获取赛事列表
*/ */
@POST(HostUrl.Companion.POST_ROOM_RANK) @POST(HostUrl.Companion.POST_ROOM_RANK)
......
...@@ -7,15 +7,30 @@ import android.content.res.Configuration ...@@ -7,15 +7,30 @@ import android.content.res.Configuration
import android.widget.ImageView import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.multidex.MultiDex import androidx.multidex.MultiDex
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.LogUtils import com.blankj.utilcode.util.LogUtils
import com.bytedance.applog.AppLog
import com.bytedance.applog.ILogger
import com.bytedance.applog.InitConfig
import com.bytedance.applog.util.UriConstants
import com.hupu.tv.player.app.BuildConfig import com.hupu.tv.player.app.BuildConfig
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.ui.activity.SplashActivity
import com.hupu.tv.player.app.ui.im.ChatPresenter
import com.hupu.tv.player.app.ui.im.EaseChatRowDelegate
import com.hupu.tv.player.app.utils.*
import com.hupu.tv.player.app.utils.ProductFlavors.getInt
import com.hupu.tv.player.app.utils.VersionControl.initKuaishou
import com.hyphenate.chat.EMClient import com.hyphenate.chat.EMClient
import com.hyphenate.chat.EMOptions import com.hyphenate.chat.EMOptions
import com.hyphenate.easeui.EaseIM import com.hyphenate.easeui.EaseIM
import com.hyphenate.easeui.delegate.* import com.hyphenate.easeui.delegate.*
import com.hyphenate.easeui.manager.EaseMessageTypeSetManager import com.hyphenate.easeui.manager.EaseMessageTypeSetManager
import com.kongzue.dialog.util.DialogSettings import com.kongzue.dialog.util.DialogSettings
import com.kwai.monitor.log.TurboAgent
import com.kwai.monitor.log.TurboConfig
import com.qq.gdt.action.ChannelType
import com.qq.gdt.action.GDTAction
import com.qq.gdt.action.PrivateController
import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.cache.CacheFactory import com.shuyu.gsyvideoplayer.cache.CacheFactory
import com.shuyu.gsyvideoplayer.model.VideoOptionModel import com.shuyu.gsyvideoplayer.model.VideoOptionModel
...@@ -27,14 +42,6 @@ import com.softgarden.baselibrary.utils.SPUtil ...@@ -27,14 +42,6 @@ import com.softgarden.baselibrary.utils.SPUtil
import com.softgarden.baselibrary.utils.ScreenUtil import com.softgarden.baselibrary.utils.ScreenUtil
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure import com.umeng.commonsdk.UMConfigure
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.ui.activity.SplashActivity
import com.hupu.tv.player.app.ui.im.ChatPresenter
import com.hupu.tv.player.app.ui.im.EaseChatRowDelegate
import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.CrashHandler
import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.OKHttpUpdateHttpService
import com.xuexiang.xupdate.XUpdate import com.xuexiang.xupdate.XUpdate
import com.xuexiang.xupdate.entity.UpdateError.ERROR.CHECK_NO_NEW_VERSION import com.xuexiang.xupdate.entity.UpdateError.ERROR.CHECK_NO_NEW_VERSION
import com.yhao.floatwindow.FloatWindow import com.yhao.floatwindow.FloatWindow
...@@ -43,7 +50,6 @@ import com.yhao.floatwindow.Screen ...@@ -43,7 +50,6 @@ import com.yhao.floatwindow.Screen
import tv.danmaku.ijk.media.exo2.Exo2PlayerManager import tv.danmaku.ijk.media.exo2.Exo2PlayerManager
import tv.danmaku.ijk.media.exo2.ExoPlayerCacheManager import tv.danmaku.ijk.media.exo2.ExoPlayerCacheManager
import tv.danmaku.ijk.media.player.IjkMediaPlayer import tv.danmaku.ijk.media.player.IjkMediaPlayer
import java.util.logging.Handler
/** /**
...@@ -110,6 +116,83 @@ class App : BaseApplication() { ...@@ -110,6 +116,83 @@ class App : BaseApplication() {
initGsyPlayer() initGsyPlayer()
initIM() initIM()
initUmeng() initUmeng()
if (VersionControl.initGDTAction()) {
initGDT()
}
if (VersionControl.initRangers()) {
initRangers()
}
if (VersionControl.initKuaishou()){
initKuaishou()
}
}
private fun initKuaishou(){
TurboAgent.init(
TurboConfig.TurboConfigBuilder.create(this)
.setAppId("77815")
.setAppName("qiuju_02")
.setAppChannel("15")
.setEnableDebug(true)
.build())
// TurboAgent.onAppActive()
}
/**
* 头条上报
*/
private fun initRangers() {
/* 初始化开始 */
val config = InitConfig("373484", getInt(ProductFlavors.API_CHANNEL).toString()) // appid和渠道,appid须保证与广告后台申请记录一致,渠道可自定义,如有多个马甲包建议设置渠道号唯一标识一个马甲包。
//上报域名可根据业务情况自己设置上报域名,国内版本只支持上报到DEFAULT,海外GDRP版本只支持SINGAPORE、AMERICA
/* 国内: DEFAULT */config.setUriConfig(UriConstants.DEFAULT)
config.logger =
ILogger { msg: String?, t: Throwable? ->
LogUtils.dTag(
"Rangers",
msg,
t
)
} // 是否在控制台输出日志,可用于观察用户行为日志上报情况,建议仅在调试时使用
config.setEnablePlay(true) // 是否开启游戏模式,游戏APP建议设置为 true
config.isAbEnable = false // 是否开启A/B Test功能
config.setAutoStart(true)
AppLog.init(this, config)
/* 初始化结束 */
/* 自定义 “用户公共属性”(可选,初始化后调用, key相同会覆盖)
关于自定义 “用户公共属性” 请注意:1. 上报机制是随着每一次日志发送进行提交,默认的日志发送频率是1分钟,所以如果在一分钟内连续修改自定义用户公共属性,,按照日志发送前的最后一次修改为准, 2. 不推荐高频次修改,如每秒修改一次 */
// val headerMap: MutableMap<String, Any> = HashMap()
// headerMap["level"] = 8
// headerMap["gender"] = "female"
// AppLog.setHeaderInfo(headerMap as HashMap)
}
private fun initGDT() {
GDTAction.init(
this,
"1200616744",
"363510bd9be1a3ce4b58fbf65c4b36b4",
ChannelType.CHANNEL_TENCENT,
ProductFlavors.getInt(ProductFlavors.API_CHANNEL).toString()
)
GDTAction.setPrivateController(object : PrivateController() {
override fun isCanUsePhoneState(): Boolean {
return false;
}
override fun getDevImei(): String {
return DeviceUtils.getDeviceId(this@App)
}
})
} }
override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) {
...@@ -117,7 +200,7 @@ class App : BaseApplication() { ...@@ -117,7 +200,7 @@ class App : BaseApplication() {
LogUtils.e("onConfigurationChanged newConfig = $newConfig") LogUtils.e("onConfigurationChanged newConfig = $newConfig")
if (newConfig.orientation != oldOrientation) { if (newConfig.orientation != oldOrientation) {
oldOrientation = newConfig.orientation oldOrientation = newConfig.orientation
}else{ } else {
//更改了系统设置 ,比如 更改字体大小 设置语言等 //更改了系统设置 ,比如 更改字体大小 设置语言等
ActivityManager.instance.finishAll() ActivityManager.instance.finishAll()
val intent = Intent(this, SplashActivity::class.java) val intent = Intent(this, SplashActivity::class.java)
......
...@@ -51,6 +51,7 @@ object Constants { ...@@ -51,6 +51,7 @@ object Constants {
//API_CHANNEL //API_CHANNEL
const val API_CHANNEL = "api-channel" const val API_CHANNEL = "api-channel"
const val UMENG_CHANGE_VALUE = "umeng-channel-value"
//API_CHANNEL //API_CHANNEL
const val APP_NAME = "app_name" const val APP_NAME = "app_name"
...@@ -529,5 +530,8 @@ object Constants { ...@@ -529,5 +530,8 @@ object Constants {
const val MATCH_POSITION = "MATCH_POSITION" const val MATCH_POSITION = "MATCH_POSITION"
const val PUSH_SWITCH = "PUSH_SWITCH" const val PUSH_SWITCH = "PUSH_SWITCH"
const val HX_ID = "HX_ID"
const val CONVERSATION_ID = "CONVERSATION_ID"
} }
\ No newline at end of file
...@@ -10,10 +10,10 @@ data class RoomInfoEntity( ...@@ -10,10 +10,10 @@ data class RoomInfoEntity(
val anchorDesc: String, val anchorDesc: String,
val anchorId: String, val anchorId: String,
val anchorName: String, val anchorName: String,
val follow: Boolean, var follow: Boolean,
val follows: Int, val follows: Int,
val hotNum: Int, val hotNum: Int,
val huanXinUserId: String, var huanXinUserId: String,
val liveUrl: String, val liveUrl: String,
val matchId: String, val matchId: String,
val matchInfo: RoomMatchInfo, val matchInfo: RoomMatchInfo,
...@@ -26,10 +26,11 @@ data class RoomInfoEntity( ...@@ -26,10 +26,11 @@ data class RoomInfoEntity(
val roomName: String, val roomName: String,
val roomNum: String, val roomNum: String,
val roomStatus: Int, val roomStatus: Int,
val userGold: Int, var userGold: Int,
val userId: String, var userId: String,
val userLevel: Int, var userLevel: Int,
val userName: String, val sportsType: Int,
var userName: String,
val wxNum: String val wxNum: String
) )
......
...@@ -11,6 +11,7 @@ import com.hupu.tv.player.app.base.RefreshActivity ...@@ -11,6 +11,7 @@ import com.hupu.tv.player.app.base.RefreshActivity
import com.hupu.tv.player.app.ui.contact.AccountBindNewPhoneContact import com.hupu.tv.player.app.ui.contact.AccountBindNewPhoneContact
import com.hupu.tv.player.app.ui.presenter.AccountBindNewPhonePresenter import com.hupu.tv.player.app.ui.presenter.AccountBindNewPhonePresenter
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.UmengUtils
import kotlinx.android.synthetic.main.activity_account_bind_new_phone.* import kotlinx.android.synthetic.main.activity_account_bind_new_phone.*
import kotlinx.android.synthetic.main.layout_title.* import kotlinx.android.synthetic.main.layout_title.*
...@@ -60,7 +61,7 @@ class AccountBindNewPhoneActivity : RefreshActivity<AccountBindNewPhonePresenter ...@@ -60,7 +61,7 @@ class AccountBindNewPhoneActivity : RefreshActivity<AccountBindNewPhonePresenter
} }
override fun onBind() { override fun onBind() {
CommonUtils.umengLogin() UmengUtils.umengLogin()
ToastUtil.s("绑定成功") ToastUtil.s("绑定成功")
finish() finish()
} }
......
...@@ -36,10 +36,7 @@ import com.hupu.tv.player.app.event.ReportEvent ...@@ -36,10 +36,7 @@ import com.hupu.tv.player.app.event.ReportEvent
import com.hupu.tv.player.app.ui.contact.LiveActivityContact import com.hupu.tv.player.app.ui.contact.LiveActivityContact
import com.hupu.tv.player.app.ui.fragment.* import com.hupu.tv.player.app.ui.fragment.*
import com.hupu.tv.player.app.ui.presenter.LiveActivityPresenter import com.hupu.tv.player.app.ui.presenter.LiveActivityPresenter
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.*
import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.GlideUtils
import com.hupu.tv.player.app.utils.VersionControl
import com.hupu.tv.player.app.widget.danmuku.DanmakuVideoPlayer import com.hupu.tv.player.app.widget.danmuku.DanmakuVideoPlayer
import kotlinx.android.synthetic.main.activity_live.* import kotlinx.android.synthetic.main.activity_live.*
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
...@@ -71,9 +68,11 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -71,9 +68,11 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
private var roomNum = "" private var roomNum = ""
var historyList = arrayListOf<HistoryMessageEntity>() var historyList = arrayListOf<HistoryMessageEntity>()
override fun loadData() { override fun loadData() {
presenter?.getHistoryMessage(roomId) // presenter?.getHistoryMessage(roomId)
presenter?.getFakeMessage() // presenter?.getFakeMessage()
presenter?.getRoomInfo(roomId) // presenter?.getRoomInfo(roomId)
presenter?.getRoomBasicsInfo(roomId)
// presenter?.getRoomChatInfo(roomId)
} }
override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? { override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? {
...@@ -179,7 +178,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -179,7 +178,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
} }
// val url = "http://129.226.169.250/hszb/#/home" // val url = "http://129.226.169.250/hszb/#/home"
// val url = "http://jiaodudesign.cn/198197519-1-208.mp4" // val url = "http://jiaodudesign.cn/198197519-1-208.mp4"
// player.setUpLazy("http://bf.moonmagic.cn/live/102003.m3u8", false, null, null, title) // player.setUpLazy("https://pullsw.talentgether.com/live/60004971-1657633437621.flv", false, null, null, title)
player.setUpLazy(url, false, null, null, title) player.setUpLazy(url, false, null, null, title)
player.startPlayLogic() player.startPlayLogic()
...@@ -231,7 +230,8 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -231,7 +230,8 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
EMClient.getInstance().login(userName, "123456", object : EMCallBack { EMClient.getInstance().login(userName, "123456", object : EMCallBack {
override fun onSuccess() { override fun onSuccess() {
runOnUiThread { runOnUiThread {
addMessage("环信登录成功") CommonUtils.copy(userName)
addMessage("环信登录成功,用户id已经复制到剪切板")
initTabLayout() initTabLayout()
} }
} }
...@@ -242,6 +242,8 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -242,6 +242,8 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
override fun onError(code: Int, error: String?) { override fun onError(code: Int, error: String?) {
runOnUiThread { runOnUiThread {
if (code == 200) { if (code == 200) {
CommonUtils.copy(userName)
addMessage("环信登录成功,用户id已经复制到剪切板")
initTabLayout() initTabLayout()
} else { } else {
initTabLayout(false) initTabLayout(false)
...@@ -350,12 +352,14 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -350,12 +352,14 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
} }
override fun onRequestRoomInfo(bean: RoomInfoEntity?) { override fun onRequestRoomInfo(bean: RoomInfoEntity?) {
CommonUtils.umengJoinLive() UmengUtils.umengJoinLive()
sportType = bean?.matchInfo?.sportsType ?: 0 sportType = bean?.sportsType?: 0
matchId = bean?.matchId ?: "" matchId = bean?.matchId ?: ""
addMessage("请求房间信息成功 直播间 IM userId = ${bean?.huanXinUserId}") addMessage("请求房间信息成功 直播间 IM userId = ${bean?.huanXinUserId}")
bean?.let { bean?.let {
roomId = it.roomId
notice = it.roomAnnouncement notice = it.roomAnnouncement
notice2 = it.globalAnnouncement.orEmpty() notice2 = it.globalAnnouncement.orEmpty()
if (bean.follow) { if (bean.follow) {
...@@ -397,16 +401,16 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -397,16 +401,16 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
when { when {
wxNum.isNotEmpty() -> { wxNum.isNotEmpty() -> {
CommonUtils.copy(wxNum, getString(R.string.string_live_copy_success_wx)) CommonUtils.copy(wxNum, getString(R.string.string_live_copy_success_wx))
CommonUtils.umengCopyQQNumOrWxNum() UmengUtils.umengCopyQQNumOrWxNum()
} }
qqNum.isNotEmpty() -> { qqNum.isNotEmpty() -> {
CommonUtils.copy(qqNum, getString(R.string.string_live_copy_success_qq)) CommonUtils.copy(qqNum, getString(R.string.string_live_copy_success_qq))
CommonUtils.umengCopyQQNumOrWxNum() UmengUtils.umengCopyQQNumOrWxNum()
} }
qqGroupNum.isNotEmpty() -> { qqGroupNum.isNotEmpty() -> {
CommonUtils.copy(qqGroupNum, getString(R.string.string_live_copy_success_qq_group)) CommonUtils.copy(qqGroupNum, getString(R.string.string_live_copy_success_qq_group))
CommonUtils.umengCopyQQNumOrWxNum() UmengUtils.umengCopyQQNumOrWxNum()
} }
} }
} }
...@@ -424,7 +428,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta ...@@ -424,7 +428,7 @@ class LiveActivity : RefreshActivity<LiveActivityPresenter>(), LiveActivityConta
liveUserHxId = bean?.huanXinUserId.orEmpty() liveUserHxId = bean?.huanXinUserId.orEmpty()
roomNum = bean?.roomNum.orEmpty() roomNum = bean?.roomNum.orEmpty()
if (VersionControl.isShowLive()) { if (VersionControl.isShowLive()) {
initIm(bean?.huanXinUserId ?: "") initIm(liveUserHxId)
} else { } else {
initTabLayout(false) initTabLayout(false)
} }
......
...@@ -25,6 +25,7 @@ import com.hupu.tv.player.app.ui.contact.LoginActivityContact ...@@ -25,6 +25,7 @@ import com.hupu.tv.player.app.ui.contact.LoginActivityContact
import com.hupu.tv.player.app.ui.presenter.LoginActivityPresenter import com.hupu.tv.player.app.ui.presenter.LoginActivityPresenter
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.UmengUtils
import com.hupu.tv.player.app.utils.VersionControl import com.hupu.tv.player.app.utils.VersionControl
import com.quanmingxing.app.widget.widget.BiggerDotPasswordTransformationMethod import com.quanmingxing.app.widget.widget.BiggerDotPasswordTransformationMethod
import com.softgarden.baselibrary.base.BaseActivity import com.softgarden.baselibrary.base.BaseActivity
...@@ -48,7 +49,7 @@ class LoginActivity : RefreshActivity<LoginActivityPresenter>(), LoginActivityCo ...@@ -48,7 +49,7 @@ class LoginActivity : RefreshActivity<LoginActivityPresenter>(), LoginActivityCo
override fun onLoginRequest() { override fun onLoginRequest() {
intent.getBooleanExtra(Constants.FORCE_EXIT, false) intent.getBooleanExtra(Constants.FORCE_EXIT, false)
WaitDialog.dismiss() WaitDialog.dismiss()
CommonUtils.umengLogin() UmengUtils.umengLogin()
startActivity(MainActivity::class.java) startActivity(MainActivity::class.java)
finish() finish()
} }
......
...@@ -11,14 +11,6 @@ import androidx.fragment.app.Fragment ...@@ -11,14 +11,6 @@ import androidx.fragment.app.Fragment
import com.flyco.tablayout.CommonTabLayout import com.flyco.tablayout.CommonTabLayout
import com.flyco.tablayout.listener.CustomTabEntity import com.flyco.tablayout.listener.CustomTabEntity
import com.flyco.tablayout.listener.OnTabSelectListener import com.flyco.tablayout.listener.OnTabSelectListener
import com.kongzue.dialog.util.DialogSettings
import com.mirkowu.basetoolbar.BaseToolbar
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.softgarden.baselibrary.base.BaseFragment
import com.softgarden.baselibrary.base.FragmentBasePagerAdapter
import com.softgarden.baselibrary.utils.L
import com.softgarden.baselibrary.utils.SPUtil
import com.softgarden.baselibrary.utils.ToastUtil
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshActivity import com.hupu.tv.player.app.base.RefreshActivity
...@@ -30,10 +22,19 @@ import com.hupu.tv.player.app.event.UserExitEvent ...@@ -30,10 +22,19 @@ import com.hupu.tv.player.app.event.UserExitEvent
import com.hupu.tv.player.app.ui.fragment.* import com.hupu.tv.player.app.ui.fragment.*
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.GlideUtils import com.hupu.tv.player.app.utils.GlideUtils
import com.hupu.tv.player.app.utils.UmengUtils.umengOnKill
import com.hupu.tv.player.app.utils.UserHelper import com.hupu.tv.player.app.utils.UserHelper
import com.hupu.tv.player.app.utils.VersionControl import com.hupu.tv.player.app.utils.VersionControl
import com.kongzue.dialog.util.DialogSettings
import com.mirkowu.basetoolbar.BaseToolbar
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.softgarden.baselibrary.base.BaseFragment
import com.softgarden.baselibrary.base.FragmentBasePagerAdapter
import com.softgarden.baselibrary.base.IBaseDisplay import com.softgarden.baselibrary.base.IBaseDisplay
import com.softgarden.baselibrary.base.IBasePresenter import com.softgarden.baselibrary.base.IBasePresenter
import com.softgarden.baselibrary.utils.L
import com.softgarden.baselibrary.utils.SPUtil
import com.softgarden.baselibrary.utils.ToastUtil
import kotlinx.android.synthetic.main.activity_main2.* import kotlinx.android.synthetic.main.activity_main2.*
import me.jessyan.autosize.AutoSizeConfig import me.jessyan.autosize.AutoSizeConfig
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
...@@ -368,6 +369,7 @@ class MainActivity : RefreshActivity<IBasePresenter>(), IBaseDisplay { ...@@ -368,6 +369,7 @@ class MainActivity : RefreshActivity<IBasePresenter>(), IBaseDisplay {
ToastUtil.s("再按一次,退出应用!") ToastUtil.s("再按一次,退出应用!")
return true return true
} else { } else {
umengOnKill()
finish() // 退出 finish() // 退出
} }
return false return false
......
...@@ -98,16 +98,16 @@ class NewMatchDetailActivity : RefreshActivity<NewMatchDetailPresenter>(), ...@@ -98,16 +98,16 @@ class NewMatchDetailActivity : RefreshActivity<NewMatchDetailPresenter>(),
1 -> { 1 -> {
tv_status.background = getDrawable(R.drawable.shape_match_status_live) tv_status.background = getDrawable(R.drawable.shape_match_status_live)
tv_status.text = "直播中" tv_status.text = "直播中"
tv_status.setOnClickListener { // tv_status.setOnClickListener {
DialogUtils.showMatchLive( // DialogUtils.showMatchLive(
this, // this,
liveBeanList, // liveBeanList,
object : DialogUtils.OnClickTextListener { // object : DialogUtils.OnClickTextListener {
override fun onClick(text: String) { // override fun onClick(text: String) {
startActivity(CommonUtils.toWeb(text)) // startActivity(CommonUtils.toWeb(text))
} // }
}) // })
} // }
} }
3 -> { 3 -> {
tv_status.background = getDrawable(R.drawable.shape_match_status_end) tv_status.background = getDrawable(R.drawable.shape_match_status_end)
......
...@@ -18,6 +18,7 @@ import com.hupu.tv.player.app.ui.presenter.NickNameActivityPresenter ...@@ -18,6 +18,7 @@ import com.hupu.tv.player.app.ui.presenter.NickNameActivityPresenter
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.GlideEngine import com.hupu.tv.player.app.utils.GlideEngine
import com.hupu.tv.player.app.utils.GlideUtils import com.hupu.tv.player.app.utils.GlideUtils
import com.hupu.tv.player.app.utils.UmengUtils
import com.luck.picture.lib.PictureSelector import com.luck.picture.lib.PictureSelector
import com.luck.picture.lib.animators.AnimationType import com.luck.picture.lib.animators.AnimationType
import com.luck.picture.lib.config.PictureConfig import com.luck.picture.lib.config.PictureConfig
...@@ -42,7 +43,7 @@ class NickNameActivity : RefreshActivity<NickNameActivityPresenter>(), NickNameA ...@@ -42,7 +43,7 @@ class NickNameActivity : RefreshActivity<NickNameActivityPresenter>(), NickNameA
override fun onLoginRequest() { override fun onLoginRequest() {
CommonUtils.umengLogin() UmengUtils.umengLogin()
WaitDialog.dismiss() WaitDialog.dismiss()
hideProgressDialog() hideProgressDialog()
ToastUtil.s("登录成功") ToastUtil.s("登录成功")
......
...@@ -11,6 +11,7 @@ import android.text.style.ForegroundColorSpan ...@@ -11,6 +11,7 @@ import android.text.style.ForegroundColorSpan
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import cc.taylorzhang.singleclick.onSingleClick import cc.taylorzhang.singleclick.onSingleClick
import com.bytedance.applog.AppLog
import com.kongzue.dialog.v3.WaitDialog import com.kongzue.dialog.v3.WaitDialog
import com.mirkowu.basetoolbar.BaseToolbar import com.mirkowu.basetoolbar.BaseToolbar
import com.softgarden.baselibrary.utils.CheckUtil import com.softgarden.baselibrary.utils.CheckUtil
...@@ -23,6 +24,7 @@ import com.hupu.tv.player.app.ui.contact.RegisterActivityContact ...@@ -23,6 +24,7 @@ import com.hupu.tv.player.app.ui.contact.RegisterActivityContact
import com.hupu.tv.player.app.ui.presenter.RegisterActivityPresenter import com.hupu.tv.player.app.ui.presenter.RegisterActivityPresenter
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.UmengUtils
import com.hupu.tv.player.app.utils.VersionControl import com.hupu.tv.player.app.utils.VersionControl
import com.mirkowu.statusbarutil.StatusBarUtil import com.mirkowu.statusbarutil.StatusBarUtil
import com.quanmingxing.app.widget.widget.BiggerDotPasswordTransformationMethod import com.quanmingxing.app.widget.widget.BiggerDotPasswordTransformationMethod
...@@ -41,9 +43,11 @@ class RegisterActivity : RefreshActivity<RegisterActivityPresenter>(), ...@@ -41,9 +43,11 @@ class RegisterActivity : RefreshActivity<RegisterActivityPresenter>(),
override fun onRegister() { override fun onRegister() {
AppLog.onEvent("active_register")
UmengUtils.umengRegisterEvent()
// UmengUtils.umengLogin()
intent.getBooleanExtra(Constants.FORCE_EXIT, false) intent.getBooleanExtra(Constants.FORCE_EXIT, false)
WaitDialog.dismiss() WaitDialog.dismiss()
CommonUtils.umengLogin()
EventBus.getDefault().post(RegisterEvent()) EventBus.getDefault().post(RegisterEvent())
startActivity(MainActivity::class.java) startActivity(MainActivity::class.java)
finish() finish()
......
...@@ -6,6 +6,8 @@ import android.content.Intent ...@@ -6,6 +6,8 @@ import android.content.Intent
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
import com.blankj.utilcode.util.ScreenUtils
import com.bytedance.applog.AppLog
import com.hupu.tv.player.app.BuildConfig import com.hupu.tv.player.app.BuildConfig
import com.kongzue.dialog.util.BaseDialog import com.kongzue.dialog.util.BaseDialog
import com.kongzue.dialog.v3.CustomDialog import com.kongzue.dialog.v3.CustomDialog
...@@ -20,8 +22,13 @@ import com.hupu.tv.player.app.base.RefreshActivity ...@@ -20,8 +22,13 @@ import com.hupu.tv.player.app.base.RefreshActivity
import com.hupu.tv.player.app.ui.contact.SplashActivityContact import com.hupu.tv.player.app.ui.contact.SplashActivityContact
import com.hupu.tv.player.app.ui.presenter.SplashActivityPresenter import com.hupu.tv.player.app.ui.presenter.SplashActivityPresenter
import com.hupu.tv.player.app.utils.* import com.hupu.tv.player.app.utils.*
import com.hyphenate.easeui.utils.EaseCompat.openImage
import com.mirkowu.statusbarutil.StatusBarUtil import com.mirkowu.statusbarutil.StatusBarUtil
import com.qq.gdt.action.ActionType
import com.qq.gdt.action.GDTAction
import com.softgarden.baselibrary.base.BaseActivity import com.softgarden.baselibrary.base.BaseActivity
import com.softgarden.baselibrary.utils.RxPermissionsUtil
import com.softgarden.baselibrary.utils.ToastUtil
import kotlinx.android.synthetic.main.activity_splash.* import kotlinx.android.synthetic.main.activity_splash.*
...@@ -48,11 +55,41 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit ...@@ -48,11 +55,41 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit
if (SPUtil[Constants.IS_FIRST_OPEN, true] == true) { if (SPUtil[Constants.IS_FIRST_OPEN, true] == true) {
Log.e("mobclick","IS_FIRST_OPEN") Log.e("mobclick","IS_FIRST_OPEN")
SPUtil.put(Constants.IS_FIRST_OPEN,false) SPUtil.put(Constants.IS_FIRST_OPEN,false)
CommonUtils.umengFirstOpen() UmengUtils.umengFirstOpen()
if (VersionControl.initRangers()){
AppLog.onEvent("active")
}
presenter?.addDownNum() presenter?.addDownNum()
if (VersionControl.initGDTAction()){
RxPermissionsUtil.check(
this,
RxPermissionsUtil.STORAGE,
"提示",
object : RxPermissionsUtil.OnPermissionRequestListener {
override fun onSucceed() {
GDTAction.logAction(ActionType.START_APP)
GDTAction.setUserUniqueId(DeviceUtils.getDeviceId(this@SplashActivity))
goToRequest()
}
override fun onFailed() {
ToastUtil.s("存储权限未打开")
goToRequest()
// iv_show_ad.postDelayed({ finish() }, 3000)
}
})
}else{
goToRequest()
}
} }
goToRequest() goToRequest()
} }
private fun goToRequest() { private fun goToRequest() {
...@@ -63,7 +100,11 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit ...@@ -63,7 +100,11 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit
} }
override fun initialize() { override fun initialize() {
if (ScreenUtils.getScreenHeight() >1920){
iv_show_ad.setImageResource(R.mipmap.splash_bg_2)
}else{
iv_show_ad.setImageResource(R.mipmap.splash_bg_1)
}
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
// showLogDialog() // showLogDialog()
...@@ -103,9 +144,7 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit ...@@ -103,9 +144,7 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit
context.startActivity(starter) context.startActivity(starter)
} }
} }
override fun loadData() { override fun loadData() {
if (!(SPUtil[Constants.IS_AGREE, false] as Boolean)) { if (!(SPUtil[Constants.IS_AGREE, false] as Boolean)) {
DialogUtils.showPirvate(this, object : DialogUtils.OnClickListener { DialogUtils.showPirvate(this, object : DialogUtils.OnClickListener {
override fun onRightClick(view: View?) { override fun onRightClick(view: View?) {
...@@ -122,6 +161,7 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit ...@@ -122,6 +161,7 @@ class SplashActivity : RefreshActivity<SplashActivityPresenter>(), SplashActivit
requestPerMission() requestPerMission()
} }
} }
override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? { override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? {
......
...@@ -25,5 +25,7 @@ interface LiveActivityContact { ...@@ -25,5 +25,7 @@ interface LiveActivityContact {
fun unFollowAnchor(id:String) fun unFollowAnchor(id:String)
fun sendGift (giftId:Int,roomId:String,giftPosition:Int) fun sendGift (giftId:Int,roomId:String,giftPosition:Int)
fun getHistoryMessage(id:String) fun getHistoryMessage(id:String)
fun getRoomBasicsInfo(id:String)
} }
} }
\ No newline at end of file
...@@ -16,13 +16,18 @@ import android.widget.RelativeLayout; ...@@ -16,13 +16,18 @@ import android.widget.RelativeLayout;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.blankj.utilcode.util.CacheMemoryStaticUtils;
import com.blankj.utilcode.util.LogUtils;
import com.hupu.tv.player.app.bean.FakeMessageEntity; import com.hupu.tv.player.app.bean.FakeMessageEntity;
import com.hupu.tv.player.app.bean.HistoryMessageEntity;
import com.hupu.tv.player.app.ui.activity.LiveActivity; import com.hupu.tv.player.app.ui.activity.LiveActivity;
import com.hupu.tv.player.app.widget.customIm.CustomEaseChatMessageListLayout; import com.hupu.tv.player.app.widget.customIm.CustomEaseChatMessageListLayout;
import com.hyphenate.EMConnectionListener; import com.hyphenate.EMConnectionListener;
import com.hyphenate.EMError; import com.hyphenate.EMError;
import com.hyphenate.chat.EMClient; import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMMessage; import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMTextMessageBody;
import com.hyphenate.easeui.constants.EaseConstant;
import com.hyphenate.easeui.interfaces.EaseChatRoomListener; import com.hyphenate.easeui.interfaces.EaseChatRoomListener;
import com.hyphenate.easeui.modules.chat.EaseChatMessageListLayout; import com.hyphenate.easeui.modules.chat.EaseChatMessageListLayout;
import com.hyphenate.easeui.modules.chat.interfaces.OnRecallMessageResultListener; import com.hyphenate.easeui.modules.chat.interfaces.OnRecallMessageResultListener;
...@@ -35,7 +40,10 @@ import com.hupu.tv.player.app.R; ...@@ -35,7 +40,10 @@ import com.hupu.tv.player.app.R;
import com.hupu.tv.player.app.app.Constants; import com.hupu.tv.player.app.app.Constants;
import com.hupu.tv.player.app.bean.LiveUserBean; import com.hupu.tv.player.app.bean.LiveUserBean;
import com.hupu.tv.player.app.widget.danmuku.CustomChatPrimaryMenu; import com.hupu.tv.player.app.widget.danmuku.CustomChatPrimaryMenu;
import com.softgarden.baselibrary.utils.ToastUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Random; import java.util.Random;
...@@ -70,8 +78,9 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -70,8 +78,9 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
chatLayout.getChatInputMenu().setCustomPrimaryMenu(customChatPrimaryMenu); chatLayout.getChatInputMenu().setCustomPrimaryMenu(customChatPrimaryMenu);
clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
LiveConversationFragment parentFragment = (LiveConversationFragment) getParentFragment(); LiveConversationFragment parentFragment = (LiveConversationFragment) getParentFragment();
// CacheMemoryStaticUtils.put(Constants.HX_ID, userHxId);
customChatPrimaryMenu.setOnSendMessageListener(message -> parentFragment.sendDanmu(message, true)); // CacheMemoryStaticUtils.put(Constants.CONVERSATION_ID, getArguments().getString(EaseConstant.EXTRA_CONVERSATION_ID));
chatLayout.setOnSendMessageListener(message -> parentFragment.sendDanmu(message, true));
setShowChatPrimaryMenu(); setShowChatPrimaryMenu();
} }
...@@ -115,7 +124,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -115,7 +124,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
message.setAttribute(Constants.MESSAGE_USER_RID, liveUserBean.getId()); message.setAttribute(Constants.MESSAGE_USER_RID, liveUserBean.getId());
message.setAttribute(Constants.MESSAGE_USER_ID, userHxId); message.setAttribute(Constants.MESSAGE_USER_ID, userHxId);
message.setAttribute(Constants.USER_LEVEL, liveUserBean.getLevel()); message.setAttribute(Constants.USER_LEVEL, liveUserBean.getLevel());
message.setAttribute(Constants.ROOM_NUM,roomNum); message.setAttribute(Constants.ROOM_NUM, roomNum);
} }
} }
return super.addMsgAttrsBeforeSend(message); return super.addMsgAttrsBeforeSend(message);
...@@ -154,27 +163,28 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -154,27 +163,28 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
private void importHistory() { private void importHistory() {
LiveConversationFragment parentFragment = (LiveConversationFragment) getParentFragment(); LiveConversationFragment parentFragment = (LiveConversationFragment) getParentFragment();
LiveActivity activity = (LiveActivity) parentFragment.getActivity(); LiveActivity activity = (LiveActivity) parentFragment.getActivity();
if (activity != null) {
chatLayout.getChatMessageListLayout().setHistoryListData(activity.getHistoryList());
}
// if (activity != null) { // if (activity != null) {
// ArrayList<HistoryMessageEntity> historyList = activity.getHistoryList(); // chatLayout.getChatMessageListLayout().setHistoryListData(activity.getHistoryList());
// }
if (activity != null) {
ArrayList<HistoryMessageEntity> historyList = activity.getHistoryList();
// ArrayList<EMMessage> emMessages = new ArrayList<>(); // ArrayList<EMMessage> emMessages = new ArrayList<>();
// for (HistoryMessageEntity entity : historyList) { for (HistoryMessageEntity entity : historyList) {
// EMMessage msg = EMMessage.createReceiveMessage(EMMessage.Type.TXT); EMMessage msg = EMMessage.createReceiveMessage(EMMessage.Type.TXT);
// EMTextMessageBody body = new EMTextMessageBody(entity.getMsgContent()); EMTextMessageBody body = new EMTextMessageBody(entity.getMsgContent());
// msg.addBody(body); msg.addBody(body);
// msg.setTo(conversationId); msg.setTo(conversationId);
// msg.setFrom(entity.getSendUser()); msg.setFrom(entity.getSendUser());
// msg.setMsgTime(System.currentTimeMillis()); msg.setMsgTime(System.currentTimeMillis());
// msg.setAttribute(Constants.USER_NICK, entity.getSendUser()); msg.setAttribute(Constants.USER_NICK, entity.getSendUser());
// msg.setIsNeedGroupAck(false); msg.setIsNeedGroupAck(false);
// msg.setChatType(EMMessage.ChatType.ChatRoom); msg.setChatType(EMMessage.ChatType.ChatRoom);
EMClient.getInstance().chatManager().saveMessage(msg);
// emMessages.add(msg); // emMessages.add(msg);
// } }
// EMClient.getInstance().chatManager().importMessages(emMessages); // EMClient.getInstance().chatManager().importMessages(emMessages);
// } }
} }
@Override @Override
...@@ -192,7 +202,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -192,7 +202,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
} }
} }
public void sendMessage(String message){ public void sendMessage(String message) {
chatLayout.sendTextMessage(message); chatLayout.sendTextMessage(message);
} }
...@@ -227,6 +237,19 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -227,6 +237,19 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
@Override @Override
public void onChatError(int code, String errorMsg) { public void onChatError(int code, String errorMsg) {
//704 是因为被拉黑后所以 进不了房间
//215 是禁言
//602 是在房间里面 被拉黑,按理说应该是踢出房间
if (code == 215 || code == 602 || code == 704) {
customChatPrimaryMenu.setMute();
ToastUtil.Companion.s("您已被禁言,如有疑问请联系客服");
}
if (code == 215) {
chatLayout.getChatMessageListLayout().loadDefaultData();
}
if (infoListener != null) { if (infoListener != null) {
infoListener.onChatError(code, errorMsg); infoListener.onChatError(code, errorMsg);
} }
...@@ -404,9 +427,12 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -404,9 +427,12 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
@Override @Override
public void onRemovedFromChatRoom(int reason, String roomId, String roomName, String participant) { public void onRemovedFromChatRoom(int reason, String roomId, String roomName, String participant) {
if (!TextUtils.equals(roomId, conversationId)) { // if (!TextUtils.equals(roomId, conversationId)) {
return; //
} // return;
// }
//live_qzifk2uabmlekubmnrdev
LogUtils.dTag("blackMute", "onRemovedFromChatRoom: reason = " + reason + "roomId = " + roomId + "roomName = " + roomName + "participant = " + participant);
} }
...@@ -418,10 +444,20 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -418,10 +444,20 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
onMemberJoinListener.onMemberJoin(participant); onMemberJoinListener.onMemberJoin(participant);
} }
}
@Override
public void onMuteListAdded(String chatRoomId, List<String> mutes, long expireTime) {
super.onMuteListAdded(chatRoomId, mutes, expireTime);
//live_qzifk2uabmlekubmnrdev
LogUtils.dTag("blackMute", "onMuteListAdded: chatRoomId = " + chatRoomId + "mutes = " + mutes + "expireTime = " + expireTime);
} }
@Override @Override
public void onMemberExited(String roomId, String roomName, String participant) { public void onMemberExited(String roomId, String roomName, String participant) {
LogUtils.dTag("blackMute", "onMemberExited: roomId = " + roomId + "roomName = " + roomName + "participant = " + participant);
int i = 0; int i = 0;
} }
} }
......
...@@ -115,5 +115,37 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter { ...@@ -115,5 +115,37 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter {
}) })
} }
override fun getRoomBasicsInfo(id: String) {
RetrofitClient.retrofitService
.getRoomBaseInfo(JsonUtils.toRequestBody(HashMap<String, Any>().apply {
put("id", id)
}))
.compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<RoomInfoEntity>() {
override fun onSuccess(data: RoomInfoEntity?) {
getRoomChatInfo(id, data)
}
})
}
private fun getRoomChatInfo(id: String, previousData: RoomInfoEntity?) {
RetrofitClient.retrofitService
.getRoomChatInfo(JsonUtils.toRequestBody(HashMap<String, Any>().apply {
put("id", id)
}))
.compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<RoomInfoEntity>() {
override fun onSuccess(data: RoomInfoEntity?) {
previousData?.userId = data?.userId.orEmpty()
previousData?.userGold = data?.userGold ?: 0
previousData?.userName = data?.userName.orEmpty()
previousData?.userLevel = data?.userLevel ?: 1
previousData?.huanXinUserId = data?.huanXinUserId.orEmpty()
previousData?.follow = data?.follow ?: false
mView?.onRequestRoomInfo(previousData)
}
})
}
} }
\ No newline at end of file
...@@ -39,11 +39,11 @@ class LoginActivityPresenter : IBasePresenter, LoginActivityContact.Present { ...@@ -39,11 +39,11 @@ class LoginActivityPresenter : IBasePresenter, LoginActivityContact.Present {
override fun login(phone: String, nickName: String, smsCode: String, userAvatar: String) { override fun login(phone: String, nickName: String, smsCode: String, userAvatar: String) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID] // hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID]
hashMap["nickName"] = nickName // hashMap["nickName"] = nickName
hashMap["smsCode"] = smsCode hashMap["smsCode"] = smsCode
hashMap["phone"] = phone hashMap["phone"] = phone
hashMap["userAvatar"] = userAvatar // hashMap["userAvatar"] = userAvatar
mTvMessage?.text = mTvMessage?.text =
mTvMessage?.text.toString() + "\n" + "请求login地址${SPUtil[Constants.HOST_URL, HostUrl.HOST_URL] as String + HostUrl.POST_LOGIN}\n请求login参数$hashMap " mTvMessage?.text.toString() + "\n" + "请求login地址${SPUtil[Constants.HOST_URL, HostUrl.HOST_URL] as String + HostUrl.POST_LOGIN}\n请求login参数$hashMap "
RetrofitClient.retrofitService RetrofitClient.retrofitService
...@@ -79,7 +79,7 @@ class LoginActivityPresenter : IBasePresenter, LoginActivityContact.Present { ...@@ -79,7 +79,7 @@ class LoginActivityPresenter : IBasePresenter, LoginActivityContact.Present {
override fun loginPassword(phone: String, password: String) { override fun loginPassword(phone: String, password: String) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
// hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID] // hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID]
hashMap["phone"] = phone hashMap["account"] = phone
hashMap["password"] = password hashMap["password"] = password
mTvMessage?.text = mTvMessage?.text =
mTvMessage?.text.toString() + "\n" + "请求login地址${SPUtil[Constants.HOST_URL, HostUrl.HOST_URL] as String + HostUrl.POST_LOGIN}\n请求login参数$hashMap " mTvMessage?.text.toString() + "\n" + "请求login地址${SPUtil[Constants.HOST_URL, HostUrl.HOST_URL] as String + HostUrl.POST_LOGIN}\n请求login参数$hashMap "
......
...@@ -32,7 +32,7 @@ class RegisterActivityPresenter : IBasePresenter, RegisterActivityContact.Presen ...@@ -32,7 +32,7 @@ class RegisterActivityPresenter : IBasePresenter, RegisterActivityContact.Presen
override fun register(phone: String, nickName: String, smsCode: String, password: String, agentCode: String) { override fun register(phone: String, nickName: String, smsCode: String, password: String, agentCode: String) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID] // hashMap["channelId"] = SPUtil[Constants.CHANNEL_ID, BuildConfig.CHANNEL_ID]
hashMap["nickName"] = nickName hashMap["nickName"] = nickName
hashMap["smsCode"] = smsCode hashMap["smsCode"] = smsCode
hashMap["phone"] = phone hashMap["phone"] = phone
...@@ -43,7 +43,6 @@ class RegisterActivityPresenter : IBasePresenter, RegisterActivityContact.Presen ...@@ -43,7 +43,6 @@ class RegisterActivityPresenter : IBasePresenter, RegisterActivityContact.Presen
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
CommonUtils.umengRegisterEvent()
UserHelper.userLoginSaveToken(data) UserHelper.userLoginSaveToken(data)
getUserInfo(phone) getUserInfo(phone)
} }
......
...@@ -661,55 +661,4 @@ object CommonUtils { ...@@ -661,55 +661,4 @@ object CommonUtils {
return filePath return filePath
} }
fun umengLogin() {
val deviceId = SPUtil[Constants.DEVICE_ID, ""] as String
//当用户使用自有账号登录时,可以这样统计:
MobclickAgent.onEvent(App.instance, "onLogin")
MobclickAgent.onProfileSignIn(deviceId)
// MobclickAgent.onPageStart(Constants.UMENG_LOGIN)
//当用户使用第三方账号(如新浪微博)登录时,可以这样统计:
// MobclickAgent.onProfileSignIn("WB", "userID")
}
fun umengFirstOpen(){
MobclickAgent.onEvent(instance,"onFirsOpen")
}
fun umengJoinLive(){
MobclickAgent.onEvent(instance,"onOpenLIve")
}
fun umengRegisterEvent(){
MobclickAgent.onEvent(instance,"onRegisterEvent")
}
fun umengCopyQQNumOrWxNum(){
MobclickAgent.onEvent(instance,"onCopyQQNumOrWxNum")
}
fun umengLoginOut() {
//登出
Log.e("Umenglogin", "umengLoginOut")
MobclickAgent.onEvent(App.instance, "onLoginOut")
// MobclickAgent.onPageEnd(Constants.UMENG_LOGIN)
MobclickAgent.onProfileSignOff()
}
// fun getTestDeviceInfo(context: Context?): Array<String?>? {
// val deviceInfo = arrayOfNulls<String>(2)
// try {
// if (context != null) {
// deviceInfo[0] = UMConfigure.getDeviceIdForGeneral(context)
// deviceInfo[1] = DeviceConfig.getMac(context)
// Log.e("umeng","device=${deviceInfo[0]},mac = ${deviceInfo[1]}")
// }
// } catch (e: java.lang.Exception) {
// }
// return deviceInfo
// }
} }
\ No newline at end of file
...@@ -93,6 +93,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler { ...@@ -93,6 +93,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
mDefaultHandler.uncaughtException(thread, ex); mDefaultHandler.uncaughtException(thread, ex);
} else { } else {
try { try {
UmengUtils.INSTANCE.umengOnKill();
Thread.sleep(5000); Thread.sleep(5000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
L.INSTANCE.e("Error : " + e); L.INSTANCE.e("Error : " + e);
......
...@@ -31,7 +31,7 @@ public class DeviceUtils { ...@@ -31,7 +31,7 @@ public class DeviceUtils {
* @param context 上下文 * @param context 上下文
* @return 设备硬件标识 * @return 设备硬件标识
*/ */
public static String getDeviceId(Activity context) { public static String getDeviceId(Context context) {
StringBuilder sbDeviceId = new StringBuilder(); StringBuilder sbDeviceId = new StringBuilder();
//获得设备默认IMEI(>=6.0 需要ReadPhoneState权限) //获得设备默认IMEI(>=6.0 需要ReadPhoneState权限)
......
package com.hupu.tv.player.app.utils
import android.util.Log
import com.hupu.tv.player.app.app.App
import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.utils.ProductFlavors.getInt
import com.softgarden.baselibrary.utils.SPUtil
import com.umeng.analytics.MobclickAgent
/**
* @author by Dell
* @date on 2022/6/24
* @describe
*/
object UmengUtils {
fun umengLogin() {
val deviceId = SPUtil[Constants.DEVICE_ID, ""] as String
//当用户使用自有账号登录时,可以这样统计:
MobclickAgent.onEvent(App.instance, "onLoginChannel", getChannelId())
//ID:用户账号ID,长度小于64字节
//Provider:账号来源。如果用户通过第三方账号登陆,可以调用此接口进行统计。支持自定义,不能以下划线”_”开头,使用大写字母和数字标识,长度小于32 字节; 如果是上市公司,建议使用股票代码。
MobclickAgent.onProfileSignIn(getChannelId(),deviceId)
}
private fun getChannelId(): String = "channelId = ${getInt(ProductFlavors.API_CHANNEL)}"
fun umengFirstOpen() {
MobclickAgent.onEvent(App.instance, "onFirsOpenChannel", getChannelId())
}
fun umengJoinLive() {
MobclickAgent.onEvent(App.instance, "onOpenLiveChannel", getChannelId())
}
fun umengRegisterEvent() {
MobclickAgent.onEvent(App.instance, "onRegisterEventChannel", getChannelId())
}
fun umengCopyQQNumOrWxNum() {
MobclickAgent.onEvent(App.instance, "onCopyQQNumOrWxNumChannel", getChannelId())
}
fun umengLoginOut() {
//登出
Log.e("Umenglogin", "umengLoginOutChannel ${getChannelId()}")
MobclickAgent.onEvent(App.instance, "onLoginOutChannel", getChannelId())
// MobclickAgent.onPageEnd(Constants.UMENG_LOGIN)
MobclickAgent.onProfileSignOff()
}
fun umengOnKill() {
MobclickAgent.onKillProcess(App.instance)
}
}
\ No newline at end of file
package com.hupu.tv.player.app.utils package com.hupu.tv.player.app.utils
import android.util.Log
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.hupu.tv.player.app.app.App
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.LiveUserBean import com.hupu.tv.player.app.bean.LiveUserBean
import com.hupu.tv.player.app.bean.UserBean import com.hupu.tv.player.app.bean.UserBean
import com.hupu.tv.player.app.event.RefreshAvatarEvent import com.hupu.tv.player.app.event.RefreshAvatarEvent
import com.hupu.tv.player.app.event.RefreshUserEvent import com.hupu.tv.player.app.event.RefreshUserEvent
import com.hyphenate.chat.EMClient
import com.softgarden.baselibrary.utils.SPUtil import com.softgarden.baselibrary.utils.SPUtil
import com.umeng.analytics.MobclickAgent
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
/** /**
...@@ -39,10 +43,13 @@ object UserHelper { ...@@ -39,10 +43,13 @@ object UserHelper {
SPUtil.put(Constants.TOKEN, "") SPUtil.put(Constants.TOKEN, "")
SPUtil.put(Constants.USER_LOGIN, false) SPUtil.put(Constants.USER_LOGIN, false)
EventBus.getDefault().post(RefreshUserEvent()) EventBus.getDefault().post(RefreshUserEvent())
CommonUtils.umengLoginOut() UmengUtils.umengLoginOut()
EventBus.getDefault().post(RefreshAvatarEvent()) EventBus.getDefault().post(RefreshAvatarEvent())
EMClient.getInstance().logout(true)
} }
fun getUserBean():LiveUserBean?{ fun getUserBean():LiveUserBean?{
return SPUtil.getSerializableObject<LiveUserBean>(Constants.LIVE_USER_BEAN) return SPUtil.getSerializableObject<LiveUserBean>(Constants.LIVE_USER_BEAN)
} }
......
...@@ -14,6 +14,8 @@ object VersionControl { ...@@ -14,6 +14,8 @@ object VersionControl {
private const val OFFICIAL_1 = "qj_01" private const val OFFICIAL_1 = "qj_01"
private const val OFFICIAL_2 = "qj_02" private const val OFFICIAL_2 = "qj_02"
private const val OFFICIAL_3 = "qj_03" private const val OFFICIAL_3 = "qj_03"
private const val exe6 = "qj_exe6"
private const val exe11 = "qj_exe11"
private const val OFFICIAL_1001 = "qj_1001" private const val OFFICIAL_1001 = "qj_1001"
private const val OFFICIAL_1002 = "qj_1002" private const val OFFICIAL_1002 = "qj_1002"
private const val OFFICIAL_1003 = "qj_1003" private const val OFFICIAL_1003 = "qj_1003"
...@@ -23,6 +25,7 @@ object VersionControl { ...@@ -23,6 +25,7 @@ object VersionControl {
private const val OPPO = "qj_oppo_01" private const val OPPO = "qj_oppo_01"
private const val MEIZU = "qj_meizu" private const val MEIZU = "qj_meizu"
const val YINGYONGBAO = "qj_yingyongbao" const val YINGYONGBAO = "qj_yingyongbao"
const val MUBAOTOUTIAO = "qj_mubaotoutiao"
fun isShowLive(): Boolean { fun isShowLive(): Boolean {
...@@ -54,4 +57,16 @@ object VersionControl { ...@@ -54,4 +57,16 @@ object VersionControl {
fun getCurrentFlavor(): String { fun getCurrentFlavor(): String {
return BuildConfig.FLAVOR return BuildConfig.FLAVOR
} }
fun initGDTAction():Boolean{
return BuildConfig.FLAVOR == YINGYONGBAO || BuildConfig.FLAVOR == exe6
}
fun initRangers():Boolean{
return BuildConfig.FLAVOR == MUBAOTOUTIAO
}
fun initKuaishou():Boolean{
return BuildConfig.FLAVOR == exe11
}
} }
\ No newline at end of file
...@@ -214,6 +214,7 @@ public class CustomEaseChatInputMenu extends LinearLayout implements IChatInputM ...@@ -214,6 +214,7 @@ public class CustomEaseChatInputMenu extends LinearLayout implements IChatInputM
EMLog.i(TAG, "onSendBtnClicked content:"+content); EMLog.i(TAG, "onSendBtnClicked content:"+content);
if(menuListener != null) { if(menuListener != null) {
menuListener.onSendMessage(content); menuListener.onSendMessage(content);
hideSoftKeyboard();
} }
} }
......
...@@ -18,6 +18,7 @@ import android.widget.RelativeLayout; ...@@ -18,6 +18,7 @@ import android.widget.RelativeLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import com.blankj.utilcode.util.LogUtils;
import com.hupu.tv.player.app.R; import com.hupu.tv.player.app.R;
import com.hupu.tv.player.app.event.ReportEvent; import com.hupu.tv.player.app.event.ReportEvent;
import com.hupu.tv.player.app.widget.ICustomChatLayout; import com.hupu.tv.player.app.widget.ICustomChatLayout;
...@@ -28,6 +29,8 @@ import com.hyphenate.chat.EMClient; ...@@ -28,6 +29,8 @@ import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMCmdMessageBody; import com.hyphenate.chat.EMCmdMessageBody;
import com.hyphenate.chat.EMConversation; import com.hyphenate.chat.EMConversation;
import com.hyphenate.chat.EMMessage; import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMMessageBody;
import com.hyphenate.chat.EMTextMessageBody;
import com.hyphenate.chat.adapter.EMAChatRoomManagerListener; import com.hyphenate.chat.adapter.EMAChatRoomManagerListener;
import com.hyphenate.easeui.EaseIM; import com.hyphenate.easeui.EaseIM;
import com.hyphenate.easeui.constants.EaseConstant; import com.hyphenate.easeui.constants.EaseConstant;
...@@ -57,6 +60,7 @@ import com.hyphenate.easeui.widget.EaseAlertDialog; ...@@ -57,6 +60,7 @@ import com.hyphenate.easeui.widget.EaseAlertDialog;
import com.hyphenate.easeui.widget.EaseVoiceRecorderView; import com.hyphenate.easeui.widget.EaseVoiceRecorderView;
import com.hyphenate.exceptions.HyphenateException; import com.hyphenate.exceptions.HyphenateException;
import com.hyphenate.util.EMLog; import com.hyphenate.util.EMLog;
import com.softgarden.baselibrary.utils.ToastUtil;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
...@@ -105,7 +109,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -105,7 +109,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
* 用于监听发送语音的触摸事件 * 用于监听发送语音的触摸事件
*/ */
private OnChatRecordTouchListener recordTouchListener; private OnChatRecordTouchListener recordTouchListener;
private EaseHandleMessagePresenter presenter; private CustomEaseHandleMessagePresenter presenter;
/** /**
* 是否展示默认菜单 * 是否展示默认菜单
*/ */
...@@ -137,6 +141,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -137,6 +141,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
*/ */
private boolean isNotFirstSend; private boolean isNotFirstSend;
private OnSendMessageListener sendMessageListener;
public CustomEaseChatLayout(Context context) { public CustomEaseChatLayout(Context context) {
this(context, null); this(context, null);
} }
...@@ -147,8 +153,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -147,8 +153,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
public CustomEaseChatLayout(Context context, AttributeSet attrs, int defStyleAttr) { public CustomEaseChatLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
presenter = new EaseHandleMessagePresenterImpl(); presenter = new CustomEaseHandleMessagePresenterImpl();
if(context instanceof AppCompatActivity) { if (context instanceof AppCompatActivity) {
((AppCompatActivity) context).getLifecycle().addObserver(presenter); ((AppCompatActivity) context).getLifecycle().addObserver(presenter);
} }
LayoutInflater.from(context).inflate(R.layout.custom_ease_layout_chat, this); LayoutInflater.from(context).inflate(R.layout.custom_ease_layout_chat, this);
...@@ -178,6 +184,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -178,6 +184,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 初始化 * 初始化
*
* @param username 环信id * @param username 环信id
* @param chatType 聊天类型,单聊,群聊或者聊天室 * @param chatType 聊天类型,单聊,群聊或者聊天室
*/ */
...@@ -187,6 +194,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -187,6 +194,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 初始化 * 初始化
*
* @param loadDataType 加载数据模式 * @param loadDataType 加载数据模式
* @param conversationId 会话id,可能是对方环信id,也可能是群id或者聊天室id * @param conversationId 会话id,可能是对方环信id,也可能是群id或者聊天室id
* @param chatType 聊天类型,单聊,群聊或者聊天室 * @param chatType 聊天类型,单聊,群聊或者聊天室
...@@ -196,10 +204,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -196,10 +204,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
this.chatType = chatType; this.chatType = chatType;
messageListLayout.init(loadDataType, this.conversationId, chatType); messageListLayout.init(loadDataType, this.conversationId, chatType);
presenter.setupWithToUser(chatType, this.conversationId); presenter.setupWithToUser(chatType, this.conversationId);
if(isChatRoomCon()) { if (isChatRoomCon()) {
chatRoomListener = new ChatRoomListener(); chatRoomListener = new ChatRoomListener();
EMClient.getInstance().chatroomManager().addChatRoomChangeListener(chatRoomListener); EMClient.getInstance().chatroomManager().addChatRoomChangeListener(chatRoomListener);
}else if(isGroupCon()) { } else if (isGroupCon()) {
EaseAtMessageHelper.get().removeAtMeGroup(conversationId); EaseAtMessageHelper.get().removeAtMeGroup(conversationId);
groupListener = new GroupListener(); groupListener = new GroupListener();
EMClient.getInstance().groupManager().addGroupChangeListener(groupListener); EMClient.getInstance().groupManager().addGroupChangeListener(groupListener);
...@@ -209,6 +217,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -209,6 +217,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 初始化历史消息搜索模式 * 初始化历史消息搜索模式
*
* @param toChatUsername * @param toChatUsername
* @param chatType * @param chatType
*/ */
...@@ -236,10 +245,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -236,10 +245,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void handleMessage(@NonNull Message msg) { public void handleMessage(@NonNull Message msg) {
switch (msg.what) { switch (msg.what) {
case MSG_TYPING_HEARTBEAT : case MSG_TYPING_HEARTBEAT:
setTypingBeginMsg(this); setTypingBeginMsg(this);
break; break;
case MSG_TYPING_END : case MSG_TYPING_END:
setTypingEndMsg(this); setTypingEndMsg(this);
break; break;
case MSG_OTHER_TYPING_END: case MSG_OTHER_TYPING_END:
...@@ -248,8 +257,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -248,8 +257,8 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
} }
} }
}; };
if(!turnOnTyping) { if (!turnOnTyping) {
if(typingHandler != null) { if (typingHandler != null) {
typingHandler.removeCallbacksAndMessages(null); typingHandler.removeCallbacksAndMessages(null);
} }
} }
...@@ -262,9 +271,9 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -262,9 +271,9 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
* (2)如果是多端设备,另一端将会收到channel ack的回调,SDK内部将会把该会话置为已读。 * (2)如果是多端设备,另一端将会收到channel ack的回调,SDK内部将会把该会话置为已读。
*/ */
private void sendChannelAck() { private void sendChannelAck() {
if(EaseIM.getInstance().getConfigsManager().enableSendChannelAck()) { if (EaseIM.getInstance().getConfigsManager().enableSendChannelAck()) {
EMConversation conversation = EMClient.getInstance().chatManager().getConversation(conversationId); EMConversation conversation = EMClient.getInstance().chatManager().getConversation(conversationId);
if(conversation == null || conversation.getUnreadMsgCount() <= 0) { if (conversation == null || conversation.getUnreadMsgCount() <= 0) {
return; return;
} }
try { try {
...@@ -277,6 +286,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -277,6 +286,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 对方输入状态中止 * 对方输入状态中止
*
* @param handler * @param handler
*/ */
private void setOtherTypingEnd(Handler handler) { private void setOtherTypingEnd(Handler handler) {
...@@ -287,13 +297,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -287,13 +297,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
if (chatType != EaseConstant.CHATTYPE_SINGLE) if (chatType != EaseConstant.CHATTYPE_SINGLE)
return; return;
handler.removeMessages(MSG_OTHER_TYPING_END); handler.removeMessages(MSG_OTHER_TYPING_END);
if(listener != null) { if (listener != null) {
listener.onOtherTyping(ACTION_TYPING_END); listener.onOtherTyping(ACTION_TYPING_END);
} }
} }
/** /**
* 处理“正在输入”开始 * 处理“正在输入”开始
*
* @param handler * @param handler
*/ */
private void setTypingBeginMsg(Handler handler) { private void setTypingBeginMsg(Handler handler) {
...@@ -308,6 +319,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -308,6 +319,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 处理“正在输入”结束 * 处理“正在输入”结束
*
* @param handler * @param handler
*/ */
private void setTypingEndMsg(Handler handler) { private void setTypingEndMsg(Handler handler) {
...@@ -326,6 +338,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -326,6 +338,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 是否是聊天室 * 是否是聊天室
*
* @return * @return
*/ */
public boolean isChatRoomCon() { public boolean isChatRoomCon() {
...@@ -334,6 +347,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -334,6 +347,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 是否是群聊 * 是否是群聊
*
* @return * @return
*/ */
public boolean isGroupCon() { public boolean isGroupCon() {
...@@ -358,7 +372,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -358,7 +372,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void turnOnTypingMonitor(boolean turnOn) { public void turnOnTypingMonitor(boolean turnOn) {
this.turnOnTyping = turnOn; this.turnOnTyping = turnOn;
if(!turnOn) { if (!turnOn) {
isNotFirstSend = false; isNotFirstSend = false;
} }
} }
...@@ -468,6 +482,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -468,6 +482,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 发送逻辑:如果正在输入,第一次发送一条cmd消息,然后每隔10s发送一次; * 发送逻辑:如果正在输入,第一次发送一条cmd消息,然后每隔10s发送一次;
* 如果停止发送超过10s后,则状态需重置。 * 如果停止发送超过10s后,则状态需重置。
*
* @param s * @param s
* @param start * @param start
* @param before * @param before
...@@ -475,12 +490,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -475,12 +490,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
*/ */
@Override @Override
public void onTyping(CharSequence s, int start, int before, int count) { public void onTyping(CharSequence s, int start, int before, int count) {
if(listener != null) { if (listener != null) {
listener.onTextChanged(s, start, before, count); listener.onTextChanged(s, start, before, count);
} }
if(turnOnTyping) { if (turnOnTyping) {
if(typingHandler != null) { if (typingHandler != null) {
if(!isNotFirstSend) { if (!isNotFirstSend) {
isNotFirstSend = true; isNotFirstSend = true;
typingHandler.sendEmptyMessage(MSG_TYPING_HEARTBEAT); typingHandler.sendEmptyMessage(MSG_TYPING_HEARTBEAT);
} }
...@@ -497,14 +512,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -497,14 +512,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onExpressionClicked(Object emojicon) { public void onExpressionClicked(Object emojicon) {
if(emojicon instanceof EaseEmojicon) { if (emojicon instanceof EaseEmojicon) {
presenter.sendBigExpressionMessage(((EaseEmojicon) emojicon).getName(), ((EaseEmojicon) emojicon).getIdentityCode()); presenter.sendBigExpressionMessage(((EaseEmojicon) emojicon).getName(), ((EaseEmojicon) emojicon).getIdentityCode());
} }
} }
@Override @Override
public boolean onPressToSpeakBtnTouch(View v, MotionEvent event) { public boolean onPressToSpeakBtnTouch(View v, MotionEvent event) {
if(recordTouchListener != null && recordTouchListener.onRecordTouch(v, event)) { if (recordTouchListener != null && recordTouchListener.onRecordTouch(v, event)) {
return recordTouchListener.onRecordTouch(v, event); return recordTouchListener.onRecordTouch(v, event);
} }
return voiceRecorder.onPressToSpeakBtnTouch(v, event, (this::sendVoiceMessage)); return voiceRecorder.onPressToSpeakBtnTouch(v, event, (this::sendVoiceMessage));
...@@ -512,7 +527,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -512,7 +527,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onChatExtendMenuItemClick(int itemId, View view) { public void onChatExtendMenuItemClick(int itemId, View view) {
if(listener != null) { if (listener != null) {
listener.onChatExtendMenuItemClick(view, itemId); listener.onChatExtendMenuItemClick(view, itemId);
} }
} }
...@@ -540,24 +555,25 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -540,24 +555,25 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
refresh = true; refresh = true;
} }
} }
if(refresh) { if (refresh) {
getChatMessageListLayout().refreshToLatest(); getChatMessageListLayout().refreshToLatest();
} }
} }
/** /**
* 发送群组已读回执 * 发送群组已读回执
*
* @param message * @param message
*/ */
public void sendReadAck(EMMessage message) { public void sendReadAck(EMMessage message) {
if(EaseIM.getInstance().getConfigsManager().enableSendChannelAck()) { if (EaseIM.getInstance().getConfigsManager().enableSendChannelAck()) {
//是接收的消息,未发送过read ack消息且是单聊 //是接收的消息,未发送过read ack消息且是单聊
if(message.direct() == EMMessage.Direct.RECEIVE if (message.direct() == EMMessage.Direct.RECEIVE
&& !message.isAcked() && !message.isAcked()
&& message.getChatType() == EMMessage.ChatType.Chat) { && message.getChatType() == EMMessage.ChatType.Chat) {
EMMessage.Type type = message.getType(); EMMessage.Type type = message.getType();
//视频,语音及文件需要点击后再发送 //视频,语音及文件需要点击后再发送
if(type == EMMessage.Type.VIDEO || type == EMMessage.Type.VOICE || type == EMMessage.Type.FILE) { if (type == EMMessage.Type.VIDEO || type == EMMessage.Type.VOICE || type == EMMessage.Type.FILE) {
return; return;
} }
try { try {
...@@ -571,10 +587,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -571,10 +587,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 发送群组已读回执 * 发送群组已读回执
*
* @param message * @param message
*/ */
private void sendGroupReadAck(EMMessage message) { private void sendGroupReadAck(EMMessage message) {
if(message.isNeedGroupAck() && message.isUnread()) { if (message.isNeedGroupAck() && message.isUnread()) {
try { try {
EMClient.getInstance().chatManager().ackGroupMessageRead(message.getTo(), message.getMsgId(), ""); EMClient.getInstance().chatManager().ackGroupMessageRead(message.getTo(), message.getMsgId(), "");
} catch (HyphenateException e) { } catch (HyphenateException e) {
...@@ -586,6 +603,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -586,6 +603,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* 接收到正在输入动作的处理逻辑: * 接收到正在输入动作的处理逻辑:
* 如果接收到正在输入的消息,则开始计时,5s内如果没有接收到新的消息,则输入状态结束 * 如果接收到正在输入的消息,则开始计时,5s内如果没有接收到新的消息,则输入状态结束
*
* @param messages * @param messages
*/ */
@Override @Override
...@@ -595,11 +613,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -595,11 +613,11 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
final EMCmdMessageBody body = (EMCmdMessageBody) msg.getBody(); final EMCmdMessageBody body = (EMCmdMessageBody) msg.getBody();
EMLog.i(TAG, "Receive cmd message: " + body.action() + " - " + body.isDeliverOnlineOnly()); EMLog.i(TAG, "Receive cmd message: " + body.action() + " - " + body.isDeliverOnlineOnly());
EaseThreadManager.getInstance().runOnMainThread(() -> { EaseThreadManager.getInstance().runOnMainThread(() -> {
if(TextUtils.equals(msg.getFrom(), conversationId)) { if (TextUtils.equals(msg.getFrom(), conversationId)) {
if(listener != null) { if (listener != null) {
listener.onOtherTyping(body.action()); listener.onOtherTyping(body.action());
} }
if(typingHandler != null) { if (typingHandler != null) {
typingHandler.removeMessages(MSG_OTHER_TYPING_END); typingHandler.removeMessages(MSG_OTHER_TYPING_END);
typingHandler.sendEmptyMessageDelayed(MSG_OTHER_TYPING_END, OTHER_TYPING_SHOW_TIME); typingHandler.sendEmptyMessageDelayed(MSG_OTHER_TYPING_END, OTHER_TYPING_SHOW_TIME);
} }
...@@ -620,7 +638,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -620,7 +638,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onMessageRecalled(List<EMMessage> messages) { public void onMessageRecalled(List<EMMessage> messages) {
if(getChatMessageListLayout() != null) { if (getChatMessageListLayout() != null) {
getChatMessageListLayout().refreshMessages(); getChatMessageListLayout().refreshMessages();
} }
} }
...@@ -631,7 +649,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -631,7 +649,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
} }
private void refreshMessage(EMMessage message) { private void refreshMessage(EMMessage message) {
if(getChatMessageListLayout() != null) { if (getChatMessageListLayout() != null) {
getChatMessageListLayout().refreshMessage(message); getChatMessageListLayout().refreshMessage(message);
} }
} }
...@@ -649,7 +667,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -649,7 +667,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void createThumbFileFail(String message) { public void createThumbFileFail(String message) {
if(listener != null) { if (listener != null) {
listener.onChatError(-1, message); listener.onChatError(-1, message);
} }
} }
...@@ -657,21 +675,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -657,21 +675,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void addMsgAttrBeforeSend(EMMessage message) { public void addMsgAttrBeforeSend(EMMessage message) {
//发送消息前,添加消息属性,比如设置ext //发送消息前,添加消息属性,比如设置ext
if(sendMsgEvent != null && sendMsgEvent.addMsgAttrsBeforeSend(message)) { if (sendMsgEvent != null && sendMsgEvent.addMsgAttrsBeforeSend(message)) {
sendMsgEvent.addMsgAttrsBeforeSend(message); sendMsgEvent.addMsgAttrsBeforeSend(message);
} }
} }
@Override @Override
public void sendMessageFail(String message) { public void sendMessageFail(String message) {
if(listener != null) { if (listener != null) {
listener.onChatError(-1, message); listener.onChatError(-1, message);
} }
} }
@Override @Override
public void sendMessageFinish(EMMessage message) { public void sendMessageFinish(EMMessage message) {
if(getChatMessageListLayout() != null) { if (getChatMessageListLayout() != null) {
getChatMessageListLayout().refreshToLatest(); getChatMessageListLayout().refreshToLatest();
} }
} }
...@@ -683,7 +701,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -683,7 +701,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void recallMessageFinish(EMMessage message) { public void recallMessageFinish(EMMessage message) {
if(recallMessageListener != null) { if (recallMessageListener != null) {
recallMessageListener.recallSuccess(message); recallMessageListener.recallSuccess(message);
} }
messageListLayout.refreshMessages(); messageListLayout.refreshMessages();
...@@ -691,10 +709,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -691,10 +709,10 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void recallMessageFail(int code, String message) { public void recallMessageFail(int code, String message) {
if(recallMessageListener != null) { if (recallMessageListener != null) {
recallMessageListener.recallFail(code, message); recallMessageListener.recallFail(code, message);
} }
if(listener != null) { if (listener != null) {
listener.onChatError(code, message); listener.onChatError(code, message);
} }
} }
...@@ -713,7 +731,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -713,7 +731,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public boolean onBubbleClick(EMMessage message) { public boolean onBubbleClick(EMMessage message) {
if(listener != null) { if (listener != null) {
return listener.onBubbleClick(message); return listener.onBubbleClick(message);
} }
return false; return false;
...@@ -736,14 +754,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -736,14 +754,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public boolean onBubbleLongClick(View v, EMMessage message) { public boolean onBubbleLongClick(View v, EMMessage message) {
if(showDefaultMenu) { if (showDefaultMenu) {
showDefaultMenu(v, message); showDefaultMenu(v, message);
if(listener != null) { if (listener != null) {
return listener.onBubbleLongClick(v, message); return listener.onBubbleLongClick(v, message);
} }
return true; return true;
} }
if(listener != null) { if (listener != null) {
return listener.onBubbleLongClick(v, message); return listener.onBubbleLongClick(v, message);
} }
return false; return false;
...@@ -751,7 +769,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -751,7 +769,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onUserAvatarClick(String username) { public void onUserAvatarClick(String username) {
if(listener != null) { if (listener != null) {
listener.onUserAvatarClick(username); listener.onUserAvatarClick(username);
} }
} }
...@@ -760,7 +778,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -760,7 +778,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
public void onUserAvatarLongClick(String username) { public void onUserAvatarLongClick(String username) {
EMLog.i(TAG, "onUserAvatarLongClick"); EMLog.i(TAG, "onUserAvatarLongClick");
inputAtUsername(username, true); inputAtUsername(username, true);
if(listener != null) { if (listener != null) {
listener.onUserAvatarLongClick(username); listener.onUserAvatarLongClick(username);
} }
} }
...@@ -773,14 +791,30 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -773,14 +791,30 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
sendMessage(message); sendMessage(message);
} }
public void setOnSendMessageListener(OnSendMessageListener onSendMessageListener) {
sendMessageListener = onSendMessageListener;
}
@Override @Override
public void onMessageSuccess(EMMessage message) { public void onMessageSuccess(EMMessage message) {
//todo 消息状态的监听
EMLog.i(TAG, "send message onMessageSuccess"); EMLog.i(TAG, "send message onMessageSuccess");
if (sendMessageListener != null) {
EMTextMessageBody msg = (EMTextMessageBody) message.getBody();
if (!msg.getMessage().equals("进入直播间")) {
sendMessageListener.send(msg.getMessage());
}
}
} }
@Override @Override
public void onMessageError(EMMessage message, int code, String error) { public void onMessageError(EMMessage message, int code, String error) {
if(listener != null) { if (code == 215 || code == 602 || code == 704) {
EMClient.getInstance().chatManager().getConversation(conversationId).removeMessage(message.getMsgId());
}
if (listener != null) {
listener.onChatError(code, error); listener.onChatError(code, error);
} }
} }
...@@ -793,7 +827,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -793,7 +827,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onChatError(int code, String errorMsg) { public void onChatError(int code, String errorMsg) {
if(listener != null) { if (listener != null) {
listener.onChatError(code, errorMsg); listener.onChatError(code, errorMsg);
} }
} }
...@@ -841,20 +875,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -841,20 +875,21 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* input @ * input @
* only for group chat * only for group chat
*
* @param username * @param username
*/ */
public void inputAtUsername(String username, boolean autoAddAtSymbol){ public void inputAtUsername(String username, boolean autoAddAtSymbol) {
if(EMClient.getInstance().getCurrentUser().equals(username) || if (EMClient.getInstance().getCurrentUser().equals(username) ||
!messageListLayout.isGroupChat()){ !messageListLayout.isGroupChat()) {
return; return;
} }
EaseAtMessageHelper.get().addAtUser(username); EaseAtMessageHelper.get().addAtUser(username);
EaseUser user = EaseUserUtils.getUserInfo(username); EaseUser user = EaseUserUtils.getUserInfo(username);
if (user != null){ if (user != null) {
username = user.getNickname(); username = user.getNickname();
} }
EditText editText = inputMenu.getPrimaryMenu().getEditText(); EditText editText = inputMenu.getPrimaryMenu().getEditText();
if(autoAddAtSymbol) if (autoAddAtSymbol)
insertText(editText, AT_PREFIX + username + AT_SUFFIX); insertText(editText, AT_PREFIX + username + AT_SUFFIX);
else else
insertText(editText, username + AT_SUFFIX); insertText(editText, username + AT_SUFFIX);
...@@ -862,13 +897,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -862,13 +897,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
/** /**
* insert text to EditText * insert text to EditText
*
* @param edit * @param edit
* @param text * @param text
*/ */
private void insertText(EditText edit, String text) { private void insertText(EditText edit, String text) {
if(edit.isFocused()) { if (edit.isFocused()) {
edit.getText().insert(edit.getSelectionStart(), text); edit.getText().insert(edit.getSelectionStart(), text);
}else { } else {
edit.getText().insert(edit.getText().length() - 1, text); edit.getText().insert(edit.getText().length() - 1, text);
} }
} }
...@@ -881,14 +917,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -881,14 +917,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
menuHelper.addItemMenu(bean); menuHelper.addItemMenu(bean);
menuHelper.setOutsideTouchable(true); menuHelper.setOutsideTouchable(true);
setMenuByMsgType(message); setMenuByMsgType(message);
if(menuChangeListener != null) { if (menuChangeListener != null) {
menuChangeListener.onPreMenu(menuHelper, message); menuChangeListener.onPreMenu(menuHelper, message);
} }
menuHelper.setOnPopupMenuItemClickListener(item -> { menuHelper.setOnPopupMenuItemClickListener(item -> {
if(menuChangeListener != null && menuChangeListener.onMenuItemClick(item, message)) { if (menuChangeListener != null && menuChangeListener.onMenuItemClick(item, message)) {
return true; return true;
} }
if(showDefaultMenu) { if (showDefaultMenu) {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_ban_member) { if (itemId == R.id.action_ban_member) {
EventBus.getDefault().post(new ReportEvent()); EventBus.getDefault().post(new ReportEvent());
...@@ -908,7 +944,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -908,7 +944,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
return false; return false;
}); });
menuHelper.setOnPopupMenuDismissListener(menu -> { menuHelper.setOnPopupMenuDismissListener(menu -> {
if(menuChangeListener != null) { if (menuChangeListener != null) {
menuChangeListener.onDismiss(menu); menuChangeListener.onDismiss(menu);
} }
}); });
...@@ -943,7 +979,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -943,7 +979,7 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
break; break;
} }
if(message.direct() == EMMessage.Direct.RECEIVE ){ if (message.direct() == EMMessage.Direct.RECEIVE) {
menuHelper.findItemVisible(R.id.action_chat_recall, false); menuHelper.findItemVisible(R.id.action_chat_recall, false);
} }
} }
...@@ -957,12 +993,13 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -957,12 +993,13 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
@Override @Override
public void onRemovedFromChatRoom(int reason, String roomId, String roomName, String participant) { public void onRemovedFromChatRoom(int reason, String roomId, String roomName, String participant) {
if(!TextUtils.equals(roomId, conversationId)) { // if(!TextUtils.equals(roomId, conversationId)) {
return; // return;
} // }
if(reason == EMAChatRoomManagerListener.BE_KICKED) { // if(reason == EMAChatRoomManagerListener.BE_KICKED) {
finishCurrent(); // finishCurrent();
} // }
LogUtils.dTag("blackMute", "onRemovedFromChatRoom: reason = " + reason + "roomId = " + roomId + "roomName = " + roomName + "participant = " + participant);
} }
@Override @Override
...@@ -974,6 +1011,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -974,6 +1011,12 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
public void onMemberExited(String roomId, String roomName, String participant) { public void onMemberExited(String roomId, String roomName, String participant) {
} }
@Override
public void onMuteListAdded(String chatRoomId, List<String> mutes, long expireTime) {
super.onMuteListAdded(chatRoomId, mutes, expireTime);
LogUtils.dTag("blackMute", "onMuteListAdded: chatRoomId = " + chatRoomId + "mutes = " + mutes + "expireTime = " + expireTime);
}
} }
/** /**
...@@ -996,10 +1039,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL ...@@ -996,10 +1039,14 @@ public class CustomEaseChatLayout extends RelativeLayout implements ICustomChatL
* finish current activity * finish current activity
*/ */
private void finishCurrent() { private void finishCurrent() {
if(getContext() instanceof Activity) { if (getContext() instanceof Activity) {
((Activity) getContext()).finish(); ((Activity) getContext()).finish();
} }
} }
public interface OnSendMessageListener {
void send(String message);
}
} }
...@@ -5,6 +5,7 @@ import android.animation.ValueAnimator; ...@@ -5,6 +5,7 @@ import android.animation.ValueAnimator;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -22,6 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager; ...@@ -22,6 +23,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.blankj.utilcode.util.LogUtils;
import com.hupu.tv.player.app.R; import com.hupu.tv.player.app.R;
import com.hupu.tv.player.app.bean.FakeMessageEntity; import com.hupu.tv.player.app.bean.FakeMessageEntity;
import com.hupu.tv.player.app.bean.HistoryMessageEntity; import com.hupu.tv.player.app.bean.HistoryMessageEntity;
...@@ -54,7 +56,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -54,7 +56,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
private static final int DEFAULT_PAGE_SIZE = 10; private static final int DEFAULT_PAGE_SIZE = 10;
private static final String TAG = EaseChatMessageListLayout.class.getSimpleName(); private static final String TAG = CustomEaseChatMessageListLayout.class.getSimpleName();
private EaseChatMessagePresenter presenter; private EaseChatMessagePresenter presenter;
private EaseMessageAdapter messageAdapter; private EaseMessageAdapter messageAdapter;
private ConcatAdapter baseAdapter; private ConcatAdapter baseAdapter;
...@@ -68,7 +70,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -68,7 +70,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
private String msgId; private String msgId;
private int pageSize = DEFAULT_PAGE_SIZE; private int pageSize = DEFAULT_PAGE_SIZE;
private RecyclerView rvList; private RecyclerView rvList;
private NestedScrollView nestedScroll;
private SwipeRefreshLayout srlRefresh; private SwipeRefreshLayout srlRefresh;
private LinearLayoutManager layoutManager; private LinearLayoutManager layoutManager;
private EMConversation conversation; private EMConversation conversation;
...@@ -95,8 +96,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -95,8 +96,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
private MessageListItemClickListener messageListItemClickListener; private MessageListItemClickListener messageListItemClickListener;
private EaseChatItemStyleHelper chatSetHelper; private EaseChatItemStyleHelper chatSetHelper;
MessageHistoryAdapter messageHistoryAdapter;
public CustomEaseChatMessageListLayout(@NonNull Context context) { public CustomEaseChatMessageListLayout(@NonNull Context context) {
this(context, null); this(context, null);
} }
...@@ -107,7 +106,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -107,7 +106,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
public CustomEaseChatMessageListLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { public CustomEaseChatMessageListLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
LayoutInflater.from(context).inflate(R.layout.custom_ease_chat_message_list, this); LayoutInflater.from(context).inflate(R.layout.new_custom_ease_chat_message_list, this);
EaseChatItemStyleHelper.getInstance().clear(); EaseChatItemStyleHelper.getInstance().clear();
chatSetHelper = EaseChatItemStyleHelper.getInstance(); chatSetHelper = EaseChatItemStyleHelper.getInstance();
presenter = new EaseChatMessagePresenterImpl(); presenter = new EaseChatMessagePresenterImpl();
...@@ -186,36 +185,10 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -186,36 +185,10 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
rvList = findViewById(R.id.message_list); rvList = findViewById(R.id.message_list);
srlRefresh = findViewById(R.id.srl_refresh); srlRefresh = findViewById(R.id.srl_refresh);
nestedScroll = findViewById(R.id.nestedScroll);
RecyclerView recyclerView = findViewById(R.id.top_message);
messageHistoryAdapter = new MessageHistoryAdapter();
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()) {
@Override
public boolean canScrollVertically() {
return false;
}
@Override
public boolean canScrollHorizontally() {
return false;
}
});
recyclerView.setAdapter(messageHistoryAdapter);
srlRefresh.setEnabled(canUseRefresh); srlRefresh.setEnabled(canUseRefresh);
layoutManager = new LinearLayoutManager(getContext()) { layoutManager = new LinearLayoutManager(getContext());
@Override
public boolean canScrollVertically() {
return false;
}
@Override
public boolean canScrollHorizontally() {
return false;
}
};
rvList.setLayoutManager(layoutManager); rvList.setLayoutManager(layoutManager);
...@@ -229,11 +202,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -229,11 +202,6 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
initListener(); initListener();
} }
public void setHistoryListData(List<HistoryMessageEntity> list) {
messageHistoryAdapter.setNewData(list);
}
public void setOnJoinRoomListener(OnJoinRoomListener onJoinRoomListener) { public void setOnJoinRoomListener(OnJoinRoomListener onJoinRoomListener) {
this.onJoinRoomListener = onJoinRoomListener; this.onJoinRoomListener = onJoinRoomListener;
} }
...@@ -341,6 +309,14 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -341,6 +309,14 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
*/ */
public void loadMorePreviousData() { public void loadMorePreviousData() {
String msgId = getListFirstMessageId(); String msgId = getListFirstMessageId();
if (msgId == null){
srlRefresh.setRefreshing(false);
return;
}
if (!isMessageId(msgId)){
srlRefresh.setRefreshing(false);
return;
}
if (loadDataType == EaseChatMessageListLayout.LoadDataType.ROAM) { if (loadDataType == EaseChatMessageListLayout.LoadDataType.ROAM) {
presenter.loadMoreServerMessages(msgId, pageSize); presenter.loadMoreServerMessages(msgId, pageSize);
} else if (loadDataType == EaseChatMessageListLayout.LoadDataType.HISTORY) { } else if (loadDataType == EaseChatMessageListLayout.LoadDataType.HISTORY) {
...@@ -350,6 +326,15 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -350,6 +326,15 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
} }
} }
public boolean isMessageId(String msgId) {
if(TextUtils.isEmpty(msgId)) {
//可以允许消息id为空
return true;
}
EMMessage message = conversation.getMessage(msgId, false);
return message != null;
}
/** /**
* 专用于加载更多的更新一些的数据,上拉加载更多时使用 * 专用于加载更多的更新一些的数据,上拉加载更多时使用
*/ */
...@@ -410,43 +395,31 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -410,43 +395,31 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
loadMorePreviousData(); loadMorePreviousData();
} }
}); });
nestedScroll.setOnScrollChangeListener(new OnScrollChangeListener() {
rvList.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override @Override
public void onScrollChange(View view, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
//滑动到底部 super.onScrollStateChanged(recyclerView, newState);
if(scrollY == nestedScroll.getChildAt(0).getMeasuredHeight()- nestedScroll.getMeasuredHeight()){ if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//判断状态及是否还有更多数据
if (loadDataType == EaseChatMessageListLayout.LoadDataType.HISTORY if (loadDataType == EaseChatMessageListLayout.LoadDataType.HISTORY
&& loadMoreStatus == EaseChatMessageListLayout.LoadMoreStatus.HAS_MORE){ && loadMoreStatus == EaseChatMessageListLayout.LoadMoreStatus.HAS_MORE
&& layoutManager.findLastVisibleItemPosition() != 0
&& layoutManager.findLastVisibleItemPosition() == layoutManager.getItemCount() - 1) {
//加载更多 //加载更多
loadMoreHistoryData(); loadMoreHistoryData();
} }
} else {
//if recyclerView not idle should hide keyboard
if (messageTouchListener != null) {
messageTouchListener.onViewDragging();
}
} }
} }
}); });
// nestedScroll.addOnScrollListener(new RecyclerView.OnScrollListener() {
// @Override
// public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
// super.onScrollStateChanged(recyclerView, newState);
// if (newState == RecyclerView.SCROLL_STATE_IDLE) {
// //判断状态及是否还有更多数据
// if (loadDataType == EaseChatMessageListLayout.LoadDataType.HISTORY
// && loadMoreStatus == EaseChatMessageListLayout.LoadMoreStatus.HAS_MORE
// && layoutManager.findLastVisibleItemPosition() != 0
// && layoutManager.findLastVisibleItemPosition() == layoutManager.getItemCount() - 1) {
// //加载更多
// loadMoreHistoryData();
// }
// } else {
// //if recyclerView not idle should hide keyboard
// if (messageTouchListener != null) {
// messageTouchListener.onViewDragging();
// }
// }
// }
// });
//用于监听RecyclerView高度的变化,从而刷新列表 //用于监听RecyclerView高度的变化,从而刷新列表
nestedScroll.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { rvList.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override @Override
public void onGlobalLayout() { public void onGlobalLayout() {
int height = rvList.getHeight(); int height = rvList.getHeight();
...@@ -659,7 +632,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -659,7 +632,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
public void refreshCurrentConSuccess(List<EMMessage> data, boolean toLatest) { public void refreshCurrentConSuccess(List<EMMessage> data, boolean toLatest) {
Log.e("CustomIm", "refreshCurrentConSuccess"); Log.e("CustomIm", "refreshCurrentConSuccess");
messageAdapter.setData(data); messageAdapter.setData(data);
LogUtils.d("CustomIm","data = "+data.toString());
if (toLatest) { if (toLatest) {
seekToPosition(data.size() - 1); seekToPosition(data.size() - 1);
} }
...@@ -871,7 +844,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -871,7 +844,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
((LinearLayoutManager) manager).scrollToPositionWithOffset(position, 0); ((LinearLayoutManager) manager).scrollToPositionWithOffset(position, 0);
} }
nestedScroll.post(() -> nestedScroll.fullScroll(View.FOCUS_DOWN)); // nestedScroll.post(() -> nestedScroll.fullScroll(View.FOCUS_DOWN));
} }
/** /**
......
package com.hupu.tv.player.app.widget.customIm;
import android.net.Uri;
import androidx.annotation.NonNull;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMConversation;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.easeui.constants.EaseConstant;
import com.hyphenate.easeui.modules.EaseBasePresenter;
import com.hyphenate.easeui.modules.ILoadDataView;
import com.hyphenate.easeui.modules.chat.presenter.IHandleMessageView;
import com.hyphenate.easeui.utils.EaseCommonUtils;
public abstract class CustomEaseHandleMessagePresenter extends EaseBasePresenter {
protected IHandleMessageView mView;
protected int chatType;
protected String toChatUsername;
protected EMConversation conversation;
@Override
public void attachView(ILoadDataView view) {
mView = (IHandleMessageView) view;
}
@Override
public void detachView() {
mView = null;
}
@Override
public void onDestroy() {
super.onDestroy();
detachView();
}
/**
* 绑定发送方id
* @param chatType
* @param toChatUsername
*/
public void setupWithToUser(int chatType, @NonNull String toChatUsername) {
this.chatType = chatType;
this.toChatUsername = toChatUsername;
conversation = EMClient.getInstance().chatManager().getConversation(toChatUsername, EaseCommonUtils.getConversationType(chatType), true);
}
/**
* 发送文本消息
* @param content
*/
public abstract void sendTextMessage(String content);
/**
* 发送文本消息
* @param content
* @param isNeedGroupAck 需要需要群回执
*/
public abstract void sendTextMessage(String content, boolean isNeedGroupAck);
/**
* 发送@消息
* @param content
*/
public abstract void sendAtMessage(String content);
/**
* 发送大表情消息
* @param name
* @param identityCode
*/
public abstract void sendBigExpressionMessage(String name, String identityCode);
/**
* 发送语音消息
* @param filePath
* @param length
*/
public abstract void sendVoiceMessage(Uri filePath, int length);
/**
* 发送图片消息
* @param imageUri
*/
public abstract void sendImageMessage(Uri imageUri);
/**
* 发送图片消息
* @param imageUri
* @param sendOriginalImage
*/
public abstract void sendImageMessage(Uri imageUri, boolean sendOriginalImage);
/**
* 发送定位消息
* @param latitude
* @param longitude
* @param locationAddress
*/
public abstract void sendLocationMessage(double latitude, double longitude, String locationAddress);
/**
* 发送视频消息
* @param videoUri
* @param videoLength
*/
public abstract void sendVideoMessage(Uri videoUri, int videoLength);
/**
* 发送文件消息
* @param fileUri
*/
public abstract void sendFileMessage(Uri fileUri);
/**
* 为消息添加扩展字段
* @param message
*/
public abstract void addMessageAttributes(EMMessage message);
/**
* 发送消息
* @param message
*/
public abstract void sendMessage(EMMessage message);
/**
* 发送cmd消息
* @param action
*/
public abstract void sendCmdMessage(String action);
/**
* 重新发送消息
* @param message
*/
public abstract void resendMessage(EMMessage message);
/**
* 删除消息
* @param message
*/
public abstract void deleteMessage(EMMessage message);
/**
* 撤回消息
* @param message
*/
public abstract void recallMessage(EMMessage message);
/**
* 是否是群聊
* @return
*/
public boolean isGroupChat() {
return chatType == EaseConstant.CHATTYPE_GROUP;
}
}
package com.hupu.tv.player.app.widget.customIm;
import android.graphics.Bitmap;
import android.media.MediaMetadataRetriever;
import android.media.ThumbnailUtils;
import android.net.Uri;
import android.text.TextUtils;
import com.blankj.utilcode.util.LogUtils;
import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMCmdMessageBody;
import com.hyphenate.chat.EMGroup;
import com.hyphenate.chat.EMMessage;
import com.hyphenate.chat.EMMessageBody;
import com.hyphenate.chat.EMTextMessageBody;
import com.hyphenate.easeui.R;
import com.hyphenate.easeui.constants.EaseConstant;
import com.hyphenate.easeui.interfaces.EaseMessageCallback;
import com.hyphenate.easeui.manager.EaseAtMessageHelper;
import com.hyphenate.easeui.modules.chat.EaseChatLayout;
import com.hyphenate.easeui.utils.EaseCommonUtils;
import com.hyphenate.exceptions.HyphenateException;
import com.hyphenate.util.EMLog;
import com.hyphenate.util.PathUtil;
import com.hyphenate.util.UriUtils;
import com.softgarden.baselibrary.utils.ToastUtil;
import java.io.File;
import java.io.FileOutputStream;
public class CustomEaseHandleMessagePresenterImpl extends CustomEaseHandleMessagePresenter {
private static final String TAG = EaseChatLayout.class.getSimpleName();
@Override
public void sendTextMessage(String content) {
sendTextMessage(content, false);
}
@Override
public void sendTextMessage(String content, boolean isNeedGroupAck) {
if (EaseAtMessageHelper.get().containsAtUsername(content)) {
sendAtMessage(content);
return;
}
EMMessage message = EMMessage.createTxtSendMessage(content, toChatUsername);
message.setIsNeedGroupAck(isNeedGroupAck);
sendMessage(message);
}
@Override
public void sendAtMessage(String content) {
if (!isGroupChat()) {
EMLog.e(TAG, "only support group chat message");
if (isActive()) {
runOnUI(() -> mView.sendMessageFail("only support group chat message"));
}
return;
}
EMMessage message = EMMessage.createTxtSendMessage(content, toChatUsername);
EMGroup group = EMClient.getInstance().groupManager().getGroup(toChatUsername);
if (EMClient.getInstance().getCurrentUser().equals(group.getOwner()) && EaseAtMessageHelper.get().containsAtAll(content)) {
message.setAttribute(EaseConstant.MESSAGE_ATTR_AT_MSG, EaseConstant.MESSAGE_ATTR_VALUE_AT_MSG_ALL);
} else {
message.setAttribute(EaseConstant.MESSAGE_ATTR_AT_MSG,
EaseAtMessageHelper.get().atListToJsonArray(EaseAtMessageHelper.get().getAtMessageUsernames(content)));
}
sendMessage(message);
}
@Override
public void sendBigExpressionMessage(String name, String identityCode) {
EMMessage message = EaseCommonUtils.createExpressionMessage(toChatUsername, name, identityCode);
sendMessage(message);
}
@Override
public void sendVoiceMessage(Uri filePath, int length) {
EMMessage message = EMMessage.createVoiceSendMessage(filePath, length, toChatUsername);
sendMessage(message);
}
@Override
public void sendImageMessage(Uri imageUri) {
sendImageMessage(imageUri, false);
}
@Override
public void sendImageMessage(Uri imageUri, boolean sendOriginalImage) {
EMMessage message = EMMessage.createImageSendMessage(imageUri, sendOriginalImage, toChatUsername);
sendMessage(message);
}
@Override
public void sendLocationMessage(double latitude, double longitude, String locationAddress) {
EMMessage message = EMMessage.createLocationSendMessage(latitude, longitude, locationAddress, toChatUsername);
EMLog.i(TAG, "current = " + EMClient.getInstance().getCurrentUser() + " to = " + toChatUsername);
EMMessageBody body = message.getBody();
String msgId = message.getMsgId();
String from = message.getFrom();
EMLog.i(TAG, "body = " + body);
EMLog.i(TAG, "msgId = " + msgId + " from = " + from);
sendMessage(message);
}
@Override
public void sendVideoMessage(Uri videoUri, int videoLength) {
String thumbPath = getThumbPath(videoUri);
EMMessage message = EMMessage.createVideoSendMessage(videoUri, thumbPath, videoLength, toChatUsername);
sendMessage(message);
}
@Override
public void sendFileMessage(Uri fileUri) {
EMMessage message = EMMessage.createFileSendMessage(fileUri, toChatUsername);
sendMessage(message);
}
@Override
public void addMessageAttributes(EMMessage message) {
//可以添加一些自定义属性
mView.addMsgAttrBeforeSend(message);
}
@Override
public void sendMessage(EMMessage message) {
if (message == null) {
if (isActive()) {
runOnUI(() -> mView.sendMessageFail("message is null!"));
}
return;
}
addMessageAttributes(message);
if (chatType == EaseConstant.CHATTYPE_GROUP) {
message.setChatType(EMMessage.ChatType.GroupChat);
} else if (chatType == EaseConstant.CHATTYPE_CHATROOM) {
message.setChatType(EMMessage.ChatType.ChatRoom);
}
// send message
message.setMessageStatusCallback(new EaseMessageCallback() {
@Override
public void onSuccess(EMMessage message, int position) {
LogUtils.dTag("EaseMessageCallback", "onSuccess");
}
@Override
public void onError(int code, String error) {
LogUtils.dTag("EaseMessageCallback", "onError : code = " + code + "error = " + error);
super.onError(code, error);
}
});
EMClient.getInstance().chatManager().sendMessage(message);
if (isActive()) {
runOnUI(() -> mView.sendMessageFinish(message));
}
}
@Override
public void sendCmdMessage(String action) {
EMMessage beginMsg = EMMessage.createSendMessage(EMMessage.Type.CMD);
EMCmdMessageBody body = new EMCmdMessageBody(action);
// Only deliver this cmd msg to online users
body.deliverOnlineOnly(true);
beginMsg.addBody(body);
beginMsg.setTo(toChatUsername);
EMClient.getInstance().chatManager().sendMessage(beginMsg);
}
@Override
public void resendMessage(EMMessage message) {
message.setStatus(EMMessage.Status.CREATE);
sendMessage(message);
}
@Override
public void deleteMessage(EMMessage message) {
conversation.removeMessage(message.getMsgId());
if (isActive()) {
runOnUI(() -> mView.deleteLocalMessageSuccess(message));
}
}
@Override
public void recallMessage(EMMessage message) {
try {
EMMessage msgNotification = EMMessage.createSendMessage(EMMessage.Type.TXT);
EMTextMessageBody txtBody = new EMTextMessageBody(mView.context().getResources().getString(R.string.msg_recall_by_self));
msgNotification.addBody(txtBody);
msgNotification.setTo(message.getTo());
msgNotification.setMsgTime(message.getMsgTime());
msgNotification.setLocalTime(message.getMsgTime());
msgNotification.setAttribute(EaseConstant.MESSAGE_TYPE_RECALL, true);
msgNotification.setStatus(EMMessage.Status.SUCCESS);
EMClient.getInstance().chatManager().recallMessage(message);
EMClient.getInstance().chatManager().saveMessage(msgNotification);
if (isActive()) {
runOnUI(() -> mView.recallMessageFinish(msgNotification));
}
} catch (HyphenateException e) {
e.printStackTrace();
if (isActive()) {
runOnUI(() -> mView.recallMessageFail(e.getErrorCode(), e.getDescription()));
}
}
}
/**
* 获取视频封面
*
* @param videoUri
* @return
*/
private String getThumbPath(Uri videoUri) {
if (!UriUtils.isFileExistByUri(mView.context(), videoUri)) {
return "";
}
String filePath = UriUtils.getFilePath(mView.context(), videoUri);
File file = new File(PathUtil.getInstance().getVideoPath(), "thvideo" + System.currentTimeMillis() + ".jpeg");
boolean createSuccess = true;
if (!TextUtils.isEmpty(filePath) && new File(filePath).exists()) {
try {
FileOutputStream fos = new FileOutputStream(file);
Bitmap ThumbBitmap = ThumbnailUtils.createVideoThumbnail(filePath, 3);
ThumbBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
} catch (Exception e) {
e.printStackTrace();
EMLog.e(TAG, e.getMessage());
if (isActive()) {
runOnUI(() -> mView.createThumbFileFail(e.getMessage()));
}
createSuccess = false;
}
} else {
try {
FileOutputStream fos = new FileOutputStream(file);
MediaMetadataRetriever media = new MediaMetadataRetriever();
media.setDataSource(mView.context(), videoUri);
Bitmap frameAtTime = media.getFrameAtTime();
frameAtTime.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.close();
} catch (Exception e) {
e.printStackTrace();
EMLog.e(TAG, e.getMessage());
if (isActive()) {
runOnUI(() -> mView.createThumbFileFail(e.getMessage()));
}
createSuccess = false;
}
}
return createSuccess ? file.getAbsolutePath() : "";
}
}
...@@ -44,6 +44,7 @@ import java.util.regex.Pattern; ...@@ -44,6 +44,7 @@ import java.util.regex.Pattern;
public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimaryMenu, View.OnClickListener, EaseInputEditText.OnEditTextChangeListener, TextWatcher { public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimaryMenu, View.OnClickListener, EaseInputEditText.OnEditTextChangeListener, TextWatcher {
private LinearLayout rlBottom; private LinearLayout rlBottom;
private LinearLayout rlBottomMute;
private ImageView buttonSetModeVoice; private ImageView buttonSetModeVoice;
private ImageView buttonSetModeKeyboard; private ImageView buttonSetModeKeyboard;
private FrameLayout buttonPressToSpeak; private FrameLayout buttonPressToSpeak;
...@@ -54,7 +55,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -54,7 +55,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
private ImageView faceChecked; private ImageView faceChecked;
private CheckBox buttonMore; private CheckBox buttonMore;
private Button buttonSend; private Button buttonSend;
private OnSendMessageListener sendMessageListener;
private boolean isCanSend =true; private boolean isCanSend =true;
private EaseChatPrimaryMenuListener listener; private EaseChatPrimaryMenuListener listener;
private EaseInputMenuStyle menuType = EaseInputMenuStyle.All;//菜单展示形式 private EaseInputMenuStyle menuType = EaseInputMenuStyle.All;//菜单展示形式
...@@ -77,15 +78,19 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -77,15 +78,19 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
initViews(); initViews();
} }
public void setOnSendMessageListener(OnSendMessageListener onSendMessageListener) { public void setMute(){
sendMessageListener = onSendMessageListener; rlBottom.setVisibility(View.GONE);
rlBottomMute.setVisibility(View.VISIBLE);
} }
public void setCanSend(boolean canSend){ public void setCanSend(boolean canSend){
isCanSend = canSend; isCanSend = canSend;
} }
private void initViews() { private void initViews() {
rlBottom = findViewById(R.id.rl_bottom); rlBottom = findViewById(R.id.rl_bottom);
rlBottomMute = findViewById(R.id.rl_bottom_mute);
buttonSetModeVoice = findViewById(R.id.btn_set_mode_voice); buttonSetModeVoice = findViewById(R.id.btn_set_mode_voice);
buttonSetModeKeyboard = findViewById(R.id.btn_set_mode_keyboard); buttonSetModeKeyboard = findViewById(R.id.btn_set_mode_keyboard);
buttonPressToSpeak = findViewById(R.id.btn_press_to_speak); buttonPressToSpeak = findViewById(R.id.btn_press_to_speak);
...@@ -243,9 +248,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -243,9 +248,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
if (listener != null) { if (listener != null) {
editText.setText(""); editText.setText("");
listener.onSendBtnClicked(message); listener.onSendBtnClicked(message);
if (sendMessageListener != null) {
sendMessageListener.send(message);
}
} }
} }
...@@ -497,8 +500,6 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -497,8 +500,6 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
Log.e("TAG", this.getClass().getSimpleName() + " afterTextChanged s:" + s); Log.e("TAG", this.getClass().getSimpleName() + " afterTextChanged s:" + s);
} }
public interface OnSendMessageListener {
void send(String message);
}
} }
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
tools:context=".ui.activity.SplashActivity"> tools:context=".ui.activity.SplashActivity">
<ImageView <ImageView
android:src="@mipmap/splash_bg" tools:src="@mipmap/splash_bg_2"
android:id="@+id/iv_show_ad" android:id="@+id/iv_show_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
android:layout_above="@id/layout_menu"/> android:layout_above="@id/layout_menu"/>
<com.hupu.tv.player.app.widget.customIm.CustomEaseChatInputMenu <com.hupu.tv.player.app.widget.customIm.CustomEaseChatInputMenu
android:minHeight="@dimen/dp_70"
android:id="@+id/layout_menu" android:id="@+id/layout_menu"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
android:id="@+id/tv_total" android:id="@+id/tv_total"
style="@style/style_index_match" style="@style/style_index_match"
android:background="@drawable/selector_total" android:background="@drawable/selector_total"
android:text="总分" /> android:text="大小球" />
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/srl_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/message_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_70"
android:orientation="vertical" android:orientation="vertical"
> >
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
android:paddingBottom="@dimen/dp_25" android:paddingBottom="@dimen/dp_25"
android:id="@+id/rl_bottom" android:id="@+id/rl_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_70"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -124,6 +124,8 @@ ...@@ -124,6 +124,8 @@
<FrameLayout <FrameLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
...@@ -142,4 +144,26 @@ ...@@ -142,4 +144,26 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:visibility="gone"
android:paddingTop="@dimen/dp_12"
android:paddingEnd="@dimen/dp_14"
android:paddingStart="@dimen/dp_14"
android:paddingBottom="@dimen/dp_25"
android:id="@+id/rl_bottom_mute"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:gravity="center"
android:background="@drawable/shape_bg_send_message"
android:text="您已经被禁言"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp_14"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -30,6 +30,7 @@ import com.trello.rxlifecycle4.components.support.RxAppCompatActivity ...@@ -30,6 +30,7 @@ import com.trello.rxlifecycle4.components.support.RxAppCompatActivity
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
import java.lang.reflect.ParameterizedType import java.lang.reflect.ParameterizedType
import java.net.ConnectException import java.net.ConnectException
import java.net.SocketException
import java.net.SocketTimeoutException import java.net.SocketTimeoutException
import java.net.UnknownHostException import java.net.UnknownHostException
import java.util.* import java.util.*
...@@ -186,6 +187,7 @@ abstract class BaseActivity<P : IBasePresenter?> : RxAppCompatActivity(), IBaseD ...@@ -186,6 +187,7 @@ abstract class BaseActivity<P : IBasePresenter?> : RxAppCompatActivity(), IBaseD
override fun onResume() { override fun onResume() {
baseDelegate.onResume() baseDelegate.onResume()
super.onResume() super.onResume()
} }
fun setStatusTextBlank() { fun setStatusTextBlank() {
...@@ -365,8 +367,6 @@ abstract class BaseActivity<P : IBasePresenter?> : RxAppCompatActivity(), IBaseD ...@@ -365,8 +367,6 @@ abstract class BaseActivity<P : IBasePresenter?> : RxAppCompatActivity(), IBaseD
}else{ }else{
ToastUtil.s(getString(R.string.base_socket_timeout)) ToastUtil.s(getString(R.string.base_socket_timeout))
} }
} }
is JsonParseException -> { is JsonParseException -> {
if (isConfigStatus) { if (isConfigStatus) {
......
...@@ -23,6 +23,7 @@ import java.lang.ref.WeakReference ...@@ -23,6 +23,7 @@ import java.lang.ref.WeakReference
import java.lang.reflect.ParameterizedType import java.lang.reflect.ParameterizedType
import java.util.* import java.util.*
import java.net.ConnectException import java.net.ConnectException
import java.net.SocketException
import java.net.SocketTimeoutException import java.net.SocketTimeoutException
import java.net.UnknownHostException import java.net.UnknownHostException
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment