Commit fb03f606 authored by jyx's avatar jyx

我的,邀请页面接口对接

parent 52a3949f
......@@ -15,10 +15,14 @@
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE"
<permission
android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
......@@ -108,12 +112,13 @@
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SettingsActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.GuideActivity"/>
<activity android:name=".ui.activitys.LiebaoGameActivity"/>
<activity android:name=".ui.activitys.DrawcashActivity"/>
<activity android:name=".ui.activitys.WaterActivity"/>
<activity android:name=".ui.activitys.WalkActivity"/>
android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.GuideActivity" />
<activity android:name=".ui.activitys.LiebaoGameActivity" />
<activity android:name=".ui.activitys.DrawcashActivity" />
<activity android:name=".ui.activitys.WaterActivity" />
<activity android:name=".ui.activitys.WalkActivity" />
<activity android:name=".ui.activitys.AboutusActivity" />
<service
android:name=".service.UpdateService"
......
......@@ -8,15 +8,11 @@ import android.text.TextUtils
import cn.jpush.android.api.BasicPushNotificationBuilder
import cn.jpush.android.api.JPushInterface
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.LiebaoManager
import com.mints.goodmoney.manager.OaidManager
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.library.utils.CommonUtils
import com.mob.MobSDK
import com.orhanobut.logger.AndroidLogAdapter
import com.orhanobut.logger.FormatStrategy
import com.orhanobut.logger.Logger
import com.orhanobut.logger.PrettyFormatStrategy
import com.orhanobut.logger.*
import com.tendcloud.tenddata.TCAgent
import com.umeng.commonsdk.UMConfigure
import com.yilan.sdk.ui.YLUIInit
......
......@@ -91,6 +91,7 @@ object Constant {
const val CARRIER_DAILY_TURN = "DAILY_TURN" //每日大转盘
const val CARRIER_CHALLENGE_TURN = "CHALLENGE_TURN" //挑战大转盘
const val CARRIER_SIGNIN_HOMEPAGE_CARD = "SIGNIN_HOMEPAGE_CARD" //签到翻倍
const val CARRIER_SIGNIN_HOMEPAGE_AWARD = "SIGNIN_HOMEPAGE_AWARD" //签到奖励
const val CARRIER_OFFLINE_DOUBLE = "OFFLINE_DOUBLE" //离线收益
const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //挑战刮刮乐
const val CARRIER_ONLINE_INCOME = "ONLINE_INCOME" //在线收益
......@@ -125,9 +126,13 @@ object Constant {
const val CARRIER_CHALLENGE_HEALTH_STAND = "CHALLENGE_HEALTH_STAND" //小健康-站一站
const val CARRIER_CHALLENGE_HEALTH_FRUIT = "CHALLENGE_HEALTH_FRUIT" //小健康-吃水果
const val CARRIER_CHALLENGE_HEALTH_EYE = "CHALLENGE_HEALTH_EYE" //小健康-放松眼
const val CARRIER_FRIENDS = "CARRIER_FRIENDS" //邀请好友
const val CARRIER_NEW_USER = "CARRIER_NEW_USER" //新用户5000红包
// 邀请好友
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
const val AD_SOURCE_LY = "LIYAN"
const val AD_SOURCE_CSJ = "CSJ"
......@@ -174,4 +179,9 @@ object Constant {
const val EVENT_TYPE_TIME = "TIME"
const val EVENT_TYPE_ADCLICK = "GAME_AD_CLICK"
const val EVENT_TYPE_GAMEINFO = "GAMEINFO"
// 热门活动类型
const val HOT_ACTIVITY_WATER = "water"
const val HOT_ACTIVITY_WALK = "walk"
const val HOT_ACTIVITY_CARD = "card"
}
\ No newline at end of file
package com.mints.goodmoney.mvp.model;
import java.util.List;
public class FriendsTaskBean {
/**
* challenge : {"complete":0,"list":[{"button":"去邀请","rewardCoin":100,"title":"任务一","remarks":"邀请1个好友 (0/1)","status":0},{"button":"去邀请","rewardCoin":200,"title":"任务二","remarks":"邀请5个好友 (0/5)","status":0},{"button":"去邀请","rewardCoin":300,"title":"任务三","remarks":"邀请10个好友 (0/10)","status":0},{"button":"去邀请","rewardCoin":400,"title":"任务四","remarks":"邀请20个好友 (0/20)","status":0},{"button":"去邀请","rewardCoin":500,"title":"任务五","remarks":"邀请50个好友 (0/50)","status":0},{"button":"去邀请","rewardCoin":600,"title":"任务六","remarks":"邀请100个好友 (0/100)","status":0}]}
* friends : {"friendSum":1,"list":[{"head":"","rcoin":0,"nickName":"","mobile":"186****1554","ruid":2028614250701500000,"time":"10月14日","cashout":0}]}
*/
private ChallengeBean challenge;
private FriendsBean friends;
public ChallengeBean getChallenge() {
return challenge;
}
public void setChallenge(ChallengeBean challenge) {
this.challenge = challenge;
}
public FriendsBean getFriends() {
return friends;
}
public void setFriends(FriendsBean friends) {
this.friends = friends;
}
public static class ChallengeBean {
/**
* complete : 0
* list : [{"button":"去邀请","rewardCoin":100,"title":"任务一","remarks":"邀请1个好友 (0/1)","status":0},{"button":"去邀请","rewardCoin":200,"title":"任务二","remarks":"邀请5个好友 (0/5)","status":0},{"button":"去邀请","rewardCoin":300,"title":"任务三","remarks":"邀请10个好友 (0/10)","status":0},{"button":"去邀请","rewardCoin":400,"title":"任务四","remarks":"邀请20个好友 (0/20)","status":0},{"button":"去邀请","rewardCoin":500,"title":"任务五","remarks":"邀请50个好友 (0/50)","status":0},{"button":"去邀请","rewardCoin":600,"title":"任务六","remarks":"邀请100个好友 (0/100)","status":0}]
*/
private int complete;
private List<ListBean> list;
public int getComplete() {
return complete;
}
public void setComplete(int complete) {
this.complete = complete;
}
public List<ListBean> getList() {
return list;
}
public void setList(List<ListBean> list) {
this.list = list;
}
public static class ListBean {
/**
* button : 去邀请
* rewardCoin : 100
* title : 任务一
* remarks : 邀请1个好友 (0/1)
* status : 0
*/
private String button;
private int rewardCoin;
private String title;
private String remarks;
private int status;
public String getButton() {
return button;
}
public void setButton(String button) {
this.button = button;
}
public int getRewardCoin() {
return rewardCoin;
}
public void setRewardCoin(int rewardCoin) {
this.rewardCoin = rewardCoin;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
}
public static class FriendsBean {
/**
* friendSum : 1
* list : [{"head":"","rcoin":0,"nickName":"","mobile":"186****1554","ruid":2028614250701500000,"time":"10月14日","cashout":0}]
*/
private int friendSum;
private List<ListBeanX> list;
public int getFriendSum() {
return friendSum;
}
public void setFriendSum(int friendSum) {
this.friendSum = friendSum;
}
public List<ListBeanX> getList() {
return list;
}
public void setList(List<ListBeanX> list) {
this.list = list;
}
public static class ListBeanX {
/**
* head :
* rcoin : 0
* nickName :
* mobile : 186****1554
* ruid : 2028614250701500000
* time : 10月14日
* cashout : 0
*/
private String head;
private int rcoin;
private String nickName;
private String mobile;
private long ruid;
private String time;
private int cashout;
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
public int getRcoin() {
return rcoin;
}
public void setRcoin(int rcoin) {
this.rcoin = rcoin;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public long getRuid() {
return ruid;
}
public void setRuid(long ruid) {
this.ruid = ruid;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public int getCashout() {
return cashout;
}
public void setCashout(int cashout) {
this.cashout = cashout;
}
}
}
}
......@@ -3,14 +3,176 @@ package com.mints.goodmoney.mvp.model;
import java.io.Serializable;
public class MyInfo implements Serializable {
private int coin;
private String idcode;
public int getCoin() {
return coin;
/**
* taskVeido : {"max":20,"carrierType":"CHALLENGE_VEDIO","complete":0}
* taskShareFriend : {"max":20,"carrierType":"CHALLENGE_SHAREFRIEND","complete":0}
* userMsg : {"head":"","realName":null,"surplus":0,"idcode":"20000003","nickName":"","coin":50}
*/
private TaskVeidoBean taskVeido;
private TaskShareFriendBean taskShareFriend;
private UserMsgBean userMsg;
public TaskVeidoBean getTaskVeido() {
return taskVeido;
}
public void setTaskVeido(TaskVeidoBean taskVeido) {
this.taskVeido = taskVeido;
}
public TaskShareFriendBean getTaskShareFriend() {
return taskShareFriend;
}
public void setTaskShareFriend(TaskShareFriendBean taskShareFriend) {
this.taskShareFriend = taskShareFriend;
}
public UserMsgBean getUserMsg() {
return userMsg;
}
public void setUserMsg(UserMsgBean userMsg) {
this.userMsg = userMsg;
}
public String getIdcode() {
return idcode;
public static class TaskVeidoBean {
/**
* max : 20
* carrierType : CHALLENGE_VEDIO
* complete : 0
*/
private int max;
private String carrierType;
private int complete;
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public String getCarrierType() {
return carrierType;
}
public void setCarrierType(String carrierType) {
this.carrierType = carrierType;
}
public int getComplete() {
return complete;
}
public void setComplete(int complete) {
this.complete = complete;
}
}
public static class TaskShareFriendBean {
/**
* max : 20
* carrierType : CHALLENGE_SHAREFRIEND
* complete : 0
*/
private int max;
private String carrierType;
private int complete;
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public String getCarrierType() {
return carrierType;
}
public void setCarrierType(String carrierType) {
this.carrierType = carrierType;
}
public int getComplete() {
return complete;
}
public void setComplete(int complete) {
this.complete = complete;
}
}
public static class UserMsgBean {
/**
* head :
* realName : null
* surplus : 0
* idcode : 20000003
* nickName :
* coin : 50
*/
private String head;
private Object realName;
private int surplus;
private String idcode;
private String nickName;
private int coin;
public String getHead() {
return head;
}
public void setHead(String head) {
this.head = head;
}
public Object getRealName() {
return realName;
}
public void setRealName(Object realName) {
this.realName = realName;
}
public int getSurplus() {
return surplus;
}
public void setSurplus(int surplus) {
this.surplus = surplus;
}
public String getIdcode() {
return idcode;
}
public void setIdcode(String idcode) {
this.idcode = idcode;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public int getCoin() {
return coin;
}
public void setCoin(int coin) {
this.coin = coin;
}
}
}
......@@ -4,59 +4,18 @@ public class TaskBean {
private int imageSrc;
private String title;
private String coin;
private int coinSrc;
private String info;
private String progressStr;
private String btnStr;
private Boolean isNeedTimer = false;
private int time;
private int type;
public TaskBean(int imageSrc, String title, String coin, int coinSrc, String info, String btnStr, Boolean isNeedTimer, int time, int type) {
public TaskBean(int imageSrc, String title, String progressStr, String btnStr, int type) {
this.imageSrc = imageSrc;
this.title = title;
this.coin = coin;
this.coinSrc = coinSrc;
this.info = info;
this.progressStr = progressStr;
this.btnStr = btnStr;
this.isNeedTimer = isNeedTimer;
this.time = time;
this.type = type;
}
public TaskBean(int imageSrc, String title, String coin, int coinSrc, String info, String btnStr) {
this.imageSrc = imageSrc;
this.title = title;
this.coin = coin;
this.coinSrc = coinSrc;
this.info = info;
this.btnStr = btnStr;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public Boolean getNeedTimer() {
return isNeedTimer;
}
public void setNeedTimer(Boolean needTimer) {
isNeedTimer = needTimer;
}
public int getTime() {
return time;
}
public void setTime(int time) {
this.time = time;
}
public int getImageSrc() {
return imageSrc;
}
......@@ -73,28 +32,12 @@ public class TaskBean {
this.title = title;
}
public String getCoin() {
return coin;
}
public void setCoin(String coin) {
this.coin = coin;
}
public int getCoinSrc() {
return coinSrc;
}
public void setCoinSrc(int coinSrc) {
this.coinSrc = coinSrc;
}
public String getInfo() {
return info;
public String getProgressStr() {
return progressStr;
}
public void setInfo(String info) {
this.info = info;
public void setProgressStr(String progressStr) {
this.progressStr = progressStr;
}
public String getBtnStr() {
......@@ -104,4 +47,12 @@ public class TaskBean {
public void setBtnStr(String btnStr) {
this.btnStr = btnStr;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
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.FriendsTaskBean
import com.mints.goodmoney.mvp.views.FriendsView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class FriendsPresenter : BasePresenter<FriendsView>() {
/**
* 世界人民排名
*/
fun getLeaders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.leaders, object : BaseSubscriber<BaseResponse< FriendsTaskBean.FriendsBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse< FriendsTaskBean.FriendsBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> view.getWorldRank(baseResponse.data)
}
}
})
}
/**
* 好友任务
*/
fun getFriendsMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.friendsMsg, object : BaseSubscriber<BaseResponse<FriendsTaskBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<FriendsTaskBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> {
view.getFriendsRank(baseResponse.data)
}
}
}
})
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.views.MyView
import com.mints.goodmoney.utils.DeviceUuidFactory
import com.mints.goodmoney.utils.LogUtil
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import net.grandcentrix.tray.AppPreferences
......@@ -20,10 +21,11 @@ class MyPresenter : BasePresenter<MyView>() {
* 获取签到内容
*/
open fun getSignInHomePageMsg() {
// view.showLoading("加载中...");
AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePageMsg,
object : BaseSubscriber<BaseResponse<SignCardBean?>?>() {
object : BaseSubscriber<BaseResponse<SignCardBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -35,12 +37,13 @@ class MyPresenter : BasePresenter<MyView>() {
view.showToast(e.message)
}
fun onNext(baseResponse: BaseResponse<SignCardBean?>) {
override fun onNext(baseResponse: BaseResponse<SignCardBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getSignInHomePageMsgSuc(baseResponse.getData())
200 -> view.getSignInHomePageMsgSuc(baseResponse.data)
401 -> {
}
else -> view.showToast(message)
......@@ -56,7 +59,7 @@ class MyPresenter : BasePresenter<MyView>() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePage(),
object : BaseSubscriber<BaseResponse<Any?>?>() {
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -68,7 +71,7 @@ class MyPresenter : BasePresenter<MyView>() {
view.showToast(e.message)
}
fun onNext(baseResponse: BaseResponse<Any?>) {
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
......@@ -79,13 +82,9 @@ class MyPresenter : BasePresenter<MyView>() {
})
}
/**
* isCall -- true 连续调用
* 获取用户配置信息
*/
fun getUserTaskMsg(isCall: Boolean) {
fun getUserHallBaseMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.myInfoMsg, object : BaseSubscriber<BaseResponse<MyInfo>>() {
.call(loanService.userHallBaseMsg, object : BaseSubscriber<BaseResponse<MyInfo>>() {
override fun onCompleted() {
if (isLinkView)
......@@ -101,11 +100,7 @@ class MyPresenter : BasePresenter<MyView>() {
val message: String = baseResponse.getMessage()
when (code) {
200 -> {
if (isCall) {
view.getUserTaskMsgSuc(baseResponse.getData())
} else {
view.getUserTaskMsgSuc(baseResponse.getData())
}
view.getUserTaskMsgSuc(baseResponse.getData())
myHotActivity()
}
401 -> view.getUserTaskMsgFail()
......@@ -148,7 +143,7 @@ class MyPresenter : BasePresenter<MyView>() {
override fun onNext(baseResponse: BaseResponse<BannerBean?>) {
if (isLinkView) return
val data: BannerBean? = baseResponse.getData()
val data: BannerBean? = baseResponse.data
if (data != null) {
view.getMyHotActivitySuc(data)
}
......@@ -208,7 +203,7 @@ class MyPresenter : BasePresenter<MyView>() {
}
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = ps.getString(Constant.OAID,"")!!
vo["oaid"] = ps.getString(Constant.OAID, "")!!
vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
......@@ -234,11 +229,38 @@ class MyPresenter : BasePresenter<MyView>() {
if (isLinkView) return
val code = baseResponse.status
when (code) {
// 200 -> baseMsg()
200 -> view.userLoginSuc()
}
}
})
}
/**
* 设置邀请成功
*
*/
fun cmtShareStatus() {
val vo = HashMap<String, Any>()
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
vo["value"] = "1"
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
when (baseResponse.status) {
// 200 -> baseMsg()
}
}
})
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.FriendsTaskBean
interface FriendsView : BaseView {
fun getWorldRank(data: FriendsTaskBean.FriendsBean)
fun getFriendsRank(data: FriendsTaskBean)
}
......@@ -27,4 +27,9 @@ interface MyView : BaseView {
* 签到成功
*/
fun signInHomePageSuc()
/**
* 游客登录成功
*/
fun userLoginSuc()
}
......@@ -7,6 +7,7 @@ import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.mvp.model.BannerBean;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.FriendsTaskBean;
import com.mints.goodmoney.mvp.model.MyInfo;
import com.mints.goodmoney.mvp.model.SignCardBean;
import com.mints.goodmoney.mvp.model.UserBean;
......@@ -72,15 +73,15 @@ public interface LoanService {
*
* @return
*/
@POST("api/v125/myInfoMsg")
Observable<BaseResponse<MyInfo>> getMyInfoMsg();
@POST("api/getUserHallBaseMsg")
Observable<BaseResponse<MyInfo>> getUserHallBaseMsg();
/**
* 热门活动接口
*
* @return
*/
@POST("api/v125/myHotActivity")
@POST("api/myHotActivity")
Observable<BaseResponse<BannerBean>> myHotActivity(@Body Map<String, Object> vo);
/**
......@@ -99,6 +100,14 @@ public interface LoanService {
@POST("api/getSignInHomePageMsg")
Observable<BaseResponse<SignCardBean>> getSignInHomePageMsg();
/**
* 设置邀请成功
*
* @return
*/
@POST("api/setStatusInOneDayByCarrierType")
Observable<BaseResponse<Object>> setStatusInOneDayByCarrierType(@Body Map<String, Object> vo);
/**
* 获取验证码
*
......@@ -120,7 +129,7 @@ public interface LoanService {
*
* @return
*/
@POST("api/v125/wechatlogin")
@POST("api/wechatlogin")
Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo);
/**
......@@ -184,7 +193,7 @@ public interface LoanService {
*
* @return
*/
@POST("api/v125/bindingWechat")
@POST("api/bindingWechat")
Observable<BaseResponse<UserBean>> bindingWechat(@Body Map<String, Object> vo);
/**
......@@ -192,9 +201,25 @@ public interface LoanService {
*
* @return
*/
@POST("api/v115/addCashoutReq")
@POST("api/addCashoutReq")
Observable<BaseResponse<Object>> addCashoutReq(@Body Map<String, Object> vo);
/**
* 世界人民排行信息
*
* @return
*/
@POST("api/getLeaders")
Observable<BaseResponse<FriendsTaskBean.FriendsBean>> getLeaders();
/**
* 好友任务信息
*
* @return
*/
@POST("api/getFriendsMsg")
Observable<BaseResponse<FriendsTaskBean>> getFriendsMsg();
/**
* 默认http工厂
*/
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.library.utils.ConstantUtil
import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:关于我们
* 作者:孟崔广
* 时间:2020/9/23 18:39
*/
class AboutusActivity : BaseActivity()
, View.OnClickListener {
override fun getContentViewLayoutID() = R.layout.activity_aboutus
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tvAboutasVersion.text = getString(R.string.app_name) + " v" + ConstantUtil.getVersionName(context)
tv_title.text = "关于我们"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
initListener()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
R.id.tvAboutasService -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.register_name))
bundle.putString(WebActivity.WEB_URL, Constant.REGISTER_URL)
readyGo(WebActivity::class.java, bundle)
}
R.id.tvAboutasPolicy -> {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, getString(R.string.privacy_name))
bundle.putString(WebActivity.WEB_URL, Constant.PRIVACY_URL)
readyGo(WebActivity::class.java, bundle)
}
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
tvAboutasService.setOnClickListener(this)
tvAboutasPolicy.setOnClickListener(this)
}
}
......@@ -132,10 +132,10 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
readyGo(WebActivity::class.java, bundle)
}
R.id.item_aboutUs -> {
readyGo(AboutusActivity::class.java)
}
R.id.btn_switch -> {
readyGo(LoginActivity::class.java)
}
R.id.iv_left_icon -> {
onBackPressed()
......
......@@ -2,13 +2,19 @@ package com.mints.goodmoney.ui.adapter
import android.content.Context
import android.view.View
import android.widget.Button
import android.widget.TextView
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.FriendsTaskBean
class BannerTaskAdapter(context: Context) : BannerBaseAdapter<Any>(context) {
class BannerTaskAdapter(context: Context) : BannerBaseAdapter<FriendsTaskBean.ChallengeBean.ListBean>(context) {
override fun getLayoutResID() = R.layout.item_bv_friends_task
override fun convert(convertView: View?, data: Any?) {
override fun convert(convertView: View, data: FriendsTaskBean.ChallengeBean.ListBean) {
convertView.findViewById<TextView>(R.id.item_bv_friends_task_title).text = data.title
convertView.findViewById<TextView>(R.id.item_bv_friends_task_info).text = data.remarks
convertView.findViewById<Button>(R.id.item_bv_friends_task_btn).text = data.button
}
}
\ No newline at end of file
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.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.library.utils.GlideUtils
class InvitedAdapter(private val invitedData: List<Any>) : RecyclerView.Adapter<InvitedAdapter.InvitedHolder>() {
class InvitedAdapter : RecyclerView.Adapter<InvitedAdapter.InvitedHolder> {
constructor(context: Context, invitedData: MutableList<FriendsTaskBean.FriendsBean.ListBeanX>) {
mContext = context
this.invitedData = invitedData
}
private var mContext: Context
private var invitedData: List<FriendsTaskBean.FriendsBean.ListBeanX>? = null
private var mOnItemClickListener: OnItemClickListener? = null
......@@ -16,19 +28,59 @@ class InvitedAdapter(private val invitedData: List<Any>) : RecyclerView.Adapter<
return InvitedHolder(view)
}
override fun getItemCount() = invitedData.size
override fun getItemCount(): Int {
return if (invitedData == null) {
0
} else {
invitedData!!.size
}
}
override fun onBindViewHolder(holder: InvitedHolder, position: Int) {
when (position) {
0 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_first)
}
1 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_second)
}
2 -> {
holder.tvNum.visibility = View.GONE
holder.ivRanking.visibility = View.VISIBLE
holder.ivRanking.setImageResource(R.mipmap.icon_ranking_third)
}
else -> {
holder.tvNum.visibility = View.VISIBLE
holder.ivRanking.visibility = View.GONE
holder.tvNum.text = "" + position + 1
}
}
val data = invitedData!![position]
GlideUtils.loadImageViewLoding(mContext, data.head, holder.ivAvatar, R.mipmap.ic_avatar_ph, R.mipmap.ic_avatar_ph)
if (data.nickName.isNotEmpty()) {
holder.tvName.text = data.nickName
} else {
holder.tvName.text = data.mobile
}
holder.tvCoin.text = "" + data.rcoin
holder.ivAvatar
holder.itemView.setOnClickListener {
mOnItemClickListener?.onItemClick(holder.itemView, position)
}
}
inner class InvitedHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
private val tvNum = itemView.findViewById<TextView>(R.id.item_invited_tv_num)
private val iv = itemView.findViewById<TextView>(R.id.item_invited_iv)
private val tvName = itemView.findViewById<TextView>(R.id.item_invited_tv_name)
private val tvCoin = itemView.findViewById<TextView>(R.id.item_invited_tv_coin)
val tvNum: TextView = itemView.findViewById(R.id.item_invited_tv_num)
val ivAvatar: ImageView = itemView.findViewById(R.id.item_invited_iv_avatar)
val ivRanking: ImageView = itemView.findViewById(R.id.item_invite_iv_ranking)
val tvName: TextView = itemView.findViewById(R.id.item_invited_tv_name)
val tvCoin: TextView = itemView.findViewById(R.id.item_invited_tv_coin)
}
//define interface
......
package com.mints.goodmoney.ui.adapter
import android.content.Context
import android.graphics.Color
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
......@@ -16,16 +17,13 @@ import com.mints.goodmoney.utils.TimeRender
class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
companion object {
const val HEALTH_TYPE_BREATH = 0x00000001 // 呼吸
const val HEALTH_TYPE_STAND = 0x00000002 // 站一站
const val HEALTH_TYPE_FRUIT = 0x00000003 // 吃水果
const val HEALTH_TYPE_EYE = 0x00000004 // 放松眼睛
const val TASK_TYPE_VIDEO = 0x00000005 // 看视频
const val TASK_TYPE_INVITE = 0x00000006 // 邀好友
const val TASK_TYPE_GAME = 0x00000007 // 玩游戏
const val TASK_TYPE_FICTION = 0x00000007 // 看小说
const val COUNT_DOWN_INTERVAL = 1000L
const val TASK_TYPE_HOME = 0x00000001
const val TASK_TYPE_INVITE = 0x00000002
const val TASK_TYPE_VIDEO = 0x00000003
const val TASK_TYPE_GAME = 0x00000004
const val TASK_TYPE_FICTION = 0x00000005
const val TASK_TYPE_DEMO = 0x00000006
}
constructor(context: Context, taskData: MutableList<TaskBean>) {
......@@ -39,11 +37,6 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
private var mOnItemClickListener: OnItemClickListener? = null
private var mOnItemChildClickListener: OnItemChildClickListener? = null
private var mBreathTimer: CountDownTimerSupport? = null
private var mStandTimer: CountDownTimerSupport? = null
private var mFruitTimer: CountDownTimerSupport? = null
private var mEyeTimer: CountDownTimerSupport? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val inflater: LayoutInflater = LayoutInflater.from(mContext)
return TaskHolder(inflater.inflate(R.layout.item_fragment_main_my_task, parent, false))
......@@ -68,85 +61,37 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
mOnItemChildClickListener?.onItemChildClick(it2, position)
}
holder.itemTaskTitle.text = taskBean.title
holder.itemTaskInfo.text = taskBean.info
holder.itemTaskMoney.text = taskBean.coin
val gold = mContext.resources.getDrawable(R.mipmap.ic_gold)
gold.setBounds(0, 0, 50, 50)
holder.itemTaskMoney.setCompoundDrawables(gold, null, null, null)
holder.itemTaskImg.setImageDrawable(mContext.resources.getDrawable(taskBean.imageSrc))
if (taskBean.btnStr.isNotEmpty() && !taskBean.needTimer) {
holder.itemTaskClick.text = taskBean.btnStr
if (taskBean.btnStr.isEmpty()) {
holder.itemTaskClick.visibility = View.GONE
} else {
when (taskBean.type) {
HEALTH_TYPE_BREATH -> {
mBreathTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL)
startTime(mBreathTimer!!, HEALTH_TYPE_BREATH, holder.itemTaskClick, holder.itemTaskTitle)
}
HEALTH_TYPE_EYE -> {
mEyeTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL)
startTime(mEyeTimer!!, HEALTH_TYPE_EYE, holder.itemTaskClick, holder.itemTaskTitle)
}
HEALTH_TYPE_FRUIT -> {
mFruitTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL)
startTime(mFruitTimer!!, HEALTH_TYPE_FRUIT, holder.itemTaskClick, holder.itemTaskTitle)
}
HEALTH_TYPE_STAND -> {
mStandTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL)
startTime(mStandTimer!!, HEALTH_TYPE_STAND, holder.itemTaskClick, holder.itemTaskTitle)
}
}
}
when (taskBean.btnStr) {
"立即领取" -> {
holder.itemTaskClick.background = mContext.resources.getDrawable(R.drawable.shape_tv_gold)
}
"去完成" -> {
holder.itemTaskClick.background = mContext.resources.getDrawable(R.drawable.shape_main_water)
}
else -> {
holder.itemTaskClick.background = mContext.resources.getDrawable(R.drawable.shape_tv_gold_gury)
holder.itemTaskClick.visibility = View.VISIBLE
holder.itemTaskClick.text = taskBean.btnStr
if (taskBean.btnStr == "立即领取") {
holder.itemTaskClick.setBackgroundResource(R.drawable.shape_btn_orange_complete)
holder.itemTaskClick.setTextColor(Color.WHITE)
} else {
holder.itemTaskClick.setBackgroundResource(R.drawable.shape_btn_orange)
holder.itemTaskClick.setTextColor(mContext.resources.getColor(R.color.my_color_orange))
}
}
}
}
}
private fun startTime(timer: CountDownTimerSupport, type: Int, tvClick: TextView, tvTitle: TextView) {
timer.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onFinish() {
val str = tvTitle.text.toString()
var currentIndex = str.substring(str.indexOf("(") + 1, str.indexOf("(") + 2).toInt()
val maxCount = str.substring(str.indexOf(")") - 1, str.indexOf(")")).toInt()
if (currentIndex < maxCount) {
val replaceStr = str.replace(currentIndex.toString(), (currentIndex + 1).toString())
tvTitle.text = replaceStr
tvClick.text = "立即领取"
tvClick.background = mContext.resources.getDrawable(R.drawable.shape_tv_gold)
if (taskBean.progressStr.isEmpty()) {
holder.itemTaskProgress.visibility = View.GONE
} else {
val replaceStr = str.replace(maxCount.toString(), currentIndex.toString())
tvTitle.text = replaceStr
tvClick.text = "已完成"
tvClick.background = mContext.resources.getDrawable(R.drawable.shape_tv_gold_gury)
holder.itemTaskProgress.visibility = View.VISIBLE
holder.itemTaskProgress.text = taskBean.progressStr
}
}
override fun onTick(millisUntilFinished: Long) {
tvClick.text = TimeRender.ms2HMS(millisUntilFinished.toInt())
}
})
timer.start()
}
}
private inner class TaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val itemTaskImg: ImageView = itemView.findViewById(R.id.item_title_img)
val itemTaskTitle: TextView = itemView.findViewById(R.id.item_task_title)
val itemTaskMoney: TextView = itemView.findViewById(R.id.item_task_money)
val itemTaskInfo: TextView = itemView.findViewById(R.id.item_task_info)
val itemTaskProgress: TextView = itemView.findViewById(R.id.item_task_progress)
val itemTaskClick: TextView = itemView.findViewById(R.id.item_task_click)
}
......
package com.mints.goodmoney.ui.fragment
import android.text.TextUtils
import android.graphics.Typeface
import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.DividerItemDecoration
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BannerBean
import com.mints.goodmoney.ui.adapter.BannerAdapter
import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.mvp.presenters.FriendsPresenter
import com.mints.goodmoney.mvp.views.FriendsView
import com.mints.goodmoney.ui.adapter.BannerBaseAdapter
import com.mints.goodmoney.ui.adapter.BannerTaskAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.tablayout.TabLayout
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.fragment_main_friends.srl_my
import kotlinx.android.synthetic.main.header_layout.*
import com.mints.goodmoney.utils.LogUtil
/**
* 描述:邀请好友
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class FriendsFragment : BaseFragment() {
class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener {
private val friendsPresenter by lazy { FriendsPresenter() }
private val userManager by lazy { UserManager.getInstance() }
private var bvTaskData: List<Any> = arrayListOf()
private var bvBannerData: List<BannerBean.ListBean> = arrayListOf()
private var invitedData: List<Any> = arrayListOf()
private var bvTaskData: MutableList<FriendsTaskBean.ChallengeBean.ListBean> = mutableListOf()
private var invitedData: MutableList<FriendsTaskBean.FriendsBean.ListBeanX> = mutableListOf()
private var bannerTaskAdapter: BannerTaskAdapter? = null
private var invitedAdapter: InvitedAdapter? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_friends
override fun initViewsAndEvents() {
friendsPresenter.attachView(this)
srl_my.setOnRefreshListener(this)
initView()
initRecy()
......@@ -45,48 +53,52 @@ class FriendsFragment : BaseFragment() {
private fun initView() {
tv_title.text = "邀请好友"
view_title1.findViewById<TextView>(R.id.view_title).text = "邀好友 做任务 赚现金"
view_title2.findViewById<TextView>(R.id.view_title).text = "邀好友 赚分红 邀越多 赚越多"
}
private fun initRecy() {
// rg.setOnCheckedChangeListener { group, checkedId ->
// when (checkedId) {
// R.id.rb_my_friends -> {
// showToast("我的好友")
// }
// R.id.rb_world_person -> {
// showToast("世界人民")
// }
// }
//
// }
private fun initRecy() {
tab_friends.addTab(tab_friends.newTab().setText("我的好友").setTag("my_friends"))
tab_friends.addTab(tab_friends.newTab().setText("世界人民").setTag("world_person"))
tab_friends.setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabReselected(tab: TabLayout.Tab?) {
}
override fun onTabReselected(tab: TabLayout.Tab?) {}
override fun onTabUnselected(tab: TabLayout.Tab?) {
val title =
((tab_friends.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(
1
) as TextView
title.apply {
// setTextAppearance(context, R.style.TabLayoutTextSize)
typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
}
}
override fun onTabSelected(tab: TabLayout.Tab?) {
val title =
((tab_friends.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(
1
) as TextView
title.apply {
// setTextAppearance(context, R.style.BigTabLayoutTextStyle)
typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
tab?.let {
if (it.tag == "我的好友") {
showToast("我的好友")
if (it.tag == "my_friends") {
} else {
showToast("世界人民")
friendsPresenter.getLeaders()
}
}
}
})
// tab_friends.setOnScrollChangeListener(object :.(){})
recy_friends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
val invitedAdapter = InvitedAdapter(invitedData)
invitedAdapter = InvitedAdapter(mContext, invitedData)
recy_friends.adapter = invitedAdapter
invitedAdapter.setOnItemClickListener(object : InvitedAdapter.OnItemClickListener {
invitedAdapter?.setOnItemClickListener(object : InvitedAdapter.OnItemClickListener {
override fun onItemClick(view: View?, position: Int) {
}
......@@ -95,41 +107,24 @@ class FriendsFragment : BaseFragment() {
}
private fun initBanner() {
val bannerTaskAdapter = BannerTaskAdapter(mContext)
bannerTaskAdapter.setData(bvTaskData)
bv_friends_task.setAdapter(bannerTaskAdapter)
bannerTaskAdapter.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<Any> {
override fun onPageClick(position: Int, t: Any?) {
}
override fun onPageDown() {
bv_friends_task.stopAutoScroll()
}
override fun onPageUp() {
bv_friends_task.startAutoScroll()
}
})
bannerTaskAdapter = BannerTaskAdapter(mContext)
bannerTaskAdapter?.let {
it.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<FriendsTaskBean.ChallengeBean.ListBean> {
override fun onPageClick(position: Int, t: FriendsTaskBean.ChallengeBean.ListBean?) {
val bannerAdapter = BannerAdapter(mContext)
bannerAdapter.setData(bvBannerData)
bv_friends_banner.setAdapter(bannerAdapter)
bannerAdapter.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<BannerBean.ListBean> {
override fun onPageClick(position: Int, t: BannerBean.ListBean?) {
}
}
override fun onPageDown() {
bv_friends_task.stopAutoScroll()
}
override fun onPageDown() {
bv_friends_task.stopAutoScroll()
}
override fun onPageUp() {
bv_friends_task.startAutoScroll()
}
override fun onPageUp() {
bv_friends_task.startAutoScroll()
}
})
})
}
bv_friends_task.setAdapter(bannerTaskAdapter)
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -144,25 +139,41 @@ class FriendsFragment : BaseFragment() {
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS) {
if (!TextUtils.isEmpty(userManager?.userID)) {
// if (!TextUtils.isEmpty(userManager?.userID)) {
// friendsPresenter.getFriendsMsg()
// }
} else {
}
friendsPresenter.getFriendsMsg()
}
bv_friends_banner.startAutoScroll()
bv_friends_task.stopAutoScroll()
bv_friends_task.startAutoScroll()
}
override fun onPause() {
super.onPause()
bv_friends_banner.startAutoScroll()
bv_friends_task.stopAutoScroll()
}
override fun onDestroy() {
super.onDestroy()
friendsPresenter.detachView()
}
override fun onRefresh(refreshLayout: RefreshLayout) {
if (userManager.userID.isNotEmpty()) {
friendsPresenter.getFriendsMsg()
}
}
override fun getWorldRank(data: FriendsTaskBean.FriendsBean) {
invitedData.clear()
invitedData.addAll(data.list)
invitedAdapter?.notifyDataSetChanged()
}
override fun getFriendsRank(data: FriendsTaskBean) {
bvTaskData = data.challenge.list
bannerTaskAdapter?.setData(bvTaskData)
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.fragment
import android.Manifest
import android.annotation.SuppressLint
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.AdapterView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import com.google.gson.Gson
import cn.sharesdk.framework.Platform
import cn.sharesdk.framework.Platform.ShareParams
import cn.sharesdk.framework.PlatformActionListener
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
......@@ -17,12 +24,14 @@ import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView
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.SettingsActivity
import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.AppPackageUsageUtils
import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.ConstantUtil
......@@ -39,7 +48,6 @@ import kotlinx.android.synthetic.main.item_fragment_main_my_promotions.*
import kotlinx.android.synthetic.main.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.*
import net.grandcentrix.tray.AppPreferences
import java.math.BigDecimal
import java.util.*
/**
......@@ -47,14 +55,15 @@ import java.util.*
* 作者:孟崔广
* 时间:2020/6/4 17:30
*/
class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListener, MainMyAdapter.OnItemClickListener, OnRefreshListener, View.OnClickListener, AdapterView.OnItemClickListener {
@SuppressLint("SetTextI18n")
class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListener, OnRefreshListener, View.OnClickListener, AdapterView.OnItemClickListener, PlatformActionListener {
private val ps by lazy { AppPreferences(context) }
private val myPresenter by lazy { MyPresenter() }
private val userManager by lazy { UserManager.getInstance() }
private var userConfig: MyInfo? = null
private var hotList: List<BannerBean.ListBean>? = null
private var hotList: List<BannerBean.ListBean>? = arrayListOf()
// 当天签到金币
private var curSignCoin = 5
......@@ -76,75 +85,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
initRecy()
}
private val json = "{\n" +
" \"challenge_health_breath_maxcount\": 5,\n" +
" \"challenge_vedio1_vedio_coin\": 1000, \n" +
" \"challenge_health_eye_maxcount\": 3,\n" +
" \"challenge_wechat_coin\": 5000,\n" +
" \"challenge_health_fruit_complatecount\": 1,\n" +
" \"ywhzShow\": true,\n" +
" \"challenge_firstwater_coin\": 2000, \n" +
" \"timelimit_challenge_health_fruit\": 0, \n" +
" \"challenge_health_fruit_maxcount\": 2, \n" +
" \"challenge_vedio1_maxcount\": 10,\n" +
" \"challenge_sharefriend_status\": 0,\n" +
" \"gameChallengePlaytimesLevelOneCoin\": 200,\n" +
" \"challenge_watercomplete_coin\": 1000,\n" +
" \"challenge_sharefriend_maxcount\": 3,\n" +
" \"waterComplete\": 0,\n" +
" \"challenge_health_eye_complatecount\": 0,\n" +
" \"challenge_notice_coin\": 2000,\n" +
" \"ywhzCoin\": \"上不封顶\",\n" +
" \"sys_task_time_interval\": 3,\n" +
" \"timelimit_challenge_health_stand\": 0,\n" +
" \"challenge_firstcashout_complete\": 0,\n" +
" \"challenge_idcode_coin\": 10000,\n" +
" \"challenge_vedio1_complatecount\": 1,\n" +
" \"challenge_download1_complatecount\": 0,\n" +
" \"challenge_mobile_coin\": 5000,\n" +
" \"gameHomeId\": \"huanlecaizi\",\n" +
" \"challenge_vedio1_download_coin\": 650,\n" +
" \"challenge_health_stand_coin\": 10,\n" +
" \"gameChallengePlaytimesLevelOneMinTimes\": 1200,\n" +
" \"challenge_wechat_complete\": 0,\n" +
" \"challenge_firsthomegame_coin\": 10000,\n" +
" \"gameChallengePlaytimesLevelOneStatus\": 0,\n" +
" \"timelimit_challenge_health_breath\": 0,\n" +
" \"challenge_download1_vedio_coin\": 600,\n" +
" \"challenge_download1_download_coin\": 1400,\n" +
" \"turnOrderType\": 1,\n" +
" \"mobileCoinExchangeEnable\": false,\n" +
" \"challenge_firsthomegame_complete\": 0,\n" +
" \"challenge_sharefriend_complatecount\": 0,\n" +
" \"gameAppkey\": \"T0B84V\",\n" +
" \"challenge_health_stand_maxcount\": 5,\n" +
" \"challenge_notice_complete\": 2,\n" +
" \"firstGiveFriendCoin\": 1000,\n" +
" \"challenge_download1_maxcount\": 5,\n" +
" \"challenge_firstwater_complete\": 2,\n" +
" \"challenge_sharefriend_coin\": 10,\n" +
" \"challenge_health_fruit_coin\": 10,\n" +
" \"challenge_watercomplete_maxcount\": 3000,\n" +
" \"challenge_health_breath_coin\": 10,\n" +
" \"csj_vedio_complatecount\": 4,\n" +
" \"cardOrderType\": 2,\n" +
" \"challenge_firstcashout_coin\": 10000,\n" +
" \"challenge_mobile_complete\": 2,\n" +
" \"csj_vedio_needcount\": 12,\n" +
" \"challenge_health_breath_complatecount\": 4,\n" +
" \"challenge_health_eye_coin\": 10,\n" +
" \"challenge_idcode_complete\": 0,\n" +
" \"challenge_watercomplete_complatecount\": 200,\n" +
" \"timelimit_challenge_health_eye\": 10,\n" +
" \"gameOpenReward\": 1,\n" +
" \"challenge_health_stand_complatecount\": 1\n" +
"}"
private fun initView() {
iv_right_icon.visibility = View.VISIBLE
iv_right_icon.setImageResource(R.mipmap.ic_my_account)
tv_title.text = "个人中心"
view_title.text = "每日任务"
item_iv_settings.setOnClickListener(this)
item_title_id.setOnClickListener(this)
......@@ -154,8 +97,6 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
item_title_invitecode_copy.setOnClickListener(this)
ll_my_login.setOnClickListener(this)
view_title.text = "每日任务"
item_promotions_egv.onItemClickListener = this
item_bottom_version.text = "v" + ConstantUtil.getVersionName(mContext)
}
......@@ -165,19 +106,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
*/
private fun initRecy() {
recy_my.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recy_my.setItemViewCacheSize(20)
recy_my.setItemViewCacheSize(10)
mainMyAdapter = MainMyAdapter(mContext, dataList)
recy_my.adapter = mainMyAdapter
mainMyAdapter?.setOnItemChildClickListener(this)
mainMyAdapter?.setOnItemClickListener(this)
generteData()
}
private fun generteData() {
val fromJson = Gson().fromJson<UserVersusBean>(json, UserVersusBean::class.java)
handleRecyData(fromJson)
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -192,11 +124,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MY) {
if (!TextUtils.isEmpty(userManager.userID)) {
myPresenter.getUserTaskMsg(false)
myPresenter.getUserHallBaseMsg()
} else {
// 游客登录
myPresenter.userLogin(ps)
}
......@@ -216,12 +146,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
return
}
val code = data.idcode
if (!TextUtils.isEmpty(code)) {
item_title_invitecode.text = "ID:$code"
}
myPresenter.getSignInHomePageMsg()
userConfig = data
handleRecyData()
setUserLoginStatus()
}
......@@ -234,15 +162,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
override fun getMyHotActivitySuc(data: BannerBean?) {
if (UserManager.getInstance().adShowFlag) {
data?.let {
item_promotions_egv.visibility = View.VISIBLE
hotList = it.list
item_promotions_egv.adapter = GvMyAdapter(mContext, hotList)
}
} else {
item_promotions_egv.visibility = View.GONE
}
// if (UserManager.getInstance().adShowFlag) {
data?.let {
item_promotions_egv.visibility = View.VISIBLE
hotList = it.list
item_promotions_egv.adapter = GvMyAdapter(mContext, hotList)
}
// } else {
// item_promotions_egv.visibility = View.GONE
// }
}
override fun getSignInHomePageMsgSuc(signBean: SignCardBean?) {
......@@ -263,17 +191,21 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
return
}
// val bundle = Bundle()
// bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin)
//// bundle.putInt(Constant.MAIN_ALL_COIN, userConfig.getCoin());
// // bundle.putInt(Constant.MAIN_ALL_COIN, userConfig.getCoin());
// bundle.putString(Constant.MAIN_CARRIET_TURN, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
// readyGo(AwardActivity::class.java, bundle)
myPresenter.getSignInHomePageMsg()
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD)
readyGo(AwardActivity::class.java, bundle)
}
override fun userLoginSuc() {
myPresenter.getUserHallBaseMsg()
}
override fun onRefresh(refreshLayout: RefreshLayout) {
if (userManager.userID.isEmpty()) {
myPresenter.getUserTaskMsg(false)
if (userManager.userID.isNotEmpty()) {
myPresenter.getUserHallBaseMsg()
} else {
myPresenter.userLogin(ps)
}
......@@ -296,27 +228,35 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
val signBean = signList[i]
val signDays = signBean.d
// 初始化每天的金币
if (signDays == 1) {
signGoldList.add(signBean.coin)
signViewBean.firstStatus = signBean.status
} else if (signDays == 2) {
signGoldList.add(signBean.coin)
signViewBean.twoStatus = signBean.status
} else if (signDays == 3) {
signGoldList.add(signBean.coin)
signViewBean.threeStatus = signBean.status
} else if (signDays == 4) {
signGoldList.add(signBean.coin)
signViewBean.fourStatus = signBean.status
} else if (signDays == 5) {
signGoldList.add(signBean.coin)
signViewBean.fiveStatus = signBean.status
} else if (signDays == 6) {
signGoldList.add(signBean.coin)
signViewBean.sixStatus = signBean.status
} else if (signDays == 7) {
signGoldList.add(signBean.coin)
signViewBean.sevenStatus = signBean.status
when (signDays) {
1 -> {
signGoldList.add(signBean.coin)
signViewBean.firstStatus = signBean.status
}
2 -> {
signGoldList.add(signBean.coin)
signViewBean.twoStatus = signBean.status
}
3 -> {
signGoldList.add(signBean.coin)
signViewBean.threeStatus = signBean.status
}
4 -> {
signGoldList.add(signBean.coin)
signViewBean.fourStatus = signBean.status
}
5 -> {
signGoldList.add(signBean.coin)
signViewBean.fiveStatus = signBean.status
}
6 -> {
signGoldList.add(signBean.coin)
signViewBean.sixStatus = signBean.status
}
7 -> {
signGoldList.add(signBean.coin)
signViewBean.sevenStatus = signBean.status
}
}
// 获取当天状态
......@@ -325,6 +265,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
curSignCoin = signBean.coin
}
}
// 初始化金币数据
item_clock_signview.initSignViewGoldLayout(signGoldList)
// 设置签到样式
......@@ -337,16 +278,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
// 根据当天状态 计算连续签到天数
var alwaysSignDay = 0
alwaysSignDay = if (signStatus == 0) {
val alwaysSignDay = if (signStatus == 0) {
nowDate - 1
} else {
nowDate
}
item_clock_signday.text = SpanUtils()
.append(" 已连续签到").setFontSize(36).setForegroundColor(context!!.resources.getColor(R.color.product_text))
.append(" $alwaysSignDay ").setFontSize(36).setForegroundColor(context!!.resources.getColor(R.color.versus_sign_day))
.append("天").setFontSize(36).setForegroundColor(context!!.resources.getColor(R.color.product_text))
.append(" 已连续签到").setForegroundColor(mContext.resources.getColor(R.color.product_text))
.append(" $alwaysSignDay ").setForegroundColor(mContext.resources.getColor(R.color.versus_sign_day))
.append("天").setForegroundColor(mContext.resources.getColor(R.color.product_text))
.create()
val finalSignStatus = signStatus
item_clock_signview.setSignViewListener { day ->
......@@ -355,13 +295,16 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
.request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
if (userManager.adShowFlag) {
if (finalSignStatus == 0) {
myPresenter.signInHomePage()
} else if (finalSignStatus == 1) {
// loadAd(Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, TTAdManagerHolder.TT_AD_VEDIO_MOREDIALOG)
}
// if (userManager.adShowFlag) {
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)
readyGo(AwardActivity::class.java, bundle)
}
// }
} else {
showMissingPermissionDialog("设备、储存")
}
......@@ -371,294 +314,81 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
private fun setUserLoginStatus() {
val code = userConfig!!.userMsg.idcode
if (code.isNotEmpty()) {
item_title_invitecode.text = "邀请码:$code"
}
if (userManager.userIsLogin()) {
// 已登录
if (!TextUtils.isEmpty(userManager.getWxOpenid())) {
GlideUtils.loadImageView(context, userManager.getWxHeader(), item_title_avatar)
item_title_id.setText(userManager.getWxName())
if (userManager.wxOpenid.isNotEmpty()) {
GlideUtils.loadImageView(context, userManager.wxHeader, item_title_avatar)
item_title_id.text = userManager.wxName
} else {
var mobile = userManager.mobile
if (!TextUtils.isEmpty(mobile)) {
if (mobile.isNotEmpty()) {
mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
}
item_title_id.text = "手机:$mobile"
item_title_avatar.setImageResource(R.mipmap.ic_my)
}
// item_title_login.setVisibility(View.GONE)
} else {
// 未登录
var userId = userManager.userID
if (!TextUtils.isEmpty(userId) && userId.length > 11) {
if (userId.isNotEmpty() && userId.length > 11) {
userId = userId.substring(userId.length - 10)
item_title_id.text = "游客$userId 去登录"
} else {
item_title_id.text = "游客 去登录"
}
// item_title_login.visibility = View.VISIBLE
item_title_avatar.setImageResource(R.mipmap.ic_my)
}
if (BuildConfig.DEBUG) {
item_title_id.text = "测试环境->" + item_title_id.text.toString()
}
val userGold: String
val usercash: String
if (userConfig == null) {
userGold = "0.00"
usercash = "0.00"
val userGold = if (userConfig == null) {
"0.00"
} else {
userGold = java.lang.String.valueOf(userConfig!!.coin)
val allcoinBig = BigDecimal(userGold)
val rateBig = BigDecimal("10000")
usercash = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
"" + userConfig!!.userMsg.coin
}
// 零钱金币
// 金币
item_title_gold_count.text = userGold
// item_title_cash_count.text = usercash
}
/**
* 处理列表数据
*/
fun handleRecyData(data: UserVersusBean) {
private fun handleRecyData() {
dataList.clear()
// 看视频赚金币
// val maxcount = userConfig.challenge_vedio1_maxcount
// val complatecount = userConfig.challenge_vedio1_complatecount
// val watchVideo = TaskBean(R.mipmap.ic_launcher, "看视频赚金币", )
// 游戏
val gameTime = data.gameChallengePlaytimesLevelOneMinTimes
val gameStr = when (data.gameChallengePlaytimesLevelOneStatus) {
1 -> "立即领取"
2 -> "已领取"
else -> "去完成"
}
val gameTask = TaskBean(R.mipmap.ic_launcher, "每日游戏奖励", "+" + data.gameChallengePlaytimesLevelOneCoin,
R.mipmap.ic_launcher, "玩任意游戏达" + gameTime + "秒", gameStr)
dataList.add(gameTask)
// 鱼玩盒子
if (userManager.adShowFlag) {
if (data.isYwhzShow) {
val ywhzTask = TaskBean(R.mipmap.ic_launcher, "高额游戏任务", "+" + data.ywhzCoin,
R.mipmap.ic_launcher, "完成任务拿高额金币奖励,上不封顶", "去完成")
dataList.add(ywhzTask)
}
}
// ----------------------------
// 第一次喝水 Complete 0-未完成 1-完成 2-领取
val challengeFirstwaterComplete = data.challenge_firstwater_complete
if (challengeFirstwaterComplete == 0) {
val drinkTask = TaskBean(R.mipmap.ic_launcher, "首次喝水打卡", "+" + data.challenge_firstwater_coin,
R.mipmap.ic_launcher, "喝水还能赚金币,健康挣钱两不误", "去完成")
dataList.add(drinkTask)
} else if (challengeFirstwaterComplete == 1) {
val drinkTask = TaskBean(R.mipmap.ic_launcher, "首次喝水打卡", "+" + data.challenge_firstwater_coin,
R.mipmap.ic_launcher, "喝水还能赚金币,健康挣钱两不误", "立即领取")
dataList.add(drinkTask)
}
// 邀请好友
val inviteTask = TaskBean(R.mipmap.ic_launcher, "邀请好友赚金币", "+" + data.firstGiveFriendCoin,
R.mipmap.ic_launcher, "邀好友立得" + data.firstGiveFriendCoin + "金币,成功自动到账", "去完成")
dataList.add(inviteTask)
//每日喝水达标
val watercompleteComplatecount = data.challenge_watercomplete_complatecount
val challengeWatercompleteMaxcount = data.challenge_watercomplete_maxcount
val waterComplete = data.waterComplete
//0-未完成 1-完成 2-领取
var waterStr = when (waterComplete) {
0 -> "去完成"
1 -> "立即领取"
else -> "已完成"
}
val waterTask = TaskBean(R.mipmap.ic_launcher, "喝水达标($watercompleteComplatecount/$challengeWatercompleteMaxcount)", "+" + data.challenge_watercomplete_coin,
R.mipmap.ic_launcher, "每日喝水达标即可领取", waterStr)
dataList.add(waterTask)
//每日分享
val challengeSharefriendComplatecount = data.challenge_sharefriend_complatecount
val challengeSharefriendMaxcount = data.challenge_sharefriend_maxcount
val shareStr = if (challengeSharefriendComplatecount < challengeSharefriendMaxcount) {
if (data.challenge_sharefriend_status === 0) {
"去完成"
} else {
"立即领取"
}
} else {
"已完成"
}
val shareTask = TaskBean(R.mipmap.ic_launcher, "每日分享($challengeSharefriendComplatecount/$challengeSharefriendMaxcount)", "+" + data.challenge_sharefriend_coin * challengeSharefriendMaxcount,
R.mipmap.ic_launcher, "分享到微信群提高到300%", shareStr)
dataList.add(shareTask)
//绑定微信号 Complete 0-未完成 1-完成 2-领取
val challengeWechatComplete = data.challenge_wechat_complete
if (challengeWechatComplete == 0) {
val wechatTask = TaskBean(R.mipmap.ic_launcher, "绑定微信号", "+" + data.challenge_wechat_coin,
R.mipmap.ic_launcher, "绑定微信邀好友来挑战", "去完成")
dataList.add(wechatTask)
} else if (challengeWechatComplete == 1) {
val wechatTask = TaskBean(R.mipmap.ic_launcher, "绑定微信号", "+" + data.challenge_wechat_coin,
R.mipmap.ic_launcher, "绑定微信邀好友来挑战", "立即领取")
dataList.add(wechatTask)
}
//绑定手机号 Complete 0-未完成 1-完成 2-领取
val challengeMobileComplete = data.challenge_mobile_complete
if (challengeMobileComplete == 0) {
val phoneTask = TaskBean(R.mipmap.ic_launcher, "绑定手机号", "+" + data.challenge_mobile_coin,
R.mipmap.ic_launcher, "安全提现 获得更多金币", "去完成")
dataList.add(phoneTask)
} else if (challengeMobileComplete == 1) {
val phoneTask = TaskBean(R.mipmap.ic_launcher, "绑定手机号", "+" + data.challenge_mobile_coin,
R.mipmap.ic_launcher, "安全提现 获得更多金币", "立即领取")
dataList.add(phoneTask)
}
//首次提现 Complete 0-未完成 1-完成 2-领取
val challengeFirstcashoutComplete = data.challenge_firstcashout_complete
if (challengeFirstcashoutComplete == 0) {
val cashOutTask = TaskBean(R.mipmap.ic_launcher, "完成第一笔提现", "+" + data.challenge_firstcashout_coin,
R.mipmap.ic_launcher, "提现红包到口袋 零钱花不完", "去完成")
dataList.add(cashOutTask)
} else if (challengeFirstcashoutComplete == 1) {
val cashOutTask = TaskBean(R.mipmap.ic_launcher, "完成第一笔提现", "+" + data.challenge_firstcashout_coin,
R.mipmap.ic_launcher, "提现红包到口袋 零钱花不完", "立即领取")
dataList.add(cashOutTask)
}
//每日游戏一次 Complete 0-未完成 1-完成 2-领取
if (userManager.adShowFlag) {
val challengeFirsthomegameComplete = data.challenge_firsthomegame_complete
if (challengeFirsthomegameComplete == 0) {
val homeGameTask = TaskBean(R.mipmap.ic_launcher, "首次完成游戏任务", "+" + data.challenge_firsthomegame_coin,
R.mipmap.ic_launcher, "每日完成首页游戏任务,玩越多赚越多", "去完成")
dataList.add(homeGameTask)
} else if (challengeFirsthomegameComplete == 1) {
val homeGameTask = TaskBean(R.mipmap.ic_launcher, "首次完成游戏任务", "+" + data.challenge_firsthomegame_coin,
R.mipmap.ic_launcher, "每日完成首页游戏任务,玩越多赚越多", "立即领取")
dataList.add(homeGameTask)
}
}
//开启消息通知权限 Complete 0-未完成 1-完成 2-领取
val challengeNoticeComplete = data.challenge_notice_complete
if (challengeNoticeComplete != 2) {
if (AppPackageUsageUtils.isNotificationEnabled(context)) {
val noticeTask = TaskBean(R.mipmap.ic_launcher, "开启喝水提醒", "+" + data.challenge_notice_coin,
R.mipmap.ic_launcher, "按时提醒你喝水,金币一个也不漏", "立即领取")
dataList.add(noticeTask)
} else {
val noticeTask = TaskBean(R.mipmap.ic_launcher, "开启喝水提醒", "+" + data.challenge_notice_coin,
R.mipmap.ic_launcher, "按时提醒你喝水,金币一个也不漏", "去完成")
dataList.add(noticeTask)
}
}
//深呼吸
val healthBreathComplatecount = data.challenge_health_breath_complatecount
val healthBreathMaxcount = data.challenge_health_breath_maxcount
if (healthBreathComplatecount < healthBreathMaxcount) {
val breathTime = data.timelimit_challenge_health_breath
if (breathTime > 0) {
val breathTask = TaskBean(R.mipmap.ic_launcher, "小健康:深呼吸 ($healthBreathComplatecount/$healthBreathMaxcount)",
"+" + data.challenge_health_breath_coin,
R.mipmap.ic_launcher, "沉静思绪,静心阐远,解除疲惫", "", true,
data.timelimit_challenge_health_breath, MainMyAdapter.HEALTH_TYPE_BREATH)
dataList.add(breathTask)
} else {
// 上方显示
val breathTask = TaskBean(R.mipmap.ic_launcher, "小健康:深呼吸 ($healthBreathComplatecount/$healthBreathMaxcount)",
"+" + data.challenge_health_breath_coin,
R.mipmap.ic_launcher, "沉静思绪,静心阐远,解除疲惫", "立即领取")
dataList.add(breathTask)
}
} else {
val breathTask = TaskBean(R.mipmap.ic_launcher, "小健康:深呼吸 ($healthBreathComplatecount/$healthBreathMaxcount)",
"+" + data.challenge_health_breath_coin,
R.mipmap.ic_launcher, "沉静思绪,静心阐远,解除疲惫", "已完成")
dataList.add(breathTask)
}
//站一站
val healthStandComplatecount = data.challenge_health_stand_complatecount
val healthStandMaxcount = data.challenge_health_stand_maxcount
if (healthStandComplatecount < healthStandMaxcount) {
val standTime = data.timelimit_challenge_health_stand
if (standTime > 0) {
val standTask = TaskBean(R.mipmap.ic_launcher, "小健康:站一站 ($healthStandComplatecount/$healthStandMaxcount)",
"+" + data.challenge_health_stand_coin,
R.mipmap.ic_launcher, "舒展站立,放松肩颈,缓解疲劳", "",
true, standTime, MainMyAdapter.HEALTH_TYPE_STAND)
dataList.add(standTask)
} else {
// 上方显示
val standTask = TaskBean(R.mipmap.ic_launcher, "小健康:站一站 ($healthStandComplatecount/$healthStandMaxcount)",
"+" + data.challenge_health_stand_coin,
R.mipmap.ic_launcher, "舒展站立,放松肩颈,缓解疲劳", "立即领取")
dataList.add(standTask)
}
} else {
val standTask = TaskBean(R.mipmap.ic_launcher, "小健康:站一站 ($healthStandComplatecount/$healthStandMaxcount)",
"+" + data.challenge_health_stand_coin,
R.mipmap.ic_launcher, "舒展站立,放松肩颈,缓解疲劳", "已完成")
dataList.add(standTask)
}
//吃水果
val healthFruitComplatecount = data.challenge_health_fruit_complatecount
val healthFruitMaxcount = data.challenge_health_fruit_maxcount
if (healthFruitComplatecount < healthFruitMaxcount) {
val fruitsTime = data.timelimit_challenge_health_fruit
if (fruitsTime > 0) {
val fruitTask = TaskBean(R.mipmap.ic_launcher, "小健康:吃水果 ($healthFruitComplatecount/$healthFruitMaxcount)",
"+" + data.challenge_health_fruit_coin,
R.mipmap.ic_launcher, "多吃水果,补充营养,抵抗疾病", "",
true, fruitsTime, MainMyAdapter.HEALTH_TYPE_FRUIT)
dataList.add(fruitTask)
} else {
// 上方显示
val fruitTask = TaskBean(R.mipmap.ic_launcher, "小健康:吃水果 ($healthFruitComplatecount/$healthFruitMaxcount)",
"+" + data.challenge_health_fruit_coin,
R.mipmap.ic_launcher, "多吃水果,补充营养,抵抗疾病", "立即领取")
dataList.add(fruitTask)
}
} else {
val fruitTask = TaskBean(R.mipmap.ic_launcher, "小健康:吃水果 ($healthFruitComplatecount/$healthFruitMaxcount)",
"+" + data.challenge_health_fruit_coin,
R.mipmap.ic_launcher, "多吃水果,补充营养,抵抗疾病", "已完成")
dataList.add(fruitTask)
}
//放松眼睛
val healthEyeComplatecount = data.challenge_health_eye_complatecount
val healthEyeMaxcount = data.challenge_health_eye_maxcount
if (healthEyeComplatecount < healthEyeMaxcount) {
val eyesTime = data.timelimit_challenge_health_eye
if (eyesTime > 0) {
val eyeTask = TaskBean(R.mipmap.ic_launcher, "小健康:放松眼睛 ($healthEyeComplatecount/$healthEyeMaxcount)",
"+" + data.challenge_health_eye_coin,
R.mipmap.ic_launcher, "眺望远方,舒缓眼睛,放松身心", "",
true, eyesTime, MainMyAdapter.HEALTH_TYPE_EYE)
dataList.add(eyeTask)
} else {
// 上方显示
val eyeTask = TaskBean(R.mipmap.ic_launcher, "小健康:放松眼睛 ($healthEyeComplatecount/$healthEyeMaxcount)",
"+" + data.challenge_health_eye_coin,
R.mipmap.ic_launcher, "眺望远方,舒缓眼睛,放松身心", "立即领取")
dataList.add(eyeTask)
}
} else {
val eyeTask = TaskBean(R.mipmap.ic_launcher, "小健康:放松眼睛 ($healthEyeComplatecount/$healthEyeMaxcount)",
"+" + data.challenge_health_eye_coin,
R.mipmap.ic_launcher, "眺望远方,舒缓眼睛,放松身心", "已完成")
dataList.add(eyeTask)
}
// 跳转首页视频
val task1 = TaskBean(R.mipmap.icon_my_coin, "分分钟赚金币,翻倍还能赚更多", "", "去赚钱", 1)
// 邀好友赚金币
var progressStrInvited = ""
if (userConfig != null) {
progressStrInvited = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
}
val task2 = TaskBean(R.mipmap.icon_my_invite, "邀好友,赚金币", progressStrInvited, "去邀请", 2)
// 看福利视频赚金币
var progressStrVideo = ""
if (userConfig != null) {
progressStrVideo = "(" + userConfig!!.taskVeido.complete + "/" + userConfig!!.taskVeido.max + ")"
}
val task3 = TaskBean(R.mipmap.icon_my_video, "看福利视频赚金币", progressStrVideo, "赚金币", 3)
// 玩游戏,赚金币
val task4 = TaskBean(R.mipmap.icon_my_game, "玩游戏,赚金币", "", "赚金币", 4)
// 小说免费看,金币大家赚
val task5 = TaskBean(R.mipmap.icon_my_fiction, "小说免费看,金币大家赚", "", "去阅读", 5)
// 试玩平台
val task6 = TaskBean(R.mipmap.icon_my_demo, "试玩平台", "", "", 5)
dataList.add(task1)
dataList.add(task2)
dataList.add(task3)
dataList.add(task4)
dataList.add(task5)
dataList.add(task6)
mainMyAdapter?.notifyDataSetChanged()
}
......@@ -673,49 +403,62 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
when (view?.id) {
R.id.item_task_click -> {
val taskBean = dataList[position]
when (taskBean.type) {
// 跳转首页视频
MainMyAdapter.TASK_TYPE_HOME -> {
val activity: MainActivity? = activity as MainActivity?
activity?.clickTab1Layout()
}
// 邀好友赚金币
MainMyAdapter.TASK_TYPE_INVITE -> {
if (userConfig!!.taskShareFriend!!.complete >= userConfig!!.taskShareFriend!!.max) {
showToast("邀好友赚金币任务已完成,请明日再来")
return
}
}
}
}
override fun onItemClick(view: View?, position: Int) {
if (AntiShake.check(view?.id)) return
if (!NetUtils.isNetworkConnected(context)) {
showToast("网络异常,请检测网络")
return
}
if (TextUtils.equals(taskBean.btnStr, "立即领取")) {
if (userConfig!!.taskShareFriend!!.complete < userConfig!!.taskShareFriend!!.max) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, 50)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CHALLENGE_SHAREFRIEND)
readyGo(AwardActivity::class.java, bundle)
}
} else {
val wechatSp = ShareParams()
wechatSp.shareType = Platform.SHARE_IMAGE
wechatSp.imageData = ImageUtil.drawableToBitmap(ContextCompat.getDrawable(mContext, R.mipmap.ic_launcher))
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (wechat.isClientValid) {
myPresenter.cmtShareStatus()
wechat.platformActionListener = this // 设置分享事件回调
// 执行图文分享
wechat.share(wechatSp)
} else {
showToast("请先安装微信")
}
}
}
// 看福利视频赚金币
MainMyAdapter.TASK_TYPE_VIDEO -> {
if (userConfig!!.taskVeido!!.complete >= userConfig!!.taskVeido!!.max) {
showToast("看福利视频赚金币任务已完成,请明日再来")
return
}
val taskBean = dataList[position]
when (taskBean.type) {
// 深呼吸
MainMyAdapter.HEALTH_TYPE_BREATH -> {
}
// 放松眼睛
MainMyAdapter.HEALTH_TYPE_EYE -> {
}
// 吃水果
MainMyAdapter.HEALTH_TYPE_FRUIT -> {
}
// 站一站
MainMyAdapter.HEALTH_TYPE_STAND -> {
}
// 看视频
MainMyAdapter.TASK_TYPE_VIDEO -> {
}
// 看小说
MainMyAdapter.TASK_TYPE_FICTION -> {
}
// 邀请好友
MainMyAdapter.TASK_TYPE_INVITE -> {
}
// 玩游戏
MainMyAdapter.TASK_TYPE_GAME -> {
}
else -> {
}
// 玩游戏,赚金币
MainMyAdapter.TASK_TYPE_GAME -> {
}
// 小说免费看,金币大家赚
MainMyAdapter.TASK_TYPE_FICTION -> {
}
// 试玩平台
MainMyAdapter.TASK_TYPE_DEMO -> {
}
}
}
}
}
override fun onClick(v: View?) {
......@@ -743,7 +486,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
R.id.btn_withdraw -> {
if (userConfig == null) {
showToast("网络异常,请检测网络!")
myPresenter.getUserTaskMsg(false)
myPresenter.getUserHallBaseMsg()
return
}
......@@ -751,7 +494,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
R.id.item_title_invitecode -> {
if (userConfig != null) {
val invitedCode = userConfig!!.idcode
val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
......@@ -761,7 +504,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
R.id.item_title_invitecode_copy -> {
if (userConfig != null) {
val invitedCode = userConfig!!.idcode
val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
......@@ -769,67 +512,42 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
}
}
else -> {
}
}
}
override fun onItemClick(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
// if (hotList != null && hotList.size > 0) {
// val hotBean: ListBean = hotList.get(position)
// if (hotBean != null) {
// val hotUrl: String = hotBean.getUrl()
// val hotTourl: String = hotBean.getToUrl()
// myPresenter.addMyAdCount(Constant.CARRIER_HOTACTIVITY, hotBean.getId())
// if (!TextUtils.isEmpty(hotUrl)) {
// val bundle = Bundle()
// bundle.putString(Constant.DAICHAO_URL, hotUrl)
// bundle.putString(Constant.DAICHAO_TITLE, hotBean.getTitle())
// val sid: String = hotBean.getId()
// if (TextUtils.equals(sid, Constant.HOT_ACTIVITY_SID)) {
// // 新闻资讯 兼容h5 iframe
// readyGo(NewsWebviewActivity::class.java, bundle)
// } else {
// readyGo(WebActivity::class.java, bundle)
// }
// } else if (!TextUtils.isEmpty(hotTourl)) {
// // 自有界面
// when (hotTourl) {
// Constant.HOT_ACTIVITY_YWHZ -> {
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java)
// return
// }
// RxPermissions(activity!!)
// .request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
// .subscribe { granted: Boolean ->
// if (granted) {
// try {
// YwSDK_WebActivity.Companion.open(activity)
// // toggleIsBack2Left();
// } catch (e: Exception) {
// e.printStackTrace()
// showToast("暂不支持该版本")
// }
// } else {
// showMissingPermissionDialog("设备、储存")
// }
// }
// }
// Constant.HOT_ACTIVITY_CHB -> readyGo(RedboxActivity::class.java)
// Constant.HOT_ACTIVITY_YQHY -> {
// val bundle = Bundle()
// bundle.putInt(Constant.FRIENDS_SHOWPAGEFLAG, 1)
// readyGo(FriendsNewActivity::class.java, bundle)
// }
// Constant.HOT_ACTIVITY_YDZQ -> readyGo(AdWebActivity::class.java)
// else -> showToast("该热门活动暂未开放")
// }
// } else {
// showToast("该热门活动暂未开放")
// }
// }
// }
if (hotList!!.isNotEmpty()) {
val hotBean: BannerBean.ListBean = hotList!![position]
val hotUrl: String = hotBean.url
val hotTourl: String = hotBean.toUrl
// myPresenter.addMyAdCount(Constant.CARRIER_HOTACTIVITY, hotBean.id)
// 自有界面
when (hotTourl) {
Constant.HOT_ACTIVITY_WATER -> {
// readyGo(RedboxActivity::class.java)
}
Constant.HOT_ACTIVITY_WALK -> {
}
Constant.HOT_ACTIVITY_CARD -> {
// readyGo(AdWebActivity::class.java)
}
else -> showToast("该热门活动暂未开放")
}
}
}
override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) {
userConfig?.taskShareFriend!!.complete += 1
dataList[1].progressStr = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
dataList[1].btnStr = "立即领取"
mainMyAdapter?.notifyItemChanged(1)
}
override fun onError(p0: Platform?, p1: Int, p2: Throwable?) = showToast("邀请取消")
override fun onCancel(p0: Platform?, p1: Int) = showToast("邀请取消")
}
\ No newline at end of file
......@@ -179,100 +179,100 @@ public class SignView extends LinearLayout implements View.OnClickListener {
*/
private void setContentLayoutAndBgColor(int days, int status, TextView tvContent, TextView tvDay, boolean isCurFlag) {
Resources resources = getResources();
if (UserManager.getInstance().getAdShowFlag()) {
switch (status) {
case 0:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvDay.setTextColor(resources.getColor(R.color.black));
break;
case 1:
if (isCurFlag) {
tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya));
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_vedio));
tvDay.setTextColor(resources.getColor(R.color.black));
tvDay.setText("可翻倍");
} else {
if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_none));
}
tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya));
tvDay.setText("已领");
}
break;
case 2:
if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_none));
}
// if (UserManager.getInstance().getAdShowFlag()) {
switch (status) {
case 0:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvDay.setTextColor(resources.getColor(R.color.black));
break;
case 1:
if (isCurFlag) {
tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya));
tvDay.setText("已领");
break;
default:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_vedio));
tvDay.setTextColor(resources.getColor(R.color.black));
break;
}
} else {
switch (status) {
case 0:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
tvDay.setText("可翻倍");
} else {
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvDay.setTextColor(resources.getColor(R.color.black));
break;
case 1:
case 2:
if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_none));
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya));
tvDay.setText("已领");
break;
default:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvDay.setTextColor(resources.getColor(R.color.black));
break;
}
}
break;
case 2:
if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya));
tvDay.setText("已领");
break;
default:
if (days == 7) {
tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
}
tvDay.setTextColor(resources.getColor(R.color.black));
break;
}
// } else {
// switch (status) {
// case 0:
// if (days == 7) {
// tvContent.setText("");
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
//
// } else {
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
// }
// tvDay.setTextColor(resources.getColor(R.color.black));
// break;
// case 1:
// case 2:
// if (days == 7) {
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
//
// } else {
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_none));
// }
//
// tvContent.setText("");
// tvContent.setTextColor(resources.getColor(R.color.graya));
// tvDay.setTextColor(resources.getColor(R.color.graya));
// tvDay.setText("已领");
// break;
// default:
// if (days == 7) {
// tvContent.setText("");
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
// } else {
// tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
// }
// tvDay.setTextColor(resources.getColor(R.color.black));
// break;
// }
// }
}
......
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="500"
android:duration="300"
android:fromYDelta="100%p"
android:toYDelta="0" />
<alpha
android:duration="750"
android:duration="500"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<stroke
android:width="1.5dp"
android:color="@color/my_color_orange" />
<corners android:radius="100dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="270"
android:endColor="#ffff7f2c"
android:startColor="#ffffb032"
android:type="linear"
android:useLevel="true" />
<corners android:radius="100dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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">
<include layout="@layout/header_layout" />
<TextView
android:id="@+id/tvAboutasVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="15dp"
android:text="@string/app_name"
android:textColor="@color/text_font"
android:textSize="13sp" />
<ImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_launcher" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:id="@+id/tvAboutasService"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="2dp"
android:padding="5dp"
android:text="@string/register_name"
android:textColor="@color/main_mints"
android:textSize="14sp" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/main_mints" />
<TextView
android:id="@+id/tvAboutasPolicy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:padding="5dp"
android:text="隐私政策"
android:textColor="@color/main_mints"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:gravity="center"
android:text="Copyright © 2020 Inc.."
android:textColor="@color/text_font"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
......@@ -25,14 +25,13 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:layout_behavior=".ui.widgets.FlingBehavior">
android:background="@color/white">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<LinearLayout
android:layout_width="match_parent"
......@@ -46,32 +45,41 @@
<com.mints.goodmoney.ui.widgets.BannerView
android:id="@+id/bv_friends_task"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_height="80dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
app:bannerAnimDuration="1500"
app:bannerAnimScroll="true"
app:bannerAutoScroll="true"
app:bannerAutoScroll="false"
app:bannerPageAlpha="0"
app:bannerPageMargin="8dp"
app:bannerPagePercent="0.9"
app:bannerPageScale="0.8"
app:bannerScrollDuration="4000" />
<com.mints.goodmoney.ui.widgets.BannerView
android:id="@+id/bv_friends_banner"
<include layout="@layout/item_divider_gray" />
<!-- <com.mints.goodmoney.ui.widgets.BannerView-->
<!-- android:id="@+id/bv_friends_banner"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="100dp"-->
<!-- app:bannerAnimDuration="1500"-->
<!-- app:bannerAnimScroll="true"-->
<!-- app:bannerAutoScroll="true"-->
<!-- app:bannerPageAlpha="0"-->
<!-- app:bannerPageMargin="8dp"-->
<!-- app:bannerPagePercent="0.9"-->
<!-- app:bannerPageScale="0.8"-->
<!-- app:bannerScrollDuration="4000" />-->
<ImageView
android:layout_width="match_parent"
android:layout_height="120dp"
app:bannerAnimDuration="1500"
app:bannerAnimScroll="true"
app:bannerAutoScroll="true"
app:bannerPageAlpha="0"
app:bannerPageMargin="8dp"
app:bannerPagePercent="0.9"
app:bannerPageScale="0.8"
app:bannerScrollDuration="4000" />
android:layout_height="wrap_content"
android:padding="15dp"
android:scaleType="centerCrop"
android:src="@mipmap/bg_friends" />
<include
android:id="@+id/view_title2"
layout="@layout/view_title" />
<include layout="@layout/item_divider_gray" />
</LinearLayout>
......@@ -83,29 +91,25 @@
android:layout_height="56dp"
android:layout_gravity="center_horizontal"
app:indicatorEndColor="#e73820"
app:indicatorMarginBottom="3dp"
app:indicatorMarginEnd="22dp"
app:indicatorMarginStart="22dp"
app:indicatorMarginEnd="20dp"
app:indicatorMarginStart="20dp"
app:indicatorStartColor="#d6694e"
app:tabIndicatorHeight="4dp"
app:tabMode="scrollable" />
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/my_color_orange"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="@color/main_bg_text" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_friends"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_friends"
android:layout_width="match_parent"
android:layout_height="1000dp"
android:background="@color/blue"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.core.widget.NestedScrollView>
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
......
......@@ -22,6 +22,7 @@
android:layout_height="wrap_content" />
<androidx.core.widget.NestedScrollView
android:overScrollMode="never"
android:layout_width="match_parent"
android:layout_height="wrap_content">
......
......@@ -2,13 +2,16 @@
<androidx.constraintlayout.widget.ConstraintLayout 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:padding="10dp">
android:layout_height="wrap_content">
<ImageView
android:id="@+id/item_bv_friends_task_iv"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:src="@mipmap/ic_friends_task"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......@@ -18,7 +21,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="任务1"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/item_bv_friends_task_iv"
app:layout_constraintTop_toTopOf="parent" />
......@@ -27,16 +34,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginBottom="10dp"
android:text="邀请1名好友"
android:textColor="@color/main_bg_text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/item_bv_friends_task_iv" />
<Button
android:id="@+id/item_bv_friends_task_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:background="@drawable/shape_btn_orange"
android:text="去邀请"
android:textColor="@color/my_color_orange"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
......
......@@ -6,28 +6,30 @@
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:background="@mipmap/bg_sign"
android:gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/item_clock_sign"
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@mipmap/ic_sign_icon"
android:visibility="visible" />
android:src="@mipmap/ic_sign_icon" />
<TextView
android:id="@+id/item_clock_signday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="16pt" />
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
......@@ -36,7 +38,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:visibility="visible" />
android:layout_marginRight="20dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
android:layout_height="60dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/item_title_img"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:src="@mipmap/ic_versus_drinkone" />
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="center_vertical" />
<LinearLayout
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">
android:layout_weight="1">
<RelativeLayout
<TextView
android:id="@+id/item_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="6dp">
<TextView
android:id="@+id/item_task_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
android:text="首次喝水打卡"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/item_task_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_toEndOf="@+id/item_task_title"
android:drawableStart="@mipmap/ic_gold"
android:drawablePadding="2dp"
android:gravity="center_vertical"
android:text="1000"
android:textColor="@color/main_mints"
android:textSize="12sp" />
</RelativeLayout>
android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
android:text="首次喝水打卡"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/item_task_info"
android:id="@+id/item_task_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="喝水还能赚金币,健康挣钱两不误"
android:textColor="@color/graya"
android:textSize="12sp" />
</LinearLayout>
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_toEndOf="@+id/item_task_title"
android:gravity="center_vertical"
android:text="1000"
android:textColor="@color/black"
android:textSize="16sp" />
</RelativeLayout>
<TextView
android:id="@+id/item_task_click"
android:layout_width="90dp"
android:layout_height="30dp"
android:layout_width="80dp"
android:layout_height="32dp"
android:layout_gravity="center_vertical"
android:background="@drawable/shape_main_water"
android:background="@drawable/shape_btn_orange"
android:gravity="center"
android:text="立即领取"
android:textColor="@color/white"
android:textSize="12sp" />
android:textColor="@color/my_color_orange"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
......@@ -46,18 +46,20 @@
android:id="@+id/item_title_invitecode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:layout_gravity="center_vertical"
android:textColor="@color/loan_tv_choose_paycash"
android:textSize="14sp" />
<TextView
android:id="@+id/item_title_invitecode_copy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:background="@drawable/shape_tv_gold_gury"
android:paddingLeft="12dp"
android:paddingLeft="10dp"
android:paddingTop="2dp"
android:paddingRight="12dp"
android:paddingRight="10dp"
android:paddingBottom="2dp"
android:text="复制"
android:textColor="@color/main_bg_text"
......@@ -70,7 +72,7 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:padding="10dp"
android:padding="12dp"
android:src="@mipmap/ic_arrow_more" />
</LinearLayout>
......@@ -85,12 +87,12 @@
android:elevation="2dip"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
android:paddingStart="15dp"
android:paddingEnd="15dp">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@mipmap/ic_gold" />
<TextView
......@@ -108,14 +110,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="5434344"
android:textColor="@color/my_color_orange"
android:textSize="26sp" />
android:textSize="30sp" />
<Button
android:id="@+id/btn_withdraw"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_height="32dp"
android:layout_marginStart="10dp"
android:background="@drawable/shape_btn_switch"
android:text="提现"
......
......@@ -2,24 +2,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingBottom="6dp"
android:orientation="vertical">
android:orientation="vertical"
android:paddingTop="10dp">
<ImageView
android:id="@+id/ic_my_icon"
android:layout_width="38dp"
android:scaleType="fitXY"
android:layout_height="38dp"
android:layout_gravity="center_horizontal"
android:scaleType="fitXY"
android:src="@mipmap/ic_my_gury" />
<TextView
android:id="@+id/tv_my_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_gravity="center_horizontal"
android:textColor="@color/product_net_text"
android:textSize="12sp" />
android:layout_marginTop="10dp"
android:textColor="@color/color_555"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:id="@+id/item_invite_iv_ranking"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginTop="3dp"
android:visibility="gone" />
<TextView
android:id="@+id/item_invited_tv_num"
......@@ -12,22 +20,34 @@
android:text="1" />
<ImageView
android:id="@+id/item_invited_iv"
android:layout_width="60dp"
android:layout_height="60dp" />
android:id="@+id/item_invited_iv_avatar"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="10dp" />
<TextView
android:layout_weight="1"
android:id="@+id/item_invited_tv_name"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="我的好友" />
android:layout_marginStart="10dp"
android:layout_weight="1"
android:text="我的好友"
android:textColor="@color/black_text"
android:textSize="16sp" />
<TextView
android:id="@+id/item_invited_tv_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="99999999金币" />
android:text="999999"
android:textColor="@color/my_color_orange"
android:textSize="20sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="金币"
android:textColor="@color/my_color_orange"
android:textSize="14sp" />
</LinearLayout>
\ No newline at end of file
......@@ -5,7 +5,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_height="1dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="14dp"
android:layout_marginTop="-7dp"
......@@ -21,14 +21,14 @@
android:id="@+id/ll_sign_firstday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_first"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -37,6 +37,7 @@
android:id="@+id/tv_sign_firstday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="1天"
android:textColor="@color/main_bg_text"
......@@ -47,14 +48,14 @@
android:id="@+id/ll_sign_twoday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_two"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -63,6 +64,7 @@
android:id="@+id/tv_sign_twoday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="2天"
android:textColor="@color/main_bg_text"
......@@ -73,14 +75,14 @@
android:id="@+id/ll_sign_threeday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_three"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -89,6 +91,7 @@
android:id="@+id/tv_sign_threeday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="3天"
android:textColor="@color/main_bg_text"
......@@ -99,14 +102,14 @@
android:id="@+id/ll_sign_fourday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_four"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -115,6 +118,7 @@
android:id="@+id/tv_sign_fourday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="4天"
android:textColor="@color/main_bg_text"
......@@ -125,14 +129,14 @@
android:id="@+id/ll_sign_fiveday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_five"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -141,6 +145,7 @@
android:id="@+id/tv_sign_fiveday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="5天"
android:textColor="@color/main_bg_text"
......@@ -151,14 +156,14 @@
android:id="@+id/ll_sign_sixday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_six"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="@dimen/font_size_14" />
......@@ -167,6 +172,7 @@
android:id="@+id/tv_sign_sixday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="6天"
android:textColor="@color/main_bg_text"
......@@ -177,14 +183,14 @@
android:id="@+id/ll_sign_sevenday"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_sign_seven"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_width="30dp"
android:layout_height="30dp"
android:gravity="center"
android:text="78"
android:textColor="@color/white"
......@@ -194,6 +200,7 @@
android:id="@+id/tv_sign_sevenday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:text="7天"
android:textColor="@color/main_bg_text"
......
......@@ -153,6 +153,7 @@
<color name="my_color_orange">#FB560C</color>
<color name="color_999">#999999</color>
<color name="color_555">#555555</color>
<color name="color_F5F">#F5F5F5</color>
<color name="color_F8F">#F8F8F8</color>
<color name="color_D81B60">#D81B60</color>
......
......@@ -118,4 +118,17 @@
<item name="android:textColor">#cb4a39</item>
<item name="android:fontFamily">sans-serif-condensed</item>
</style>
<!--默认Tablayout字体大小-->
<style name="TabLayoutTextSize">
<item name="android:textSize">@dimen/font_size_18</item>
</style>
<!--设置Tablayout字体加粗-->
<style name="TabLayoutTextStyle">
<item name="android:textStyle">bold</item>
</style>
<!--变大Tablayout字体-->
<style name="BigTabLayoutTextStyle">
<item name="android:textSize">@dimen/font_size_20</item>
</style>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment