Commit 38c37a5a authored by mengcuiguang's avatar mengcuiguang

优化首页微转来电秀标记切换,cpd界面优化

parent 23cfb489
...@@ -209,9 +209,6 @@ ...@@ -209,9 +209,6 @@
<activity <activity
android:name=".ui.activitys.XmlyPlayActivity" android:name=".ui.activitys.XmlyPlayActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.TaskActivity"
android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.TaskCpdActivity" android:name=".ui.activitys.TaskCpdActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
......
...@@ -208,9 +208,9 @@ public final class CoralDownload { ...@@ -208,9 +208,9 @@ public final class CoralDownload {
@Override @Override
public boolean onAppDownloaded(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) { public boolean onAppDownloaded(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) {
LogUtil.d("onAppDownloaded"); LogUtil.d("onAppDownloaded");
if (mOnAdLoadListener != null) { // if (mOnAdLoadListener != null) {
mOnAdLoadListener.onSDKDownloaded(); // mOnAdLoadListener.onSDKDownloaded();
} // }
return false; return false;
} }
...@@ -228,9 +228,9 @@ public final class CoralDownload { ...@@ -228,9 +228,9 @@ public final class CoralDownload {
public boolean onAppInstalled(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) { public boolean onAppInstalled(@Nullable CoralAD ad, @Nullable String downloadUrl, @Nullable String localFile) {
LogUtil.d("onAppInstalled"); LogUtil.d("onAppInstalled");
if (mOnAdLoadListener != null) { // if (mOnAdLoadListener != null) {
mOnAdLoadListener.onSDKInstalled(); // mOnAdLoadListener.onSDKInstalled();
} // }
return false; return false;
} }
...@@ -270,9 +270,9 @@ public final class CoralDownload { ...@@ -270,9 +270,9 @@ public final class CoralDownload {
void onSDKDownloadStart(); void onSDKDownloadStart();
void onSDKDownloaded(); // void onSDKDownloaded();
//
void onSDKInstalled(); // void onSDKInstalled();
void onGetDownloadProcess(DownloadProcess downloadProcess); void onGetDownloadProcess(DownloadProcess downloadProcess);
} }
......
package com.mints.goodmoney.manager package com.mints.goodmoney.manager
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.net.CpdService import com.mints.goodmoney.net.CpdService
import com.mints.goodmoney.utils.MD5 import com.mints.goodmoney.utils.MD5
...@@ -37,7 +38,7 @@ object CpdManager { ...@@ -37,7 +38,7 @@ object CpdManager {
val application = JSONObject() val application = JSONObject()
val equipment = JSONObject() val equipment = JSONObject()
try { try {
application.put("app_pkg_name", "com.mints.goodmoney") application.put("app_pkg_name", Constant.MINTS_PKG_NAME)
application.put("app_ver_code", deviceInfo.versionCode) application.put("app_ver_code", deviceInfo.versionCode)
application.put("app_ver_name", deviceInfo.versionName) application.put("app_ver_name", deviceInfo.versionName)
// 设备类型 4-手机 // 设备类型 4-手机
......
...@@ -36,7 +36,6 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView { ...@@ -36,7 +36,6 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
const val VIDEO_ID = "video_id" const val VIDEO_ID = "video_id"
} }
//https://vring.kuyin123.com/friend/94aa83142f7f5c98?videoId=1251065712248619008
private val WEB_VEDIO_URL = "https://vring.kuyin123.com/friend/94aa83142f7f5c98?videoId=" private val WEB_VEDIO_URL = "https://vring.kuyin123.com/friend/94aa83142f7f5c98?videoId="
private lateinit var videoUrl: String private lateinit var videoUrl: String
...@@ -215,9 +214,6 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView { ...@@ -215,9 +214,6 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
showToast("视频处理中,请稍候") showToast("视频处理中,请稍候")
return return
} }
// DetailActivity.startSelf(this@KylVideoActivity, vedioPathName)
// finish()
readyGo() readyGo()
} }
......
...@@ -42,6 +42,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -42,6 +42,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private var currentFragment: Fragment? = null private var currentFragment: Fragment? = null
private var isMainShowWz: Boolean = false// 是否显示来电秀,防止线程不一样
override fun getContentViewLayoutID() = R.layout.activity_main override fun getContentViewLayoutID() = R.layout.activity_main
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
...@@ -65,9 +67,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -65,9 +67,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if (AppConfig.isMainShowWz) { if (AppConfig.isMainShowWz) {
tab_iv_four.setImageResource(R.drawable.tab_wz_share_btn) tab_iv_four.setImageResource(R.drawable.tab_wz_share_btn)
tab_tv_four.text = "新闻分享" tab_tv_four.text = "新闻分享"
isMainShowWz = true
} else { } else {
tab_iv_four.setImageResource(R.drawable.tab_bell_btn) tab_iv_four.setImageResource(R.drawable.tab_bell_btn)
tab_tv_four.text = "来电秀" tab_tv_four.text = "来电秀"
isMainShowWz = false
} }
tab_iv_one.isSelected = true tab_iv_one.isSelected = true
...@@ -207,7 +211,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -207,7 +211,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
fun clickTab4Layout() { fun clickTab4Layout() {
// 是否显示微转 // 是否显示微转
if (AppConfig.isMainShowWz) { if (isMainShowWz) {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FOUR AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FOUR
if (wzFragment == null) { if (wzFragment == null) {
wzFragment = WzFragment() wzFragment = WzFragment()
......
...@@ -95,4 +95,5 @@ class TaskCpdActivity : BaseActivity(), View.OnClickListener { ...@@ -95,4 +95,5 @@ class TaskCpdActivity : BaseActivity(), View.OnClickListener {
cdaa.setRight("确定") cdaa.setRight("确定")
cdaa.show() cdaa.show()
} }
} }
...@@ -41,6 +41,8 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -41,6 +41,8 @@ class TaskCpdFragment : BaseFragment(), TaskView,
OnItemChildClickListener, OnItemChildClickListener,
DownloadApkManager.OnMyDownloadListener { DownloadApkManager.OnMyDownloadListener {
private val TAG = TaskCpdFragment::class.java.simpleName
private val taskPresenter by lazy { TaskPresenter() } private val taskPresenter by lazy { TaskPresenter() }
private var mTaskAdapter: TaskAdapter? = null private var mTaskAdapter: TaskAdapter? = null
...@@ -60,13 +62,13 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -60,13 +62,13 @@ class TaskCpdFragment : BaseFragment(), TaskView,
// 试完时间不足弹窗 // 试完时间不足弹窗
private var tryTimeOut = false private var tryTimeOut = false
// 第二次拉取重复不拉取 // 圣于地第二次拉取重复不拉取
private var isTwiceGetCpd = false private var isTwiceGetCpd = false
private val outNetIp by lazy { SPUtil.getInstance().getString(Constant.OUT_NET_IP) } private val outNetIp by lazy { SPUtil.getInstance().getString(Constant.OUT_NET_IP) }
private var mCoin = 0 private var mCoin = 0
private var needUseTime = -1 private var needUseTime = -1// 应用试玩时间
private var shMax = 3 //珊瑚 广告最大填充数 private var shMax = 3 //珊瑚 广告最大填充数
private var cpdMax = 3 //CPD 广告最大填充数 private var cpdMax = 3 //CPD 广告最大填充数
...@@ -88,6 +90,7 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -88,6 +90,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
private fun loadCPDData() { private fun loadCPDData() {
LogUtil.d(TAG,"syd loadCPDData")
taskPresenter.getCpdDetail(outNetIp) taskPresenter.getCpdDetail(outNetIp)
} }
...@@ -139,18 +142,16 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -139,18 +142,16 @@ class TaskCpdFragment : BaseFragment(), TaskView,
if ((shMax + cpdMax) <= 0) { if ((shMax + cpdMax) <= 0) {
hideLoading() hideLoading()
showToast("今日任务已完成,请明日再试") showToast("今日任务已完成,请明日再试")
// finish()
return return
} }
isTwiceGetCpd = false isTwiceGetCpd = false
shLoadCountTime = 0 shLoadCountTime = 0
cpdLoadCountTime = 0 cpdLoadCountTime = 0
mFakeTaskList.clear() mFakeTaskList.clear()
if (shMax > 0 && (cpdMax > 0 || cpdMax == 0)) { if (shMax > 0) {
// 先加载珊瑚广告,珊瑚回调判断圣于地
for (i in 0 until shMax) { for (i in 0 until shMax) {
mCoralDownload?.pull() mCoralDownload?.pull()
} }
...@@ -158,10 +159,14 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -158,10 +159,14 @@ class TaskCpdFragment : BaseFragment(), TaskView,
for (i in 0 until cpdMax) { for (i in 0 until cpdMax) {
loadCPDData() loadCPDData()
} }
} else {
notifyDataAndShowAd()
} }
} }
override fun getCpdModelSuc(dataBean: CpdModelBean.DataBean) { override fun getCpdModelSuc(dataBean: CpdModelBean.DataBean) {
LogUtil.d(TAG,"syd getCpdModelSuc")
for (material in dataBean.materials) { for (material in dataBean.materials) {
val tzTaskBean = TzTaskBean(material.icons, material.title, material.description, false, mCoin, 0, material.app_apk_name) val tzTaskBean = TzTaskBean(material.icons, material.title, material.description, false, mCoin, 0, material.app_apk_name)
tzTaskBean.app_url = material.app_url tzTaskBean.app_url = material.app_url
...@@ -169,13 +174,17 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -169,13 +174,17 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mFakeTaskList.add(tzTaskBean) mFakeTaskList.add(tzTaskBean)
} }
// 多拉取的CPD广告 // 圣于地广告 循环完成后去重
if (cpdLoadCountTime++ >= cpdMax - 1) { if (cpdLoadCountTime++ >= cpdMax - 1) {
getCpdRepeatPkg() notifyDataAndShowAd()
// getCpdRepeatPkg()
} }
} }
override fun getCpdModelFail() { override fun getCpdModelFail() {
LogUtil.d(TAG,"syd getCpdModelFail")
if (cpdLoadCountTime++ >= cpdMax - 1) { if (cpdLoadCountTime++ >= cpdMax - 1) {
notifyDataAndShowAd() notifyDataAndShowAd()
} }
...@@ -190,9 +199,7 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -190,9 +199,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
*/ */
private fun getCpdRepeatPkg() { private fun getCpdRepeatPkg() {
if (isTwiceGetCpd) { if (isTwiceGetCpd) {
if (cpdLoadCountTime >= cpdMax) {
notifyDataAndShowAd() notifyDataAndShowAd()
}
return return
} }
...@@ -221,7 +228,7 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -221,7 +228,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
if (flag) { if (flag) {
// 是否已经安装此app // 添加未安装app
if (!DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].currentPkgName)) { if (!DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].currentPkgName)) {
cpdLoadCountTime-- cpdLoadCountTime--
newPkgData.add(mFakeTaskList[i]) newPkgData.add(mFakeTaskList[i])
...@@ -244,15 +251,12 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -244,15 +251,12 @@ class TaskCpdFragment : BaseFragment(), TaskView,
for (i in 0 until cpdLoadCountTime) { for (i in 0 until cpdLoadCountTime) {
loadCPDData() loadCPDData()
} }
cpdLoadCountTime = cpdMax - cpdLoadCountTime cpdLoadCountTime = cpdMax - cpdLoadCountTime
return
} else { } else {
notifyDataAndShowAd() notifyDataAndShowAd()
} }
} }
}) })
} }
...@@ -268,6 +272,13 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -268,6 +272,13 @@ class TaskCpdFragment : BaseFragment(), TaskView,
iv_empty.visibility = View.GONE iv_empty.visibility = View.GONE
} }
uploadSydImp()
}
/**
* 上报圣于地展示
*/
private fun uploadSydImp() {
for (tzTaskBean in mFakeTaskList) { for (tzTaskBean in mFakeTaskList) {
if (!tzTaskBean.isShCpd) { if (!tzTaskBean.isShCpd) {
...@@ -283,6 +294,7 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -283,6 +294,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
override fun onLoadSuccess(dataList: MutableList<CoralAD>?) { override fun onLoadSuccess(dataList: MutableList<CoralAD>?) {
LogUtil.d(TAG,"shanhu onLoadSuccess times")
dataList?.let { dataList?.let {
for (coralAD in it) { for (coralAD in it) {
val tzTaskBean = TzTaskBean(coralAD.icon, coralAD.title, coralAD.description, true, mCoin, 0, null) val tzTaskBean = TzTaskBean(coralAD.icon, coralAD.title, coralAD.description, true, mCoin, 0, null)
...@@ -291,8 +303,9 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -291,8 +303,9 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
} }
// 多拉取的广告 // 珊瑚循环完成后 调用圣于地广告
if (shLoadCountTime++ >= shMax - 1) { if (shLoadCountTime++ >= shMax - 1) {
LogUtil.d(TAG,"shanhu onLoadSuccess")
if (cpdMax == 0) { if (cpdMax == 0) {
notifyDataAndShowAd() notifyDataAndShowAd()
return return
...@@ -325,16 +338,6 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -325,16 +338,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
registerBroad() registerBroad()
} }
override fun onSDKDownloaded() {
// SDK上报下载完成
// mDownloadProcess?.reportDownloadSuccess(localFilePath, false)
}
override fun onSDKInstalled() {
// SDK上报安装完成
// mDownloadProcess?.reportInstallSuccess(false)
}
override fun onGetDownloadProcess(downloadProcess: DownloadProcess?) { override fun onGetDownloadProcess(downloadProcess: DownloadProcess?) {
// 点击之后回调下载数据 // 点击之后回调下载数据
mDownloadProcess = downloadProcess mDownloadProcess = downloadProcess
...@@ -356,7 +359,6 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -356,7 +359,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
taskPresenter.detachView() taskPresenter.detachView()
super.onDestroy() super.onDestroy()
} }
...@@ -404,7 +406,7 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -404,7 +406,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
} }
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
// finish() activity?.finish()
} }
3 -> { 3 -> {
showToast("当前任务已完成,试试其他任务吧!") showToast("当前任务已完成,试试其他任务吧!")
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableTop="@mipmap/ic_friends" android:drawableTop="@mipmap/ic_friends"
android:text="平台分红" android:text="平台分红"
android:textStyle="bold"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" /> android:textSize="14sp" />
......
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