Commit fb03f606 authored by jyx's avatar jyx

我的,邀请页面接口对接

parent 52a3949f
...@@ -15,10 +15,14 @@ ...@@ -15,10 +15,14 @@
<uses-permission android:name="android.permission.WRITE_SETTINGS" /> <uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> <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" /> tools:ignore="ProtectedPermissions" />
<permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE"
<permission
android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE"
android:protectionLevel="signature" /> android:protectionLevel="signature" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE" /> <uses-permission android:name="com.mints.goodmoney.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" /> <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
...@@ -108,12 +112,13 @@ ...@@ -108,12 +112,13 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.SettingsActivity" android:name=".ui.activitys.SettingsActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.GuideActivity"/> <activity android:name=".ui.activitys.GuideActivity" />
<activity android:name=".ui.activitys.LiebaoGameActivity"/> <activity android:name=".ui.activitys.LiebaoGameActivity" />
<activity android:name=".ui.activitys.DrawcashActivity"/> <activity android:name=".ui.activitys.DrawcashActivity" />
<activity android:name=".ui.activitys.WaterActivity"/> <activity android:name=".ui.activitys.WaterActivity" />
<activity android:name=".ui.activitys.WalkActivity"/> <activity android:name=".ui.activitys.WalkActivity" />
<activity android:name=".ui.activitys.AboutusActivity" />
<service <service
android:name=".service.UpdateService" android:name=".service.UpdateService"
......
...@@ -8,15 +8,11 @@ import android.text.TextUtils ...@@ -8,15 +8,11 @@ import android.text.TextUtils
import cn.jpush.android.api.BasicPushNotificationBuilder import cn.jpush.android.api.BasicPushNotificationBuilder
import cn.jpush.android.api.JPushInterface import cn.jpush.android.api.JPushInterface
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.LiebaoManager
import com.mints.goodmoney.manager.OaidManager import com.mints.goodmoney.manager.OaidManager
import com.mints.goodmoney.manager.ShumeiManager import com.mints.goodmoney.manager.ShumeiManager
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mob.MobSDK import com.mob.MobSDK
import com.orhanobut.logger.AndroidLogAdapter import com.orhanobut.logger.*
import com.orhanobut.logger.FormatStrategy
import com.orhanobut.logger.Logger
import com.orhanobut.logger.PrettyFormatStrategy
import com.tendcloud.tenddata.TCAgent import com.tendcloud.tenddata.TCAgent
import com.umeng.commonsdk.UMConfigure import com.umeng.commonsdk.UMConfigure
import com.yilan.sdk.ui.YLUIInit import com.yilan.sdk.ui.YLUIInit
......
...@@ -91,6 +91,7 @@ object Constant { ...@@ -91,6 +91,7 @@ object Constant {
const val CARRIER_DAILY_TURN = "DAILY_TURN" //每日大转盘 const val CARRIER_DAILY_TURN = "DAILY_TURN" //每日大转盘
const val CARRIER_CHALLENGE_TURN = "CHALLENGE_TURN" //挑战大转盘 const val CARRIER_CHALLENGE_TURN = "CHALLENGE_TURN" //挑战大转盘
const val CARRIER_SIGNIN_HOMEPAGE_CARD = "SIGNIN_HOMEPAGE_CARD" //签到翻倍 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_OFFLINE_DOUBLE = "OFFLINE_DOUBLE" //离线收益
const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //挑战刮刮乐 const val CARRIER_CHALLENGE_CARD = "CHALLENGE_CARD" //挑战刮刮乐
const val CARRIER_ONLINE_INCOME = "ONLINE_INCOME" //在线收益 const val CARRIER_ONLINE_INCOME = "ONLINE_INCOME" //在线收益
...@@ -125,9 +126,13 @@ object Constant { ...@@ -125,9 +126,13 @@ object Constant {
const val CARRIER_CHALLENGE_HEALTH_STAND = "CHALLENGE_HEALTH_STAND" //小健康-站一站 const val CARRIER_CHALLENGE_HEALTH_STAND = "CHALLENGE_HEALTH_STAND" //小健康-站一站
const val CARRIER_CHALLENGE_HEALTH_FRUIT = "CHALLENGE_HEALTH_FRUIT" //小健康-吃水果 const val CARRIER_CHALLENGE_HEALTH_FRUIT = "CHALLENGE_HEALTH_FRUIT" //小健康-吃水果
const val CARRIER_CHALLENGE_HEALTH_EYE = "CHALLENGE_HEALTH_EYE" //小健康-放松眼 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 CARRIER_NEW_USER = "CARRIER_NEW_USER" //新用户5000红包
// 邀请好友
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
const val AD_SOURCE_LY = "LIYAN" const val AD_SOURCE_LY = "LIYAN"
const val AD_SOURCE_CSJ = "CSJ" const val AD_SOURCE_CSJ = "CSJ"
...@@ -174,4 +179,9 @@ object Constant { ...@@ -174,4 +179,9 @@ object Constant {
const val EVENT_TYPE_TIME = "TIME" const val EVENT_TYPE_TIME = "TIME"
const val EVENT_TYPE_ADCLICK = "GAME_AD_CLICK" const val EVENT_TYPE_ADCLICK = "GAME_AD_CLICK"
const val EVENT_TYPE_GAMEINFO = "GAMEINFO" 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; ...@@ -3,14 +3,176 @@ package com.mints.goodmoney.mvp.model;
import java.io.Serializable; import java.io.Serializable;
public class MyInfo implements 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() { public static class TaskVeidoBean {
return idcode; /**
* 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 { ...@@ -4,59 +4,18 @@ public class TaskBean {
private int imageSrc; private int imageSrc;
private String title; private String title;
private String coin; private String progressStr;
private int coinSrc;
private String info;
private String btnStr; private String btnStr;
private Boolean isNeedTimer = false;
private int time;
private int type; 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.imageSrc = imageSrc;
this.title = title; this.title = title;
this.coin = coin; this.progressStr = progressStr;
this.coinSrc = coinSrc;
this.info = info;
this.btnStr = btnStr; this.btnStr = btnStr;
this.isNeedTimer = isNeedTimer;
this.time = time;
this.type = type; 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() { public int getImageSrc() {
return imageSrc; return imageSrc;
} }
...@@ -73,28 +32,12 @@ public class TaskBean { ...@@ -73,28 +32,12 @@ public class TaskBean {
this.title = title; this.title = title;
} }
public String getCoin() { public String getProgressStr() {
return coin; return progressStr;
}
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 void setInfo(String info) { public void setProgressStr(String progressStr) {
this.info = info; this.progressStr = progressStr;
} }
public String getBtnStr() { public String getBtnStr() {
...@@ -104,4 +47,12 @@ public class TaskBean { ...@@ -104,4 +47,12 @@ public class TaskBean {
public void setBtnStr(String btnStr) { public void setBtnStr(String btnStr) {
this.btnStr = 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 ...@@ -9,6 +9,7 @@ import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.* import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.views.MyView import com.mints.goodmoney.mvp.views.MyView
import com.mints.goodmoney.utils.DeviceUuidFactory 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.BaseSubscriber
import com.mints.library.net.neterror.Throwable import com.mints.library.net.neterror.Throwable
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
...@@ -20,10 +21,11 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -20,10 +21,11 @@ class MyPresenter : BasePresenter<MyView>() {
* 获取签到内容 * 获取签到内容
*/ */
open fun getSignInHomePageMsg() { open fun getSignInHomePageMsg() {
// view.showLoading("加载中..."); // view.showLoading("加载中...");
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePageMsg, .call(loanService.signInHomePageMsg,
object : BaseSubscriber<BaseResponse<SignCardBean?>?>() { object : BaseSubscriber<BaseResponse<SignCardBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -35,12 +37,13 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -35,12 +37,13 @@ class MyPresenter : BasePresenter<MyView>() {
view.showToast(e.message) view.showToast(e.message)
} }
fun onNext(baseResponse: BaseResponse<SignCardBean?>) { override fun onNext(baseResponse: BaseResponse<SignCardBean>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.status
val message = baseResponse.getMessage() val message = baseResponse.message
when (code) { when (code) {
200 -> view.getSignInHomePageMsgSuc(baseResponse.getData()) 200 -> view.getSignInHomePageMsgSuc(baseResponse.data)
401 -> { 401 -> {
} }
else -> view.showToast(message) else -> view.showToast(message)
...@@ -56,7 +59,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -56,7 +59,7 @@ class MyPresenter : BasePresenter<MyView>() {
view.showLoading("加载中...") view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePage(), .call(loanService.signInHomePage(),
object : BaseSubscriber<BaseResponse<Any?>?>() { object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -68,7 +71,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -68,7 +71,7 @@ class MyPresenter : BasePresenter<MyView>() {
view.showToast(e.message) view.showToast(e.message)
} }
fun onNext(baseResponse: BaseResponse<Any?>) { override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message val message = baseResponse.message
...@@ -79,13 +82,9 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -79,13 +82,9 @@ class MyPresenter : BasePresenter<MyView>() {
}) })
} }
/** fun getUserHallBaseMsg() {
* isCall -- true 连续调用
* 获取用户配置信息
*/
fun getUserTaskMsg(isCall: Boolean) {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.myInfoMsg, object : BaseSubscriber<BaseResponse<MyInfo>>() { .call(loanService.userHallBaseMsg, object : BaseSubscriber<BaseResponse<MyInfo>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) if (isLinkView)
...@@ -101,11 +100,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -101,11 +100,7 @@ class MyPresenter : BasePresenter<MyView>() {
val message: String = baseResponse.getMessage() val message: String = baseResponse.getMessage()
when (code) { when (code) {
200 -> { 200 -> {
if (isCall) { view.getUserTaskMsgSuc(baseResponse.getData())
view.getUserTaskMsgSuc(baseResponse.getData())
} else {
view.getUserTaskMsgSuc(baseResponse.getData())
}
myHotActivity() myHotActivity()
} }
401 -> view.getUserTaskMsgFail() 401 -> view.getUserTaskMsgFail()
...@@ -148,7 +143,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -148,7 +143,7 @@ class MyPresenter : BasePresenter<MyView>() {
override fun onNext(baseResponse: BaseResponse<BannerBean?>) { override fun onNext(baseResponse: BaseResponse<BannerBean?>) {
if (isLinkView) return if (isLinkView) return
val data: BannerBean? = baseResponse.getData() val data: BannerBean? = baseResponse.data
if (data != null) { if (data != null) {
view.getMyHotActivitySuc(data) view.getMyHotActivitySuc(data)
} }
...@@ -208,7 +203,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -208,7 +203,7 @@ class MyPresenter : BasePresenter<MyView>() {
} }
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
vo["oaid"] = ps.getString(Constant.OAID,"")!! vo["oaid"] = ps.getString(Constant.OAID, "")!!
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
...@@ -234,11 +229,38 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -234,11 +229,38 @@ class MyPresenter : BasePresenter<MyView>() {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
when (code) { 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 { ...@@ -27,4 +27,9 @@ interface MyView : BaseView {
* 签到成功 * 签到成功
*/ */
fun signInHomePageSuc() fun signInHomePageSuc()
/**
* 游客登录成功
*/
fun userLoginSuc()
} }
...@@ -7,6 +7,7 @@ import com.mints.goodmoney.BuildConfig; ...@@ -7,6 +7,7 @@ import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.mvp.model.BannerBean; import com.mints.goodmoney.mvp.model.BannerBean;
import com.mints.goodmoney.mvp.model.BaseResponse; import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.DrawcashBean; 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.MyInfo;
import com.mints.goodmoney.mvp.model.SignCardBean; import com.mints.goodmoney.mvp.model.SignCardBean;
import com.mints.goodmoney.mvp.model.UserBean; import com.mints.goodmoney.mvp.model.UserBean;
...@@ -72,15 +73,15 @@ public interface LoanService { ...@@ -72,15 +73,15 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/v125/myInfoMsg") @POST("api/getUserHallBaseMsg")
Observable<BaseResponse<MyInfo>> getMyInfoMsg(); Observable<BaseResponse<MyInfo>> getUserHallBaseMsg();
/** /**
* 热门活动接口 * 热门活动接口
* *
* @return * @return
*/ */
@POST("api/v125/myHotActivity") @POST("api/myHotActivity")
Observable<BaseResponse<BannerBean>> myHotActivity(@Body Map<String, Object> vo); Observable<BaseResponse<BannerBean>> myHotActivity(@Body Map<String, Object> vo);
/** /**
...@@ -99,6 +100,14 @@ public interface LoanService { ...@@ -99,6 +100,14 @@ public interface LoanService {
@POST("api/getSignInHomePageMsg") @POST("api/getSignInHomePageMsg")
Observable<BaseResponse<SignCardBean>> 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 { ...@@ -120,7 +129,7 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/v125/wechatlogin") @POST("api/wechatlogin")
Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo); Observable<BaseResponse<UserBean>> wechatlogin(@Body Map<String, Object> vo);
/** /**
...@@ -184,7 +193,7 @@ public interface LoanService { ...@@ -184,7 +193,7 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/v125/bindingWechat") @POST("api/bindingWechat")
Observable<BaseResponse<UserBean>> bindingWechat(@Body Map<String, Object> vo); Observable<BaseResponse<UserBean>> bindingWechat(@Body Map<String, Object> vo);
/** /**
...@@ -192,9 +201,25 @@ public interface LoanService { ...@@ -192,9 +201,25 @@ public interface LoanService {
* *
* @return * @return
*/ */
@POST("api/v115/addCashoutReq") @POST("api/addCashoutReq")
Observable<BaseResponse<Object>> addCashoutReq(@Body Map<String, Object> vo); 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工厂 * 默认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 { ...@@ -132,10 +132,10 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
readyGo(WebActivity::class.java, bundle) readyGo(WebActivity::class.java, bundle)
} }
R.id.item_aboutUs -> { R.id.item_aboutUs -> {
readyGo(AboutusActivity::class.java)
} }
R.id.btn_switch -> { R.id.btn_switch -> {
readyGo(LoginActivity::class.java)
} }
R.id.iv_left_icon -> { R.id.iv_left_icon -> {
onBackPressed() onBackPressed()
......
...@@ -2,13 +2,19 @@ package com.mints.goodmoney.ui.adapter ...@@ -2,13 +2,19 @@ package com.mints.goodmoney.ui.adapter
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import android.widget.Button
import android.widget.TextView
import com.mints.goodmoney.R 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 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 package com.mints.goodmoney.ui.adapter
import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.mints.goodmoney.R 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 private var mOnItemClickListener: OnItemClickListener? = null
...@@ -16,19 +28,59 @@ class InvitedAdapter(private val invitedData: List<Any>) : RecyclerView.Adapter< ...@@ -16,19 +28,59 @@ class InvitedAdapter(private val invitedData: List<Any>) : RecyclerView.Adapter<
return InvitedHolder(view) 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) { 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 { holder.itemView.setOnClickListener {
mOnItemClickListener?.onItemClick(holder.itemView, position) mOnItemClickListener?.onItemClick(holder.itemView, position)
} }
} }
inner class InvitedHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { inner class InvitedHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
private val tvNum = itemView.findViewById<TextView>(R.id.item_invited_tv_num) val tvNum: TextView = itemView.findViewById(R.id.item_invited_tv_num)
private val iv = itemView.findViewById<TextView>(R.id.item_invited_iv) val ivAvatar: ImageView = itemView.findViewById(R.id.item_invited_iv_avatar)
private val tvName = itemView.findViewById<TextView>(R.id.item_invited_tv_name) val ivRanking: ImageView = itemView.findViewById(R.id.item_invite_iv_ranking)
private val tvCoin = itemView.findViewById<TextView>(R.id.item_invited_tv_coin) val tvName: TextView = itemView.findViewById(R.id.item_invited_tv_name)
val tvCoin: TextView = itemView.findViewById(R.id.item_invited_tv_coin)
} }
//define interface //define interface
......
package com.mints.goodmoney.ui.adapter package com.mints.goodmoney.ui.adapter
import android.content.Context import android.content.Context
import android.graphics.Color
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -16,16 +17,13 @@ import com.mints.goodmoney.utils.TimeRender ...@@ -16,16 +17,13 @@ import com.mints.goodmoney.utils.TimeRender
class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> { class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
companion object { companion object {
const val HEALTH_TYPE_BREATH = 0x00000001 // 呼吸 const val TASK_TYPE_HOME = 0x00000001
const val HEALTH_TYPE_STAND = 0x00000002 // 站一站 const val TASK_TYPE_INVITE = 0x00000002
const val HEALTH_TYPE_FRUIT = 0x00000003 // 吃水果 const val TASK_TYPE_VIDEO = 0x00000003
const val HEALTH_TYPE_EYE = 0x00000004 // 放松眼睛 const val TASK_TYPE_GAME = 0x00000004
const val TASK_TYPE_VIDEO = 0x00000005 // 看视频 const val TASK_TYPE_FICTION = 0x00000005
const val TASK_TYPE_INVITE = 0x00000006 // 邀好友 const val TASK_TYPE_DEMO = 0x00000006
const val TASK_TYPE_GAME = 0x00000007 // 玩游戏
const val TASK_TYPE_FICTION = 0x00000007 // 看小说
const val COUNT_DOWN_INTERVAL = 1000L
} }
constructor(context: Context, taskData: MutableList<TaskBean>) { constructor(context: Context, taskData: MutableList<TaskBean>) {
...@@ -39,11 +37,6 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> { ...@@ -39,11 +37,6 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
private var mOnItemClickListener: OnItemClickListener? = null private var mOnItemClickListener: OnItemClickListener? = null
private var mOnItemChildClickListener: OnItemChildClickListener? = 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 { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val inflater: LayoutInflater = LayoutInflater.from(mContext) val inflater: LayoutInflater = LayoutInflater.from(mContext)
return TaskHolder(inflater.inflate(R.layout.item_fragment_main_my_task, parent, false)) return TaskHolder(inflater.inflate(R.layout.item_fragment_main_my_task, parent, false))
...@@ -68,85 +61,37 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> { ...@@ -68,85 +61,37 @@ class MainMyAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder> {
mOnItemChildClickListener?.onItemChildClick(it2, position) mOnItemChildClickListener?.onItemChildClick(it2, position)
} }
holder.itemTaskTitle.text = taskBean.title 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)) holder.itemTaskImg.setImageDrawable(mContext.resources.getDrawable(taskBean.imageSrc))
if (taskBean.btnStr.isNotEmpty() && !taskBean.needTimer) { if (taskBean.btnStr.isEmpty()) {
holder.itemTaskClick.text = taskBean.btnStr holder.itemTaskClick.visibility = View.GONE
} else { } else {
when (taskBean.type) { holder.itemTaskClick.visibility = View.VISIBLE
HEALTH_TYPE_BREATH -> { holder.itemTaskClick.text = taskBean.btnStr
mBreathTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL) if (taskBean.btnStr == "立即领取") {
startTime(mBreathTimer!!, HEALTH_TYPE_BREATH, holder.itemTaskClick, holder.itemTaskTitle) holder.itemTaskClick.setBackgroundResource(R.drawable.shape_btn_orange_complete)
} holder.itemTaskClick.setTextColor(Color.WHITE)
HEALTH_TYPE_EYE -> { } else {
mEyeTimer = CountDownTimerSupport(taskBean.time * COUNT_DOWN_INTERVAL, COUNT_DOWN_INTERVAL) holder.itemTaskClick.setBackgroundResource(R.drawable.shape_btn_orange)
startTime(mEyeTimer!!, HEALTH_TYPE_EYE, holder.itemTaskClick, holder.itemTaskTitle) holder.itemTaskClick.setTextColor(mContext.resources.getColor(R.color.my_color_orange))
}
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)
} }
} }
} if (taskBean.progressStr.isEmpty()) {
} holder.itemTaskProgress.visibility = View.GONE
}
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)
} else { } else {
val replaceStr = str.replace(maxCount.toString(), currentIndex.toString()) holder.itemTaskProgress.visibility = View.VISIBLE
tvTitle.text = replaceStr holder.itemTaskProgress.text = taskBean.progressStr
tvClick.text = "已完成"
tvClick.background = mContext.resources.getDrawable(R.drawable.shape_tv_gold_gury)
} }
}
override fun onTick(millisUntilFinished: Long) {
tvClick.text = TimeRender.ms2HMS(millisUntilFinished.toInt())
} }
}) }
timer.start()
} }
private inner class TaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { private inner class TaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val itemTaskImg: ImageView = itemView.findViewById(R.id.item_title_img) val itemTaskImg: ImageView = itemView.findViewById(R.id.item_title_img)
val itemTaskTitle: TextView = itemView.findViewById(R.id.item_task_title) val itemTaskTitle: TextView = itemView.findViewById(R.id.item_task_title)
val itemTaskMoney: TextView = itemView.findViewById(R.id.item_task_money) val itemTaskProgress: TextView = itemView.findViewById(R.id.item_task_progress)
val itemTaskInfo: TextView = itemView.findViewById(R.id.item_task_info)
val itemTaskClick: TextView = itemView.findViewById(R.id.item_task_click) val itemTaskClick: TextView = itemView.findViewById(R.id.item_task_click)
} }
......
package com.mints.goodmoney.ui.fragment package com.mints.goodmoney.ui.fragment
import android.text.TextUtils import android.graphics.Typeface
import android.view.View import android.view.View
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BannerBean import com.mints.goodmoney.mvp.model.FriendsTaskBean
import com.mints.goodmoney.ui.adapter.BannerAdapter 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.BannerBaseAdapter
import com.mints.goodmoney.ui.adapter.BannerTaskAdapter import com.mints.goodmoney.ui.adapter.BannerTaskAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter import com.mints.goodmoney.ui.adapter.InvitedAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.tablayout.TabLayout 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.*
import kotlinx.android.synthetic.main.fragment_main_friends.srl_my
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import com.mints.goodmoney.utils.LogUtil
/** /**
* 描述:邀请好友 * 描述:邀请好友
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/9/20 17:30 * 时间: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 val userManager by lazy { UserManager.getInstance() }
private var bvTaskData: List<Any> = arrayListOf() private var bvTaskData: MutableList<FriendsTaskBean.ChallengeBean.ListBean> = mutableListOf()
private var bvBannerData: List<BannerBean.ListBean> = arrayListOf() private var invitedData: MutableList<FriendsTaskBean.FriendsBean.ListBeanX> = mutableListOf()
private var invitedData: List<Any> = arrayListOf() private var bannerTaskAdapter: BannerTaskAdapter? = null
private var invitedAdapter: InvitedAdapter? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_friends override fun getContentViewLayoutID() = R.layout.fragment_main_friends
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
friendsPresenter.attachView(this)
srl_my.setOnRefreshListener(this)
initView() initView()
initRecy() initRecy()
...@@ -45,48 +53,52 @@ class FriendsFragment : BaseFragment() { ...@@ -45,48 +53,52 @@ class FriendsFragment : BaseFragment() {
private fun initView() { private fun initView() {
tv_title.text = "邀请好友" tv_title.text = "邀请好友"
view_title1.findViewById<TextView>(R.id.view_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("my_friends"))
tab_friends.addTab(tab_friends.newTab().setText("世界人民").setTag("world_person")) tab_friends.addTab(tab_friends.newTab().setText("世界人民").setTag("world_person"))
tab_friends.setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { tab_friends.setOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabReselected(tab: TabLayout.Tab?) { override fun onTabReselected(tab: TabLayout.Tab?) {}
}
override fun onTabUnselected(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?) { 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 { tab?.let {
if (it.tag == "我的好友") { if (it.tag == "my_friends") {
showToast("我的好友")
} else { } else {
showToast("世界人民") friendsPresenter.getLeaders()
} }
} }
} }
}) })
// tab_friends.setOnScrollChangeListener(object :.(){})
recy_friends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL)) recy_friends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
val invitedAdapter = InvitedAdapter(invitedData) invitedAdapter = InvitedAdapter(mContext, invitedData)
recy_friends.adapter = invitedAdapter recy_friends.adapter = invitedAdapter
invitedAdapter.setOnItemClickListener(object : InvitedAdapter.OnItemClickListener { invitedAdapter?.setOnItemClickListener(object : InvitedAdapter.OnItemClickListener {
override fun onItemClick(view: View?, position: Int) { override fun onItemClick(view: View?, position: Int) {
} }
...@@ -95,41 +107,24 @@ class FriendsFragment : BaseFragment() { ...@@ -95,41 +107,24 @@ class FriendsFragment : BaseFragment() {
} }
private fun initBanner() { private fun initBanner() {
val bannerTaskAdapter = BannerTaskAdapter(mContext) bannerTaskAdapter = BannerTaskAdapter(mContext)
bannerTaskAdapter.setData(bvTaskData) bannerTaskAdapter?.let {
bv_friends_task.setAdapter(bannerTaskAdapter) it.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<FriendsTaskBean.ChallengeBean.ListBean> {
bannerTaskAdapter.setOnPageTouchListener(object : BannerBaseAdapter.OnPageTouchListener<Any> { override fun onPageClick(position: Int, t: FriendsTaskBean.ChallengeBean.ListBean?) {
override fun onPageClick(position: Int, t: Any?) {
}
override fun onPageDown() {
bv_friends_task.stopAutoScroll()
}
override fun onPageUp() {
bv_friends_task.startAutoScroll()
}
})
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() { override fun onPageDown() {
bv_friends_task.stopAutoScroll() bv_friends_task.stopAutoScroll()
} }
override fun onPageUp() { override fun onPageUp() {
bv_friends_task.startAutoScroll() bv_friends_task.startAutoScroll()
} }
}) })
}
bv_friends_task.setAdapter(bannerTaskAdapter)
} }
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
...@@ -144,25 +139,41 @@ class FriendsFragment : BaseFragment() { ...@@ -144,25 +139,41 @@ class FriendsFragment : BaseFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FRIENDS) { 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.startAutoScroll()
bv_friends_task.stopAutoScroll()
} }
override fun onPause() { override fun onPause() {
super.onPause() super.onPause()
bv_friends_banner.startAutoScroll()
bv_friends_task.stopAutoScroll() bv_friends_task.stopAutoScroll()
} }
override fun onDestroy() { override fun onDestroy() {
super.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 package com.mints.goodmoney.ui.fragment
import android.Manifest import android.Manifest
import android.annotation.SuppressLint
import android.content.ClipData import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.AdapterView import android.widget.AdapterView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration 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.BuildConfig
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
...@@ -17,12 +24,14 @@ import com.mints.goodmoney.manager.UserManager ...@@ -17,12 +24,14 @@ import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.* import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView 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.LoginActivity
import com.mints.goodmoney.ui.activitys.MainActivity
import com.mints.goodmoney.ui.activitys.SettingsActivity import com.mints.goodmoney.ui.activitys.SettingsActivity
import com.mints.goodmoney.ui.adapter.GvMyAdapter import com.mints.goodmoney.ui.adapter.GvMyAdapter
import com.mints.goodmoney.ui.adapter.MainMyAdapter import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment 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.goodmoney.utils.SpanUtils
import com.mints.library.net.netstatus.NetUtils import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.ConstantUtil import com.mints.library.utils.ConstantUtil
...@@ -39,7 +48,6 @@ import kotlinx.android.synthetic.main.item_fragment_main_my_promotions.* ...@@ -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.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.* import kotlinx.android.synthetic.main.view_title.*
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
import java.math.BigDecimal
import java.util.* import java.util.*
/** /**
...@@ -47,14 +55,15 @@ import java.util.* ...@@ -47,14 +55,15 @@ import java.util.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/6/4 17:30 * 时间: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 ps by lazy { AppPreferences(context) }
private val myPresenter by lazy { MyPresenter() } private val myPresenter by lazy { MyPresenter() }
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
private var userConfig: MyInfo? = null private var userConfig: MyInfo? = null
private var hotList: List<BannerBean.ListBean>? = null private var hotList: List<BannerBean.ListBean>? = arrayListOf()
// 当天签到金币 // 当天签到金币
private var curSignCoin = 5 private var curSignCoin = 5
...@@ -76,75 +85,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -76,75 +85,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
initRecy() 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() { private fun initView() {
iv_right_icon.visibility = View.VISIBLE
iv_right_icon.setImageResource(R.mipmap.ic_my_account)
tv_title.text = "个人中心" tv_title.text = "个人中心"
view_title.text = "每日任务"
item_iv_settings.setOnClickListener(this) item_iv_settings.setOnClickListener(this)
item_title_id.setOnClickListener(this) item_title_id.setOnClickListener(this)
...@@ -154,8 +97,6 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -154,8 +97,6 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
item_title_invitecode_copy.setOnClickListener(this) item_title_invitecode_copy.setOnClickListener(this)
ll_my_login.setOnClickListener(this) ll_my_login.setOnClickListener(this)
view_title.text = "每日任务"
item_promotions_egv.onItemClickListener = this item_promotions_egv.onItemClickListener = this
item_bottom_version.text = "v" + ConstantUtil.getVersionName(mContext) item_bottom_version.text = "v" + ConstantUtil.getVersionName(mContext)
} }
...@@ -165,19 +106,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -165,19 +106,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
*/ */
private fun initRecy() { private fun initRecy() {
recy_my.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL)) recy_my.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recy_my.setItemViewCacheSize(20) recy_my.setItemViewCacheSize(10)
mainMyAdapter = MainMyAdapter(mContext, dataList) mainMyAdapter = MainMyAdapter(mContext, dataList)
recy_my.adapter = mainMyAdapter recy_my.adapter = mainMyAdapter
mainMyAdapter?.setOnItemChildClickListener(this) 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) { override fun onHiddenChanged(hidden: Boolean) {
...@@ -192,11 +124,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -192,11 +124,9 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MY) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MY) {
if (!TextUtils.isEmpty(userManager.userID)) { if (!TextUtils.isEmpty(userManager.userID)) {
myPresenter.getUserTaskMsg(false) myPresenter.getUserHallBaseMsg()
} else { } else {
// 游客登录 // 游客登录
myPresenter.userLogin(ps) myPresenter.userLogin(ps)
} }
...@@ -216,12 +146,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -216,12 +146,10 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
return return
} }
val code = data.idcode myPresenter.getSignInHomePageMsg()
if (!TextUtils.isEmpty(code)) {
item_title_invitecode.text = "ID:$code"
}
userConfig = data userConfig = data
handleRecyData()
setUserLoginStatus() setUserLoginStatus()
} }
...@@ -234,15 +162,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -234,15 +162,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
override fun getMyHotActivitySuc(data: BannerBean?) { override fun getMyHotActivitySuc(data: BannerBean?) {
if (UserManager.getInstance().adShowFlag) { // if (UserManager.getInstance().adShowFlag) {
data?.let { data?.let {
item_promotions_egv.visibility = View.VISIBLE item_promotions_egv.visibility = View.VISIBLE
hotList = it.list hotList = it.list
item_promotions_egv.adapter = GvMyAdapter(mContext, hotList) item_promotions_egv.adapter = GvMyAdapter(mContext, hotList)
} }
} else { // } else {
item_promotions_egv.visibility = View.GONE // item_promotions_egv.visibility = View.GONE
} // }
} }
override fun getSignInHomePageMsgSuc(signBean: SignCardBean?) { override fun getSignInHomePageMsgSuc(signBean: SignCardBean?) {
...@@ -263,17 +191,21 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -263,17 +191,21 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
return return
} }
// val bundle = Bundle() myPresenter.getSignInHomePageMsg()
// bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin)
//// bundle.putInt(Constant.MAIN_ALL_COIN, userConfig.getCoin()); val bundle = Bundle()
// // bundle.putInt(Constant.MAIN_ALL_COIN, userConfig.getCoin()); bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin)
// bundle.putString(Constant.MAIN_CARRIET_TURN, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD) bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD)
// readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
}
override fun userLoginSuc() {
myPresenter.getUserHallBaseMsg()
} }
override fun onRefresh(refreshLayout: RefreshLayout) { override fun onRefresh(refreshLayout: RefreshLayout) {
if (userManager.userID.isEmpty()) { if (userManager.userID.isNotEmpty()) {
myPresenter.getUserTaskMsg(false) myPresenter.getUserHallBaseMsg()
} else { } else {
myPresenter.userLogin(ps) myPresenter.userLogin(ps)
} }
...@@ -296,27 +228,35 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -296,27 +228,35 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
val signBean = signList[i] val signBean = signList[i]
val signDays = signBean.d val signDays = signBean.d
// 初始化每天的金币 // 初始化每天的金币
if (signDays == 1) { when (signDays) {
signGoldList.add(signBean.coin) 1 -> {
signViewBean.firstStatus = signBean.status signGoldList.add(signBean.coin)
} else if (signDays == 2) { signViewBean.firstStatus = signBean.status
signGoldList.add(signBean.coin) }
signViewBean.twoStatus = signBean.status 2 -> {
} else if (signDays == 3) { signGoldList.add(signBean.coin)
signGoldList.add(signBean.coin) signViewBean.twoStatus = signBean.status
signViewBean.threeStatus = signBean.status }
} else if (signDays == 4) { 3 -> {
signGoldList.add(signBean.coin) signGoldList.add(signBean.coin)
signViewBean.fourStatus = signBean.status signViewBean.threeStatus = signBean.status
} else if (signDays == 5) { }
signGoldList.add(signBean.coin) 4 -> {
signViewBean.fiveStatus = signBean.status signGoldList.add(signBean.coin)
} else if (signDays == 6) { signViewBean.fourStatus = signBean.status
signGoldList.add(signBean.coin) }
signViewBean.sixStatus = signBean.status 5 -> {
} else if (signDays == 7) { signGoldList.add(signBean.coin)
signGoldList.add(signBean.coin) signViewBean.fiveStatus = signBean.status
signViewBean.sevenStatus = 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 ...@@ -325,6 +265,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
curSignCoin = signBean.coin curSignCoin = signBean.coin
} }
} }
// 初始化金币数据 // 初始化金币数据
item_clock_signview.initSignViewGoldLayout(signGoldList) item_clock_signview.initSignViewGoldLayout(signGoldList)
// 设置签到样式 // 设置签到样式
...@@ -337,16 +278,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -337,16 +278,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
// 根据当天状态 计算连续签到天数 // 根据当天状态 计算连续签到天数
var alwaysSignDay = 0 val alwaysSignDay = if (signStatus == 0) {
alwaysSignDay = if (signStatus == 0) {
nowDate - 1 nowDate - 1
} else { } else {
nowDate nowDate
} }
item_clock_signday.text = SpanUtils() item_clock_signday.text = SpanUtils()
.append(" 已连续签到").setFontSize(36).setForegroundColor(context!!.resources.getColor(R.color.product_text)) .append(" 已连续签到").setForegroundColor(mContext.resources.getColor(R.color.product_text))
.append(" $alwaysSignDay ").setFontSize(36).setForegroundColor(context!!.resources.getColor(R.color.versus_sign_day)) .append(" $alwaysSignDay ").setForegroundColor(mContext.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))
.create() .create()
val finalSignStatus = signStatus val finalSignStatus = signStatus
item_clock_signview.setSignViewListener { day -> item_clock_signview.setSignViewListener { day ->
...@@ -355,13 +295,16 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -355,13 +295,16 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
.request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE) .request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe { granted: Boolean -> .subscribe { granted: Boolean ->
if (granted) { if (granted) {
if (userManager.adShowFlag) { // if (userManager.adShowFlag) {
if (finalSignStatus == 0) { if (finalSignStatus == 0) {
myPresenter.signInHomePage() myPresenter.signInHomePage()
} else if (finalSignStatus == 1) { } else if (finalSignStatus == 1) {
// loadAd(Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, TTAdManagerHolder.TT_AD_VEDIO_MOREDIALOG) 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 { } else {
showMissingPermissionDialog("设备、储存") showMissingPermissionDialog("设备、储存")
} }
...@@ -371,294 +314,81 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -371,294 +314,81 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
private fun setUserLoginStatus() { private fun setUserLoginStatus() {
val code = userConfig!!.userMsg.idcode
if (code.isNotEmpty()) {
item_title_invitecode.text = "邀请码:$code"
}
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
// 已登录 // 已登录
if (!TextUtils.isEmpty(userManager.getWxOpenid())) { if (userManager.wxOpenid.isNotEmpty()) {
GlideUtils.loadImageView(context, userManager.getWxHeader(), item_title_avatar) GlideUtils.loadImageView(context, userManager.wxHeader, item_title_avatar)
item_title_id.setText(userManager.getWxName()) item_title_id.text = userManager.wxName
} else { } else {
var mobile = userManager.mobile var mobile = userManager.mobile
if (!TextUtils.isEmpty(mobile)) { if (mobile.isNotEmpty()) {
mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length) mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
} }
item_title_id.text = "手机:$mobile" item_title_id.text = "手机:$mobile"
item_title_avatar.setImageResource(R.mipmap.ic_my) item_title_avatar.setImageResource(R.mipmap.ic_my)
} }
// item_title_login.setVisibility(View.GONE)
} else { } else {
// 未登录 // 未登录
var userId = userManager.userID var userId = userManager.userID
if (!TextUtils.isEmpty(userId) && userId.length > 11) { if (userId.isNotEmpty() && userId.length > 11) {
userId = userId.substring(userId.length - 10) userId = userId.substring(userId.length - 10)
item_title_id.text = "游客$userId 去登录" item_title_id.text = "游客$userId 去登录"
} else { } else {
item_title_id.text = "游客 去登录" item_title_id.text = "游客 去登录"
} }
// item_title_login.visibility = View.VISIBLE
item_title_avatar.setImageResource(R.mipmap.ic_my) item_title_avatar.setImageResource(R.mipmap.ic_my)
} }
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
item_title_id.text = "测试环境->" + item_title_id.text.toString() item_title_id.text = "测试环境->" + item_title_id.text.toString()
} }
val userGold: String
val usercash: String val userGold = if (userConfig == null) {
if (userConfig == null) { "0.00"
userGold = "0.00"
usercash = "0.00"
} else { } else {
userGold = java.lang.String.valueOf(userConfig!!.coin) "" + userConfig!!.userMsg.coin
val allcoinBig = BigDecimal(userGold)
val rateBig = BigDecimal("10000")
usercash = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
} }
// 零钱金币 // 金币
item_title_gold_count.text = userGold item_title_gold_count.text = userGold
// item_title_cash_count.text = usercash
} }
/** /**
* 处理列表数据 * 处理列表数据
*/ */
fun handleRecyData(data: UserVersusBean) { private fun handleRecyData() {
dataList.clear() dataList.clear()
// 看视频赚金币 // 跳转首页视频
// val maxcount = userConfig.challenge_vedio1_maxcount val task1 = TaskBean(R.mipmap.icon_my_coin, "分分钟赚金币,翻倍还能赚更多", "", "去赚钱", 1)
// val complatecount = userConfig.challenge_vedio1_complatecount // 邀好友赚金币
// val watchVideo = TaskBean(R.mipmap.ic_launcher, "看视频赚金币", ) var progressStrInvited = ""
if (userConfig != null) {
// 游戏 progressStrInvited = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
val gameTime = data.gameChallengePlaytimesLevelOneMinTimes }
val gameStr = when (data.gameChallengePlaytimesLevelOneStatus) { val task2 = TaskBean(R.mipmap.icon_my_invite, "邀好友,赚金币", progressStrInvited, "去邀请", 2)
1 -> "立即领取" // 看福利视频赚金币
2 -> "已领取" var progressStrVideo = ""
else -> "去完成" if (userConfig != null) {
} progressStrVideo = "(" + userConfig!!.taskVeido.complete + "/" + userConfig!!.taskVeido.max + ")"
val gameTask = TaskBean(R.mipmap.ic_launcher, "每日游戏奖励", "+" + data.gameChallengePlaytimesLevelOneCoin, }
R.mipmap.ic_launcher, "玩任意游戏达" + gameTime + "秒", gameStr) val task3 = TaskBean(R.mipmap.icon_my_video, "看福利视频赚金币", progressStrVideo, "赚金币", 3)
dataList.add(gameTask) // 玩游戏,赚金币
val task4 = TaskBean(R.mipmap.icon_my_game, "玩游戏,赚金币", "", "赚金币", 4)
// 鱼玩盒子 // 小说免费看,金币大家赚
if (userManager.adShowFlag) { val task5 = TaskBean(R.mipmap.icon_my_fiction, "小说免费看,金币大家赚", "", "去阅读", 5)
if (data.isYwhzShow) { // 试玩平台
val ywhzTask = TaskBean(R.mipmap.ic_launcher, "高额游戏任务", "+" + data.ywhzCoin, val task6 = TaskBean(R.mipmap.icon_my_demo, "试玩平台", "", "", 5)
R.mipmap.ic_launcher, "完成任务拿高额金币奖励,上不封顶", "去完成") dataList.add(task1)
dataList.add(ywhzTask) dataList.add(task2)
} dataList.add(task3)
} dataList.add(task4)
dataList.add(task5)
// ---------------------------- dataList.add(task6)
// 第一次喝水 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)
}
mainMyAdapter?.notifyDataSetChanged() mainMyAdapter?.notifyDataSetChanged()
} }
...@@ -673,49 +403,62 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -673,49 +403,62 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
when (view?.id) { when (view?.id) {
R.id.item_task_click -> { 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
}
} if (TextUtils.equals(taskBean.btnStr, "立即领取")) {
} if (userConfig!!.taskShareFriend!!.complete < userConfig!!.taskShareFriend!!.max) {
} val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, 50)
override fun onItemClick(view: View?, position: Int) { bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CHALLENGE_SHAREFRIEND)
if (AntiShake.check(view?.id)) return readyGo(AwardActivity::class.java, bundle)
}
if (!NetUtils.isNetworkConnected(context)) { } else {
showToast("网络异常,请检测网络") val wechatSp = ShareParams()
return 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.TASK_TYPE_GAME -> {
MainMyAdapter.HEALTH_TYPE_BREATH -> { }
} // 小说免费看,金币大家赚
// 放松眼睛 MainMyAdapter.TASK_TYPE_FICTION -> {
MainMyAdapter.HEALTH_TYPE_EYE -> { }
} // 试玩平台
// 吃水果 MainMyAdapter.TASK_TYPE_DEMO -> {
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 -> {
} }
} }
} }
override fun onClick(v: View?) { override fun onClick(v: View?) {
...@@ -743,7 +486,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -743,7 +486,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
R.id.btn_withdraw -> { R.id.btn_withdraw -> {
if (userConfig == null) { if (userConfig == null) {
showToast("网络异常,请检测网络!") showToast("网络异常,请检测网络!")
myPresenter.getUserTaskMsg(false) myPresenter.getUserHallBaseMsg()
return return
} }
...@@ -751,7 +494,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -751,7 +494,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
R.id.item_title_invitecode -> { R.id.item_title_invitecode -> {
if (userConfig != null) { if (userConfig != null) {
val invitedCode = userConfig!!.idcode val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) { if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功") showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
...@@ -761,7 +504,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -761,7 +504,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
R.id.item_title_invitecode_copy -> { R.id.item_title_invitecode_copy -> {
if (userConfig != null) { if (userConfig != null) {
val invitedCode = userConfig!!.idcode val invitedCode = userConfig!!.userMsg.idcode
if (!TextUtils.isEmpty(invitedCode)) { if (!TextUtils.isEmpty(invitedCode)) {
showToast("复制成功") showToast("复制成功")
val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipboardManager = mContext.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
...@@ -769,67 +512,42 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene ...@@ -769,67 +512,42 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
} }
} }
} }
else -> {
}
} }
} }
override fun onItemClick(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { override fun onItemClick(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
// if (hotList != null && hotList.size > 0) { if (hotList!!.isNotEmpty()) {
// val hotBean: ListBean = hotList.get(position) val hotBean: BannerBean.ListBean = hotList!![position]
// if (hotBean != null) { val hotUrl: String = hotBean.url
// val hotUrl: String = hotBean.getUrl() val hotTourl: String = hotBean.toUrl
// val hotTourl: String = hotBean.getToUrl() // myPresenter.addMyAdCount(Constant.CARRIER_HOTACTIVITY, hotBean.id)
// myPresenter.addMyAdCount(Constant.CARRIER_HOTACTIVITY, hotBean.getId())
// if (!TextUtils.isEmpty(hotUrl)) { // 自有界面
// val bundle = Bundle() when (hotTourl) {
// bundle.putString(Constant.DAICHAO_URL, hotUrl) Constant.HOT_ACTIVITY_WATER -> {
// bundle.putString(Constant.DAICHAO_TITLE, hotBean.getTitle()) // readyGo(RedboxActivity::class.java)
// val sid: String = hotBean.getId() }
// if (TextUtils.equals(sid, Constant.HOT_ACTIVITY_SID)) { Constant.HOT_ACTIVITY_WALK -> {
// // 新闻资讯 兼容h5 iframe
// readyGo(NewsWebviewActivity::class.java, bundle) }
// } else { Constant.HOT_ACTIVITY_CARD -> {
// readyGo(WebActivity::class.java, bundle) // readyGo(AdWebActivity::class.java)
// } }
// } else if (!TextUtils.isEmpty(hotTourl)) { else -> showToast("该热门活动暂未开放")
// // 自有界面 }
// when (hotTourl) { }
// Constant.HOT_ACTIVITY_YWHZ -> { }
// if (!userManager.userIsLogin()) {
// readyGo(WxLoginActivity::class.java) override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) {
// return userConfig?.taskShareFriend!!.complete += 1
// } dataList[1].progressStr = "(" + userConfig!!.taskShareFriend.complete + "/" + userConfig!!.taskShareFriend.max + ")"
// RxPermissions(activity!!) dataList[1].btnStr = "立即领取"
// .request(Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE) mainMyAdapter?.notifyItemChanged(1)
// .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("该热门活动暂未开放")
// }
// }
// }
} }
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 { ...@@ -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) { private void setContentLayoutAndBgColor(int days, int status, TextView tvContent, TextView tvDay, boolean isCurFlag) {
Resources resources = getResources(); Resources resources = getResources();
if (UserManager.getInstance().getAdShowFlag()) { // if (UserManager.getInstance().getAdShowFlag()) {
switch (status) { switch (status) {
case 0: case 0:
if (days == 7) { if (days == 7) {
tvContent.setText(""); tvContent.setText("");
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close));
} else { } else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
} }
tvDay.setTextColor(resources.getColor(R.color.black)); tvDay.setTextColor(resources.getColor(R.color.black));
break; break;
case 1: case 1:
if (isCurFlag) { 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));
}
tvContent.setText(""); tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya)); tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_vedio));
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)); tvDay.setTextColor(resources.getColor(R.color.black));
break; tvDay.setText("可翻倍");
} } else {
} 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) { if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else { } else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_none)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
} }
tvContent.setText(""); tvContent.setText("");
tvContent.setTextColor(resources.getColor(R.color.graya)); tvContent.setTextColor(resources.getColor(R.color.graya));
tvDay.setTextColor(resources.getColor(R.color.graya)); tvDay.setTextColor(resources.getColor(R.color.graya));
tvDay.setText("已领"); tvDay.setText("已领");
break; }
default: break;
if (days == 7) { case 2:
tvContent.setText(""); if (days == 7) {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_close)); tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_newgift_open));
} else {
tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish)); } else {
} tvContent.setBackground(resources.getDrawable(R.mipmap.ic_sign_finish));
tvDay.setTextColor(resources.getColor(R.color.black)); }
break;
} 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"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate <translate
android:duration="500" android:duration="300"
android:fromYDelta="100%p" android:fromYDelta="100%p"
android:toYDelta="0" /> android:toYDelta="0" />
<alpha <alpha
android:duration="750" android:duration="500"
android:fromAlpha="0.0" android:fromAlpha="0.0"
android:toAlpha="1.0" /> android:toAlpha="1.0" />
</set> </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 @@ ...@@ -25,14 +25,13 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white">
app:layout_behavior=".ui.widgets.FlingBehavior">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/collapsingToolbarLayout" android:id="@+id/collapsingToolbarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"> app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -46,32 +45,41 @@ ...@@ -46,32 +45,41 @@
<com.mints.goodmoney.ui.widgets.BannerView <com.mints.goodmoney.ui.widgets.BannerView
android:id="@+id/bv_friends_task" android:id="@+id/bv_friends_task"
android:layout_width="match_parent" 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:bannerAnimDuration="1500"
app:bannerAnimScroll="true" app:bannerAnimScroll="true"
app:bannerAutoScroll="true" app:bannerAutoScroll="false"
app:bannerPageAlpha="0" app:bannerPageAlpha="0"
app:bannerPageMargin="8dp" app:bannerPageMargin="8dp"
app:bannerPagePercent="0.9" app:bannerPagePercent="0.9"
app:bannerPageScale="0.8" app:bannerPageScale="0.8"
app:bannerScrollDuration="4000" /> app:bannerScrollDuration="4000" />
<com.mints.goodmoney.ui.widgets.BannerView <include layout="@layout/item_divider_gray" />
android:id="@+id/bv_friends_banner"
<!-- <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_width="match_parent"
android:layout_height="120dp" android:layout_height="wrap_content"
app:bannerAnimDuration="1500" android:padding="15dp"
app:bannerAnimScroll="true" android:scaleType="centerCrop"
app:bannerAutoScroll="true" android:src="@mipmap/bg_friends" />
app:bannerPageAlpha="0"
app:bannerPageMargin="8dp"
app:bannerPagePercent="0.9"
app:bannerPageScale="0.8"
app:bannerScrollDuration="4000" />
<include <include layout="@layout/item_divider_gray" />
android:id="@+id/view_title2"
layout="@layout/view_title" />
</LinearLayout> </LinearLayout>
...@@ -83,29 +91,25 @@ ...@@ -83,29 +91,25 @@
android:layout_height="56dp" android:layout_height="56dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:indicatorEndColor="#e73820" app:indicatorEndColor="#e73820"
app:indicatorMarginBottom="3dp" app:indicatorMarginEnd="20dp"
app:indicatorMarginEnd="22dp" app:indicatorMarginStart="20dp"
app:indicatorMarginStart="22dp"
app:indicatorStartColor="#d6694e" app:indicatorStartColor="#d6694e"
app:tabIndicatorHeight="4dp" 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> </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_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fillViewport="true" android:layout_marginStart="15dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> android:layout_marginEnd="15dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
<androidx.recyclerview.widget.RecyclerView app:layout_behavior="@string/appbar_scrolling_view_behavior" />
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>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:overScrollMode="never"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
......
...@@ -2,13 +2,16 @@ ...@@ -2,13 +2,16 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:padding="10dp">
<ImageView <ImageView
android:id="@+id/item_bv_friends_task_iv" android:id="@+id/item_bv_friends_task_iv"
android:layout_width="60dp" android:layout_width="50dp"
android:layout_height="60dp" 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_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -18,7 +21,11 @@ ...@@ -18,7 +21,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="任务1" 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_constraintStart_toEndOf="@id/item_bv_friends_task_iv"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -27,16 +34,20 @@ ...@@ -27,16 +34,20 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_marginBottom="10dp"
android:text="邀请1名好友" android:text="邀请1名好友"
android:textColor="@color/main_bg_text"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/item_bv_friends_task_iv" /> app:layout_constraintStart_toEndOf="@id/item_bv_friends_task_iv" />
<Button <Button
android:id="@+id/item_bv_friends_task_btn" android:id="@+id/item_bv_friends_task_btn"
android:layout_width="wrap_content" android:layout_width="70dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_marginEnd="20dp"
android:background="@drawable/shape_btn_orange"
android:text="去邀请" android:text="去邀请"
android:textColor="@color/my_color_orange"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
......
...@@ -6,28 +6,30 @@ ...@@ -6,28 +6,30 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
android:background="@mipmap/bg_sign" android:background="@mipmap/bg_sign"
android:gravity="center_vertical"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="16dp"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/item_clock_sign" android:id="@+id/item_clock_sign"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:src="@mipmap/ic_sign_icon" android:src="@mipmap/ic_sign_icon" />
android:visibility="visible" />
<TextView <TextView
android:id="@+id/item_clock_signday" android:id="@+id/item_clock_signday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:textColor="@color/black"
android:layout_marginStart="16pt" /> android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout> </LinearLayout>
...@@ -36,7 +38,6 @@ ...@@ -36,7 +38,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp" />
android:visibility="visible" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="60dp"
android:orientation="horizontal" android:orientation="horizontal">
android:paddingStart="10dp"
android:paddingEnd="10dp">
<ImageView <ImageView
android:id="@+id/item_title_img" android:id="@+id/item_title_img"
android:layout_width="60dp" android:layout_width="26dp"
android:layout_height="60dp" android:layout_height="26dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical" />
android:src="@mipmap/ic_versus_drinkone" />
<LinearLayout <RelativeLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_weight="1" android:layout_weight="1">
android:gravity="center_vertical"
android:orientation="vertical">
<RelativeLayout <TextView
android:id="@+id/item_task_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="6dp"> android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
<TextView android:text="首次喝水打卡"
android:id="@+id/item_task_title" android:textColor="@color/black"
android:layout_width="wrap_content" android:textSize="16sp" />
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>
<TextView <TextView
android:id="@+id/item_task_info" android:id="@+id/item_task_progress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="喝水还能赚金币,健康挣钱两不误" android:layout_centerVertical="true"
android:textColor="@color/graya" android:layout_marginStart="10dp"
android:textSize="12sp" /> android:layout_toEndOf="@+id/item_task_title"
</LinearLayout> android:gravity="center_vertical"
android:text="1000"
android:textColor="@color/black"
android:textSize="16sp" />
</RelativeLayout>
<TextView <TextView
android:id="@+id/item_task_click" android:id="@+id/item_task_click"
android:layout_width="90dp" android:layout_width="80dp"
android:layout_height="30dp" android:layout_height="32dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="@drawable/shape_main_water" android:background="@drawable/shape_btn_orange"
android:gravity="center" android:gravity="center"
android:text="立即领取" android:text="立即领取"
android:textColor="@color/white" android:textColor="@color/my_color_orange"
android:textSize="12sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -46,18 +46,20 @@ ...@@ -46,18 +46,20 @@
android:id="@+id/item_title_invitecode" android:id="@+id/item_title_invitecode"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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" /> android:textSize="14sp" />
<TextView <TextView
android:id="@+id/item_title_invitecode_copy" android:id="@+id/item_title_invitecode_copy"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:background="@drawable/shape_tv_gold_gury" android:background="@drawable/shape_tv_gold_gury"
android:paddingLeft="12dp" android:paddingLeft="10dp"
android:paddingTop="2dp" android:paddingTop="2dp"
android:paddingRight="12dp" android:paddingRight="10dp"
android:paddingBottom="2dp" android:paddingBottom="2dp"
android:text="复制" android:text="复制"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -70,7 +72,7 @@ ...@@ -70,7 +72,7 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:padding="10dp" android:padding="12dp"
android:src="@mipmap/ic_arrow_more" /> android:src="@mipmap/ic_arrow_more" />
</LinearLayout> </LinearLayout>
...@@ -85,12 +87,12 @@ ...@@ -85,12 +87,12 @@
android:elevation="2dip" android:elevation="2dip"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="10dp" android:paddingStart="15dp"
android:paddingEnd="10dp"> android:paddingEnd="15dp">
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="32dp"
android:layout_height="30dp" android:layout_height="32dp"
android:src="@mipmap/ic_gold" /> android:src="@mipmap/ic_gold" />
<TextView <TextView
...@@ -108,14 +110,13 @@ ...@@ -108,14 +110,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:text="5434344"
android:textColor="@color/my_color_orange" android:textColor="@color/my_color_orange"
android:textSize="26sp" /> android:textSize="30sp" />
<Button <Button
android:id="@+id/btn_withdraw" android:id="@+id/btn_withdraw"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="30dp" android:layout_height="32dp"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:background="@drawable/shape_btn_switch" android:background="@drawable/shape_btn_switch"
android:text="提现" android:text="提现"
......
...@@ -2,24 +2,23 @@ ...@@ -2,24 +2,23 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="4dp" android:orientation="vertical"
android:paddingBottom="6dp" android:paddingTop="10dp">
android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/ic_my_icon" android:id="@+id/ic_my_icon"
android:layout_width="38dp" android:layout_width="38dp"
android:scaleType="fitXY"
android:layout_height="38dp" android:layout_height="38dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:scaleType="fitXY"
android:src="@mipmap/ic_my_gury" /> android:src="@mipmap/ic_my_gury" />
<TextView <TextView
android:id="@+id/tv_my_title" android:id="@+id/tv_my_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:textColor="@color/product_net_text" android:layout_marginTop="10dp"
android:textSize="12sp" /> android:textColor="@color/color_555"
android:textSize="14sp" />
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="50dp"
android:gravity="center_vertical" 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 <TextView
android:id="@+id/item_invited_tv_num" android:id="@+id/item_invited_tv_num"
...@@ -12,22 +20,34 @@ ...@@ -12,22 +20,34 @@
android:text="1" /> android:text="1" />
<ImageView <ImageView
android:id="@+id/item_invited_iv" android:id="@+id/item_invited_iv_avatar"
android:layout_width="60dp" android:layout_width="30dp"
android:layout_height="60dp" /> android:layout_height="30dp"
android:layout_marginStart="10dp" />
<TextView <TextView
android:layout_weight="1"
android:id="@+id/item_invited_tv_name" android:id="@+id/item_invited_tv_name"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" 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 <TextView
android:id="@+id/item_invited_tv_coin" android:id="@+id/item_invited_tv_coin"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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> </LinearLayout>
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="2dp" android:layout_height="1dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="14dp" android:layout_marginStart="14dp"
android:layout_marginTop="-7dp" android:layout_marginTop="-7dp"
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
android:id="@+id/ll_sign_firstday" android:id="@+id/ll_sign_firstday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_first" android:id="@+id/tv_sign_first"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
android:id="@+id/tv_sign_firstday" android:id="@+id/tv_sign_firstday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="1天" android:text="1天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -47,14 +48,14 @@ ...@@ -47,14 +48,14 @@
android:id="@+id/ll_sign_twoday" android:id="@+id/ll_sign_twoday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_two" android:id="@+id/tv_sign_two"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -63,6 +64,7 @@ ...@@ -63,6 +64,7 @@
android:id="@+id/tv_sign_twoday" android:id="@+id/tv_sign_twoday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="2天" android:text="2天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -73,14 +75,14 @@ ...@@ -73,14 +75,14 @@
android:id="@+id/ll_sign_threeday" android:id="@+id/ll_sign_threeday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_three" android:id="@+id/tv_sign_three"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -89,6 +91,7 @@ ...@@ -89,6 +91,7 @@
android:id="@+id/tv_sign_threeday" android:id="@+id/tv_sign_threeday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="3天" android:text="3天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -99,14 +102,14 @@ ...@@ -99,14 +102,14 @@
android:id="@+id/ll_sign_fourday" android:id="@+id/ll_sign_fourday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_four" android:id="@+id/tv_sign_four"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -115,6 +118,7 @@ ...@@ -115,6 +118,7 @@
android:id="@+id/tv_sign_fourday" android:id="@+id/tv_sign_fourday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="4天" android:text="4天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -125,14 +129,14 @@ ...@@ -125,14 +129,14 @@
android:id="@+id/ll_sign_fiveday" android:id="@+id/ll_sign_fiveday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_five" android:id="@+id/tv_sign_five"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -141,6 +145,7 @@ ...@@ -141,6 +145,7 @@
android:id="@+id/tv_sign_fiveday" android:id="@+id/tv_sign_fiveday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="5天" android:text="5天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -151,14 +156,14 @@ ...@@ -151,14 +156,14 @@
android:id="@+id/ll_sign_sixday" android:id="@+id/ll_sign_sixday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_six" android:id="@+id/tv_sign_six"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
...@@ -167,6 +172,7 @@ ...@@ -167,6 +172,7 @@
android:id="@+id/tv_sign_sixday" android:id="@+id/tv_sign_sixday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="6天" android:text="6天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
...@@ -177,14 +183,14 @@ ...@@ -177,14 +183,14 @@
android:id="@+id/ll_sign_sevenday" android:id="@+id/ll_sign_sevenday"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1.0" android:layout_weight="1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_sign_seven" android:id="@+id/tv_sign_seven"
android:layout_width="25dp" android:layout_width="30dp"
android:layout_height="25dp" android:layout_height="30dp"
android:gravity="center" android:gravity="center"
android:text="78" android:text="78"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -194,6 +200,7 @@ ...@@ -194,6 +200,7 @@
android:id="@+id/tv_sign_sevenday" android:id="@+id/tv_sign_sevenday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="7天" android:text="7天"
android:textColor="@color/main_bg_text" android:textColor="@color/main_bg_text"
......
...@@ -153,6 +153,7 @@ ...@@ -153,6 +153,7 @@
<color name="my_color_orange">#FB560C</color> <color name="my_color_orange">#FB560C</color>
<color name="color_999">#999999</color> <color name="color_999">#999999</color>
<color name="color_555">#555555</color>
<color name="color_F5F">#F5F5F5</color> <color name="color_F5F">#F5F5F5</color>
<color name="color_F8F">#F8F8F8</color> <color name="color_F8F">#F8F8F8</color>
<color name="color_D81B60">#D81B60</color> <color name="color_D81B60">#D81B60</color>
......
...@@ -118,4 +118,17 @@ ...@@ -118,4 +118,17 @@
<item name="android:textColor">#cb4a39</item> <item name="android:textColor">#cb4a39</item>
<item name="android:fontFamily">sans-serif-condensed</item> <item name="android:fontFamily">sans-serif-condensed</item>
</style> </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> </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