Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold
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_highgold
Commits
6890a753
Commit
6890a753
authored
Sep 02, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加喝水界面
parent
e4634a4a
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
291 additions
and
884 deletions
+291
-884
Constant.java
...app/src/main/java/com/mints/highgold/common/Constant.java
+1
-0
NotifyManager.java
...c/main/java/com/mints/highgold/manager/NotifyManager.java
+22
-9
TTAdManagerHolder.java
...in/java/com/mints/highgold/manager/TTAdManagerHolder.java
+2
-0
TTNativeExpressManager.java
...va/com/mints/highgold/manager/TTNativeExpressManager.java
+3
-1
WalkBean.java
.../src/main/java/com/mints/highgold/mvp/model/WalkBean.java
+38
-0
LoanPresenter.java
...java/com/mints/highgold/mvp/presenters/LoanPresenter.java
+3
-2
WaterPresenter.java
...ava/com/mints/highgold/mvp/presenters/WaterPresenter.java
+0
-411
LoanView.java
.../src/main/java/com/mints/highgold/mvp/views/LoanView.java
+2
-1
WaterView.java
...src/main/java/com/mints/highgold/mvp/views/WaterView.java
+0
-19
LoanService.java
...app/src/main/java/com/mints/highgold/net/LoanService.java
+2
-1
WaterActivity.java
...n/java/com/mints/highgold/ui/activitys/WaterActivity.java
+59
-134
MainFragment.java
...ain/java/com/mints/highgold/ui/fragment/MainFragment.java
+29
-42
StepView.java
...src/main/java/com/mints/highgold/ui/widgets/StepView.java
+4
-8
BubbleSeekBar.java
.../com/mints/highgold/ui/widgets/seekbar/BubbleSeekBar.java
+2
-1
activity_water.xml
highgold/app/src/main/res/layout/activity_water.xml
+73
-231
fragment_main_first.xml
highgold/app/src/main/res/layout/fragment_main_first.xml
+2
-2
remoteview.xml
highgold/app/src/main/res/layout/remoteview.xml
+43
-18
view_dialog_main_drink.xml
highgold/app/src/main/res/layout/view_dialog_main_drink.xml
+1
-0
view_step.xml
highgold/app/src/main/res/layout/view_step.xml
+4
-4
dimens.xml
highgold/app/src/main/res/values/dimens.xml
+1
-0
No files found.
highgold/app/src/main/java/com/mints/highgold/common/Constant.java
View file @
6890a753
...
...
@@ -168,6 +168,7 @@ public interface Constant {
String
CARRIER_HOTACTIVITY
=
"HOTACTIVITY"
;
//热门活动
String
CARRIER_ROTATIONCHART
=
"ROTATIONCHART"
;
//轮播图
String
CARRIER_YILANVEIDO_REDENVELOPE
=
"YILANVEIDO_REDENVELOPE"
;
//yl视频红包
String
CARRIER_WALK_BUBBLE
=
"WALK_BUBBLE"
;
//走路第4个汽泡
String
CARRIER_CHALLENGE_FIRSTWATER
=
"CHALLENGE_FIRSTWATER"
;
//首次喝水挑战
String
CARRIER_CHALLENGE_IDCODE
=
"CHALLENGE_IDCODE"
;
//绑定邀请码挑战
...
...
highgold/app/src/main/java/com/mints/highgold/manager/NotifyManager.java
View file @
6890a753
...
...
@@ -6,13 +6,16 @@ import android.app.Notification;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
import
android.app.PendingIntent
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.support.v4.app.NotificationCompat
;
import
android.widget.RemoteViews
;
import
com.mints.highgold.MintsApplication
;
import
com.mints.highgold.R
;
import
com.mints.highgold.ui.activitys.MainActivity
;
import
com.mints.highgold.utils.SpanUtils
;
import
static
android
.
content
.
Context
.
NOTIFICATION_SERVICE
;
...
...
@@ -21,7 +24,7 @@ import static android.content.Context.NOTIFICATION_SERVICE;
*/
public
class
NotifyManager
{
public
static
final
String
CHINALL_ID
=
"
MINTS_
GOLDSPACE"
;
public
static
final
String
CHINALL_ID
=
"GOLDSPACE"
;
public
static
final
String
CHINALL_NAME
=
"淘金高额版通知"
;
private
static
NotifyManager
_inst
;
...
...
@@ -46,13 +49,14 @@ public class NotifyManager {
/**
* 创建通知
*
* @param water
* @param step
*/
public
void
createNotifyDialog
(
int
water
,
int
step
)
{
manager
=
(
NotificationManager
)
activity
.
getSystemService
(
NOTIFICATION_SERVICE
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
createNotificationChannel
(
CHINALL_ID
,
CHINALL_NAME
,
NotificationManager
.
IMPORTANCE_
DEFAULT
);
createNotificationChannel
(
CHINALL_ID
,
CHINALL_NAME
,
NotificationManager
.
IMPORTANCE_
MAX
);
}
notification
=
new
NotificationCompat
.
Builder
(
activity
,
CHINALL_ID
)
.
setOngoing
(
true
)
...
...
@@ -60,10 +64,11 @@ public class NotifyManager {
.
setContentTitle
(
""
)
.
setContentText
(
""
)
.
setWhen
(
System
.
currentTimeMillis
())
.
setOngoing
(
true
)
.
setSmallIcon
(
R
.
mipmap
.
ic_launcher
)
.
setContent
(
getRemoteViews
(
water
,
step
))
.
setVibrate
(
new
long
[]{
0
})
.
build
();
updateRemoteView
(
water
,
step
);
}
...
...
@@ -73,6 +78,8 @@ public class NotifyManager {
@TargetApi
(
Build
.
VERSION_CODES
.
O
)
private
void
createNotificationChannel
(
String
channelId
,
String
channelName
,
int
importance
)
{
NotificationChannel
channel
=
new
NotificationChannel
(
channelId
,
channelName
,
importance
);
channel
.
enableVibration
(
false
);
//震动不可用
channel
.
setSound
(
null
,
null
);
//设置没有声
NotificationManager
notificationManager
=
(
NotificationManager
)
activity
.
getSystemService
(
NOTIFICATION_SERVICE
);
notificationManager
.
createNotificationChannel
(
channel
);
...
...
@@ -89,10 +96,9 @@ public class NotifyManager {
Intent
intent
=
new
Intent
(
activity
,
MainActivity
.
class
);
PendingIntent
pendingIntent
=
PendingIntent
.
getActivity
(
activity
,
0
,
intent
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
remoteViews
=
new
RemoteViews
(
activity
.
getPackageName
(),
R
.
layout
.
remoteview
);
remoteViews
.
setTextViewText
(
R
.
id
.
tv_left
,
"开始"
+
System
.
currentTimeMillis
());
//设置textView内容
remoteViews
.
setTextViewText
(
R
.
id
.
tv_right
,
"跳转"
+
step
);
//设置textView内容
remoteViews
.
setImageViewResource
(
R
.
id
.
icon
,
R
.
mipmap
.
ic_launcher
);
//设置图片样式
remoteViews
.
setOnClickPendingIntent
(
R
.
id
.
tv_right
,
pendingIntent
);
//点击跳转事件
remoteViews
.
setTextViewText
(
R
.
id
.
notify_step
,
"今日步数 "
+
step
+
" 步"
);
remoteViews
.
setImageViewResource
(
R
.
id
.
icon
,
R
.
mipmap
.
ic_launcher
);
remoteViews
.
setOnClickPendingIntent
(
R
.
id
.
notify_root
,
pendingIntent
);
return
remoteViews
;
}
...
...
@@ -103,8 +109,15 @@ public class NotifyManager {
* @param step
*/
public
void
updateRemoteView
(
int
water
,
int
step
)
{
if
(
remoteViews
!=
null
)
{
remoteViews
.
setTextViewText
(
R
.
id
.
tv_right
,
"跳转"
+
step
);
//设置textView内容
Context
context
=
MintsApplication
.
getContext
();
if
(
remoteViews
!=
null
&&
context
!=
null
)
{
// remoteViews.setTextViewText(R.id.notify_step,
// new SpanUtils()
// .append("今日步数 ").setForegroundColor(context.getResources().getColor(R.color.black_text))
// .append(step + "").setBold().setForegroundColor(context.getResources().getColor(R.color.main_mints))
// .append(" 步").setForegroundColor(context.getResources().getColor(R.color.black_text))
// .create());//设置textView内容
remoteViews
.
setTextViewText
(
R
.
id
.
notify_step
,
"今日步数 "
+
step
+
" 步"
);
if
(
manager
!=
null
&&
notification
!=
null
)
{
manager
.
notify
(
1
,
notification
);
}
...
...
highgold/app/src/main/java/com/mints/highgold/manager/TTAdManagerHolder.java
View file @
6890a753
...
...
@@ -45,6 +45,8 @@ public class TTAdManagerHolder {
/*信息流*/
public
static
final
String
TT_AD_NATIVEEXPRESS_ID_DIALOG
=
"945131750"
;
//信息流弹窗
public
static
final
String
TT_AD_NATIVEEXPRESS_ID_WATER1
=
"945450706"
;
//喝水界面1
public
static
final
String
TT_AD_NATIVEEXPRESS_ID_WATER2
=
"945450708"
;
//喝水界面2
public
static
final
String
TT_AD_NATIVEEXPRESS_ID_LIEBAO_LISTEXIT
=
"945131730"
;
//猎豹列表和退出
/*全屏广告*/
...
...
highgold/app/src/main/java/com/mints/highgold/manager/TTNativeExpressManager.java
View file @
6890a753
...
...
@@ -14,6 +14,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import
com.bytedance.sdk.openadsdk.TTAppDownloadListener
;
import
com.bytedance.sdk.openadsdk.TTNativeExpressAd
;
import
com.mints.highgold.ui.widgets.DislikeDialog
;
import
com.mints.highgold.utils.LogUtil
;
import
java.util.List
;
...
...
@@ -81,7 +82,6 @@ public class TTNativeExpressManager {
* 获取穿山甲banner
*
* @param context
* @param frameLayout
* @param viewWidth
* @param viewHeight
*/
...
...
@@ -100,6 +100,8 @@ public class TTNativeExpressManager {
mTTAdNative
.
loadNativeExpressAd
(
adSlot
,
new
TTAdNative
.
NativeExpressAdListener
()
{
@Override
public
void
onError
(
int
code
,
String
message
)
{
LogUtil
.
d
(
"TTNativeExpressManager"
,
message
);
if
(
view
!=
null
)
{
view
.
removeAllViews
();
}
...
...
highgold/app/src/main/java/com/mints/highgold/mvp/model/WalkBean.java
0 → 100644
View file @
6890a753
package
com
.
mints
.
highgold
.
mvp
.
model
;
import
java.io.Serializable
;
public
class
WalkBean
implements
Serializable
{
//"walk":"步数"
// "coin":"走路气泡"
// maxWalk 步数上限
// isWalk 是否领取奖励
// walkText 下次奖励内容
private
int
walk
;
private
int
coin
;
private
int
maxWalk
;
private
boolean
isWalk
;
private
String
walkText
;
public
int
getWalk
()
{
return
walk
;
}
public
int
getCoin
()
{
return
coin
;
}
public
int
getMaxWalk
()
{
return
maxWalk
;
}
public
boolean
isWalk
()
{
return
isWalk
;
}
public
String
getWalkText
()
{
return
walkText
;
}
}
highgold/app/src/main/java/com/mints/highgold/mvp/presenters/LoanPresenter.java
View file @
6890a753
...
...
@@ -17,6 +17,7 @@ import com.mints.highgold.mvp.model.LocationBean;
import
com.mints.highgold.mvp.model.MainWaterBean
;
import
com.mints.highgold.mvp.model.UserBean
;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.model.WalkBean
;
import
com.mints.highgold.mvp.views.LoanView
;
import
com.mints.highgold.utils.DeviceUuidFactory
;
import
com.mints.highgold.utils.DevicesUtil
;
...
...
@@ -141,7 +142,7 @@ public class LoanPresenter extends BasePresenter<LoanView> {
public
void
getWalkMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getWalkMsg
(),
new
BaseSubscriber
<
BaseResponse
<
MainWater
Bean
>>()
{
new
BaseSubscriber
<
BaseResponse
<
Walk
Bean
>>()
{
@Override
public
void
onCompleted
()
{
if
(
isLinkView
())
return
;
...
...
@@ -158,7 +159,7 @@ public class LoanPresenter extends BasePresenter<LoanView> {
}
@Override
public
void
onNext
(
BaseResponse
<
MainWater
Bean
>
baseResponse
)
{
public
void
onNext
(
BaseResponse
<
Walk
Bean
>
baseResponse
)
{
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
...
...
highgold/app/src/main/java/com/mints/highgold/mvp/presenters/WaterPresenter.java
View file @
6890a753
package
com
.
mints
.
highgold
.
mvp
.
presenters
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.mints.highgold.common.Constant
;
import
com.mints.highgold.common.DeviceInfo
;
import
com.mints.highgold.manager.AppHttpManager
;
import
com.mints.highgold.manager.JpushManager
;
import
com.mints.highgold.manager.ShumeiManager
;
import
com.mints.highgold.manager.UserManager
;
import
com.mints.highgold.mvp.model.BaseResponse
;
import
com.mints.highgold.mvp.model.GameBean
;
import
com.mints.highgold.mvp.model.LocationBean
;
import
com.mints.highgold.mvp.model.MainWaterBean
;
import
com.mints.highgold.mvp.model.UserBean
;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.views.LoanView
;
import
com.mints.highgold.mvp.views.WaterView
;
import
com.mints.highgold.utils.DeviceUuidFactory
;
import
com.mints.highgold.utils.DevicesUtil
;
import
com.mints.highgold.utils.SPUtil
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
import
com.mints.library.utils.json.JsonUtil
;
import
java.util.HashMap
;
import
cn.jpush.android.api.JPushInterface
;
import
rx.Observable
;
public
class
WaterPresenter
extends
BasePresenter
<
WaterView
>
{
private
Context
context
;
private
UserBean
.
ConsumerBean
consumer
;
private
String
uuid
;
/**
* 猎豹游戏上传信息
*/
public
void
gameAdd
(
String
url
,
String
eventType
,
HashMap
<
String
,
Object
>
vo
)
{
// view.showLoading("加载中...");
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
gameAdd
(
url
,
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@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
<
Object
>
baseResponse
)
{
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
String
message
=
baseResponse
.
getMessage
();
switch
(
code
)
{
case
200
:
//成功
view
.
gameAddSuc
(
eventType
,
baseResponse
.
getData
());
break
;
default
:
// view.showToast(message);
break
;
}
}
});
}
/**
* isCall -- true 连续调用
* 获取用户配置信息
...
...
@@ -116,11 +54,9 @@ public class WaterPresenter extends BasePresenter<WaterView> {
switch
(
code
)
{
case
200
:
//成功
if
(
isCall
)
{
saveTerminalInfo
(
context
,
uuid
);
}
else
{
view
.
getUserTaskMsgSuc
(
baseResponse
.
getData
());
getWaterMsgHome
();
getGameList
();
}
break
;
case
401
:
...
...
@@ -223,50 +159,6 @@ public class WaterPresenter extends BasePresenter<WaterView> {
});
}
/**
* 获取server端游戏列表
*/
private
void
getGameList
()
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"isShowYwhzGame"
,
true
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getGameList
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
GameBean
>>()
{
@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
<
GameBean
>
baseResponse
)
{
if
(
isLinkView
())
return
;
int
code
=
baseResponse
.
getStatus
();
String
message
=
baseResponse
.
getMessage
();
switch
(
code
)
{
case
200
:
//成功
view
.
getGameListSuc
(
baseResponse
.
getData
());
// getWaterMsgHome();
break
;
default
:
view
.
showToast
(
message
);
break
;
}
}
});
}
/**
...
...
@@ -402,307 +294,4 @@ public class WaterPresenter extends BasePresenter<WaterView> {
});
}
/**
* 游客登录
*/
public
void
userLogin
(
Context
context
)
{
this
.
context
=
context
;
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
uuid
=
new
DeviceUuidFactory
(
loanApplication
).
getDeviceUuid
().
toString
();
vo
.
put
(
"device"
,
uuid
);
vo
.
put
(
"uid"
,
UserManager
.
getInstance
().
getUserID
());
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
visitorlogin
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
UserBean
>
baseResponse
)
{
int
code
=
baseResponse
.
getStatus
();
switch
(
code
)
{
case
200
:
//成功
UserBean
content
=
baseResponse
.
getData
();
if
(
content
!=
null
)
{
UserManager
.
getInstance
().
saveUserInfo
(
content
);
consumer
=
content
.
getConsumer
();
saveTerminalInfo
(
context
,
uuid
);
getUserTaskMsg
(
true
);
}
break
;
}
}
});
}
/**
* 提交设备信息
*
* @param context
* @param uuid
*/
private
void
saveTerminalInfo
(
Context
context
,
String
uuid
)
{
if
(
loanApplication
==
null
||
context
==
null
)
return
;
DeviceInfo
deviceInfo
=
DeviceInfo
.
getDeviceInfo
(
context
);
String
macAddress
=
deviceInfo
.
getMacAddress
(
context
);
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
if
(!
TextUtils
.
isEmpty
(
macAddress
))
{
String
mac
=
macAddress
.
replace
(
":"
,
""
);
vo
.
put
(
"mac"
,
mac
);
vo
.
put
(
"mac1"
,
macAddress
);
}
try
{
String
imei
=
deviceInfo
.
getIMEI
();
if
(!
TextUtils
.
isEmpty
(
imei
))
{
vo
.
put
(
"imei"
,
imei
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
vo
.
put
(
"imei"
,
""
);
}
String
androidId
=
deviceInfo
.
getAndroidId
(
context
);
if
(!
TextUtils
.
isEmpty
(
androidId
))
{
vo
.
put
(
"androidid"
,
androidId
);
}
try
{
vo
.
put
(
"shumeiId"
,
ShumeiManager
.
getInstance
().
getShumeiDeviceId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
SPUtil
spUtil
=
SPUtil
.
getInstance
(
context
);
if
(
spUtil
!=
null
)
{
String
lbStr
=
spUtil
.
getString
(
Constant
.
LOCATION_DATA
);
LocationBean
lb
=
new
Gson
().
fromJson
(
lbStr
,
LocationBean
.
class
);
if
(
lb
!=
null
)
{
vo
.
put
(
"gpsInfo"
,
JsonUtil
.
toJson
(
lb
));
}
}
}
catch
(
Exception
e
)
{
}
vo
.
put
(
"os"
,
"android"
);
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
uuid
);
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
// vo.put("appPkgList", deviceInfo.getPkgInfo(context));
vo
.
put
(
"oaid"
,
DevicesUtil
.
getOaid
());
try
{
vo
.
put
(
"tempuuid"
,
JPushInterface
.
getRegistrationID
(
context
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
int
code
=
baseResponse
.
getStatus
();
switch
(
code
)
{
case
200
:
//成功
if
(
consumer
!=
null
)
{
//绑定用户jpush
String
userId
=
String
.
valueOf
(
consumer
.
getPk_id
());
JpushManager
.
getInstance
().
setJpushService
(
userId
);
}
break
;
}
}
});
}
/**
* 数美要求提交设备信息
*
* @param context
*/
public
void
saveTerminalInfo
(
Context
context
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
DeviceInfo
deviceInfo
=
DeviceInfo
.
getDeviceInfo
(
context
);
String
macAddress
=
deviceInfo
.
getMacAddress
(
context
);
if
(!
TextUtils
.
isEmpty
(
macAddress
))
{
String
mac
=
macAddress
.
replace
(
":"
,
""
);
vo
.
put
(
"mac"
,
mac
);
vo
.
put
(
"mac1"
,
macAddress
);
}
try
{
String
imei
=
deviceInfo
.
getIMEI
();
if
(!
TextUtils
.
isEmpty
(
imei
))
{
vo
.
put
(
"imei"
,
imei
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
vo
.
put
(
"imei"
,
""
);
}
String
androidId
=
deviceInfo
.
getAndroidId
(
context
);
if
(!
TextUtils
.
isEmpty
(
androidId
))
{
vo
.
put
(
"androidid"
,
androidId
);
}
vo
.
put
(
"os"
,
"android"
);
try
{
vo
.
put
(
"shumeiId"
,
ShumeiManager
.
getInstance
().
getShumeiDeviceId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
SPUtil
spUtil
=
SPUtil
.
getInstance
(
context
);
if
(
spUtil
!=
null
)
{
String
lbStr
=
spUtil
.
getString
(
Constant
.
LOCATION_DATA
);
LocationBean
lb
=
new
Gson
().
fromJson
(
lbStr
,
LocationBean
.
class
);
if
(
lb
!=
null
)
{
vo
.
put
(
"gpsInfo"
,
JsonUtil
.
toJson
(
lb
));
}
}
}
catch
(
Exception
e
)
{
}
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
(
context
).
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
// vo.put("appPkgList", deviceInfo.getPkgInfo(context));
vo
.
put
(
"oaid"
,
DevicesUtil
.
getOaid
());
try
{
vo
.
put
(
"tempuuid"
,
JPushInterface
.
getRegistrationID
(
context
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
saveTerminalInfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
UserBean
>
baseResponse
)
{
}
});
}
/**
* 首次提交设备信息
*
* @param context
* @param spUtil
*/
public
void
commonSaveTerminalInfo
(
Context
context
,
SPUtil
spUtil
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
DeviceInfo
deviceInfo
=
DeviceInfo
.
getDeviceInfo
(
context
);
String
macAddress
=
deviceInfo
.
getMacAddress
(
context
);
if
(!
TextUtils
.
isEmpty
(
macAddress
))
{
String
mac
=
macAddress
.
replace
(
":"
,
""
);
vo
.
put
(
"mac"
,
mac
);
vo
.
put
(
"mac1"
,
macAddress
);
}
try
{
String
imei
=
deviceInfo
.
getIMEI
();
if
(!
TextUtils
.
isEmpty
(
imei
))
{
vo
.
put
(
"imei"
,
imei
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
vo
.
put
(
"imei"
,
""
);
}
String
androidId
=
deviceInfo
.
getAndroidId
(
context
);
if
(!
TextUtils
.
isEmpty
(
androidId
))
{
vo
.
put
(
"androidid"
,
androidId
);
}
vo
.
put
(
"os"
,
"android"
);
try
{
vo
.
put
(
"shumeiId"
,
ShumeiManager
.
getInstance
().
getShumeiDeviceId
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
if
(
spUtil
!=
null
)
{
String
lbStr
=
spUtil
.
getString
(
Constant
.
LOCATION_DATA
);
LocationBean
lb
=
new
Gson
().
fromJson
(
lbStr
,
LocationBean
.
class
);
if
(
lb
!=
null
)
{
vo
.
put
(
"gpsInfo"
,
JsonUtil
.
toJson
(
lb
));
}
}
}
catch
(
Exception
e
)
{
}
vo
.
put
(
"model"
,
deviceInfo
.
getBrand
()
+
" "
+
deviceInfo
.
getMobileModel
());
vo
.
put
(
"uuid"
,
new
DeviceUuidFactory
(
context
).
getDeviceUuid
());
vo
.
put
(
"osversion"
,
deviceInfo
.
getOSVersion
());
vo
.
put
(
"appversion"
,
deviceInfo
.
getVersionName
());
// vo.put("appPkgList", deviceInfo.getPkgInfo(context));
vo
.
put
(
"oaid"
,
DevicesUtil
.
getOaid
());
try
{
vo
.
put
(
"tempuuid"
,
JPushInterface
.
getRegistrationID
(
context
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
comSaveTerminalInfo
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
UserBean
>
baseResponse
)
{
int
code
=
baseResponse
.
getStatus
();
switch
(
code
)
{
case
200
:
//成功
if
(
spUtil
!=
null
)
{
spUtil
.
putBoolean
(
Constant
.
FIRST_DEVICE_FLAG
,
true
);
}
break
;
}
}
});
}
}
highgold/app/src/main/java/com/mints/highgold/mvp/views/LoanView.java
View file @
6890a753
...
...
@@ -4,6 +4,7 @@ package com.mints.highgold.mvp.views;
import
com.mints.highgold.mvp.model.GameBean
;
import
com.mints.highgold.mvp.model.MainWaterBean
;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.model.WalkBean
;
public
interface
LoanView
extends
BaseView
{
...
...
@@ -34,7 +35,7 @@ public interface LoanView extends BaseView {
*
* @param data
*/
void
getWalkMsgSuc
(
MainWater
Bean
data
);
void
getWalkMsgSuc
(
Walk
Bean
data
);
/**
* 提交游戏信息
...
...
highgold/app/src/main/java/com/mints/highgold/mvp/views/WaterView.java
View file @
6890a753
...
...
@@ -36,27 +36,8 @@ public interface WaterView extends BaseView {
*/
void
getWaterMsgHomeSuc
(
MainWaterBean
data
);
/**
* 提交游戏信息
*
* @param data
*/
void
gameAddSuc
(
String
eventType
,
Object
data
);
/**
* 获取server端游戏列表
*
* @param data
*/
void
getGameListSuc
(
GameBean
data
);
/**
* 首页喝水打卡成功
*/
void
clickForWaterSuc
(
int
waterCoin
);
/**
* 获取红包状态成功
*/
void
getRedboxEnterSuc
();
}
highgold/app/src/main/java/com/mints/highgold/net/LoanService.java
View file @
6890a753
...
...
@@ -26,6 +26,7 @@ import com.mints.highgold.mvp.model.UserBean;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.model.UserVersusBean
;
import
com.mints.highgold.mvp.model.Version
;
import
com.mints.highgold.mvp.model.WalkBean
;
import
com.mints.highgold.mvp.model.WaterMsgBean
;
import
com.mints.highgold.utils.AESUtils
;
import
com.mints.highgold.utils.SPUtil
;
...
...
@@ -370,7 +371,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/hv110/getWalkMsg"
)
Observable
<
BaseResponse
<
MainWater
Bean
>>
getWalkMsg
();
Observable
<
BaseResponse
<
Walk
Bean
>>
getWalkMsg
();
/**
* 猎豹游戏 上传信息
...
...
highgold/app/src/main/java/com/mints/highgold/ui/activitys/WaterActivity.java
View file @
6890a753
...
...
@@ -6,7 +6,6 @@ import android.text.TextUtils;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.animation.AccelerateDecelerateInterpolator
;
import
android.widget.AdapterView
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
...
...
@@ -14,27 +13,20 @@ import android.widget.TextView;
import
com.daimajia.androidanimations.library.Techniques
;
import
com.daimajia.androidanimations.library.YoYo
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
com.mints.highgold.R
;
import
com.mints.highgold.ad.VedioAdingManager
;
import
com.mints.highgold.ad.inscreenvedio.MintegralInscreenVedioAdManager
;
import
com.mints.highgold.common.AppConfig
;
import
com.mints.highgold.common.Constant
;
import
com.mints.highgold.manager.TT
BannerManag
er
;
import
com.mints.highgold.manager.TT
PreLoad
ExpressManager
;
import
com.mints.highgold.manager.TT
AdManagerHold
er
;
import
com.mints.highgold.manager.TT
Native
ExpressManager
;
import
com.mints.highgold.manager.UserManager
;
import
com.mints.highgold.mvp.model.GameBean
;
import
com.mints.highgold.mvp.model.MainWaterBean
;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.model.VedioAdingBean
;
import
com.mints.highgold.mvp.presenters.LoanPresenter
;
import
com.mints.highgold.mvp.presenters.WaterPresenter
;
import
com.mints.highgold.mvp.views.LoanView
;
import
com.mints.highgold.ui.activitys.base.BaseActivity
;
import
com.mints.highgold.ui.adapter.MainGameAdapter
;
import
com.mints.highgold.ui.fragment.MainFragment
;
import
com.mints.highgold.ui.widgets.ScollViewListView
;
import
com.mints.highgold.ui.widgets.WaterView
;
import
com.mints.highgold.ui.widgets.countdowntimer.CountDownTimerSupport
;
import
com.mints.highgold.ui.widgets.countdowntimer.OnCountDownTimerListener
;
...
...
@@ -44,17 +36,13 @@ import com.mints.highgold.utils.SPUtil;
import
com.mints.highgold.utils.SpanUtils
;
import
com.mints.highgold.utils.rxutil.CommonRxTask
;
import
com.mints.highgold.utils.rxutil.RxjavaUtil
;
import
com.mints.library.base.BaseWebActivity
;
import
com.mints.library.net.netstatus.NetUtils
;
import
com.mints.library.utils.json.JsonUtil
;
import
com.mints.library.utils.nodoubleclick.AntiShake
;
import
com.scwang.smartrefresh.layout.SmartRefreshLayout
;
import
com.shehuan.niv.NiceImageView
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
butterknife.Bind
;
import
butterknife.OnClick
;
...
...
@@ -71,32 +59,23 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
private
static
final
String
TAG
=
MainFragment
.
class
.
getSimpleName
();
@Bind
(
R
.
id
.
fl_main_ttbanner
)
FrameLayout
flMainTtbanner
;
@Bind
(
R
.
id
.
main_main_crl_refresh
)
SmartRefreshLayout
mainMainCrlRefresh
;
@Bind
(
R
.
id
.
wv_water
)
WaterView
wvWater
;
@Bind
(
R
.
id
.
iv_fragment_main_gift
)
ImageView
ivFragmentMainGift
;
@Bind
(
R
.
id
.
tv_fragment_main_friend_hint
)
TextView
tvFragmentMainFriendHint
;
@Bind
(
R
.
id
.
tv_fragment_main_gamehint
)
TextView
tvFragmentMainGamehint
;
@Bind
(
R
.
id
.
rl_fragment_main_redbox
)
RelativeLayout
rlFragmentMainRedbox
;
@Bind
(
R
.
id
.
tv_fragment_main_redbox
)
TextView
tvFragmentMainRedbox
;
@Bind
(
R
.
id
.
tv_fragment_main_gametitle
)
TextView
tvFragmentMainGametitle
;
@Bind
(
R
.
id
.
iv_fragment_main_gameicon
)
NiceImageView
ivFragmentMainGameicon
;
@Bind
(
R
.
id
.
fl_water_ad1
)
FrameLayout
flWaterAd1
;
@Bind
(
R
.
id
.
fl_water_ad2
)
FrameLayout
flWaterAd2
;
private
AlertDialog
drinkDialog
;
CountDownTimerSupport
drinkBtnTimer
=
null
;
//喝水
long
countDownInterval
=
1000
;
//间隔时长
private
WaterPresenter
loanPresenter
;
private
MainGameAdapter
mainGameAdapter
;
private
UserManager
userManager
;
// 用户管理
private
VedioAdingManager
vedioAdingManager
;
// 随机广告
...
...
@@ -104,10 +83,8 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
/*用户信息*/
private
UserTaskMsgBean
userConfig
=
null
;
// 用户配置信息
private
List
<
GameBean
.
ListBean
>
gameList
=
null
;
//首页游戏列表
private
String
CARRIER_TYPE
=
null
;
//载体
private
String
AD_SOURCE
=
Constant
.
AD_SOURCE_CSJ
;
//载体
private
String
userID
;
//用户ID
private
int
onlineIncome
=
-
1
;
// 在线金币
private
int
waterIncome
=
-
1
;
// 第4个喝水汽泡金币
...
...
@@ -118,6 +95,7 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
private
MainWaterBean
waterBean
;
private
MintegralInscreenVedioAdManager
mintegralInscreenVedioAdManager
;
private
TTNativeExpressManager
ttNativeExpressManager
;
@Override
protected
boolean
isApplyKitKatTranslucency
()
{
...
...
@@ -140,15 +118,10 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
@Override
public
void
onResume
()
{
super
.
onResume
();
userID
=
userManager
.
getUserID
();
// 点击当前标签时调用
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_LOAN
)
{
if
(!
TextUtils
.
isEmpty
(
userID
))
{
initExpress
();
loanPresenter
.
getUserTaskMsg
(
false
);
}
else
{
loanPresenter
.
userLogin
(
getContext
());
}
// 激励视频下载红包
cmtCSJDownload
();
...
...
@@ -162,6 +135,24 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
loanPresenter
.
reportAddCoinMsg
(
vo
,
Constant
.
CARRIER_POP_INTERACTIVE_AD
);
}
}
@OnClick
({
R
.
id
.
rl_fragment_main_redbox
,
R
.
id
.
iv_water_back
})
public
void
onClick
(
View
view
)
{
if
(
AntiShake
.
check
(
view
.
getId
()))
return
;
if
(!
NetUtils
.
isNetworkConnected
(
getContext
()))
{
showToast
(
"网络异常,请检测网络。"
);
return
;
}
switch
(
view
.
getId
())
{
case
R
.
id
.
iv_water_back
:
finish
();
break
;
case
R
.
id
.
rl_fragment_main_redbox
:
// 红包
readyGo
(
RedboxActivity
.
class
);
break
;
}
}
private
void
cmtCSJDownload
()
{
...
...
@@ -260,6 +251,10 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
drinkBtnTimer
=
null
;
}
if
(
ttNativeExpressManager
!=
null
)
{
ttNativeExpressManager
.
onTTAdDestroy
();
}
loanPresenter
.
detachView
();
}
...
...
@@ -268,56 +263,6 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
loanPresenter
.
getUserTaskMsg
(
false
);
}
@OnClick
({
R
.
id
.
tv_fragment_main_whatgold
,
R
.
id
.
iv_fragment_main_gift
,
R
.
id
.
rl_fragment_main_redbox
,
R
.
id
.
ll_fragment_main_game
,
R
.
id
.
ll_fragment_main_friend
,
R
.
id
.
iv_fragment_main_banner
})
public
void
onClick
(
View
view
)
{
if
(
AntiShake
.
check
(
view
.
getId
()))
return
;
if
(
spUtil
.
getBoolean
(
Constant
.
USER_DEVICE_LOGIN
,
false
)
&&
!
userManager
.
userIsLogin
())
{
readyGo
(
WxLoginActivity
.
class
);
return
;
}
if
(!
NetUtils
.
isNetworkConnected
(
getContext
()))
{
showToast
(
"网络异常,请检测网络。"
);
return
;
}
if
(
userConfig
==
null
)
{
showToast
(
"网络异常,请检测网络!"
);
loanPresenter
.
getUserTaskMsg
(
false
);
return
;
}
Bundle
bundle
;
switch
(
view
.
getId
())
{
case
R
.
id
.
tv_fragment_main_whatgold
:
// 如何赚金币
readyGo
(
WhatGoldActivity
.
class
);
break
;
case
R
.
id
.
rl_fragment_main_redbox
:
// 红包
readyGo
(
RedboxActivity
.
class
);
break
;
case
R
.
id
.
iv_fragment_main_gift
:
// 礼物
String
interactivityPop
=
userConfig
.
getInteractivityPop
();
if
(!
TextUtils
.
isEmpty
(
interactivityPop
))
{
ivFragmentMainGift
.
setVisibility
(
View
.
INVISIBLE
);
isShowGiftPop
=
true
;
bundle
=
new
Bundle
();
bundle
.
putString
(
BaseWebActivity
.
BUNDLE_KEY_URL
,
interactivityPop
);
readyGo
(
BaseWebActivity
.
class
,
bundle
);
}
break
;
case
R
.
id
.
ll_fragment_main_game
:
// 游戏
break
;
case
R
.
id
.
ll_fragment_main_friend
:
// 邀请好友
readyGo
(
FriendsNewActivity
.
class
);
// readyGo(AdWebActivity.class);
break
;
case
R
.
id
.
iv_fragment_main_banner
:
break
;
}
}
@Override
public
void
clickWater
(
int
water
,
String
waterCoin
)
{
if
(
spUtil
.
getBoolean
(
Constant
.
USER_DEVICE_LOGIN
,
false
)
&&
!
userManager
.
userIsLogin
())
{
...
...
@@ -471,7 +416,7 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
@Override
public
void
onFinish
()
{
if
(
!
WaterActivity
.
this
.
isFinishing
())
{
if
(!
WaterActivity
.
this
.
isFinishing
())
{
if
(
wvWater
!=
null
)
{
wvWater
.
setTvDrinkBtnEnable
();
}
...
...
@@ -516,34 +461,6 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
}
}
@Override
public
void
gameAddSuc
(
String
eventType
,
Object
data
)
{
switch
(
eventType
)
{
case
Constant
.
EVENT_TYPE_TIME
:
//退出游戏
if
(
data
!=
null
)
{
String
json
=
JsonUtil
.
toJson
(
data
);
JsonObject
jsonObject
=
new
JsonParser
().
parse
(
json
).
getAsJsonObject
();
int
gameCoin
=
jsonObject
.
get
(
"gameCoin"
).
getAsInt
();
int
userCoin
=
jsonObject
.
get
(
"userCoin"
).
getAsInt
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
gameCoin
);
bundle
.
putInt
(
Constant
.
MAIN_ALL_COIN
,
userCoin
);
bundle
.
putInt
(
Constant
.
MAIN_CUR_FLAG
,
Constant
.
MAIN_CUR_ONE
);
bundle
.
putString
(
Constant
.
MAIN_CARRIET_TURN
,
Constant
.
CARRIER_GAME
);
readyGo
(
AwardActivity
.
class
,
bundle
);
}
break
;
case
Constant
.
EVENT_TYPE_GAMEINFO
:
//游戏关卡回调
break
;
case
Constant
.
EVENT_TYPE_CLICK
:
//点击游戏
break
;
}
}
@Override
public
void
getGameListSuc
(
GameBean
data
)
{
}
@Override
public
void
clickForWaterSuc
(
int
waterCoin
)
{
Bundle
bundle
=
new
Bundle
();
...
...
@@ -557,12 +474,6 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
readyGo
(
AwardActivity
.
class
,
bundle
);
}
@Override
public
void
getRedboxEnterSuc
()
{
readyGo
(
RedboxActivity
.
class
);
}
/**
* Manager、view初始化
*/
...
...
@@ -576,8 +487,6 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
// 显示红包动画
initGiftAnim
(
rlFragmentMainRedbox
);
TTPreLoadExpressManager
.
getInstance
().
loadTtFrameLayout
(
getContext
());
// 下拉刷新监听
mainMainCrlRefresh
.
setOnRefreshListener
(
refreshLayout
->
onRefresh
());
// 喝水监听
...
...
@@ -788,4 +697,20 @@ public class WaterActivity extends BaseActivity implements CustomRefreshLayout.O
}
}
}
/**
* 初始化信息iyc
*/
private
void
initExpress
()
{
if
(
ttNativeExpressManager
==
null
)
{
ttNativeExpressManager
=
new
TTNativeExpressManager
();
ttNativeExpressManager
.
initTTAd
(
this
,
false
);
}
try
{
ttNativeExpressManager
.
getNativeExpressInit
(
this
,
TTAdManagerHolder
.
TT_AD_NATIVEEXPRESS_ID_WATER1
,
flWaterAd1
,
320
,
0
);
ttNativeExpressManager
.
getNativeExpressInit
(
this
,
TTAdManagerHolder
.
TT_AD_NATIVEEXPRESS_ID_WATER2
,
flWaterAd2
,
320
,
0
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
highgold/app/src/main/java/com/mints/highgold/ui/fragment/MainFragment.java
View file @
6890a753
...
...
@@ -36,15 +36,18 @@ import com.mints.highgold.common.Constant;
import
com.mints.highgold.manager.AdMngrHolder
;
import
com.mints.highgold.manager.AmapLocationManager
;
import
com.mints.highgold.manager.LiebaoManager
;
import
com.mints.highgold.manager.NotifyManager
;
import
com.mints.highgold.manager.ShumeiManager
;
import
com.mints.highgold.manager.TTAdManagerHolder
;
import
com.mints.highgold.manager.TTBannerManager
;
import
com.mints.highgold.manager.TTNativeExpressManager
;
import
com.mints.highgold.manager.TTPreLoadExpressManager
;
import
com.mints.highgold.manager.UserManager
;
import
com.mints.highgold.mvp.model.GameBean
;
import
com.mints.highgold.mvp.model.MainWaterBean
;
import
com.mints.highgold.mvp.model.UserTaskMsgBean
;
import
com.mints.highgold.mvp.model.VedioAdingBean
;
import
com.mints.highgold.mvp.model.WalkBean
;
import
com.mints.highgold.mvp.presenters.LoanPresenter
;
import
com.mints.highgold.mvp.views.LoanView
;
import
com.mints.highgold.ui.activitys.AdWebActivity
;
...
...
@@ -115,8 +118,6 @@ public class MainFragment extends BaseFragment
StepView
wvWater
;
@Bind
(
R
.
id
.
iv_fragment_main_gift
)
ImageView
ivFragmentMainGift
;
@Bind
(
R
.
id
.
tv_fragment_main_friend_hint
)
TextView
tvFragmentMainFriendHint
;
@Bind
(
R
.
id
.
tv_fragment_main_gamehint
)
TextView
tvFragmentMainGamehint
;
@Bind
(
R
.
id
.
rl_fragment_main_redbox
)
...
...
@@ -160,8 +161,9 @@ public class MainFragment extends BaseFragment
private
boolean
isShowGiftPop
=
false
;
// true-点击过pop
private
TTBannerManager
ttUtil
;
private
MainWater
Bean
waterBean
;
private
Walk
Bean
waterBean
;
private
MintegralInscreenVedioAdManager
mintegralInscreenVedioAdManager
;
private
NotifyManager
notifyManager
;
@Override
protected
int
getContentViewLayoutID
()
{
...
...
@@ -394,7 +396,7 @@ public class MainFragment extends BaseFragment
}
break
;
case
R
.
id
.
ll_fragment_main_friend
:
// 邀请好友
readyGo
(
FriendsNew
Activity
.
class
);
readyGo
(
Water
Activity
.
class
);
// readyGo(AdWebActivity.class);
break
;
case
R
.
id
.
iv_fragment_main_banner
:
...
...
@@ -655,51 +657,36 @@ public class MainFragment extends BaseFragment
}
@Override
public
void
getWalkMsgSuc
(
MainWater
Bean
data
)
{
public
void
getWalkMsgSuc
(
Walk
Bean
data
)
{
if
(
data
==
null
)
{
waterBean
=
null
;
return
;
}
waterBean
=
data
;
// wvWater.setWaterMaxProgress(data.getNeedDrink());
wvWater
.
setWaterProgress
(
data
.
getComplete
(),
data
.
getNeedDrink
());
// 喝水按钮状态
if
(
data
.
isStatus
())
{
wvWater
.
setTvDrinkBtnEnable
();
}
else
{
wvWater
.
setTvDrinkBtnNone
();
// 老用户未登录
if
(
spUtil
.
getBoolean
(
Constant
.
USER_DEVICE_LOGIN
,
false
)
&&
!
userManager
.
userIsLogin
())
{
wvWater
.
setTvDrinkBtnText
(
"去登录"
);
}
// 喝水时间
if
(
data
.
getNextGetCoinTime
()
>
0
)
{
if
(!
AppConfig
.
isMintegralInscreenFlag
)
{
if
(
mintegralInscreenVedioAdManager
!=
null
)
{
mintegralInscreenVedioAdManager
.
loadMintegralInscreen
();
}
}
wvWater
.
setWaterMaxProgress
(
data
.
getMaxWalk
());
wvWater
.
setWaterProgress
(
data
.
getWalk
(),
data
.
getMaxWalk
());
wvWater
.
setTvDrinkBtnText
(
"喝水打卡"
);
// wvWater.setWaterViewTime(getActivity(), data.getNextGetCoinTime());
// 是否可领取奖励
if
(
data
.
isWalk
())
{
wvWater
.
setTvDrinkBtnEnable
();
}
else
{
wvWater
.
setTvDrinkBtnText
(
"喝水领金币"
);
// wvWater.setWaterViewTimeGone();
}
if
(
spUtil
.
getBoolean
(
Constant
.
USER_DEVICE_LOGIN
,
false
)
&&
!
userManager
.
userIsLogin
())
{
wvWater
.
setTvDrinkBtnText
(
"去登录"
);
wvWater
.
setTvDrinkBtnNone
();
}
// 第4个汽泡
if
(
userManager
.
getAdShowFlag
())
{
wvWater
.
setTvDrinkBtnText
(
data
.
getWalkText
());
if
(
data
.
getCoin
()
>
0
)
{
wvWater
.
setFourWaterViewVisible
(
data
.
getCoin
());
}
else
{
wvWater
.
setFourWaterViewGone
();
}
}
else
{
wvWater
.
setFourWaterViewGone
();
if
(
notifyManager
!=
null
)
{
notifyManager
.
updateRemoteView
(
0
,
data
.
getWalk
());
}
}
...
...
@@ -746,7 +733,7 @@ public class MainFragment extends BaseFragment
if
(
waterCoin
>
0
)
{
// 显示喝水金币
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
waterCoin
);
bundle
.
putString
(
Constant
.
MAIN_CARRIET_TURN
,
Constant
.
CARRIER_
HOMEWATER_BUBBLE_TIM
E
);
bundle
.
putString
(
Constant
.
MAIN_CARRIET_TURN
,
Constant
.
CARRIER_
WALK_BUBBL
E
);
}
else
{
bundle
.
putString
(
Constant
.
MAIN_CARRIET_TURN
,
Constant
.
CARRIER_HOMEWATER_HIT
);
}
...
...
@@ -892,6 +879,8 @@ public class MainFragment extends BaseFragment
userManager
=
UserManager
.
getInstance
();
liebaoManager
=
LiebaoManager
.
getInstance
();
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
getActivity
());
notifyManager
=
NotifyManager
.
getInstance
(
getActivity
());
notifyManager
.
createNotifyDialog
(
0
,
0
);
mintegralInscreenVedioAdManager
=
MintegralInscreenVedioAdManager
.
getInstance
(
getActivity
());
mLocationHandler
=
new
AmapLocationManager
.
LocationHandler
(
getActivity
());
...
...
@@ -1067,11 +1056,6 @@ public class MainFragment extends BaseFragment
CmGameSdk
.
setGameExitInfoCallback
(
this
);
// 显示游戏文字
// tvFragmentMainFriendHint.setText(new SpanUtils().append("每邀一位得")
// .append("1000").setForegroundColor(getResources().getColor(R.color.main_mints))
// .create());
// 显示红包动画
initGiftAnim
(
rlFragmentMainRedbox
);
...
...
@@ -1204,6 +1188,7 @@ public class MainFragment extends BaseFragment
TextView
tvDrinkWatch
=
v_help
.
findViewById
(
R
.
id
.
tv_maindrink_watch
);
TextView
tvDrinkExit
=
v_help
.
findViewById
(
R
.
id
.
tv_maindrink_exit
);
TextView
tvDrinkCash
=
v_help
.
findViewById
(
R
.
id
.
tv_maindrink_cash
);
TextView
tvDrinkWalk
=
v_help
.
findViewById
(
R
.
id
.
tv_maindrink_walk
);
BigDecimal
allcoinBig
=
new
BigDecimal
(
String
.
valueOf
(
allCoin
));
BigDecimal
rateBig
=
new
BigDecimal
(
"10000"
);
...
...
@@ -1219,6 +1204,8 @@ public class MainFragment extends BaseFragment
.
create
()
);
tvDrinkWalk
.
setText
(
"当天累计超过2000步,需观看趣味视频兑换"
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
getActivity
(),
R
.
style
.
notice_dialog
);
drinkDialog
=
builder
.
create
();
drinkDialog
.
setView
(
v_help
);
...
...
@@ -1229,7 +1216,7 @@ public class MainFragment extends BaseFragment
waterIncome
=
curCoin
;
getRandomVedioAd
(
Constant
.
CARRIER_
HOMEWATER
_BUBBLE
,
curCoin
,
""
,
userConfig
.
getConfigDownloadTaskDownloadCoin
());
getRandomVedioAd
(
Constant
.
CARRIER_
WALK
_BUBBLE
,
curCoin
,
""
,
userConfig
.
getConfigDownloadTaskDownloadCoin
());
}
});
ivDrinkExit
.
setOnClickListener
(
v
->
{
...
...
highgold/app/src/main/java/com/mints/highgold/ui/widgets/StepView.java
View file @
6890a753
...
...
@@ -50,9 +50,6 @@ public class StepView extends FrameLayout
private
BubbleSeekBar
bsStep
;
private
RelativeLayout
rlNext
;
// 喝水进度
private
CircleProgress
cpWater
;
// 浮云金币动画
private
ObjectAnimator
oneAnimator
;
private
ObjectAnimator
twoAnimator
;
...
...
@@ -145,6 +142,7 @@ public class StepView extends FrameLayout
tvTwoWater
.
setOnClickListener
(
this
);
tvThreeWater
.
setOnClickListener
(
this
);
tvFouroneWater
.
setOnClickListener
(
this
);
tvNext
.
setOnClickListener
(
this
);
}
/**
...
...
@@ -247,7 +245,6 @@ public class StepView extends FrameLayout
}
else
{
bsStep
.
setProgress
(
maxProgress
);
}
bsStep
.
setmMax
(
maxProgress
);
}
if
(
tvStep
!=
null
)
{
tvStep
.
setText
(
progress
+
""
);
...
...
@@ -260,10 +257,9 @@ public class StepView extends FrameLayout
* @param maxProgress
*/
public
void
setWaterMaxProgress
(
int
maxProgress
)
{
// if (cpWater != null && tvDrink != null) {
// cpWater.setMaxValue(maxProgress);
// tvDrink.setText("0/" + maxProgress + "ml");
// }
if
(
bsStep
!=
null
)
{
bsStep
.
setmMax
(
maxProgress
);
}
}
/**
...
...
highgold/app/src/main/java/com/mints/highgold/ui/widgets/seekbar/BubbleSeekBar.java
View file @
6890a753
...
...
@@ -517,7 +517,8 @@ public class BubbleSeekBar extends View {
// draw thumb
mPaint
.
setColor
(
mThumbColor
);
canvas
.
drawCircle
(
mThumbCenterX
,
yTop
,
isThumbOnDragging
?
mThumbRadiusOnDragging
:
mThumbRadius
,
mPaint
);
// canvas.drawCircle(mThumbCenterX, yTop, isThumbOnDragging ? mThumbRadiusOnDragging : mThumbRadius, mPaint);
canvas
.
drawCircle
(
mThumbCenterX
,
yTop
,
isThumbOnDragging
?
mThumbRadiusOnDragging
/
2
:
mThumbRadius
/
2
,
mPaint
);
}
@Override
...
...
highgold/app/src/main/res/layout/activity_water.xml
View file @
6890a753
<?xml version="1.0" encoding="utf-8"?>
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.scwang.smartrefresh.layout.SmartRefresh
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/main_main_crl_refresh"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:srlAccentColor=
"@color/gray"
app:srlPrimaryColor=
"@color/white"
>
...
...
@@ -20,7 +13,8 @@
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:fadingEdge=
"none"
android:overScrollMode=
"never"
>
...
...
@@ -31,42 +25,16 @@
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"760pt"
android:layout_height=
"660pt"
android:background=
"@mipmap/bg_main_top"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"30pt"
android:layout_marginTop=
"70pt"
android:layout_marginRight=
"30pt"
>
<TextView
android:id=
"@+id/tv_fragment_main_whatgold"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:drawableLeft=
"@mipmap/ic_main_whatgold"
android:drawablePadding=
"10pt"
android:gravity=
"center_vertical"
android:text=
"如何赚金币"
android:textColor=
"@color/white"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/iv_fragment_main_putcard
"
android:id=
"@+id/iv_water_back
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/ic_main_putcard"
android:visibility=
"gone"
/>
</RelativeLayout>
android:layout_marginTop=
"40pt"
android:padding=
"30pt"
android:src=
"@drawable/yl_mp_ic_back_left"
></ImageView>
<com.mints.highgold.ui.widgets.WaterView
android:id=
"@+id/wv_water"
...
...
@@ -75,16 +43,6 @@
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"150pt"
/>
<ImageView
android:id=
"@+id/iv_fragment_main_gift"
android:layout_width=
"60pt"
android:layout_height=
"70pt"
android:layout_gravity=
"right"
android:layout_marginTop=
"530pt"
android:layout_marginRight=
"70pt"
android:src=
"@mipmap/ic_main_redgift"
android:visibility=
"gone"
/>
<RelativeLayout
android:id=
"@+id/rl_fragment_main_redbox"
android:layout_width=
"130pt"
...
...
@@ -108,141 +66,25 @@
</RelativeLayout>
</FrameLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"140pt"
android:layout_marginLeft=
"28pt"
android:layout_marginTop=
"640pt"
android:layout_marginRight=
"28pt"
android:layout_marginBottom=
"20pt"
android:background=
"@drawable/shape_my_about_write"
android:elevation=
"2dip"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_fragment_main_game"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<com.shehuan.niv.NiceImageView
android:id=
"@+id/iv_fragment_main_gameicon"
android:layout_width=
"80pt"
android:layout_height=
"80pt"
android:layout_marginLeft=
"20pt"
android:src=
"@mipmap/ic_newman_game"
app:corner_radius=
"20pt"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
android:paddingLeft=
"20pt"
>
<TextView
android:id=
"@+id/tv_fragment_main_gametitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"成语闯关"
android:textColor=
"@color/black"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/tv_fragment_main_gamehint"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2pt"
android:text=
"游戏赚钱两不误"
android:textColor=
"@color/graya"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width=
"2pt"
android:layout_height=
"match_parent"
android:layout_marginTop=
"40pt"
android:layout_marginBottom=
"40pt"
android:background=
"@color/line_color"
/>
<LinearLayout
android:id=
"@+id/ll_fragment_main_friend"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center_vertical"
>
<com.shehuan.niv.NiceImageView
android:layout_width=
"80pt"
android:layout_height=
"80pt"
android:layout_marginLeft=
"20pt"
android:src=
"@mipmap/ic_newmain_friend"
app:corner_radius=
"20pt"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"vertical"
android:paddingLeft=
"20pt"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"邀请好友"
android:textColor=
"@color/black"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/tv_fragment_main_friend_hint"
<FrameLayout
android:id=
"@+id/fl_water_ad1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2pt"
android:text=
"邀请好友来赚钱"
android:textColor=
"@color/graya"
android:textSize=
"12sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
android:layout_gravity=
"center_horizontal"
android:background=
"@color/full_transparent"
>
</FrameLayout>
<TextView
<FrameLayout
android:id=
"@+id/fl_water_ad2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"28pt"
android:drawableLeft=
"@mipmap/ic_main_goldhint"
android:drawablePadding=
"10pt"
android:gravity=
"center_vertical"
android:text=
"每日福利"
android:textColor=
"@color/black"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_fragment_main_banner"
android:layout_width=
"match_parent"
android:layout_height=
"240pt"
android:layout_marginLeft=
"28pt"
android:layout_marginRight=
"28pt"
android:layout_marginBottom=
"20pt"
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_main_banner"
/>
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"20pt"
android:background=
"@color/full_transparent"
>
</FrameLayout>
</LinearLayout>
</ScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<FrameLayout
android:id=
"@+id/fl_main_ttbanner"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginBottom=
"98pt"
/>
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
highgold/app/src/main/res/layout/fragment_main_first.xml
View file @
6890a753
...
...
@@ -194,7 +194,7 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
邀请好友
"
android:text=
"
喝水打卡
"
android:textColor=
"@color/black"
android:textSize=
"18sp"
/>
...
...
@@ -203,7 +203,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2pt"
android:text=
"邀请好友来
赚钱
"
android:text=
"邀请好友来
打卡
"
android:textColor=
"@color/graya"
android:textSize=
"12sp"
/>
</LinearLayout>
...
...
highgold/app/src/main/res/layout/remoteview.xml
View file @
6890a753
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<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/notify_root"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:background=
"#0f0"
android:orientation=
"vertical"
>
android:layout_height=
"wrap_content"
>
<LinearLayout
android:id=
"@+id/notify_title_root"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/domob_dimen18"
android:layout_marginTop=
"@dimen/domob_dimen20"
>
<ImageView
android:id=
"@+id/icon"
android:layout_width=
"48dp"
android:layout_height=
"48dp"
android:layout_centerInParent=
"true"
android:layout_width=
"@dimen/domob_dimen18"
android:layout_height=
"@dimen/domob_dimen18"
android:src=
"@mipmap/ic_launcher"
/>
<TextView
android:id=
"@+id/tv_left"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_alignParentStart=
"true
"
android:layout_marginLeft=
"@dimen/domob_dimen6
"
android:gravity=
"center_vertical"
android:text=
"Left"
/>
android:text=
"淘金空间高额版"
android:textColor=
"@color/black"
android:textSize=
"@dimen/font_size_10"
/>
</LinearLayout>
<TextView
android:id=
"@+id/notity_title"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/domob_dimen18"
android:gravity=
"center_vertical"
android:text=
"淘金空间高额版"
android:layout_marginTop=
"@dimen/domob_dimen10"
android:textColor=
"@color/black"
android:textSize=
"@dimen/font_size_14"
/>
<TextView
android:id=
"@+id/
tv_right
"
android:id=
"@+id/
notify_step
"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_
alignParentEnd=
"true
"
android:layout_
marginLeft=
"@dimen/domob_dimen18
"
android:gravity=
"center_vertical"
android:text=
"Right"
/>
</RelativeLayout>
android:text=
""
android:layout_marginTop=
"4dp"
android:textColor=
"@color/black"
android:layout_marginBottom=
"20dp"
android:textSize=
"@dimen/font_size_14"
/>
</LinearLayout>
highgold/app/src/main/res/layout/view_dialog_main_drink.xml
View file @
6890a753
...
...
@@ -31,6 +31,7 @@
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_maindrink_walk"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
...
...
highgold/app/src/main/res/layout/view_step.xml
View file @
6890a753
...
...
@@ -34,8 +34,8 @@
app:bsb_min=
"0"
app:bsb_progress=
"0"
app:bsb_track_size=
"4dp"
app:bsb_track_color=
"@color/
gray
"
app:bsb_second_track_color=
"@color/
tv_basic_color
"
app:bsb_track_color=
"@color/
tv_basic_color
"
app:bsb_second_track_color=
"@color/
main_mints
"
app:bsb_section_count=
"4"
app:bsb_section_text_position=
"below_section_mark"
app:bsb_show_section_mark=
"true"
...
...
@@ -49,7 +49,7 @@
<RelativeLayout
android:id=
"@+id/rl_water_next"
android:layout_width=
"2
2
0pt"
android:layout_width=
"2
5
0pt"
android:layout_height=
"70pt"
android:layout_gravity=
"bottom|center_horizontal"
android:layout_marginRight=
"4pt"
...
...
@@ -65,7 +65,7 @@
android:gravity=
"center"
android:text=
"继续努力"
android:textColor=
"@color/water_hint_btn"
android:textSize=
"1
4
sp"
/>
android:textSize=
"1
2
sp"
/>
</RelativeLayout>
...
...
highgold/app/src/main/res/values/dimens.xml
View file @
6890a753
...
...
@@ -34,4 +34,5 @@
<dimen
name=
"font_size_13"
>
13sp
</dimen>
<dimen
name=
"font_size_12"
>
12sp
</dimen>
<dimen
name=
"font_size_10"
>
10sp
</dimen>
<dimen
name=
"font_size_8"
>
8sp
</dimen>
</resources>
\ 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