Commit 38c37a5a authored by mengcuiguang's avatar mengcuiguang

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

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