Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
1e4580a5
Commit
1e4580a5
authored
Mar 02, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改圣于地珊瑚顺序配置,进度条显示不全
parent
b4476efa
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
205 additions
and
133 deletions
+205
-133
TzTaskBean.java
...c/main/java/com/mints/goodmoney/mvp/model/TzTaskBean.java
+11
-26
TaskPresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
+9
-4
TaskView.kt
...p/src/main/java/com/mints/goodmoney/mvp/views/TaskView.kt
+1
-1
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+5
-3
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+6
-9
TaskCpdFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
+171
-86
progress_horizontal.xml
GoodMoney/app/src/main/res/layout/progress_horizontal.xml
+1
-1
view_dialog_update.xml
GoodMoney/app/src/main/res/layout/view_dialog_update.xml
+1
-3
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/TzTaskBean.java
View file @
1e4580a5
...
@@ -27,7 +27,7 @@ public class TzTaskBean {
...
@@ -27,7 +27,7 @@ public class TzTaskBean {
private
String
aid
;
private
String
aid
;
public
TzTaskBean
(
String
icon
,
String
title
,
String
description
,
boolean
isShCpd
,
int
coin
,
int
state
,
String
downLoadPkgName
)
{
public
TzTaskBean
(
String
icon
,
String
title
,
String
description
,
boolean
isShCpd
,
int
coin
,
int
state
,
String
downLoadPkgName
)
{
this
.
icon
=
icon
;
this
.
icon
=
icon
;
this
.
title
=
title
;
this
.
title
=
title
;
this
.
description
=
description
;
this
.
description
=
description
;
...
@@ -38,7 +38,7 @@ public class TzTaskBean {
...
@@ -38,7 +38,7 @@ public class TzTaskBean {
this
.
downLoadPkgName
=
downLoadPkgName
;
this
.
downLoadPkgName
=
downLoadPkgName
;
}
}
public
TzTaskBean
(
String
icon
,
String
title
,
int
coin
,
int
state
,
String
currentPkgName
,
String
aid
)
{
public
TzTaskBean
(
String
icon
,
String
title
,
int
coin
,
int
state
,
String
currentPkgName
,
String
aid
)
{
this
.
icon
=
icon
;
this
.
icon
=
icon
;
this
.
title
=
title
;
this
.
title
=
title
;
this
.
coin
=
coin
;
this
.
coin
=
coin
;
...
@@ -75,19 +75,19 @@ public class TzTaskBean {
...
@@ -75,19 +75,19 @@ public class TzTaskBean {
this
.
app_url
=
app_url
;
this
.
app_url
=
app_url
;
}
}
//
public CpdModelBean.DataBean.MaterialsBean.TrackerBean getTrackerBean() {
public
CpdModelBean
.
DataBean
.
MaterialsBean
.
TrackerBean
getTrackerBean
()
{
//
return trackerBean;
return
trackerBean
;
//
}
}
//
//
public void setTrackerBean(CpdModelBean.DataBean.MaterialsBean.TrackerBean trackerBean) {
public
void
setTrackerBean
(
CpdModelBean
.
DataBean
.
MaterialsBean
.
TrackerBean
trackerBean
)
{
//
this.trackerBean = trackerBean;
this
.
trackerBean
=
trackerBean
;
//
}
}
public
SydCpdListBean
.
DataBean
.
MaterialsBean
.
TrackerBean
getTrackerBean
()
{
public
SydCpdListBean
.
DataBean
.
MaterialsBean
.
TrackerBean
getTracker
List
Bean
()
{
return
trackerListBean
;
return
trackerListBean
;
}
}
public
void
setTrackerBean
(
SydCpdListBean
.
DataBean
.
MaterialsBean
.
TrackerBean
trackerListBean
)
{
public
void
setTracker
List
Bean
(
SydCpdListBean
.
DataBean
.
MaterialsBean
.
TrackerBean
trackerListBean
)
{
this
.
trackerListBean
=
trackerListBean
;
this
.
trackerListBean
=
trackerListBean
;
}
}
...
@@ -143,19 +143,4 @@ public class TzTaskBean {
...
@@ -143,19 +143,4 @@ public class TzTaskBean {
this
.
currentPkgName
=
currentPkgName
;
this
.
currentPkgName
=
currentPkgName
;
}
}
@Override
public
String
toString
()
{
return
"TzTaskBean{"
+
"icon='"
+
icon
+
'\''
+
", title='"
+
title
+
'\''
+
", description='"
+
description
+
'\''
+
", app_url='"
+
app_url
+
'\''
+
", isShCpd="
+
isShCpd
+
", coralAd="
+
coralAd
+
", trackerBean="
+
trackerBean
+
", coin="
+
coin
+
", state="
+
state
+
", currentPkgName='"
+
currentPkgName
+
'\''
+
'}'
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
View file @
1e4580a5
...
@@ -43,8 +43,13 @@ class TaskPresenter : BasePresenter<TaskView>() {
...
@@ -43,8 +43,13 @@ class TaskPresenter : BasePresenter<TaskView>() {
when
(
code
)
{
when
(
code
)
{
200
->
{
200
->
{
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
view
.
getShCpdTimeSuc
(
data
.
get
(
"needSeconds"
).
asInt
,
data
.
get
(
"coin"
).
asInt
,
view
.
getShCpdTimeSuc
(
data
.
get
(
"CPD"
).
asInt
,
data
.
get
(
"CPD_SYD"
).
asInt
)
data
.
get
(
"needSeconds"
).
asInt
,
data
.
get
(
"coin"
).
asInt
,
data
.
get
(
"CPD"
).
asInt
,
data
.
get
(
"CPD_SYD"
).
asInt
,
data
.
get
(
"cpdOrder"
).
asString
)
}
}
}
}
}
}
...
@@ -104,9 +109,9 @@ class TaskPresenter : BasePresenter<TaskView>() {
...
@@ -104,9 +109,9 @@ class TaskPresenter : BasePresenter<TaskView>() {
})
})
}
}
fun
getCpdListDetail
(
ip
:
String
,
number
:
Int
)
{
fun
getCpdListDetail
(
ip
:
String
,
number
:
Int
)
{
AppHttpManager
.
getInstance
(
loanApplication
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
CpdService
.
Factory
.
getInstance
().
getAdVedio
(
CpdManager
.
getCpdLisrUrl
(),
CpdManager
.
getCpdListBody
(
ip
,
number
)),
.
call
(
CpdService
.
Factory
.
getInstance
().
getAdVedio
(
CpdManager
.
getCpdLisrUrl
(),
CpdManager
.
getCpdListBody
(
ip
,
number
)),
object
:
BaseSubscriber
<
JsonObject
>()
{
object
:
BaseSubscriber
<
JsonObject
>()
{
override
fun
onCompleted
()
{
override
fun
onCompleted
()
{
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/TaskView.kt
View file @
1e4580a5
...
@@ -4,7 +4,7 @@ import com.mints.goodmoney.mvp.model.CpdModelBean
...
@@ -4,7 +4,7 @@ import com.mints.goodmoney.mvp.model.CpdModelBean
import
com.mints.goodmoney.mvp.model.SydCpdListBean
import
com.mints.goodmoney.mvp.model.SydCpdListBean
interface
TaskView
:
BaseView
{
interface
TaskView
:
BaseView
{
fun
getShCpdTimeSuc
(
time
:
Int
,
coin
:
Int
,
CPD
:
Int
,
CPD_SYD
:
Int
)
fun
getShCpdTimeSuc
(
time
:
Int
,
coin
:
Int
,
CPD
:
Int
,
CPD_SYD
:
Int
,
CPD_ORDER
:
String
?
)
fun
getCpdModelSuc
(
dataBean
:
CpdModelBean
.
DataBean
)
fun
getCpdModelSuc
(
dataBean
:
CpdModelBean
.
DataBean
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
1e4580a5
...
@@ -377,10 +377,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
...
@@ -377,10 +377,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
AppConfig
.
isSuperTask
=
false
AppConfig
.
isSuperTask
=
false
if
(
mReceiverBroadcastReceiver
!=
null
)
{
if
(
mReceiverBroadcastReceiver
!=
null
)
{
if
(
mReceiverBroadcastReceiver
!!
.
isInitialStickyBroadcast
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
mReceiverBroadcastReceiver
=
null
}
}
}
awardPresenter
.
setHighTaskType
(
"0"
)
awardPresenter
.
setHighTaskType
(
"0"
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
1e4580a5
...
@@ -2,11 +2,11 @@ package com.mints.goodmoney.ui.fragment
...
@@ -2,11 +2,11 @@ package com.mints.goodmoney.ui.fragment
import
android.Manifest
import
android.Manifest
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.content.BroadcastReceiver
import
android.content.BroadcastReceiver
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.content.Intent
import
android.content.IntentFilter
import
android.content.IntentFilter
import
android.app.Dialog
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.View
import
android.view.View
...
@@ -34,14 +34,11 @@ import com.mints.goodmoney.ui.adapter.GvMyAdapter
...
@@ -34,14 +34,11 @@ import com.mints.goodmoney.ui.adapter.GvMyAdapter
import
com.mints.goodmoney.ui.adapter.MainMyAdapter
import
com.mints.goodmoney.ui.adapter.MainMyAdapter
import
com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import
com.mints.goodmoney.ui.adapter.listener.OnItemChildClickListener
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.widgets.dialog.DialogListener
import
com.mints.goodmoney.ui.widgets.ShareDialog
import
com.mints.goodmoney.ui.widgets.ShareDialog
import
com.mints.goodmoney.ui.widgets.dialog.DialogListener
import
com.mints.goodmoney.ui.widgets.dialog.DialogUtils
import
com.mints.goodmoney.ui.widgets.dialog.DialogUtils
import
com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import
com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import
com.mints.goodmoney.utils.AppUtil
import
com.mints.goodmoney.utils.*
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.QQJumpUtil
import
com.mints.goodmoney.utils.SpanUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.net.netstatus.NetUtils
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.CommonUtils
import
com.mints.library.utils.GlideUtils
import
com.mints.library.utils.GlideUtils
...
@@ -721,7 +718,7 @@ class MyFragment : BaseFragment(),
...
@@ -721,7 +718,7 @@ class MyFragment : BaseFragment(),
0
->
{
0
->
{
// 牧场人生包名
// 牧场人生包名
pkgMCRSCarrier
=
Constant
.
CARRIER_MC_FIRSTDOWNLOAD
pkgMCRSCarrier
=
Constant
.
CARRIER_MC_FIRSTDOWNLOAD
pkgMCRSKey
=
""
pkgMCRSKey
=
""
pkgMCRSName
=
taskBean
.
otherConfig
.
pkg
pkgMCRSName
=
taskBean
.
otherConfig
.
pkg
// 下载牧场人生
// 下载牧场人生
...
@@ -1157,7 +1154,7 @@ class MyFragment : BaseFragment(),
...
@@ -1157,7 +1154,7 @@ class MyFragment : BaseFragment(),
}
}
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
private
fun
initExpress
(
flowAdRules
:
FlowAdRulesBean
)
{
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
PreLoadExpressManager
.
init
(
flowAdRules
.
csj
,
flowAdRules
.
ylh
,
flowAdRules
.
ks
)
}
}
/**
/**
...
@@ -1305,7 +1302,7 @@ class MyFragment : BaseFragment(),
...
@@ -1305,7 +1302,7 @@ class MyFragment : BaseFragment(),
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"3"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"3"
)
}
else
if
(
TextUtils
.
equals
(
pkg
,
pkgMCRSName
))
{
}
else
if
(
TextUtils
.
equals
(
pkg
,
pkgMCRSName
))
{
// 上报后台更新按钮状态
// 上报后台更新按钮状态
myPresenter
.
setHighTaskType
(
pkgMCRSCarrier
,
"1"
,
pkgMCRSKey
)
myPresenter
.
setHighTaskType
(
pkgMCRSCarrier
,
"1"
,
pkgMCRSKey
)
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
View file @
1e4580a5
...
@@ -68,7 +68,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -68,7 +68,7 @@ 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
)
}
...
@@ -81,7 +81,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -81,7 +81,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
@Volatile
@Volatile
private
var
shLoadCountTime
=
0
// 珊瑚 加载广告次数
private
var
shLoadCountTime
=
0
// 珊瑚 加载广告次数
@Volatile
//
@Volatile
private
var
cpdLoadCountTime
=
0
// CPD 加载广告次数
private
var
cpdLoadCountTime
=
0
// CPD 加载广告次数
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
...
@@ -97,18 +97,13 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -97,18 +97,13 @@ class TaskCpdFragment : BaseFragment(), TaskView,
loadData
()
loadData
()
}
}
private
fun
loadCPDData
()
{
LogUtil
.
d
(
TAG
,
"syd loadCPDData"
)
taskPresenter
.
getCpdDetail
(
outNetIp
)
}
private
fun
initView
()
{
private
fun
initView
()
{
val
gridLayoutManager
=
GridLayoutManager
(
activity
,
3
)
val
gridLayoutManager
=
GridLayoutManager
(
activity
,
3
)
recy_task
.
layoutManager
=
gridLayoutManager
recy_task
.
layoutManager
=
gridLayoutManager
recy_task
.
addItemDecoration
(
SpacesItemDecoration
(
3
,
SpacesItemDecoration
.
px2dp
(
10f
)))
recy_task
.
addItemDecoration
(
SpacesItemDecoration
(
3
,
SpacesItemDecoration
.
px2dp
(
10f
)))
mTaskAdapter
=
TaskAdapter
(
mFakeTaskList
,
activity
!!
)
mTaskAdapter
=
TaskAdapter
(
mFakeTaskList
,
activity
!!
)
recy_task
.
adapter
=
mTaskAdapter
recy_task
.
adapter
=
mTaskAdapter
recy_task
.
setItemViewCacheSize
(
2
0
)
recy_task
.
setItemViewCacheSize
(
1
0
)
mTaskAdapter
?.
setOnItemChildClickListener
(
this
)
mTaskAdapter
?.
setOnItemChildClickListener
(
this
)
}
}
...
@@ -141,7 +136,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -141,7 +136,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_task
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_task
override
fun
getShCpdTimeSuc
(
time
:
Int
,
coin
:
Int
,
CPD
:
Int
,
CPD_SYD
:
Int
)
{
override
fun
getShCpdTimeSuc
(
time
:
Int
,
coin
:
Int
,
CPD
:
Int
,
CPD_SYD
:
Int
,
CPD_ORDER
:
String
?
)
{
needUseTime
=
time
needUseTime
=
time
mCoin
=
coin
mCoin
=
coin
shMax
=
CPD
shMax
=
CPD
...
@@ -159,57 +154,75 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -159,57 +154,75 @@ class TaskCpdFragment : BaseFragment(), TaskView,
return
return
}
}
isTwiceGetCpd
=
false
//
isTwiceGetCpd = false
shLoadCountTime
=
0
shLoadCountTime
=
0
cpdLoadCountTime
=
0
cpdLoadCountTime
=
0
mFakeTaskList
.
clear
()
mFakeTaskList
.
clear
()
if
(
shMax
>
0
)
{
if
(
TextUtils
.
isEmpty
(
CPD_ORDER
))
{
// 先加载珊瑚广告,珊瑚回调判断圣于地
notifyDataAndShowAd
()
for
(
i
in
0
until
shMax
)
{
return
mCoralDownload
?.
pull
()
}
}
}
else
if
(
cpdMax
>
0
)
{
// for (i in 0 until cpdMax) {
// loadCPDData()
// }
// 珊瑚和CPD展示顺序
if
(
CPD_ORDER
==
"CPD_SYD"
)
{
if
(
cpdMax
>
0
)
{
loadCPDDataList
()
loadCPDDataList
()
}
else
{
notifyDataAndShowAd
()
}
}
}
else
if
(
CPD_ORDER
==
"CPD_SH"
)
{
if
(
shMax
>
0
)
{
loadShDataList
()
}
}
}
else
{
private
fun
loadCPDDataList
()
{
notifyDataAndShowAd
()
taskPresenter
.
getCpdListDetail
(
outNetIp
,
cpdMax
)
}
}
override
fun
getCpdModelSuc
(
dataBean
:
CpdModelBean
.
DataBean
)
{
//
for (material in dataBean.materials)
{
//
when
{
//
// 校验包名、下载apk为空 跳过
//
shMax > 0 -> {
//
if (TextUtils.isEmpty(material.app_apk_name) || TextUtils.isEmpty(material.app_url)) {
//
// 先加载珊瑚广告,珊瑚回调判断圣于地
//
if (BuildConfig.DEBUG
) {
//
for (i in 0 until shMax
) {
//
LogUtil.d(TAG, "syd getCpdModelSuc 校验包名、下载apk为空 跳过${dataBean.uuid}"
)
//
mCoralDownload?.pull(
)
// }
// }
// continue
// }
// }
//
// cpdMax > 0 -> {
// val tzTaskBean = TzTaskBean(material.icons, material.description, material.title, false, mCoin, 0, material.app_apk_name)
// for (i in 0 until cpdMax) {
// tzTaskBean.app_url = material.app_url
// loadCPDData()
// tzTaskBean.trackerBean = material.tracker
// mFakeTaskList.add(tzTaskBean)
// }
// }
//
// // 圣于地广告 循环完成后去重
// loadCPDDataList()
// if (cpdLoadCountTime++ >= cpdMax - 1) {
// getCpdRepeatPkg()
// }
// }
// else -> {
// notifyDataAndShowAd()
// }
// }
}
LogUtil
.
d
(
TAG
,
"syd getCpdModelSuc "
+
cpdLoadCountTime
)
private
fun
loadShDataList
()
{
// 珊瑚CPD广告拉取
for
(
i
in
shLoadCountTime
until
shMax
)
{
mCoralDownload
?.
pull
()
}
}
}
override
fun
getCpdListModelSuc
(
dataBean
:
SydCpdListBean
.
DataBean
)
{
private
fun
loadCPDDataList
()
{
// 圣于地CPD广告拉取
for
(
i
in
cpdLoadCountTime
until
cpdMax
)
{
loadCPDData
()
}
}
private
fun
loadCPDData
()
{
LogUtil
.
d
(
TAG
,
"syd loadCPDData"
)
taskPresenter
.
getCpdDetail
(
outNetIp
)
}
// private fun loadCPDDataList() {
// // 圣于地CPD广告拉取
// taskPresenter.getCpdListDetail(outNetIp, cpdMax)
// }
override
fun
getCpdModelSuc
(
dataBean
:
CpdModelBean
.
DataBean
)
{
for
(
material
in
dataBean
.
materials
)
{
for
(
material
in
dataBean
.
materials
)
{
// 校验包名、下载apk为空 跳过
// 校验包名、下载apk为空 跳过
...
@@ -220,29 +233,83 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -220,29 +233,83 @@ class TaskCpdFragment : BaseFragment(), TaskView,
continue
continue
}
}
val
tzTaskBean
=
TzTaskBean
(
material
.
icons
,
material
.
app_name
,
material
.
description
,
false
,
mCoin
,
0
,
material
.
app_apk_name
)
val
tzTaskBean
=
TzTaskBean
(
material
.
icons
,
material
.
description
,
material
.
title
,
false
,
mCoin
,
0
,
material
.
app_apk_name
)
tzTaskBean
.
app_url
=
material
.
app_url
tzTaskBean
.
app_url
=
material
.
app_url
tzTaskBean
.
trackerBean
=
material
.
tracker
tzTaskBean
.
trackerBean
=
material
.
tracker
mFakeTaskList
.
add
(
tzTaskBean
)
mFakeTaskList
.
add
(
tzTaskBean
)
LogUtil
.
d
(
tzTaskBean
.
title
)
}
}
// 圣于地广告 循环完成后去重
// 圣于地广告 循环完成后去重
if
(
cpdLoadCountTime
++
>=
cpdMax
-
1
)
{
for
(
tzTaskBean
in
mFakeTaskList
)
{
LogUtil
.
d
(
"AA -> "
+
tzTaskBean
.
title
)
}
getCpdRepeatPkg
()
getCpdRepeatPkg
()
if
(
shMax
==
0
||
shLoadCountTime
>=
shMax
)
{
notifyDataAndShowAd
()
}
else
{
// 圣于地拉取完成后 调用珊瑚广告
loadShDataList
()
}
}
}
LogUtil
.
d
(
TAG
,
"syd getCpdModelSuc $cpdLoadCountTime"
)
}
override
fun
getCpdModelFail
()
{
override
fun
getCpdModelFail
()
{
//
LogUtil.d(TAG, "syd getCpdModelFail")
LogUtil
.
d
(
TAG
,
"syd getCpdModelFail"
)
// if (cpdLoadCountTime++ >= cpdMax - 1) {
if
(
cpdLoadCountTime
++
>=
cpdMax
-
1
)
{
getCpdRepeatPkg
()
if
(
shMax
==
0
||
shLoadCountTime
>=
shMax
)
{
notifyDataAndShowAd
()
}
else
{
// 圣于地拉取完成后 调用珊瑚广告
loadShDataList
()
}
}
// getCpdRepeatPkg()
// getCpdRepeatPkg()
// }
LogUtil
.
d
(
TAG
,
"syd getCpdModelFail $cpdLoadCountTime"
)
}
override
fun
getCpdListModelSuc
(
dataBean
:
SydCpdListBean
.
DataBean
)
{
for
(
material
in
dataBean
.
materials
)
{
// 校验包名、下载apk为空 跳过
if
(
TextUtils
.
isEmpty
(
material
.
app_apk_name
)
||
TextUtils
.
isEmpty
(
material
.
app_url
))
{
if
(
BuildConfig
.
DEBUG
)
{
LogUtil
.
d
(
TAG
,
"syd getCpdModelSuc 校验包名、下载apk为空 跳过${dataBean.uuid}"
)
}
continue
}
val
tzTaskBean
=
TzTaskBean
(
material
.
icons
,
material
.
app_name
,
material
.
description
,
false
,
mCoin
,
0
,
material
.
app_apk_name
)
tzTaskBean
.
app_url
=
material
.
app_url
tzTaskBean
.
trackerListBean
=
material
.
tracker
mFakeTaskList
.
add
(
tzTaskBean
)
}
// 圣于地广告 循环完成后去重
getCpdRepeatPkg
()
getCpdRepeatPkg
()
LogUtil
.
d
(
TAG
,
"syd getCpdModelFail "
+
cpdLoadCountTime
)
if
(
shMax
==
0
||
shLoadCountTime
>=
shMax
)
{
notifyDataAndShowAd
()
}
else
{
// 圣于地拉取完成后 调用珊瑚广告
loadShDataList
()
}
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
onDest
or
yBroadcastReceiver
()
onDest
ro
yBroadcastReceiver
()
loadData
()
loadData
()
}
}
...
@@ -251,48 +318,67 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -251,48 +318,67 @@ class TaskCpdFragment : BaseFragment(), TaskView,
* 遍历去重APP包名
* 遍历去重APP包名
*/
*/
private
fun
getCpdRepeatPkg
()
{
private
fun
getCpdRepeatPkg
()
{
if
(
isTwiceGetCpd
)
{
//
if (isTwiceGetCpd) {
notifyDataAndShowAd
()
//
notifyDataAndShowAd()
return
//
return
}
//
}
cpdLoadCountTime
=
cpdMax
//
cpdLoadCountTime = cpdMax
RxjavaUtil
.
executeRxTask
<
MutableList
<
TzTaskBean
>>(
object
:
CommonRxTask
<
MutableList
<
TzTaskBean
>>()
{
RxjavaUtil
.
executeRxTask
<
MutableList
<
TzTaskBean
>>(
object
:
CommonRxTask
<
MutableList
<
TzTaskBean
>>()
{
override
fun
doInIOThread
()
{
override
fun
doInIOThread
()
{
val
newPkgData
=
mutableListOf
<
TzTaskBean
>()
val
newPkgData
=
mutableListOf
<
TzTaskBean
>()
for
(
i
in
0
until
mFakeTaskList
.
size
)
{
if
(
mFakeTaskList
[
i
].
isShCpd
)
{
newPkgData
.
add
(
mFakeTaskList
[
i
])
}
else
{
var
flag
=
true
for
(
j
in
0
until
mFakeTaskList
.
size
)
{
if
(!
mFakeTaskList
[
i
].
isShCpd
&&
!
mFakeTaskList
[
j
].
isShCpd
)
{
var
flag
=
false
// 数据重复
for
(
oldTaskBean
in
mFakeTaskList
)
{
if
(
i
!=
j
&&
mFakeTaskList
[
i
].
downLoadPkgName
==
mFakeTaskList
[
j
].
downLoadPkgName
)
{
// 珊瑚无须去重操作,直接添加
LogUtil
.
d
(
TAG
,
"syd currentPkgName:"
+
mFakeTaskList
[
j
].
downLoadPkgName
)
if
(
oldTaskBean
.
isShCpd
)
{
newPkgData
.
add
(
oldTaskBean
)
flag
=
false
}
else
{
break
for
(
newTaskBean
in
newPkgData
)
{
}
if
(!
newTaskBean
.
isShCpd
&&
!
oldTaskBean
.
isShCpd
)
{
flag
=
newTaskBean
.
downLoadPkgName
==
oldTaskBean
.
downLoadPkgName
}
}
}
}
if
(
flag
)
{
if
(
!
flag
)
{
// 添加未安装app
// 添加未安装app
if
(!
TextUtils
.
isEmpty
(
mFakeTaskList
[
i
].
downLoadPkgName
)
&&
!
DeviceInfo
.
instance
.
isLoadingPkg
(
mFakeTaskList
[
i
].
downLoadPkgName
))
{
if
(!
TextUtils
.
isEmpty
(
oldTaskBean
.
downLoadPkgName
)
&&
!
DeviceInfo
.
instance
.
isLoadingPkg
(
oldTaskBean
.
downLoadPkgName
))
{
cpdLoadCountTime
--
newPkgData
.
add
(
oldTaskBean
)
newPkgData
.
add
(
mFakeTaskList
[
i
])
}
}
}
}
}
}
}
}
// for (i in 0 until mFakeTaskList.size) {
//
// if (mFakeTaskList[i].isShCpd) {
// newPkgData.add(mFakeTaskList[i])
// } else {
// for (j in 0 until mFakeTaskList.size) {
// if (!mFakeTaskList[i].isShCpd && !mFakeTaskList[j].isShCpd) {
// // 数据重复
// if (j != i && mFakeTaskList[i].downLoadPkgName == mFakeTaskList[j].downLoadPkgName) {
// LogUtil.d(TAG, "syd currentPkgName:" + mFakeTaskList[j].downLoadPkgName)
//
// flag = false
// break
// }
// }
// }
//
// if (flag) {
// // 添加未安装app
// if (!TextUtils.isEmpty(mFakeTaskList[i].downLoadPkgName) && !DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].downLoadPkgName)) {
//// cpdLoadCountTime--
// newPkgData.add(mFakeTaskList[i])
// }
// }
// }
// }
t
=
newPkgData
t
=
newPkgData
}
}
...
@@ -300,7 +386,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -300,7 +386,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mFakeTaskList
.
clear
()
mFakeTaskList
.
clear
()
mFakeTaskList
.
addAll
(
t
)
mFakeTaskList
.
addAll
(
t
)
notifyDataAndShowAd
()
//
notifyDataAndShowAd()
// 重新获取数据
// 重新获取数据
// if (cpdLoadCountTime in 1..cpdMax) {
// if (cpdLoadCountTime in 1..cpdMax) {
...
@@ -364,15 +450,14 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -364,15 +450,14 @@ class TaskCpdFragment : BaseFragment(), TaskView,
// 珊瑚循环完成后 调用圣于地广告
// 珊瑚循环完成后 调用圣于地广告
if
(
shLoadCountTime
++
>=
shMax
-
1
)
{
if
(
shLoadCountTime
++
>=
shMax
-
1
)
{
LogUtil
.
d
(
TAG
,
"shanhu onLoadSuccess"
)
LogUtil
.
d
(
TAG
,
"shanhu onLoadSuccess"
)
if
(
cpdMax
==
0
)
{
if
(
cpdMax
==
0
||
cpdLoadCountTime
>=
cpdMax
)
{
notifyDataAndShowAd
()
notifyDataAndShowAd
()
return
}
else
{
// 珊瑚拉取完成后 调用圣于地广告
loadCPDDataList
()
}
}
// for (i in 0 until cpdMax) {
// loadCPDData()
// }
loadCPDDataList
()
}
}
}
}
...
@@ -414,7 +499,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -414,7 +499,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mDownloadProcess
=
null
mDownloadProcess
=
null
DownloadApkManager
.
destroy
()
DownloadApkManager
.
destroy
()
onDest
or
yBroadcastReceiver
()
onDest
ro
yBroadcastReceiver
()
taskPresenter
.
detachView
()
taskPresenter
.
detachView
()
super
.
onDestroy
()
super
.
onDestroy
()
...
@@ -587,7 +672,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -587,7 +672,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
val
currentPkgName
=
mFakeTaskList
[
position
].
currentPkgName
val
currentPkgName
=
mFakeTaskList
[
position
].
currentPkgName
if
(
currentPkgName
!=
null
)
{
if
(
currentPkgName
!=
null
)
{
onDest
or
yBroadcastReceiver
()
onDest
ro
yBroadcastReceiver
()
// 时间为0
// 时间为0
if
(
needUseTime
==
0
)
{
if
(
needUseTime
==
0
)
{
...
@@ -699,7 +784,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -699,7 +784,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
}
}
}
}
fun
onDestor
yBroadcastReceiver
()
{
private
fun
onDestro
yBroadcastReceiver
()
{
if
(
mReceiverBroadcastReceiver
!=
null
)
{
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
...
...
GoodMoney/app/src/main/res/layout/progress_horizontal.xml
View file @
1e4580a5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<ProgressBar
xmlns:android=
"http://schemas.android.com/apk/res/android"
<ProgressBar
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/my_profile_tracker"
android:id=
"@+id/my_profile_tracker"
style=
"?android:attr/progressBarStyleHorizontal"
style=
"?android:attr/progressBarStyleHorizontal"
android:layout_width=
"
fill
_parent"
android:layout_width=
"
match
_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@null"
android:background=
"@null"
android:indeterminateOnly=
"false"
android:indeterminateOnly=
"false"
...
...
GoodMoney/app/src/main/res/layout/view_dialog_update.xml
View file @
1e4580a5
...
@@ -30,9 +30,7 @@
...
@@ -30,9 +30,7 @@
android:textColor=
"@color/color_333"
android:textColor=
"@color/color_333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<View
<View
style=
"@style/line_1"
/>
style=
"@style/line_1"
android:layout_above=
"@+id/dialog_ll_bottom"
/>
<include
<include
android:id=
"@+id/pb_du_updating"
android:id=
"@+id/pb_du_updating"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment