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
6f5a8fbb
Commit
6f5a8fbb
authored
Jan 20, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
b29a856a
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
171 additions
and
31 deletions
+171
-31
TrackManager.java
...c/main/java/com/mints/goodmoney/manager/TrackManager.java
+6
-0
CommonParamBean.java
...n/java/com/mints/goodmoney/mvp/model/CommonParamBean.java
+13
-0
DrawcashBean.java
...main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
+4
-0
TaskPresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
+39
-0
TrackPresenter.java
...va/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
+32
-0
TaskView.kt
...p/src/main/java/com/mints/goodmoney/mvp/views/TaskView.kt
+5
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+17
-0
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+2
-0
SplashYlhActivity.kt
...ava/com/mints/goodmoney/ui/activitys/SplashYlhActivity.kt
+3
-0
TaskActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
+49
-19
DrawcashAdapter.kt
...in/java/com/mints/goodmoney/ui/adapter/DrawcashAdapter.kt
+1
-3
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+0
-6
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+0
-2
PanFragment.kt
.../main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
+0
-1
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TrackManager.java
View file @
6f5a8fbb
...
...
@@ -92,4 +92,10 @@ public class TrackManager {
trackPresenter
.
addCarrierTypeTime
(
second
);
}
}
public
void
getCommonHallBaseMsg
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
getCommonHallBaseMsg
();
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/CommonParamBean.java
0 → 100644
View file @
6f5a8fbb
package
com
.
mints
.
goodmoney
.
mvp
.
model
;
import
java.io.Serializable
;
public
class
CommonParamBean
implements
Serializable
{
private
boolean
showSomeodular
=
true
;
public
boolean
isShowSomeodular
()
{
return
showSomeodular
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
View file @
6f5a8fbb
...
...
@@ -115,6 +115,7 @@ public class DrawcashBean implements Serializable {
private
int
vedio
;
private
double
money
;
private
boolean
canCashOut
;
private
String
remark
;
public
void
setCanCashOut
(
boolean
canCashOut
)
{
this
.
canCashOut
=
canCashOut
;
...
...
@@ -132,5 +133,8 @@ public class DrawcashBean implements Serializable {
return
canCashOut
;
}
public
String
getRemark
()
{
return
remark
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
0 → 100644
View file @
6f5a8fbb
package
com.mints.goodmoney.mvp.presenters
import
com.google.gson.JsonObject
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.TaskView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
class
TaskPresenter
:
BasePresenter
<
TaskView
>()
{
fun
getShCpdTime
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getShCpdTime
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
val
message
=
baseResponse
.
getMessage
()
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->{
if
(
data
!=
null
)
{
view
.
getShCpdTimeSuc
(
data
.
get
(
"needSeconds"
).
asInt
)
}
}
else
->
view
.
showToast
(
message
)
}
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
View file @
6f5a8fbb
package
com
.
mints
.
goodmoney
.
mvp
.
presenters
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.AppHttpManager
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.CommonParamBean
;
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
...
...
@@ -151,4 +154,33 @@ public class TrackPresenter extends BaseTrackPresenter {
});
}
public
void
getCommonHallBaseMsg
()
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"param"
,
"param"
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getCommonHallBaseMsg
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
CommonParamBean
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
CommonParamBean
>
baseResponse
)
{
try
{
if
(
baseResponse
.
getStatus
()
==
200
)
{
CommonParamBean
data
=
baseResponse
.
getData
();
AppConfig
.
showAdFlag
=
data
.
isShowSomeodular
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/TaskView.kt
0 → 100644
View file @
6f5a8fbb
package
com.mints.goodmoney.mvp.views
interface
TaskView
:
BaseView
{
fun
getShCpdTimeSuc
(
time
:
Int
)
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
6f5a8fbb
...
...
@@ -7,6 +7,7 @@ import com.mints.goodmoney.BuildConfig;
import
com.mints.goodmoney.mvp.model.AccountMsgBean
;
import
com.mints.goodmoney.mvp.model.BannerBean
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.CommonParamBean
;
import
com.mints.goodmoney.mvp.model.DrawcashBean
;
import
com.mints.goodmoney.mvp.model.DrawcashRecordBean
;
import
com.mints.goodmoney.mvp.model.FriendHallMsgBean
;
...
...
@@ -526,6 +527,22 @@ public interface LoanService {
@POST
(
"api/innerApp"
)
Observable
<
BaseResponse
<
JsonObject
>>
innerApp
();
/**
* 获取珊瑚cpd试玩时间
*
* @return
*/
@POST
(
"api/getCPDBaseMsg"
)
Observable
<
BaseResponse
<
JsonObject
>>
getShCpdTime
();
/**
* 获取用户配置信息
*
* @return
*/
@POST
(
"common/commonMainMsg"
)
Observable
<
BaseResponse
<
CommonParamBean
>>
getCommonHallBaseMsg
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
6f5a8fbb
...
...
@@ -43,6 +43,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
initViewsAndEvents
()
{
ZhangyueManager
.
onCreateIreader
(
baseApplication
)
showShortVedioLayout
()
if
(
moneyFragment
==
null
)
{
moneyFragment
=
MoneyFragment
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SplashYlhActivity.kt
View file @
6f5a8fbb
...
...
@@ -12,6 +12,7 @@ import com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.DeviceInfo
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YlhAdManager
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
...
...
@@ -63,6 +64,8 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
finish
()
return
}
TrackManager
.
getInstance
().
getCommonHallBaseMsg
()
// 校验APP签名
checkAppSign
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
View file @
6f5a8fbb
...
...
@@ -13,6 +13,9 @@ import com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.AppTryPlayManager
import
com.mints.goodmoney.manager.DownloadApkManager
import
com.mints.goodmoney.mvp.model.TzTaskBean
import
com.mints.goodmoney.mvp.presenters.TaskPresenter
import
com.mints.goodmoney.mvp.presenters.WalkPresenter
import
com.mints.goodmoney.mvp.views.TaskView
import
com.mints.goodmoney.service.AppInstallService
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.adapter.TaskAdapter
...
...
@@ -37,13 +40,14 @@ import kotlinx.android.synthetic.main.header_layout.*
*
* 描述:试玩任务
*/
class
TaskActivity
:
BaseActivity
(),
class
TaskActivity
:
BaseActivity
(),
TaskView
,
OnRefreshListener
,
CoralDownload
.
OnAdLoadListener
,
OnItemChildClickListener
,
View
.
OnClickListener
,
DownloadApkManager
.
OnMyDownloadListener
{
private
val
taskPresenter
by
lazy
{
TaskPresenter
()
}
private
var
mTaskAdapter
:
TaskAdapter
?
=
null
private
val
mTaskList
:
MutableList
<
CoralAD
>
=
arrayListOf
()
...
...
@@ -66,13 +70,12 @@ class TaskActivity : BaseActivity(),
companion
object
{
const
val
TASK_COIN
=
"task_coin"
const
val
TASK_USE_TIME
=
"task_use_time"
const
val
TASK_USE_MAX
=
"task_use_max"
const
val
TASK_USE_COMPLETE
=
"task_use_complete"
}
private
var
mCoin
=
0
private
var
needUseTime
=
0
private
var
needUseTime
=
-
1
private
var
max
=
3
//广告最大填充数
private
var
complete
=
0
//本地判断:领取金币,完成数+1
private
var
loadCountTime
=
0
// 加载广告次数
...
...
@@ -80,7 +83,6 @@ class TaskActivity : BaseActivity(),
override
fun
getBundleExtras
(
extras
:
Bundle
)
{
super
.
getBundleExtras
(
extras
)
mCoin
=
extras
.
getInt
(
TASK_COIN
)
needUseTime
=
extras
.
getInt
(
TASK_USE_TIME
)
max
=
extras
.
getInt
(
TASK_USE_MAX
,
3
)
complete
=
extras
.
getInt
(
TASK_USE_COMPLETE
,
0
)
}
...
...
@@ -88,6 +90,8 @@ class TaskActivity : BaseActivity(),
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_task
override
fun
initViewsAndEvents
()
{
taskPresenter
.
attachView
(
this
)
tv_title
.
text
=
"下载试玩任务"
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
...
...
@@ -123,7 +127,9 @@ class TaskActivity : BaseActivity(),
DownloadApkManager
.
tryOnceInstallApk
()
try
{
refreshDemoTask
()
if
(
needUseTime
!=
-
1
)
{
refreshDemoTask
()
}
}
catch
(
e
:
Exception
)
{
LogUtil
.
e
(
e
.
printStackTrace
())
}
...
...
@@ -131,6 +137,25 @@ class TaskActivity : BaseActivity(),
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
getShCpdTimeSuc
(
time
:
Int
)
{
needUseTime
=
time
if
(
complete
>=
max
)
{
showToast
(
"今日任务已完成,请明日再试"
)
finish
()
return
}
showLoading
(
"加载中..."
)
mFakeTaskList
.
clear
()
mTaskList
.
clear
()
for
(
i
in
0
until
max
-
complete
)
{
loadCountTime
=
i
mCoralDownload
?.
pull
()
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
loadData
()
}
...
...
@@ -200,6 +225,8 @@ class TaskActivity : BaseActivity(),
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
}
taskPresenter
.
detachView
()
super
.
onDestroy
()
}
...
...
@@ -284,6 +311,8 @@ class TaskActivity : BaseActivity(),
}
private
fun
clickDialog
(
position
:
Int
)
{
if
(
needUseTime
==
-
1
)
return
taskDialog
=
TaskDialog
(
this
)
taskDialog
?.
setData
(
mTaskList
[
position
],
needUseTime
,
mCoin
)
taskDialog
?.
show
()
...
...
@@ -336,6 +365,18 @@ class TaskActivity : BaseActivity(),
val
currentPkgName
=
mFakeTaskList
[
position
].
currentPkgName
if
(
currentPkgName
!=
null
)
{
// 时间为0
if
(
needUseTime
==
0
)
{
mFakeTaskList
[
position
].
state
=
2
it
.
notifyItemChanged
(
position
)
// 上报激活完成
mDownloadProcess
?.
reportAppActivated
()
return
}
if
(
AppTryPlayManager
.
getTryPlayIsOK
(
currentPkgName
,
needUseTime
))
{
// 完成试玩任务
mFakeTaskList
[
position
].
state
=
2
...
...
@@ -368,20 +409,7 @@ class TaskActivity : BaseActivity(),
}
private
fun
loadData
()
{
if
(
complete
>=
max
)
{
showToast
(
"今日任务已完成,请明日再试"
)
finish
()
return
}
showLoading
(
"加载中..."
)
mFakeTaskList
.
clear
()
mTaskList
.
clear
()
for
(
i
in
0
until
max
-
complete
)
{
loadCountTime
=
i
mCoralDownload
?.
pull
()
}
taskPresenter
.
getShCpdTime
()
}
private
fun
backDialog
()
{
...
...
@@ -430,4 +458,6 @@ class TaskActivity : BaseActivity(),
// 上报下载成功
mDownloadProcess
?.
reportDownloadSuccess
(
path
,
false
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/DrawcashAdapter.kt
View file @
6f5a8fbb
...
...
@@ -56,9 +56,7 @@ class DrawcashAdapter(val priceList: MutableList<DrawcashBean.CashOutMoneyArrBea
}
else
{
holder
.
tvDrawItemCash
.
text
=
"${priceBean.money}元"
}
if
(
priceBean
.
money
==
0.3
)
{
holder
.
tvDrawItemHint
.
text
=
remark
}
holder
.
tvDrawItemHint
.
text
=
priceBean
.
remark
holder
.
tvDrawItemGold
.
text
=
"约${String.format("
%.
0f
", priceBean.money * 10000)}金币"
holder
.
llDrawItem
.
setOnClickListener
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
6f5a8fbb
...
...
@@ -224,12 +224,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
ChannelManager
.
updataCodeIdForRegisterChannel
(
data
.
adcode
)
// 隐藏 短视频、首页视频、书城
val
activity
:
MainActivity
?
=
activity
as
MainActivity
?
activity
?.
let
{
it
.
showShortVedioLayout
()
}
// 新人福利 放到个人中心展示 防止首页红包转动异常
// 设置视频权重
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
6f5a8fbb
...
...
@@ -464,7 +464,6 @@ class MyFragment : BaseFragment(),
val
bundle
=
Bundle
()
bundle
.
putInt
(
TaskActivity
.
TASK_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_TIME
,
taskBean
.
otherConfig
.
needSeconds
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_MAX
,
taskBean
.
otherConfig
.
max
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_COMPLETE
,
taskBean
.
otherConfig
.
complete
)
readyGo
(
TaskActivity
::
class
.
java
,
bundle
)
...
...
@@ -911,7 +910,6 @@ class MyFragment : BaseFragment(),
if
(
listBean
.
baseConfig
.
taskId
==
MainMyAdapter
.
TO_SHARE_NEWS
)
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
TaskActivity
.
TASK_COIN
,
listBean
.
otherConfig
.
coin
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_TIME
,
listBean
.
otherConfig
.
needSeconds
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_MAX
,
listBean
.
otherConfig
.
max
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_COMPLETE
,
listBean
.
otherConfig
.
complete
)
readyGo
(
TaskActivity
::
class
.
java
,
bundle
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
View file @
6f5a8fbb
...
...
@@ -144,7 +144,6 @@ class PanFragment : BaseFragment(), PanView {
val
bundle
=
Bundle
()
bundle
.
putInt
(
TaskActivity
.
TASK_COIN
,
panActionInfo
.
coin
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_TIME
,
panActionInfo
.
time
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_MAX
,
panActionInfo
.
max
)
bundle
.
putInt
(
TaskActivity
.
TASK_USE_COMPLETE
,
panActionInfo
.
complete
)
readyGo
(
TaskActivity
::
class
.
java
,
bundle
)
...
...
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