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
cf792285
Commit
cf792285
authored
Nov 20, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
8304195e
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
605 additions
and
200 deletions
+605
-200
build.gradle
GoodMoney/app/build.gradle
+0
-4
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+4
-76
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+7
-0
BxmManager.kt
...p/src/main/java/com/mints/goodmoney/manager/BxmManager.kt
+2
-3
TtCsjAdManager.java
...main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
+2
-0
YlVideoManager.kt
...c/main/java/com/mints/goodmoney/manager/YlVideoManager.kt
+42
-0
YwhzManager.kt
.../src/main/java/com/mints/goodmoney/manager/YwhzManager.kt
+47
-0
ZhangyueManager.kt
.../main/java/com/mints/goodmoney/manager/ZhangyueManager.kt
+1
-1
FriendHallMsgBean.java
...java/com/mints/goodmoney/mvp/model/FriendHallMsgBean.java
+1
-1
MorningClockBean.java
.../java/com/mints/goodmoney/mvp/model/MorningClockBean.java
+46
-0
MyInfo.java
...p/src/main/java/com/mints/goodmoney/mvp/model/MyInfo.java
+4
-4
UserMsgBean.java
.../main/java/com/mints/goodmoney/mvp/model/UserMsgBean.java
+5
-0
MorningClockPresenter.java
...mints/goodmoney/mvp/presenters/MorningClockPresenter.java
+0
-53
MorningClockPresenter.kt
...m/mints/goodmoney/mvp/presenters/MorningClockPresenter.kt
+67
-0
MyPresenter.kt
...in/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
+0
-8
MorningClockView.kt
...in/java/com/mints/goodmoney/mvp/views/MorningClockView.kt
+3
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+17
-0
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+13
-4
FoodSubsidyActivity.kt
...a/com/mints/goodmoney/ui/activitys/FoodSubsidyActivity.kt
+1
-1
LoginActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/LoginActivity.kt
+2
-1
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+5
-5
MorningClockActivity.kt
.../com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
+114
-7
MorningClockAdapter.kt
...ava/com/mints/goodmoney/ui/adapter/MorningClockAdapter.kt
+52
-0
DhGameFragment.kt
...in/java/com/mints/goodmoney/ui/fragment/DhGameFragment.kt
+7
-4
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+30
-12
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+13
-6
shape_morning_clock.xml
GoodMoney/app/src/main/res/drawable/shape_morning_clock.xml
+11
-0
activity_food_subsidy.xml
GoodMoney/app/src/main/res/layout/activity_food_subsidy.xml
+3
-2
activity_morning_clock.xml
GoodMoney/app/src/main/res/layout/activity_morning_clock.xml
+57
-4
fragment_horiz_channel.xml
GoodMoney/app/src/main/res/layout/fragment_horiz_channel.xml
+1
-1
fragment_main_money.xml
GoodMoney/app/src/main/res/layout/fragment_main_money.xml
+3
-3
item_rv_morning_clock.xml
GoodMoney/app/src/main/res/layout/item_rv_morning_clock.xml
+45
-0
No files found.
GoodMoney/app/build.gradle
View file @
cf792285
...
...
@@ -134,7 +134,6 @@ android {
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
// implementation 'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.appcompat:appcompat:1.0.0'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
implementation
'androidx.recyclerview:recyclerview:1.0.0'
...
...
@@ -219,9 +218,6 @@ dependencies {
// 数美
implementation
files
(
'libs/smantifraud.aar'
)
// 猎豹游戏
// implementation(name: 'cmgame-sdk-tt2203-2.0.3', ext: 'aar')
// implementation(name: 'x5fit-2.0.3', ext: 'aar')
// implementation(name: 'gdtfit-2.0.3', ext: 'aar')
implementation
(
name:
'cmgame-sdk-tt3251-2.0.7'
,
ext:
'aar'
)
implementation
(
name:
'x5fit-2.0.7'
,
ext:
'aar'
)
implementation
(
name:
'gdtfit-2.0.7'
,
ext:
'aar'
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
cf792285
...
...
@@ -16,6 +16,7 @@ import com.mints.goodmoney.common.Constant;
import
com.mints.goodmoney.manager.MiitHelper
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.UserManager
;
import
com.mints.goodmoney.manager.YlVideoManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.net.LoanService
;
import
com.mints.goodmoney.utils.ForegroundOrBackground
;
...
...
@@ -103,16 +104,13 @@ public class MintsApplication extends MultiDexApplication {
}
// 优量汇
initYlh
(
);
YlhAdManager
.
INSTANCE
.
initYlhAd
(
this
);
// 穿山甲
initCsj
(
);
TtCsjAdManager
.
init
(
this
);
// 一览视频
initYL
();
// // 猎豹游戏初始化
// LiebaoManager.getInstance().initCmGameSdk();
YlVideoManager
.
INSTANCE
.
init
(
this
);
}
private
MiitHelper
.
AppIdsUpdater
appIdsUpdater
=
ids
->
OAID
=
ids
;
...
...
@@ -130,76 +128,6 @@ public class MintsApplication extends MultiDexApplication {
}
}
/**
* 优量汇
*/
private
void
initYlh
()
{
YlhAdManager
.
INSTANCE
.
initYlhAd
(
this
);
}
/**
* 穿山甲
*/
private
void
initCsj
()
{
TtCsjAdManager
.
init
(
this
);
}
/**
* 一览视频
*/
private
void
initYL
()
{
YLUIInit
.
getInstance
()
.
setCrashOpen
(
false
)
.
setApplication
(
this
)
.
setAccessKey
(
"ylxgszgwjrr8"
)
.
setAccessToken
(
"lmnzhm9yjdlc86xiy74cjgixnqpxe4o2"
)
.
build
();
//页面个性化配置
YLUIConfig
.
getInstance
()
//抖音样式小视频配置
.
littleLikeShow
(
true
)
//是否显示点赞
.
littleShareShow
(
false
)
//是否显示分享
.
littleShowGuide
(
true
)
//是否显示新手引导滑动浮层(第一次安装进入显示)
.
littleComment
(
CommentConfig
.
CommentType
.
DISMISS_COMMENT
)
//评论,参数详见文档;
//feed流短视频样式配置
.
videoComment
(
CommentConfig
.
CommentType
.
DISMISS_COMMENT
)
//评论,参数详见文档;
.
videoLikeShow
(
false
)
//是否显示点赞
.
videoShareShow
(
false
)
//是否显示分享
.
followAvailable
(
false
)
//关注功能是否可用
.
feedAvatarClickable
(
true
)
//头像是否支持点击跳转到作者页面
.
feedPlayAuto
(
true
)
//feed自动播放
.
feedSwipeRefreshEnable
(
true
);
//feed是否可以下拉刷新
FeedConfig
.
getInstance
().
setPlayerStyle
(
FeedConfig
.
STYLE_FEED_PLAY
);
//FeedConfig.STYLE_FEED_PLAY当前页面播放
}
/**
* 鱼丸盒子
*/
public
void
initYwSdk
()
{
UserManager
userManager
=
UserManager
.
getInstance
();
String
userID
=
userManager
.
getUserID
();
if
(!
userManager
.
userIsLogin
()
||
TextUtils
.
isEmpty
(
userID
))
{
// 用户id为空 或 未登录 = 游客
userID
=
"0"
;
}
String
appid
;
String
appSecret
;
if
(
BuildConfig
.
DEBUG
)
{
appid
=
"1725"
;
appSecret
=
"0yzizbqwyjt104gsdukmto53qclo9ljs"
;
}
else
{
appid
=
"1726"
;
appSecret
=
"g4fuod79v6e7cw4liw91iwfm5qryvz1u"
;
}
String
oaid
=
""
;
if
(
Build
.
VERSION
.
SDK_INT
>
28
)
{
oaid
=
OAID
;
}
YwSDK
.
Companion
.
setDebugMode
();
YwSDK
.
Companion
.
init
(
this
,
appSecret
,
appid
,
userID
,
"1"
,
oaid
);
}
/**
* app退出
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
cf792285
...
...
@@ -100,6 +100,7 @@ object Constant {
const
val
CARRIER_EATMEAL_SUBSIDY_NOT
=
"EATMEAL_SUBSIDY_NOT"
//饭补
const
val
CARRIER_WALK_BUBBLE
=
"WALK_BUBBLE"
//走路汽泡
const
val
CARRIER_NEW_USER
=
"CARRIER_NEW_USER"
//新用户红包
const
val
CARRIER_NEW_VISITOR
=
"CARRIER_NEW_VISITOR"
//游戏首次登录
const
val
CARRIER_GAME_ONLINE
=
"GAME_ONLINE"
//跳转猎豹
const
val
CARRIER_ZHANGYUE
=
"ZHANGYUE"
//阅读书城
const
val
CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
=
"CHALLENGE_SHAREFRIEND_DOUBLE"
//邀请好友翻倍
...
...
@@ -107,6 +108,7 @@ object Constant {
const
val
CARRIER_HOMEVEDIO_DOUBLE
=
"HOMEVEDIO_DOUBLE"
//首页红包翻倍
const
val
CARRIER_SMALLHOMEVEDIO
=
"SMALLHOMEVEDIO"
//首页红包
const
val
CARRIER_SMALLHOMEVEDIO_DOUBLE
=
"SMALLHOMEVEDIO_DOUBLE"
//首页红包翻倍
const
val
CARRIER_MORNING_CLOCK
=
"MORNING_CLOCK"
//早上打卡
const
val
SHAREFRIEND_COMPLETE_1
=
"SHAREFRIEND_COMPLETE_1"
//邀请任务1
const
val
SHAREFRIEND_COMPLETE_2
=
"SHAREFRIEND_COMPLETE_2"
//邀请任务2
...
...
@@ -149,7 +151,9 @@ object Constant {
const
val
HOT_ACTIVITY_WALK
=
"walk"
const
val
HOT_ACTIVITY_CARD
=
"card"
const
val
HOT_ACTIVITY_BXM
=
"bianxianmao"
const
val
HOT_ACTIVITY_LIEBAO
=
"liebao"
const
val
HOT_ACTIVITY_EAT
=
"eat"
const
val
HOT_ACTIVITY_MORNINGCLOCK
=
"morningclock"
const
val
HOT_ACTIVITY_H5
=
"h5"
// 打开激活
...
...
@@ -165,4 +169,7 @@ object Constant {
// 首页视频时长 单位-秒
const
val
CHANNEL_SHARE
=
"share_goodmoney"
// 游客首次登录弹窗
const
val
FIRST_VISITOR_FLAG
=
"first_visitor_flag"
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/BxmManager.kt
View file @
cf792285
...
...
@@ -15,9 +15,8 @@ import com.mints.goodmoney.common.Constant
*/
object
BxmManager
{
const
val
APP_ID
=
"3b08a06c36a04eb7ad31ee31547b9e69"
const
val
BUTTON_AD_SPOT_ID
=
"807020001003"
private
const
val
APP_ID
=
"3b08a06c36a04eb7ad31ee31547b9e69"
private
const
val
BUTTON_AD_SPOT_ID
=
"807020001003"
private
var
bdAdvanceButtonAd
:
BDAdvanceButtonAd
?
=
null
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
View file @
cf792285
...
...
@@ -29,6 +29,8 @@ public class TtCsjAdManager {
public
static
final
String
TT_AD_NATIVEEXPRESS_AWARD
=
"945562047"
;
//信息流弹窗
public
static
final
String
TT_AD_NATIVEEXPRESS_WALK
=
"945562480"
;
//走路
public
static
final
String
TT_AD_NATIVEEXPRESS_WATER
=
"945562698"
;
//喝水
public
static
final
String
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
=
"945627921"
;
//早上打卡
public
static
final
String
TT_AD_NATIVEEXPRESS_EAT
=
"945627922"
;
//餐补
public
static
final
String
TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT
=
"945562050"
;
//猎豹列表和退出
/*全屏广告*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/YlVideoManager.kt
0 → 100644
View file @
cf792285
package
com.mints.goodmoney.manager
import
android.app.Application
import
com.yilan.sdk.ui.YLUIInit
import
com.yilan.sdk.ui.configs.CommentConfig
import
com.yilan.sdk.ui.configs.FeedConfig
import
com.yilan.sdk.ui.configs.YLUIConfig
/**
* 描述:一览视频(好兔)
* 作者:孟崔广
*/
object
YlVideoManager
{
private
const
val
ACCESSKEY
=
"ylxgszgwjrr8"
private
const
val
ACCESSTOKEN
=
"lmnzhm9yjdlc86xiy74cjgixnqpxe4o2"
fun
init
(
application
:
Application
)
{
YLUIInit
.
getInstance
()
.
setCrashOpen
(
false
)
.
setApplication
(
application
)
.
setAccessKey
(
ACCESSKEY
)
.
setAccessToken
(
ACCESSTOKEN
)
.
build
()
//页面个性化配置
YLUIConfig
.
getInstance
()
//抖音样式小视频配置
.
littleLikeShow
(
true
)
//是否显示点赞
.
littleShareShow
(
false
)
//是否显示分享
.
littleShowGuide
(
true
)
//是否显示新手引导滑动浮层(第一次安装进入显示)
.
littleComment
(
CommentConfig
.
CommentType
.
DISMISS_COMMENT
)
//评论,参数详见文档;
//feed流短视频样式配置
.
videoComment
(
CommentConfig
.
CommentType
.
DISMISS_COMMENT
)
//评论,参数详见文档;
.
videoLikeShow
(
false
)
//是否显示点赞
.
videoShareShow
(
false
)
//是否显示分享
.
followAvailable
(
false
)
//关注功能是否可用
.
feedAvatarClickable
(
true
)
//头像是否支持点击跳转到作者页面
.
feedPlayAuto
(
true
)
//feed自动播放
.
feedSwipeRefreshEnable
(
true
)
//feed是否可以下拉刷新
FeedConfig
.
getInstance
().
playerStyle
=
FeedConfig
.
STYLE_FEED_PLAY
//FeedConfig.STYLE_FEED_PLAY当前页面播放
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/YwhzManager.kt
0 → 100644
View file @
cf792285
package
com.mints.goodmoney.manager
import
android.app.Application
import
android.os.Build
import
android.text.TextUtils
import
com.component.dly.xzzq_ywsdk.YwSDK.Companion.init
import
com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
/**
* 描述:鱼丸盒子游戏
* 作者:孟崔广
*/
object
YwhzManager
{
private
const
val
APPID_DEBUG
=
"1725"
private
const
val
APPSECRET_DEBUG
=
"0yzizbqwyjt104gsdukmto53qclo9ljs"
private
const
val
APPID_RELEASE
=
"1726"
private
const
val
APPSECRET_RELEASE
=
"g4fuod79v6e7cw4liw91iwfm5qryvz1u"
fun
init
(
application
:
Application
){
val
userManager
=
UserManager
.
getInstance
()
var
userID
=
userManager
.
userID
if
(!
userManager
.
userIsLogin
()
||
TextUtils
.
isEmpty
(
userID
))
{
// 用户id为空 或 未登录 = 游客
userID
=
"0"
}
val
appid
:
String
val
appSecret
:
String
if
(
BuildConfig
.
DEBUG
)
{
appid
=
APPID_DEBUG
appSecret
=
APPSECRET_DEBUG
}
else
{
appid
=
APPID_RELEASE
appSecret
=
APPSECRET_RELEASE
}
var
oaid
:
String
=
""
if
(
Build
.
VERSION
.
SDK_INT
>
28
)
{
oaid
=
MintsApplication
.
OAID
}
setDebugMode
()
init
(
application
,
appSecret
,
appid
,
userID
,
"1"
,
oaid
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ZhangyueManager.kt
View file @
cf792285
...
...
@@ -9,7 +9,7 @@ import com.ireader.ireadersdk.IreaderApi
*/
object
ZhangyueManager
{
const
val
APPID
=
"10054"
private
const
val
APPID
=
"10054"
fun
onCreateIreader
(
application
:
Application
)
{
IreaderApi
.
onCreate
(
application
,
APPID
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/FriendHallMsgBean.java
View file @
cf792285
...
...
@@ -155,7 +155,7 @@ public class FriendHallMsgBean implements Serializable {
this
.
list
=
list
;
}
public
static
class
ListBean
implements
Serializable
{
public
class
ListBean
implements
Serializable
{
/**
* id : 6
* sid : 2031418094401000000
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/MorningClockBean.java
0 → 100644
View file @
cf792285
package
com
.
mints
.
goodmoney
.
mvp
.
model
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
MorningClockBean
implements
Serializable
{
private
int
continuityDays
;
private
boolean
canClick
;
private
String
buttonMsg
;
private
List
<
MorningClockTargetBean
>
targetList
;
public
int
getContinuityDays
()
{
return
continuityDays
;
}
public
boolean
isCanClick
()
{
return
canClick
;
}
public
String
getButtonMsg
()
{
return
buttonMsg
;
}
public
List
<
MorningClockTargetBean
>
getTargetList
()
{
return
targetList
;
}
public
class
MorningClockTargetBean
implements
Serializable
{
private
int
needDays
;
private
int
coin
;
private
String
buttonMsg
;
public
int
getNeedDays
()
{
return
needDays
;
}
public
int
getCoin
()
{
return
coin
;
}
public
String
getButtonMsg
()
{
return
buttonMsg
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/MyInfo.java
View file @
cf792285
...
...
@@ -29,7 +29,7 @@ public class MyInfo implements Serializable {
this
.
autoList
=
autoList
;
}
public
static
class
UserMsgBean
implements
Serializable
{
public
class
UserMsgBean
implements
Serializable
{
/**
* surplus : 0
* idcode : 20000001
...
...
@@ -75,7 +75,7 @@ public class MyInfo implements Serializable {
}
}
public
static
class
AutoListBean
implements
Serializable
{
public
class
AutoListBean
implements
Serializable
{
/**
* baseConfig : {"buttonText":"去赚钱","coinText":"+2000金币","context":"分分钟赚金币,翻倍还能赚更多","hotType":0,"title":"看首页视频","taskId":"TO_HOME"}
* otherConfig : {"doubleCoin":50,"max":20,"carrierType":"CHALLENGE_SHAREFRIEND","doubleCarrierType":"CHALLENGE_SHAREFRIEND_DOUBLE","complete":0,"status":0,"coin":50}
...
...
@@ -100,7 +100,7 @@ public class MyInfo implements Serializable {
this
.
otherConfig
=
otherConfig
;
}
public
static
class
BaseConfigBean
implements
Serializable
{
public
class
BaseConfigBean
implements
Serializable
{
/**
* buttonText : 去赚钱
* coinText : +2000金币
...
...
@@ -175,7 +175,7 @@ public class MyInfo implements Serializable {
}
}
public
static
class
OtherConfigBean
implements
Serializable
{
public
class
OtherConfigBean
implements
Serializable
{
/**
* doubleCoin : 50
* max : 20
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserMsgBean.java
View file @
cf792285
...
...
@@ -4,8 +4,13 @@ import java.io.Serializable;
public
class
UserMsgBean
implements
Serializable
{
private
int
firstGiveCoin
;
private
int
showCoin
;
public
int
getFirstGiveCoin
()
{
return
firstGiveCoin
;
}
public
int
getShowCoin
()
{
return
showCoin
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MorningClockPresenter.java
deleted
100755 → 0
View file @
8304195e
package
com
.
mints
.
goodmoney
.
mvp
.
presenters
;
import
com.mints.goodmoney.manager.AppHttpManager
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.model.DrawcashBean
;
import
com.mints.goodmoney.mvp.views.MorningClockView
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
public
class
MorningClockPresenter
extends
BasePresenter
<
MorningClockView
>
{
/**
* 获取用户配置信息
*/
public
void
getUserTaskMsg
()
{
view
.
showLoading
(
"加载中..."
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getDrawcashUserTaskMsg
(),
new
BaseSubscriber
<
BaseResponse
<
DrawcashBean
>>()
{
@Override
public
void
onCompleted
()
{
if
(
isLinkView
())
return
;
view
.
hideLoading
();
}
@Override
public
void
onError
(
Throwable
e
)
{
if
(
isLinkView
())
return
;
view
.
hideLoading
();
view
.
showToast
(
e
.
getMessage
());
}
@Override
public
void
onNext
(
BaseResponse
<
DrawcashBean
>
baseResponse
)
{
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
String
message
=
baseResponse
.
getMessage
();
switch
(
code
)
{
case
200
:
//成功
break
;
default
:
view
.
showToast
(
message
);
break
;
}
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MorningClockPresenter.kt
0 → 100644
View file @
cf792285
package
com.mints.goodmoney.mvp.presenters
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.MorningClockBean
import
com.mints.goodmoney.mvp.views.MorningClockView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
java.util.*
class
MorningClockPresenter
:
BasePresenter
<
MorningClockView
>()
{
/**
* 早上打卡信息
*/
open
fun
getUpEarlySignMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getUpEarlySignMsg
(),
object
:
BaseSubscriber
<
BaseResponse
<
MorningClockBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
.
message
)
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MorningClockBean
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
getUpEarlySignMsgSuc
(
baseResponse
.
data
)
else
->
view
.
showToast
(
message
)
}
}
})
}
/**
* 早上打卡
*/
fun
getUpEarlyClickButton
(
adSource
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"adSource"
]
=
adSource
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getUpEarlyClickButton
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
}
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
view
.
showToast
(
e
.
message
)
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
View file @
cf792285
...
...
@@ -19,7 +19,6 @@ class MyPresenter : BasePresenter<MyView>() {
* 获取签到内容
*/
open
fun
getSignInHomePageMsg
()
{
// view.showLoading("加载中...");
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
signInHomePageMsg
,
object
:
BaseSubscriber
<
BaseResponse
<
SignCardBean
>>()
{
...
...
@@ -41,9 +40,6 @@ class MyPresenter : BasePresenter<MyView>() {
when
(
code
)
{
200
->
view
.
getSignInHomePageMsgSuc
(
baseResponse
.
data
)
401
->
{
}
else
->
view
.
showToast
(
message
)
}
}
})
...
...
@@ -71,12 +67,8 @@ class MyPresenter : BasePresenter<MyView>() {
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
signInHomePageSuc
()
else
->
{
view
.
showToast
(
message
)
}
}
}
})
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/MorningClockView.kt
View file @
cf792285
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.MorningClockBean
interface
MorningClockView
:
BaseView
{
fun
getUpEarlySignMsgSuc
(
data
:
MorningClockBean
)
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
cf792285
...
...
@@ -13,6 +13,7 @@ import com.mints.goodmoney.mvp.model.FriendsTaskBean;
import
com.mints.goodmoney.mvp.model.GoldRecordBean
;
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
;
import
com.mints.goodmoney.mvp.model.MealBean
;
import
com.mints.goodmoney.mvp.model.MorningClockBean
;
import
com.mints.goodmoney.mvp.model.MyInfo
;
import
com.mints.goodmoney.mvp.model.SignCardBean
;
import
com.mints.goodmoney.mvp.model.UserBean
;
...
...
@@ -418,6 +419,22 @@ public interface LoanService {
@POST
(
"api/getMealMsg"
)
Observable
<
BaseResponse
<
MealBean
>>
getMealMsg
();
/**
* 早上打卡信息
*
* @return
*/
@POST
(
"api/getUpEarlySignMsg"
)
Observable
<
BaseResponse
<
MorningClockBean
>>
getUpEarlySignMsg
();
/**
* 早上打卡
*
* @return
*/
@POST
(
"api/getUpEarlyClickButton"
)
Observable
<
BaseResponse
<
Object
>>
getUpEarlyClickButton
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
cf792285
...
...
@@ -83,7 +83,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
awardPresenter
.
reportAddCoinMsg
(
vo
)
tvAwardContent
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
tvAwardNext
.
setText
(
"看视频
赚
${extraId}金币"
)
tvAwardNext
.
setText
(
"看视频
再领
${extraId}金币"
)
carrierType
=
Constant
.
CARRIER_HOMEVEDIO_DOUBLE
}
...
...
@@ -93,7 +93,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
awardPresenter
.
reportAddCoinMsg
(
vo
)
tvAwardContent
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
tvAwardNext
.
setText
(
"看视频
赚
${extraId}金币"
)
tvAwardNext
.
setText
(
"看视频
再领
${extraId}金币"
)
carrierType
=
Constant
.
CARRIER_SMALLHOMEVEDIO_DOUBLE
}
...
...
@@ -103,7 +103,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
awardPresenter
.
reportAddCoinMsg
(
vo
)
tvAwardContent
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
tvAwardNext
.
setText
(
"看视频
赚
${extraId}金币"
)
tvAwardNext
.
setText
(
"看视频
再领
${extraId}金币"
)
carrierType
=
Constant
.
CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
}
...
...
@@ -113,6 +113,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardHint
.
setVisibility
(
View
.
VISIBLE
)
tvAwardHint
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
}
Constant
.
CARRIER_NEW_VISITOR
->
{
tvAwardContent
.
setText
(
"新人红包"
)
tvAwardNext
.
setText
(
"点击领取"
)
tvAwardHint
.
setVisibility
(
View
.
VISIBLE
)
tvAwardHint
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
}
Constant
.
CARRIER_OFFLINE_DOUBLE
->
{
tvAwardContent
.
setText
(
"离线收益奖励"
+
curCoin
+
"金币"
)
tvAwardNext
.
setText
(
"金币翻倍"
)
...
...
@@ -139,7 +145,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
,
Constant
.
CARRIER_WALK_BUBBLE
,
Constant
.
CARRIER_EATMEAL_SUBSIDY
,
Constant
.
CARRIER_WALK
,
Constant
.
CARRIER_HOMEWATER
->
{
tvAwardContent
.
setText
(
"看视频领
取
"
+
curCoin
+
"金币"
)
tvAwardContent
.
setText
(
"看视频领"
+
curCoin
+
"金币"
)
}
else
->
{
tvAwardContent
.
setText
(
curCoin
.
toString
()
+
"金币已到账"
)
...
...
@@ -208,6 +214,9 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant
.
CARRIER_WALK
,
Constant
.
CARRIER_HOMEWATER
->
{
awardVedio
()
}
Constant
.
CARRIER_NEW_VISITOR
->
{
readyGoThenKill
(
LoginActivity
::
class
.
java
)
}
else
->
{
finish
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/FoodSubsidyActivity.kt
View file @
cf792285
...
...
@@ -95,7 +95,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
private
fun
initExpress
()
{
try
{
ttNativeExpressManager
.
initTTAd
(
false
)
ttNativeExpressManager
.
getNativeExpressInit
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_
WALK
,
flWalkAd
,
320f
,
0f
)
ttNativeExpressManager
.
getNativeExpressInit
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_
EAT
,
flWalkAd
,
320f
,
0f
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/LoginActivity.kt
View file @
cf792285
...
...
@@ -13,6 +13,7 @@ import com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.login.LoginApi
import
com.mints.goodmoney.login.OnLoginListener
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.mvp.model.WXInfo
import
com.mints.goodmoney.mvp.presenters.LoginPresenter
import
com.mints.goodmoney.mvp.views.LoginView
...
...
@@ -175,7 +176,7 @@ class LoginActivity : BaseActivity()
override
fun
loginSuc
()
{
try
{
// 登录成功初始化鱼玩盒子userid
baseApplication
.
initYwSdk
(
)
YwhzManager
.
init
(
baseApplication
)
}
catch
(
e
:
Exception
)
{
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
cf792285
...
...
@@ -123,7 +123,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_iv_main
.
isSelected
=
true
tab_tv_main
.
isSelected
=
true
tab_iv_channel
.
isSelected
=
false
tab_
i
v_channel
.
isSelected
=
false
tab_
t
v_channel
.
isSelected
=
false
tab_iv_pan
.
isSelected
=
false
tab_tv_pan
.
isSelected
=
false
tab_iv_friends
.
isSelected
=
false
...
...
@@ -150,7 +150,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
true
tab_
i
v_channel
.
isSelected
=
true
tab_
t
v_channel
.
isSelected
=
true
tab_iv_pan
.
isSelected
=
false
tab_tv_pan
.
isSelected
=
false
tab_iv_friends
.
isSelected
=
false
...
...
@@ -171,7 +171,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_
i
v_channel
.
isSelected
=
false
tab_
t
v_channel
.
isSelected
=
false
tab_iv_pan
.
isSelected
=
false
tab_tv_pan
.
isSelected
=
false
tab_iv_friends
.
isSelected
=
true
...
...
@@ -192,7 +192,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_
i
v_channel
.
isSelected
=
false
tab_
t
v_channel
.
isSelected
=
false
tab_iv_pan
.
isSelected
=
true
tab_tv_pan
.
isSelected
=
true
tab_iv_friends
.
isSelected
=
false
...
...
@@ -213,7 +213,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_
i
v_channel
.
isSelected
=
false
tab_
t
v_channel
.
isSelected
=
false
tab_iv_pan
.
isSelected
=
false
tab_tv_pan
.
isSelected
=
false
tab_iv_friends
.
isSelected
=
false
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
View file @
cf792285
package
com.mints.goodmoney.ui.activitys
import
android.view.View
import
androidx.recyclerview.widget.GridLayoutManager
import
com.mints.goodmoney.R
import
com.mints.goodmoney.mvp.presenters.DrawcashPresenter
import
com.mints.goodmoney.ad.video.VedioAdingManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TTNativeExpressManager
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.mvp.model.MorningClockBean
import
com.mints.goodmoney.mvp.model.VedioAdingBean
import
com.mints.goodmoney.mvp.presenters.MorningClockPresenter
import
com.mints.goodmoney.mvp.views.MorningClockView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.adapter.MorningClockAdapter
import
kotlinx.android.synthetic.main.activity_morning_clock.*
import
kotlinx.android.synthetic.main.activity_water.*
import
kotlinx.android.synthetic.main.header_layout.*
/**
...
...
@@ -17,34 +26,132 @@ class MorningClockActivity : BaseActivity()
,
View
.
OnClickListener
,
MorningClockView
{
private
val
morningClockPresenter
by
lazy
{
MorningClockPresenter
()
}
private
val
ttNativeExpressManager
by
lazy
{
TTNativeExpressManager
()
}
private
lateinit
var
morningClockAdapter
:
MorningClockAdapter
private
var
morningClockList
:
MutableList
<
MorningClockBean
.
MorningClockTargetBean
>?
=
null
private
lateinit
var
vedioAdingManager
:
VedioAdingManager
private
var
loadVedioFailCount
=
0
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_morning_clock
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
initViewsAndEvents
()
{
tv_title
.
text
=
"早起打卡"
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
this
)
initListener
()
morningClockPresenter
.
attachView
(
this
)
}
override
fun
onResume
()
{
super
.
onResume
()
initExpress
()
morningClockPresenter
.
getUpEarlySignMsg
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
ttNativeExpressManager
.
onTTAdDestroy
()
morningClockPresenter
.
detachView
()
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
finish
()
R
.
id
.
ivMorningClockBack
->
finish
()
R
.
id
.
tvMorningClockClick
->
{
awardVedio
()
}
}
}
override
fun
getUpEarlySignMsgSuc
(
data
:
MorningClockBean
)
{
morningClockList
=
data
.
targetList
tvMorningClockClick
.
isEnabled
=
data
.
isCanClick
tvMorningClockClick
.
text
=
data
.
buttonMsg
initRvView
()
}
private
fun
initRvView
()
{
if
(
morningClockList
!=
null
&&
morningClockList
!!
.
size
>
0
)
{
val
gridLayoutManager
=
GridLayoutManager
(
this
,
4
)
rvMorningClock
.
layoutManager
=
gridLayoutManager
morningClockAdapter
=
MorningClockAdapter
(
morningClockList
!!
)
rvMorningClock
.
adapter
=
morningClockAdapter
}
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
ivMorningClockBack
.
setOnClickListener
(
this
)
tvMorningClockClick
.
setOnClickListener
(
this
)
}
/**
* 获取激励视频
*/
private
fun
awardVedio
()
{
if
(
vedioAdingManager
.
vedioFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
showLoading
(
"加载中..."
)
val
bean
=
VedioAdingBean
()
bean
.
carrierType
=
Constant
.
CARRIER_MORNING_CLOCK
loadVedio
(
vedioAdingManager
,
bean
,
true
)
}
/**
* 加载激励视频
*/
private
fun
loadVedio
(
vedioAdingManager
:
VedioAdingManager
,
bean
:
VedioAdingBean
,
isFirstLoad
:
Boolean
)
{
vedioAdingManager
.
setVedioAdingListener
(
object
:
VedioAdingManager
.
VedioAdingListener
{
override
fun
vedioAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
vedioAdingListenerFail
(
adType
:
String
)
{
loadVedioFailCount
++
if
(
loadVedioFailCount
>=
2
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
loadVedio
(
vedioAdingManager
,
bean
,
false
)
}
}
override
fun
vedioAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
vedioAdingSuccess
(
adType
)
}
})
if
(
isFirstLoad
)
{
// 首页按权重加载
vedioAdingManager
.
loadAding
(
this
,
bean
)
}
else
{
// 失败按优先级加载
vedioAdingManager
.
loadFailAding
(
this
,
bean
)
}
}
private
fun
vedioAdingSuccess
(
adType
:
String
)
{
morningClockPresenter
.
getUpEarlyClickButton
(
adType
)
}
/**
* 初始化信息iyc
*/
private
fun
initExpress
()
{
try
{
ttNativeExpressManager
.
initTTAd
(
false
)
ttNativeExpressManager
.
getNativeExpressInit
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
,
flMorningClockAd
,
320f
,
0f
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/MorningClockAdapter.kt
0 → 100644
View file @
cf792285
package
com.mints.goodmoney.ui.adapter
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.mints.goodmoney.R
import
com.mints.goodmoney.mvp.model.MorningClockBean
class
MorningClockAdapter
(
val
morningClockList
:
MutableList
<
MorningClockBean
.
MorningClockTargetBean
>)
:
RecyclerView
.
Adapter
<
MorningClockAdapter
.
ViewHolder
>()
{
lateinit
var
context
:
Context
lateinit
var
mOnItemClickListener
:
OnItemClickListener
inner
class
ViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
val
rlMorningClockItemRoot
:
LinearLayout
=
view
.
findViewById
(
R
.
id
.
rlMorningClockItemRoot
)
val
tvMorningClockItemDay
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvMorningClockItemDay
)
val
tvMorningClockItemCoin
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvMorningClockItemCoin
)
val
tvMorningClockItemStatus
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvMorningClockItemStatus
)
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
context
=
parent
.
context
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
item_rv_morning_clock
,
parent
,
false
)
val
viewHolder
=
ViewHolder
(
view
)
return
viewHolder
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
val
morningClockBean
=
morningClockList
[
position
]
holder
.
tvMorningClockItemDay
.
text
=
morningClockBean
.
needDays
.
toString
()
holder
.
tvMorningClockItemCoin
.
text
=
"${morningClockBean.coin}金币"
holder
.
tvMorningClockItemStatus
.
text
=
morningClockBean
.
buttonMsg
holder
.
itemView
.
setTag
(
position
)
}
override
fun
getItemCount
()
=
morningClockList
.
size
interface
OnItemClickListener
{
fun
onItemClick
(
position
:
Int
)
}
fun
setOnItemClickListener
(
listener
:
OnItemClickListener
)
{
mOnItemClickListener
=
listener
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/DhGameFragment.kt
View file @
cf792285
package
com.mints.goodmoney.ui.fragment
import
android.annotation.SuppressLint
import
android.content.Intent
import
android.content.pm.ApplicationInfo
import
android.net.Uri
...
...
@@ -20,6 +21,7 @@ import kotlinx.android.synthetic.main.fragment_main_dh.*
/**
* 描述:电魂游戏
* 作者:孟崔广
* 时间:2020/11/17 13:48
*/
class
DhGameFragment
:
LazyLoadBaseFragment
(),
View
.
OnClickListener
{
...
...
@@ -61,7 +63,7 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
}
override
fun
onClick
(
v
:
View
)
{
when
(
v
?
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
ivDhBack
->
{
dh_webview
.
goBack
()
}
...
...
@@ -74,9 +76,10 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
/**
* 加载H5Game
*/
@SuppressLint
(
"SetJavaScriptEnabled"
)
private
fun
loadH5Game
()
{
dh_webview
?.
let
{
va
r
loadUrl
=
getLoadUrl
()
va
l
loadUrl
=
getLoadUrl
()
LogUtil
.
d
(
TAG
,
"url-->${loadUrl}"
)
val
settings
=
it
.
settings
// 本地 DOM 存储(解决加载某些网页出现白板现象)
...
...
@@ -127,7 +130,7 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
*/
fun
getLoadUrl
():
String
{
val
currentTimeMillis
=
System
.
currentTimeMillis
()
/
1000
va
r
loadUrl
=
"${AUTH_URL}?"
+
va
l
loadUrl
=
"${AUTH_URL}?"
+
"channel=${CHANNEL}&"
+
"openid=${URIEncoder.encodeURIComponent(UserManager.getInstance().userID)}&"
+
"time=${currentTimeMillis}&"
+
...
...
@@ -157,7 +160,7 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
fun
isAppExist
(
pkgName
:
String
):
Boolean
{
var
info
:
ApplicationInfo
?
=
null
try
{
context
?.
getPackageManager
()
!!
.
getApplicationInfo
(
pkgName
,
0
)
info
=
context
?.
getPackageManager
()
!!
.
getApplicationInfo
(
pkgName
,
0
)
context
!!
.
startActivity
(
context
!!
.
packageManager
.
getLaunchIntentForPackage
(
pkgName
))
}
catch
(
e
:
Exception
)
{
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
cf792285
...
...
@@ -6,6 +6,7 @@ import android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
androidx.fragment.app.FragmentTransaction
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.video.VedioAdingManager
import
com.mints.goodmoney.common.AppConfig
...
...
@@ -17,11 +18,14 @@ import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.presenters.HomePresenter
import
com.mints.goodmoney.mvp.views.HomeView
import
com.mints.goodmoney.ui.activitys.AwardActivity
import
com.mints.goodmoney.ui.activitys.LoginActivity
import
com.mints.goodmoney.ui.activitys.MainActivity
import
com.mints.goodmoney.ui.activitys.WebActivity
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.ui.widgets.PowerDialog
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.utils.CommonUtils
import
com.yilan.sdk.player.ylplayer.YLPlayerConfig
import
com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import
com.yilan.sdk.ui.configs.YLUIConfig
...
...
@@ -45,6 +49,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
private
var
powerDialog
:
PowerDialog
?
=
null
private
var
userMsgBean
:
UserTaskMsgBean
?
=
null
// 视频相关
private
var
rewardDoubleCoin
=
0
// 大金币
private
var
rewardCoin
=
0
// 小金币
...
...
@@ -85,7 +91,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onSuccess"
)
LogUtil
.
d
(
TAG
,
"onSuccess"
)
}
override
fun
onError
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
Int
,
p4
:
String
?,
p5
:
String
?)
{
...
...
@@ -95,7 +101,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onShow
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onShow"
)
LogUtil
.
d
(
TAG
,
"onShow"
)
resumeAdTime
()
}
...
...
@@ -110,21 +116,21 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onAdEmpty
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{}
override
fun
onVideoStart
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
)
{
LogUtil
.
d
(
TAG
,
"onVideoStart"
)
LogUtil
.
d
(
TAG
,
"onVideoStart"
)
}
override
fun
onVideoPause
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoPause"
)
LogUtil
.
d
(
TAG
,
"onVideoPause"
)
pauseDownloadTime
()
}
override
fun
onVideoResume
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoResume"
)
LogUtil
.
d
(
TAG
,
"onVideoResume"
)
resumeAdTime
()
}
override
fun
onVideoComplete
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
LogUtil
.
d
(
TAG
,
"onVideoComplete"
)
LogUtil
.
d
(
TAG
,
"onVideoComplete"
)
pauseDownloadTime
()
}
...
...
@@ -133,7 +139,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
})
}
private
fun
resumeAdTime
(){
private
fun
resumeAdTime
()
{
// 视频未转满 且 界面切换时可继续加进度
if
(!
isAward
)
{
cdvvYilanTime
?.
resume
()
...
...
@@ -205,6 +211,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
return
}
userMsgBean
=
data
// 新人福利
if
(
data
.
userMsg
.
firstGiveCoin
>
0
)
{
val
bundle
=
Bundle
()
...
...
@@ -303,18 +311,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
isFirstLoadVedio
=
false
initTimeview
()
}
else
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStart"
)
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStart"
)
resumeDownloadTime
(
videoid
)
}
}
override
fun
onPause
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onPause"
)
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onPause"
)
pauseDownloadTime
()
}
override
fun
onResume
(
pager
:
String
,
videoid
:
String
,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onResume"
)
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onResume"
)
resumeDownloadTime
(
videoid
)
}
...
...
@@ -323,7 +331,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onLoopComplete"
)
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onLoopComplete"
)
addVedioIdList
(
videoID
)
pauseDownloadTime
()
}
...
...
@@ -340,7 +348,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
override
fun
onStop
(
pager
:
String
,
p1
:
String
?,
p2
:
String
?)
{
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStop"
)
LogUtil
.
d
(
TAG
,
"registerPlayerCallBack onStop"
)
// pauseDownloadTime()
}
})
...
...
@@ -445,6 +453,16 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
)
{
powerDialog
!!
.
dismiss
()
ps
.
put
(
Constant
.
LOAN_PERMISSION_FLAG
,
false
)
// 游客首次提示1500新人奖励 且 不是分享包
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(!
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
)
&&
ps
.
getBoolean
(
Constant
.
FIRST_VISITOR_FLAG
,
true
))
{
ps
.
put
(
Constant
.
FIRST_VISITOR_FLAG
,
false
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
if
(
userMsgBean
!=
null
&&
userMsgBean
!!
.
userMsg
.
showCoin
>
0
)
userMsgBean
?.
userMsg
?.
showCoin
!!
else
1500
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_NEW_VISITOR
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
cf792285
...
...
@@ -23,6 +23,7 @@ import com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.BxmManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.YwhzManager
import
com.mints.goodmoney.mvp.model.*
import
com.mints.goodmoney.mvp.presenters.MyPresenter
import
com.mints.goodmoney.mvp.views.MyView
...
...
@@ -94,7 +95,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
baseApplication
.
initYwSdk
(
)
YwhzManager
.
init
(
baseApplication
)
}
}
else
{
// 游客登录
...
...
@@ -216,8 +217,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
return
}
myPresenter
.
getSignInHomePageMsg
()
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curSignCoin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_AWARD
)
...
...
@@ -344,9 +343,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
.
subscribe
{
granted
:
Boolean
->
if
(
granted
)
{
// if (userManager.adShowFlag) {
if
(
finalSignStatus
==
0
)
{
myPresenter
.
signInHomePage
()
}
else
if
(
finalSignStatus
==
1
)
{
// if (finalSignStatus == 0) {
// myPresenter.signInHomePage()
// } else
if
(
finalSignStatus
==
1
)
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curSignCoin
*
2
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_CARD
)
...
...
@@ -609,6 +610,12 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
Constant
.
HOT_ACTIVITY_CARD
->
{
readyGo
(
EraseActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_LIEBAO
->
{
readyGo
(
LiebaoGameActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_MORNINGCLOCK
->
{
readyGo
(
MorningClockActivity
::
class
.
java
)
}
Constant
.
HOT_ACTIVITY_BXM
->
{
// 消费变现猫事件
}
...
...
GoodMoney/app/src/main/res/drawable/shape_morning_clock.xml
0 → 100644
View file @
cf792285
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"5dip"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/main_bg_text"
/>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/activity_food_subsidy.xml
View file @
cf792285
...
...
@@ -13,7 +13,7 @@
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"
40
0dp"
android:layout_height=
"
36
0dp"
android:background=
"@mipmap/bg_eat"
>
<ImageView
...
...
@@ -29,6 +29,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"60dp"
android:visibility=
"gone"
android:src=
"@mipmap/ic_font_water"
/>
<com.mints.goodmoney.ui.widgets.MealView
...
...
@@ -36,7 +37,7 @@
android:layout_width=
"375dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"
10
0dp"
/>
android:layout_marginTop=
"
8
0dp"
/>
</FrameLayout>
...
...
GoodMoney/app/src/main/res/layout/activity_morning_clock.xml
View file @
cf792285
<?xml version="1.0" encoding="utf-8"?>
<
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
android:fadingEdge=
"none"
android:overScrollMode=
"never"
>
<include
layout=
"@layout/header_layout"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
</LinearLayout>
<FrameLayout
android:visibility=
"invisible"
android:layout_width=
"match_parent"
android:layout_height=
"340dp"
android:background=
"@mipmap/bg_walk"
>
<ImageView
android:id=
"@+id/ivMorningClockBack"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:padding=
"15dp"
android:src=
"@drawable/yl_mp_ic_back_left"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"60dp"
android:src=
"@mipmap/ic_font_water"
/>
<TextView
android:id=
"@+id/tvMorningClockClick"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"200dp"
android:enabled=
"false"
></TextView>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvMorningClock"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"10dp"
android:background=
"@null"
android:overScrollMode=
"never"
/>
<FrameLayout
android:id=
"@+id/flMorningClockAd"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:background=
"@color/full_transparent"
>
</FrameLayout>
</LinearLayout>
</ScrollView>
GoodMoney/app/src/main/res/layout/fragment_horiz_channel.xml
View file @
cf792285
...
...
@@ -7,7 +7,7 @@
android:id=
"@+id/yilan_fragment_frame_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:paddingTop=
"
20
dp"
/>
android:paddingTop=
"
32
dp"
/>
<LinearLayout
android:layout_width=
"wrap_content"
...
...
GoodMoney/app/src/main/res/layout/fragment_main_money.xml
View file @
cf792285
...
...
@@ -10,15 +10,15 @@
android:id=
"@+id/xtFragmentMoney"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"
2
0dp"
android:layout_marginTop=
"
3
0dp"
app:xTabIndicatorColor=
"#F28335"
app:xTabIndicatorHeight=
"4dp"
app:xTabMode=
"scrollable"
app:xTabSelectedTextColor=
"@color/main_mints"
app:xTabSelectedTextSize=
"2
0
sp"
app:xTabSelectedTextSize=
"2
2
sp"
app:xTabTextColor=
"#000"
app:xTabIndicatorWidth=
"10dp"
app:xTabTextSize=
"1
5
sp"
/>
app:xTabTextSize=
"1
8
sp"
/>
<com.mints.goodmoney.ui.widgets.MyViewPager
android:id=
"@+id/vpFragmentMoney"
...
...
GoodMoney/app/src/main/res/layout/item_rv_morning_clock.xml
0 → 100644
View file @
cf792285
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/rlMorningClockItemRoot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_horizontal"
android:background=
"@drawable/shape_morning_clock"
android:layout_gravity=
"center_horizontal"
android:layout_margin=
"6dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tvMorningClockItemDay"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:textSize=
"12sp"
android:textColor=
"@color/ban_transparent"
android:text=
"7天"
/>
<TextView
android:id=
"@+id/tvMorningClockItemCoin"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginLeft=
"6dp"
android:layout_marginRight=
"6dp"
android:gravity=
"center"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:text=
"1600金币"
/>
<TextView
android:id=
"@+id/tvMorningClockItemStatus"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:layout_marginBottom=
"14dp"
android:textSize=
"14sp"
android:textColor=
"@color/black"
android:text=
"领取"
/>
</LinearLayout>
\ No newline at end of file
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