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
5afcef23
Commit
5afcef23
authored
Feb 05, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
376cf367
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
20 additions
and
15 deletions
+20
-15
CsjVideoAdManager.java
.../java/com/mints/goodmoney/ad/video/CsjVideoAdManager.java
+0
-2
ShVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
+0
-2
DownloadApkManager.kt
...in/java/com/mints/goodmoney/manager/DownloadApkManager.kt
+1
-1
TrackManager.java
...c/main/java/com/mints/goodmoney/manager/TrackManager.java
+6
-0
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+1
-1
TaskCpdActivity.kt
.../java/com/mints/goodmoney/ui/activitys/TaskCpdActivity.kt
+1
-1
WebActivity.kt
...main/java/com/mints/goodmoney/ui/activitys/WebActivity.kt
+1
-1
TaskCpdFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
+1
-1
DownloadProgressDialog.kt
...nts/goodmoney/ui/widgets/dialog/DownloadProgressDialog.kt
+4
-3
CacheUtil.java
...pp/src/main/java/com/mints/goodmoney/utils/CacheUtil.java
+5
-3
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/CsjVideoAdManager.java
View file @
5afcef23
...
@@ -206,8 +206,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
...
@@ -206,8 +206,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onAdClose
()
{
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJ
,
extraId
,
curCoin
));
if
(
csjVideoAdListener
!=
null
)
{
if
(
csjVideoAdListener
!=
null
)
{
csjVideoAdListener
.
csjVideoAdSuccess
();
csjVideoAdListener
.
csjVideoAdSuccess
();
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/ShVideoAdManager.kt
View file @
5afcef23
...
@@ -166,8 +166,6 @@ class ShVideoAdManager private constructor(activity: Activity) :
...
@@ -166,8 +166,6 @@ class ShVideoAdManager private constructor(activity: Activity) :
override
fun
onVideoClosed
(
@Nullable
coralAD
:
CoralAD
?,
@Nullable
s
:
String
?):
Boolean
{
override
fun
onVideoClosed
(
@Nullable
coralAD
:
CoralAD
?,
@Nullable
s
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
TrackManager
.
getInstance
().
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SH
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
shVideoAdListener
!=
null
)
{
if
(
shVideoAdListener
!=
null
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/DownloadApkManager.kt
View file @
5afcef23
...
@@ -128,7 +128,7 @@ object DownloadApkManager {
...
@@ -128,7 +128,7 @@ object DownloadApkManager {
override
fun
onError
(
error
:
Error
)
{
override
fun
onError
(
error
:
Error
)
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
())
{
downloadProgressDialog
?.
dismiss
()
downloadProgressDialog
?.
dismiss
()
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
}
}
}
}
})
})
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TrackManager.java
View file @
5afcef23
...
@@ -114,6 +114,12 @@ public class TrackManager {
...
@@ -114,6 +114,12 @@ public class TrackManager {
}
}
}
}
/**
* 穿山甲和珊瑚由回调发放奖励
*
* @param activity
* @param vo
*/
public
void
reportAddCoinMsg
(
Activity
activity
,
HashMap
<
String
,
Object
>
vo
)
{
public
void
reportAddCoinMsg
(
Activity
activity
,
HashMap
<
String
,
Object
>
vo
)
{
if
(
trackPresenter
!=
null
)
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
reportAddCoinMsg
(
activity
,
vo
);
trackPresenter
.
reportAddCoinMsg
(
activity
,
vo
);
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
5afcef23
...
@@ -266,7 +266,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
...
@@ -266,7 +266,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
dialog_btn_right
->
{
R
.
id
.
dialog_btn_right
->
{
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
item_cleanCache
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"0KB"
item_cleanCache
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"0KB"
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/TaskCpdActivity.kt
View file @
5afcef23
...
@@ -32,7 +32,7 @@ class TaskCpdActivity : BaseActivity(), View.OnClickListener {
...
@@ -32,7 +32,7 @@ class TaskCpdActivity : BaseActivity(), View.OnClickListener {
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
initViewAndData
()
initViewAndData
()
initListener
()
initListener
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WebActivity.kt
View file @
5afcef23
...
@@ -104,7 +104,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
...
@@ -104,7 +104,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
super
.
onDestroy
()
super
.
onDestroy
()
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
if
(
browser_layout
!=
null
)
{
if
(
browser_layout
!=
null
)
{
browser_layout
.
destroyDrawingCache
()
browser_layout
.
destroyDrawingCache
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/TaskCpdFragment.kt
View file @
5afcef23
...
@@ -88,7 +88,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
...
@@ -88,7 +88,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mCoralDownload
=
CoralDownload
().
setOnAdLoadListener
(
this
)
mCoralDownload
=
CoralDownload
().
setOnAdLoadListener
(
this
)
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
initView
()
initView
()
initListener
()
initListener
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/dialog/DownloadProgressDialog.kt
View file @
5afcef23
...
@@ -10,6 +10,7 @@ import android.widget.ImageView
...
@@ -10,6 +10,7 @@ import android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
import
com.downloader.PRDownloader
import
com.downloader.PRDownloader
import
com.downloader.Progress
import
com.downloader.Progress
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.R
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.Utils
import
com.mints.goodmoney.utils.Utils
...
@@ -47,10 +48,10 @@ class DownloadProgressDialog(context: Context) :
...
@@ -47,10 +48,10 @@ class DownloadProgressDialog(context: Context) :
if
(
AntiShake
.
check
(
v
?.
id
))
return
if
(
AntiShake
.
check
(
v
?.
id
))
return
when
(
v
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
iv_download_quit
->
{
R
.
id
.
iv_download_quit
->
{
dismiss
()
PRDownloader
.
cancelAll
()
PRDownloader
.
cancelAll
()
CacheUtil
.
clearAllCache
(
context
)
CacheUtil
.
clearAllCache
()
dismiss
()
}
}
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/CacheUtil.java
View file @
5afcef23
...
@@ -3,6 +3,8 @@ package com.mints.goodmoney.utils;
...
@@ -3,6 +3,8 @@ package com.mints.goodmoney.utils;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Environment
;
import
android.os.Environment
;
import
com.mints.goodmoney.MintsApplication
;
import
java.io.File
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -24,10 +26,10 @@ public class CacheUtil {
...
@@ -24,10 +26,10 @@ public class CacheUtil {
/***
/***
* 清理所有缓存
* 清理所有缓存
* @param context
*/
*/
public
static
void
clearAllCache
(
Context
context
)
{
public
static
void
clearAllCache
()
{
try
{
try
{
Context
context
=
MintsApplication
.
getContext
();
deleteDir
(
context
.
getCacheDir
());
deleteDir
(
context
.
getCacheDir
());
if
(
Environment
.
getExternalStorageState
().
equals
(
Environment
.
MEDIA_MOUNTED
))
{
if
(
Environment
.
getExternalStorageState
().
equals
(
Environment
.
MEDIA_MOUNTED
))
{
deleteDir
(
context
.
getExternalCacheDir
());
deleteDir
(
context
.
getExternalCacheDir
());
...
@@ -90,7 +92,7 @@ public class CacheUtil {
...
@@ -90,7 +92,7 @@ public class CacheUtil {
// 小于1023返回0KB
// 小于1023返回0KB
if
(
result1
.
intValue
()
<
1023
)
{
if
(
result1
.
intValue
()
<
1023
)
{
return
"
O
KB"
;
return
"
0
KB"
;
}
}
return
result1
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
return
result1
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
...
...
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