Commit 8304195e authored by jyx's avatar jyx

新增饭补页面及分红页面

parent d4883bee
...@@ -163,6 +163,9 @@ ...@@ -163,6 +163,9 @@
<activity <activity
android:name=".ui.activitys.MorningClockActivity" android:name=".ui.activitys.MorningClockActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.FriendsActivity"
android:screenOrientation="portrait" />
<service <service
android:name=".service.UpdateService" android:name=".service.UpdateService"
......
...@@ -95,6 +95,9 @@ object Constant { ...@@ -95,6 +95,9 @@ object Constant {
const val CARRIER_GAME = "GAME" //游戏 const val CARRIER_GAME = "GAME" //游戏
const val CARRIER_HOMEWATER = "HOMEWATER" //喝水 const val CARRIER_HOMEWATER = "HOMEWATER" //喝水
const val CARRIER_WALK = "WALK" //走路 const val CARRIER_WALK = "WALK" //走路
const val CARRIER_EATMEAL = "EATMEAL" // 打卡
const val CARRIER_EATMEAL_SUBSIDY = "EATMEAL_SUBSIDY" //饭补
const val CARRIER_EATMEAL_SUBSIDY_NOT = "EATMEAL_SUBSIDY_NOT" //饭补
const val CARRIER_WALK_BUBBLE = "WALK_BUBBLE" //走路汽泡 const val CARRIER_WALK_BUBBLE = "WALK_BUBBLE" //走路汽泡
const val CARRIER_NEW_USER = "CARRIER_NEW_USER" //新用户红包 const val CARRIER_NEW_USER = "CARRIER_NEW_USER" //新用户红包
const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹 const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹
...@@ -146,6 +149,7 @@ object Constant { ...@@ -146,6 +149,7 @@ object Constant {
const val HOT_ACTIVITY_WALK = "walk" const val HOT_ACTIVITY_WALK = "walk"
const val HOT_ACTIVITY_CARD = "card" const val HOT_ACTIVITY_CARD = "card"
const val HOT_ACTIVITY_BXM = "bianxianmao" const val HOT_ACTIVITY_BXM = "bianxianmao"
const val HOT_ACTIVITY_EAT = "eat"
const val HOT_ACTIVITY_H5 = "h5" const val HOT_ACTIVITY_H5 = "h5"
// 打开激活 // 打开激活
......
...@@ -27,6 +27,52 @@ public class FriendHallMsgBean implements Serializable { ...@@ -27,6 +27,52 @@ public class FriendHallMsgBean implements Serializable {
private double contribution_today; private double contribution_today;
private String cash; private String cash;
private int status; private int status;
private int friendCount;
private int directFriendsCount;
private int indirectFriendsCount;
private String gameRule;
private String rankRule;
public String getGameRule() {
return gameRule;
}
public void setGameRule(String gameRule) {
this.gameRule = gameRule;
}
public String getRankRule() {
return rankRule;
}
public void setRankRule(String rankRule) {
this.rankRule = rankRule;
}
public int getDirectFriendsCount() {
return directFriendsCount;
}
public void setDirectFriendsCount(int directFriendsCount) {
this.directFriendsCount = directFriendsCount;
}
public int getIndirectFriendsCount() {
return indirectFriendsCount;
}
public void setIndirectFriendsCount(int indirectFriendsCount) {
this.indirectFriendsCount = indirectFriendsCount;
}
public int getFriendCount() {
return friendCount;
}
public void setFriendCount(int friendCount) {
this.friendCount = friendCount;
}
private List<ListBean> list; private List<ListBean> list;
public String getTitleMsg() { public String getTitleMsg() {
......
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.FriendHallMsgBean
import com.mints.goodmoney.mvp.views.FriendsActivityView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() {
/**
* 直接亲友
*/
fun getDirectFriends() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.directFriends(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.onDirectFriendsSuc(baseResponse.data)
}
else -> {
view.showToast("网络出小差儿了")
}
}
}
})
}
/**
* 间接亲友
*/
fun getIndirectFriends() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.indirectFriends(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.onIndirectFriendsSuc(baseResponse.data)
}
else -> {
view.showToast("网络出小差儿了")
}
}
}
})
}
}
\ No newline at end of file
...@@ -10,59 +10,10 @@ import com.mints.library.net.neterror.Throwable ...@@ -10,59 +10,10 @@ import com.mints.library.net.neterror.Throwable
class FriendsPresenter : BasePresenter<FriendsView>() { 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.getWorldRankSuc(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.getFriendsRankSuc(baseResponse.data)
// }
// }
// }
// })
// }
/** /**
* 分红奖励信息 * 分红奖励信息
*/ */
fun getFriendHallMsg() { fun getFriendHallMsg() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.friendHallMsg(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(loanService.friendHallMsg(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
...@@ -92,10 +43,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -92,10 +43,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
} }
/** /**
* 贡献榜单数据 * 今日收益榜
*/ */
fun getContributionLeaders() { fun getContributionLeaders() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(loanService.contributionLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
...@@ -124,11 +74,75 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -124,11 +74,75 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
}) })
} }
/**
* 总榜单
*/
fun getContributionBigLeaders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionBigLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.getContributionBigLeadersSuc(baseResponse.data)
}
else -> {
view.showToast(baseResponse.message)
}
}
}
})
}
/**
* 昨日贡献榜
*/
fun getFriendsGiveTodayList() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.friendsGiveTodayList, object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.getContributionLeadersSuc(baseResponse.data)
}
else -> {
view.showToast(baseResponse.message)
}
}
}
})
}
/** /**
* 贡献榜单数据 * 收益提现
*/ */
fun getContributionOutToCash() { fun getContributionOutToCash() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionOutToCash(), object : BaseSubscriber<BaseResponse<JsonObject>>() { .call(loanService.contributionOutToCash(), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() { override fun onCompleted() {
......
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
interface FriendsActivityView : BaseView {
fun onDirectFriendsSuc(data: FriendHallMsgBean)
fun onIndirectFriendsSuc(data: FriendHallMsgBean)
}
\ No newline at end of file
...@@ -8,16 +8,12 @@ interface FriendsView : BaseView { ...@@ -8,16 +8,12 @@ interface FriendsView : BaseView {
// //
// fun getFriendsRankSuc(data: FriendsTaskBean) // fun getFriendsRankSuc(data: FriendsTaskBean)
fun getFriendsHallMsgSuc(data: FriendHallMsgBean) fun getContributionBigLeadersSuc(data: FriendHallMsgBean)
// fun getFriendsHallMsgFail() fun getFriendsHallMsgSuc(data: FriendHallMsgBean)
fun getContributionLeadersSuc(data: FriendHallMsgBean) fun getContributionLeadersSuc(data: FriendHallMsgBean)
// fun getContributionLeadersFail()
fun getContributionOutToCashSuc() fun getContributionOutToCashSuc()
// fun getContributionOutToCash()
} }
...@@ -355,7 +355,39 @@ public interface LoanService { ...@@ -355,7 +355,39 @@ public interface LoanService {
Observable<BaseResponse<FriendHallMsgBean>> friendHallMsg(); Observable<BaseResponse<FriendHallMsgBean>> friendHallMsg();
/** /**
* 贡献榜单 * 直接亲友
*
* @return
*/
@POST("api/directFriends")
Observable<BaseResponse<FriendHallMsgBean>> directFriends();
/**
* 间接亲友
*
* @return
*/
@POST("api/indirectFriends")
Observable<BaseResponse<FriendHallMsgBean>> indirectFriends();
/**
* 总榜单
*
* @return
*/
@POST("api/contributionBigLeaders")
Observable<BaseResponse<FriendHallMsgBean>> contributionBigLeaders();
/**
* 昨日贡献榜
*
* @return
*/
@POST("api/getFriendsGiveTodayList")
Observable<BaseResponse<FriendHallMsgBean>> getFriendsGiveTodayList();
/**
* 今日收益榜
* *
* @return * @return
*/ */
......
...@@ -14,8 +14,7 @@ import kotlinx.android.synthetic.main.header_layout.* ...@@ -14,8 +14,7 @@ import kotlinx.android.synthetic.main.header_layout.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/9/23 18:39 * 时间:2020/9/23 18:39
*/ */
class AboutusActivity : BaseActivity() class AboutusActivity : BaseActivity(), View.OnClickListener {
, View.OnClickListener {
override fun getContentViewLayoutID() = R.layout.activity_aboutus override fun getContentViewLayoutID() = R.layout.activity_aboutus
......
...@@ -123,6 +123,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -123,6 +123,10 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> { Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> {
tvAwardContent.setText("签到奖励" + curCoin + "金币") tvAwardContent.setText("签到奖励" + curCoin + "金币")
} }
Constant.CARRIER_EATMEAL_SUBSIDY_NOT -> {
tvAwardContent.setText("还未到吃饭时间")
tvAwardNext.setText("我知道了")
}
Constant.CARRIER_GAME -> { Constant.CARRIER_GAME -> {
if (curCoin > 0) { if (curCoin > 0) {
tvAwardContent.setText("游戏奖励" + curCoin + "金币") tvAwardContent.setText("游戏奖励" + curCoin + "金币")
...@@ -133,7 +137,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -133,7 +137,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
} }
Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD, Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> { Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
tvAwardContent.setText("看视频领取" + curCoin + "金币") tvAwardContent.setText("看视频领取" + curCoin + "金币")
} }
...@@ -200,7 +204,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -200,7 +204,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD, Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE, Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE,
Constant.CARRIER_SMALLHOMEVEDIO_DOUBLE, Constant.CARRIER_SMALLHOMEVEDIO_DOUBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> { Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
awardVedio() awardVedio()
} }
......
...@@ -15,6 +15,12 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener ...@@ -15,6 +15,12 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.activity_drawcash_record.* import kotlinx.android.synthetic.main.activity_drawcash_record.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:金币记录
* 作者:孟崔广
* 时间:2020/10/15 15:48
* 邮箱:mengcga@163.com
*/
class CoinRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListener { class CoinRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListener {
private var coinRecordAdapter: CoinRecordAdapter? = null private var coinRecordAdapter: CoinRecordAdapter? = null
......
...@@ -15,6 +15,12 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener ...@@ -15,6 +15,12 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.activity_drawcash_record.* import kotlinx.android.synthetic.main.activity_drawcash_record.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:提现几率
* 作者:孟崔广
* 时间:2020/10/15 15:48
* 邮箱:mengcga@163.com
*/
class DrawcashRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListener { class DrawcashRecordActivity : BaseActivity(), View.OnClickListener, OnRefreshListener {
private var drawcashRecordAdapter: DrawcashRecordAdapter? = null private var drawcashRecordAdapter: DrawcashRecordAdapter? = null
......
...@@ -10,6 +10,7 @@ import com.mints.goodmoney.mvp.model.MealBean ...@@ -10,6 +10,7 @@ import com.mints.goodmoney.mvp.model.MealBean
import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter import com.mints.goodmoney.mvp.presenters.FoodSubsidyPresenter
import com.mints.goodmoney.mvp.views.FoodSubsidyView import com.mints.goodmoney.mvp.views.FoodSubsidyView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.widgets.MealView
import com.mints.goodmoney.ui.widgets.StepView import com.mints.goodmoney.ui.widgets.StepView
import kotlinx.android.synthetic.main.activity_food_subsidy.* import kotlinx.android.synthetic.main.activity_food_subsidy.*
...@@ -18,12 +19,15 @@ import kotlinx.android.synthetic.main.activity_food_subsidy.* ...@@ -18,12 +19,15 @@ import kotlinx.android.synthetic.main.activity_food_subsidy.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/10/13 11:55 * 时间:2020/10/13 11:55
*/ */
class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyView, StepView.StepViewListener { class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyView, StepView.StepViewListener, MealView.MealViewListener {
private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() } private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() } private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private var curCoin = 0//点击的汽泡金币 private var curCoin = 0//点击的汽泡金币
private var buttonCoin = 0//点击的汽泡金币
private var isCanClickVedio = false
override fun getContentViewLayoutID() = R.layout.activity_food_subsidy override fun getContentViewLayoutID() = R.layout.activity_food_subsidy
...@@ -52,7 +56,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -52,7 +56,7 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
private fun initListener() { private fun initListener() {
ivWalkBack.setOnClickListener(this) ivWalkBack.setOnClickListener(this)
svWalk.setStepViewListener(this) svWalk.setMealViewListener(this)
} }
override fun onClick(v: View) { override fun onClick(v: View) {
...@@ -65,13 +69,23 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -65,13 +69,23 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
override fun clickWater(water: Int, waterCoin: String) { override fun clickWater(water: Int, waterCoin: String) {
if (water == 0) { if (water == 0) {
// walkPresenter.clickForWalk() val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, buttonCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL)
readyGo(AwardActivity::class.java, bundle)
} else { } else {
if (isCanClickVedio) {
val bundle = Bundle() val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, curCoin) bundle.putInt(Constant.MAIN_CUR_COIN, curCoin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_WALK_BUBBLE) bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL_SUBSIDY)
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
svWalk.setCancelAnim(water)
} else {
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_EATMEAL_SUBSIDY_NOT)
readyGo(AwardActivity::class.java, bundle)
}
} }
} }
...@@ -89,20 +103,21 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -89,20 +103,21 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
override fun getFoodSubsidySuc(data: MealBean) { override fun getFoodSubsidySuc(data: MealBean) {
svWalk.setThreeBtnGone() svWalk.setThreeBtnGone()
// curCoin = data.bubbleCoin curCoin = data.vedioCoin
// for (i in 0 until data.bubbleCount) { buttonCoin = data.buttonCoin
// svWalk.setWaterTextviewLayout(i + 1, 0)
// } this.isCanClickVedio = data.isCanClickVedio
// svWalk.setWaterMaxProgress(data.maxWalk) for (i in 0 until data.vedioCoin) {
// svWalk.setWaterProgress(data.walk, data.maxWalk) svWalk.setWaterTextviewLayout(i + 1, 0)
// }
// // 是否可领取奖励
// if (data.isWalk) { // 是否可领取奖励
// svWalk.setTvDrinkBtnEnable() if (data.isCanClickButton) {
// } else { svWalk.setTvDrinkBtnEnable()
// svWalk.setTvDrinkBtnNone() } else {
// } svWalk.setTvDrinkBtnNone()
// svWalk.setTvDrinkBtnText(data.walkText) }
svWalk.setTvDrinkBtnText(data.buttonMsg)
} }
} }
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.view.View
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.ViewPager
import com.mints.goodmoney.R
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.FriendHallMsgBean
import com.mints.goodmoney.mvp.presenters.FriendsActivityPresenter
import com.mints.goodmoney.mvp.views.FriendsActivityView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter
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.header_layout.*
/**
* 描述:亲友团详情
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class FriendsActivity : BaseActivity(), View.OnClickListener, FriendsActivityView, OnRefreshListener {
private val friendsActivityPresenter by lazy { FriendsActivityPresenter() }
private var viewPagerAdapter: FriendsPagerAdapter? = null
private val recyList: MutableList<RecyclerView> = mutableListOf()
private var directData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var indirectData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var directAdapter: InvitedAdapter? = null
private var indirectAdapter: InvitedAdapter? = null
override fun getContentViewLayoutID() = R.layout.activity_friends
override fun initViewsAndEvents() {
tv_title.text = "亲友团详情"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
friendsActivityPresenter.attachView(this)
initListener()
initRecy()
}
private fun initRecy() {
val recyFriends = View.inflate(mContext, R.layout.item_friends_recy, null) as RecyclerView
val recyWorld = View.inflate(mContext, R.layout.item_friends_recy, null) as RecyclerView
recyFriends.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recyWorld.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
directAdapter = InvitedAdapter(mContext, directData)
indirectAdapter = InvitedAdapter(mContext, indirectData)
recyFriends.adapter = directAdapter
recyWorld.adapter = indirectAdapter
recyList.add(recyFriends)
recyList.add(recyWorld)
val titleList = arrayListOf("直接亲友", "间接亲友")
viewPagerAdapter = FriendsPagerAdapter(titleList, recyList)
view_pager_friends.adapter = viewPagerAdapter
view_pager_friends.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) {
if (position == 0) {
if (directData.size <= 0) {
friendsActivityPresenter.getDirectFriends()
}
} else {
if (indirectData.size <= 0) {
friendsActivityPresenter.getIndirectFriends()
}
}
}
override fun onPageScrollStateChanged(state: Int) {
}
})
tab_friends.setupWithViewPager(view_pager_friends)
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
override fun onDestroy() {
super.onDestroy()
friendsActivityPresenter.detachView()
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
srl_my.setOnRefreshListener(this)
}
override fun isApplyKitKatTranslucency() = false
override fun onDirectFriendsSuc(data: FriendHallMsgBean) {
srl_my.finishRefresh(true)
directData.clear()
directData.addAll(data.list)
directAdapter?.notifyDataSetChanged()
}
override fun onIndirectFriendsSuc(data: FriendHallMsgBean) {
srl_my.finishRefresh(true)
indirectData.clear()
indirectData.addAll(data.list)
indirectAdapter?.notifyDataSetChanged()
}
override fun onRefresh(refreshLayout: RefreshLayout) {
if (UserManager.getInstance().userID.isNotEmpty()) {
if (view_pager_friends.currentItem == 0) {
friendsActivityPresenter.getDirectFriends()
} else {
friendsActivityPresenter.getIndirectFriends()
}
}
}
}
\ No newline at end of file
...@@ -104,8 +104,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -104,8 +104,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
when (view.id) { when (view.id) {
R.id.tab_rl_main -> clickTab1Layout() R.id.tab_rl_main -> clickTab1Layout()
R.id.tab_rl_channel -> clickTab2Layout() R.id.tab_rl_channel -> clickTab2Layout()
R.id.tab_rl_pan -> clickTab3Layout() R.id.tab_rl_friends -> clickTab3Layout()
R.id.tab_rl_friends -> clickTab4Layout() R.id.tab_rl_pan -> clickTab4Layout()
R.id.tab_rl_my -> clickTab5Layout() R.id.tab_rl_my -> clickTab5Layout()
} }
} }
...@@ -163,19 +163,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -163,19 +163,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
* 点击第三个tab * 点击第三个tab
*/ */
fun clickTab3Layout() { fun clickTab3Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_PAN AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FRIENDS
if (panFragment == null) { if (friendsFragment == null) {
panFragment = PanFragment() friendsFragment = FriendsFragment()
} }
addOrShowFragment(supportFragmentManager.beginTransaction(), panFragment!!) addOrShowFragment(supportFragmentManager.beginTransaction(), friendsFragment!!)
tab_iv_main.isSelected = false tab_iv_main.isSelected = false
tab_tv_main.isSelected = false tab_tv_main.isSelected = false
tab_iv_channel.isSelected = false tab_iv_channel.isSelected = false
tab_iv_channel.isSelected = false tab_iv_channel.isSelected = false
tab_iv_pan.isSelected = true tab_iv_pan.isSelected = false
tab_tv_pan.isSelected = true tab_tv_pan.isSelected = false
tab_iv_friends.isSelected = false tab_iv_friends.isSelected = true
tab_tv_friends.isSelected = false tab_tv_friends.isSelected = true
tab_iv_my.isSelected = false tab_iv_my.isSelected = false
tab_tv_my.isSelected = false tab_tv_my.isSelected = false
} }
...@@ -184,19 +184,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -184,19 +184,19 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
* 点击第四个tab * 点击第四个tab
*/ */
private fun clickTab4Layout() { private fun clickTab4Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_FRIENDS AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_PAN
if (friendsFragment == null) { if (panFragment == null) {
friendsFragment = FriendsFragment() panFragment = PanFragment()
} }
addOrShowFragment(supportFragmentManager.beginTransaction(), friendsFragment!!) addOrShowFragment(supportFragmentManager.beginTransaction(), panFragment!!)
tab_iv_main.isSelected = false tab_iv_main.isSelected = false
tab_tv_main.isSelected = false tab_tv_main.isSelected = false
tab_iv_channel.isSelected = false tab_iv_channel.isSelected = false
tab_iv_channel.isSelected = false tab_iv_channel.isSelected = false
tab_iv_pan.isSelected = false tab_iv_pan.isSelected = true
tab_tv_pan.isSelected = false tab_tv_pan.isSelected = true
tab_iv_friends.isSelected = true tab_iv_friends.isSelected = false
tab_tv_friends.isSelected = true tab_tv_friends.isSelected = false
tab_iv_my.isSelected = false tab_iv_my.isSelected = false
tab_tv_my.isSelected = false tab_tv_my.isSelected = false
} }
......
...@@ -201,7 +201,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -201,7 +201,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
private fun backDialog() { private fun backDialog() {
cdaa = CustomDialogAsApple(context, object : DialogListener() { cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) { override fun onClick(v: View) {
if (cdaa != null && cdaa.isShowing()) { if (cdaa.isShowing) {
cdaa.dismiss() cdaa.dismiss()
} }
when (v.id) { when (v.id) {
...@@ -242,10 +242,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -242,10 +242,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
} }
dialog.setView(view) dialog.setView(view)
// val window = dialog.window
// window?.setGravity(Gravity.CENTER)
// window?.setWindowAnimations(R.style.DialogAnimBottom)
dialog.show() dialog.show()
} }
......
...@@ -5,17 +5,18 @@ import android.view.ViewGroup ...@@ -5,17 +5,18 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager.widget.PagerAdapter import androidx.viewpager.widget.PagerAdapter
class FriendsPagerAdapter(recyList: MutableList<RecyclerView>) class FriendsPagerAdapter(titltStr: List<String>, recyList: MutableList<RecyclerView>)
: PagerAdapter() { : PagerAdapter() {
private val mRecyList: MutableList<RecyclerView> = recyList private val mRecyList: MutableList<RecyclerView> = recyList
private val mTitleList: List<String> = titltStr
override fun getItemPosition(`object`: Any): Int { override fun getItemPosition(`object`: Any): Int {
// 处理notify方法失效 // 处理notify方法失效
return POSITION_NONE return POSITION_NONE
} }
override fun getCount() = 2 override fun getCount() = mTitleList.size
override fun isViewFromObject(view: View, `object`: Any): Boolean { override fun isViewFromObject(view: View, `object`: Any): Boolean {
return view === `object` return view === `object`
...@@ -32,10 +33,6 @@ class FriendsPagerAdapter(recyList: MutableList<RecyclerView>) ...@@ -32,10 +33,6 @@ class FriendsPagerAdapter(recyList: MutableList<RecyclerView>)
} }
override fun getPageTitle(position: Int): CharSequence? { override fun getPageTitle(position: Int): CharSequence? {
return if (position == 0) { return mTitleList[position]
"昨日贡献榜"
} else {
"今日收益榜"
}
} }
} }
\ No newline at end of file
...@@ -612,6 +612,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -612,6 +612,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
Constant.HOT_ACTIVITY_BXM -> { Constant.HOT_ACTIVITY_BXM -> {
// 消费变现猫事件 // 消费变现猫事件
} }
Constant.HOT_ACTIVITY_EAT -> {
readyGo(FoodSubsidyActivity::class.java)
}
else -> { else -> {
val bundle = Bundle() val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, hotBean.title) bundle.putString(WebActivity.WEB_TITLE, hotBean.title)
......
package com.mints.goodmoney.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.KeyEvent
import android.view.View
import android.view.WindowManager
import android.widget.Button
import android.widget.TextView
import com.mints.goodmoney.R
/**
* 提示弹框
*/
class BonusDialog(context: Context, private val listener: DialogListener) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val tv_dialogper_title: TextView
private val tv_dialogper_content: TextView
private val btn_dialogper_submit: Button
fun setTitle(title: String) {
tv_dialogper_title.visibility = View.VISIBLE
tv_dialogper_title.text = title
}
fun setContent(content: String) {
tv_dialogper_content.text = content
}
fun setBtnStr(btnStr: String) {
btn_dialogper_submit.text = btnStr
}
init {
setContentView(R.layout.dialog_friends)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimBottom
// lp.dimAmount = 0; // 去背景遮盖
// lp.alpha = 1.0f;//透明效果
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(true)
setCanceledOnTouchOutside(true)
// 查找View
tv_dialogper_title =
findViewById<View>(R.id.tv_title) as TextView
tv_dialogper_content =
findViewById<View>(R.id.tv_content) as TextView
btn_dialogper_submit =
findViewById<View>(R.id.btn_submit) as Button
tv_dialogper_content.setOnClickListener(listener)
tv_dialogper_title.setOnClickListener(listener)
btn_dialogper_submit.setOnClickListener(listener)
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.widgets;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.TranslateAnimation;
import androidx.core.widget.NestedScrollView;
/**
* 有弹性的ScrollView
* 实现下拉弹回和上拉弹回
*
* @author zhangjg
* @date Feb 13, 2014 6:11:33 PM
*/
public class ElasticScrollView extends NestedScrollView {
private static final String TAG = "ElasticScrollView";
//移动因子, 是一个百分比, 比如手指移动了100px, 那么View就只移动50px
//目的是达到一个延迟的效果
private static final float MOVE_FACTOR = 0.5f;
//松开手指后, 界面回到正常位置需要的动画时间
private static final int ANIM_TIME = 300;
//ScrollView的子View, 也是ScrollView的唯一一个子View
private View contentView;
//手指按下时的Y值, 用于在移动时计算移动距离
//如果按下时不能上拉和下拉, 会在手指移动时更新为当前手指的Y值
private float startY;
//用于记录正常的布局位置
private Rect originalRect = new Rect();
//手指按下时记录是否可以继续下拉
private boolean canPullDown = false;
//手指按下时记录是否可以继续上拉
private boolean canPullUp = false;
//在手指滑动的过程中记录是否移动了布局
private boolean isMoved = false;
public ElasticScrollView(Context context) {
super(context);
}
public ElasticScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
if (getChildCount() > 0) {
contentView = getChildAt(0);
}
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
if (contentView == null) return;
//ScrollView中的唯一子控件的位置信息, 这个位置信息在整个控件的生命周期中保持不变
originalRect.set(contentView.getLeft(), contentView.getTop(), contentView
.getRight(), contentView.getBottom());
}
/**
* 在触摸事件中, 处理上拉和下拉的逻辑
*/
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (contentView == null) {
return super.dispatchTouchEvent(ev);
}
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
//判断是否可以上拉和下拉
canPullDown = isCanPullDown();
canPullUp = isCanPullUp();
//记录按下时的Y值
startY = ev.getY();
break;
case MotionEvent.ACTION_UP:
if (!isMoved) break; //如果没有移动布局, 则跳过执行
// 开启动画
TranslateAnimation anim = new TranslateAnimation(0, 0, contentView.getTop(),
originalRect.top);
anim.setDuration(ANIM_TIME);
anim.setInterpolator(new AccelerateInterpolator());
contentView.startAnimation(anim);
// 设置回到正常的布局位置
contentView.layout(originalRect.left, originalRect.top,
originalRect.right, originalRect.bottom);
//将标志位设回false
canPullDown = false;
canPullUp = false;
isMoved = false;
break;
case MotionEvent.ACTION_MOVE:
//在移动的过程中, 既没有滚动到可以上拉的程度, 也没有滚动到可以下拉的程度
if (!canPullDown && !canPullUp) {
startY = ev.getY();
canPullDown = isCanPullDown();
canPullUp = isCanPullUp();
break;
}
//计算手指移动的距离
float nowY = ev.getY();
int deltaY = (int) (nowY - startY);
//是否应该移动布局
boolean shouldMove =
(canPullDown && deltaY > 0) //可以下拉, 并且手指向下移动
|| (canPullUp && deltaY < 0) //可以上拉, 并且手指向上移动
|| (canPullUp && canPullDown); //既可以上拉也可以下拉(这种情况出现在ScrollView包裹的控件比ScrollView还小)
if (shouldMove) {
//计算偏移量
int offset = (int) (deltaY * MOVE_FACTOR);
//随着手指的移动而移动布局
contentView.layout(originalRect.left, originalRect.top + offset,
originalRect.right, originalRect.bottom + offset);
isMoved = true; //记录移动了布局
}
break;
default:
break;
}
return super.dispatchTouchEvent(ev);
}
/**
* 判断是否滚动到顶部
*/
private boolean isCanPullDown() {
return getScrollY() == 0 ||
contentView.getHeight() < getHeight() + getScrollY();
}
/**
* 判断是否滚动到底部
*/
private boolean isCanPullUp() {
return contentView.getHeight() <= getHeight() + getScrollY();
}
}
\ No newline at end of file
...@@ -2,41 +2,155 @@ package com.mints.goodmoney.ui.widgets; ...@@ -2,41 +2,155 @@ package com.mints.goodmoney.ui.widgets;
import android.content.Context; import android.content.Context;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.widget.OverScroller;
import androidx.coordinatorlayout.widget.CoordinatorLayout; import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.AppBarLayout;
import com.mints.goodmoney.utils.LogUtil;
public final class FlingBehavior extends AppBarLayout.Behavior { import java.lang.reflect.Field;
private static final int TOP_CHILD_FLING_THRESHOLD = 3;
private boolean isPositive;
public FlingBehavior() { /**
} * 解决appbarLayout若干问题:
* (1)快速滑动appbarLayout会出现回弹
* (2)快速滑动appbarLayout到折叠状态下,立马下滑,会出现抖动的问题
* (3)滑动appbarLayout,无法通过手指按下让其停止滑动
*
* @author yuruiyin
* @version 2018/1/3
*/
public class FlingBehavior extends AppBarLayout.Behavior {
private static final String TAG = "CustomAppbarLayoutBehavior";
private static final int TYPE_FLING = 1;
private boolean isFlinging;
private boolean shouldBlockNestedScroll;
public FlingBehavior(Context context, AttributeSet attrs) { public FlingBehavior(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
} }
@Override @Override
public boolean onNestedFling(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, float velocityX, float velocityY, boolean consumed) { public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) {
if (velocityY > 0 && !isPositive || velocityY < 0 && isPositive) { LogUtil.d(TAG, "onInterceptTouchEvent:" + child.getTotalScrollRange());
velocityY = velocityY * -1; shouldBlockNestedScroll = false;
if (isFlinging) {
shouldBlockNestedScroll = true;
}
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
stopAppbarLayoutFling(child); //手指触摸屏幕的时候停止fling事件
break;
}
return super.onInterceptTouchEvent(parent, child, ev);
}
/**
* 反射获取私有的flingRunnable 属性,考虑support 28以后变量名修改的问题
* @return Field
*/
private Field getFlingRunnableField() throws NoSuchFieldException {
try {
// support design 27及以下版本
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass();
return headerBehaviorType.getDeclaredField("mFlingRunnable");
} catch (NoSuchFieldException e) {
// 可能是28及以上版本
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass().getSuperclass();
return headerBehaviorType.getDeclaredField("flingRunnable");
}
}
/**
* 反射获取私有的scroller 属性,考虑support 28以后变量名修改的问题
* @return Field
*/
private Field getScrollerField() throws NoSuchFieldException {
try {
// support design 27及以下版本
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass();
return headerBehaviorType.getDeclaredField("mScroller");
} catch (NoSuchFieldException e) {
// 可能是28及以上版本
Class<?> headerBehaviorType = this.getClass().getSuperclass().getSuperclass().getSuperclass();
return headerBehaviorType.getDeclaredField("scroller");
}
}
/**
* 停止appbarLayout的fling事件
* @param appBarLayout
*/
private void stopAppbarLayoutFling(AppBarLayout appBarLayout) {
//通过反射拿到HeaderBehavior中的flingRunnable变量
try {
Field flingRunnableField = getFlingRunnableField();
Field scrollerField = getScrollerField();
flingRunnableField.setAccessible(true);
scrollerField.setAccessible(true);
Runnable flingRunnable = (Runnable) flingRunnableField.get(this);
OverScroller overScroller = (OverScroller) scrollerField.get(this);
if (flingRunnable != null) {
LogUtil.d(TAG, "存在flingRunnable");
appBarLayout.removeCallbacks(flingRunnable);
flingRunnableField.set(this, null);
}
if (overScroller != null && !overScroller.isFinished()) {
overScroller.abortAnimation();
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
@Override
public boolean onStartNestedScroll(CoordinatorLayout parent, AppBarLayout child, View directTargetChild, View target, int nestedScrollAxes, int type) {
LogUtil.d(TAG, "onStartNestedScroll");
stopAppbarLayoutFling(child);
return super.onStartNestedScroll(parent, child, directTargetChild, target, nestedScrollAxes, type);
}
@Override
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed, int type) {
LogUtil.d(TAG, "onNestedPreScroll:" + child.getTotalScrollRange() + " ,dx:" + dx + " ,dy:" + dy + " ,type:" + type);
//type返回1时,表示当前target处于非touch的滑动,
//该bug的引起是因为appbar在滑动时,CoordinatorLayout内的实现NestedScrollingChild2接口的滑动子类还未结束其自身的fling
//所以这里监听子类的非touch时的滑动,然后block掉滑动事件传递给AppBarLayout
if (type == TYPE_FLING) {
isFlinging = true;
}
if (!shouldBlockNestedScroll) {
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed, type);
} }
if (target instanceof RecyclerView && velocityY < 0) {
final RecyclerView recyclerView = (RecyclerView) target;
final View firstChild = recyclerView.getChildAt(0);
final int childAdapterPosition = recyclerView.getChildAdapterPosition(firstChild);
consumed = childAdapterPosition > TOP_CHILD_FLING_THRESHOLD;
} }
return super.onNestedFling(coordinatorLayout, child, target, velocityX, velocityY, consumed);
@Override
public void onNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dxConsumed, int dyConsumed, int
dxUnconsumed, int dyUnconsumed, int type) {
LogUtil.d(TAG, "onNestedScroll: target:" + target.getClass() + " ," + child.getTotalScrollRange() + " ,dxConsumed:"
+ dxConsumed + " ,dyConsumed:" + dyConsumed + " " + ",type:" + type);
if (!shouldBlockNestedScroll) {
super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, type);
}
} }
@Override @Override
public void onNestedPreScroll(CoordinatorLayout coordinatorLayout, AppBarLayout child, View target, int dx, int dy, int[] consumed) { public void onStopNestedScroll(CoordinatorLayout coordinatorLayout, AppBarLayout abl, View target, int type) {
super.onNestedPreScroll(coordinatorLayout, child, target, dx, dy, consumed); LogUtil.d(TAG, "onStopNestedScroll");
isPositive = dy > 0; super.onStopNestedScroll(coordinatorLayout, abl, target, type);
isFlinging = false;
shouldBlockNestedScroll = false;
} }
} }
...@@ -17,7 +17,6 @@ import androidx.annotation.Nullable; ...@@ -17,7 +17,6 @@ import androidx.annotation.Nullable;
import com.daimajia.androidanimations.library.Techniques; import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo; import com.daimajia.androidanimations.library.YoYo;
import com.mints.goodmoney.R; import com.mints.goodmoney.R;
import com.mints.goodmoney.ui.widgets.seekbar.BubbleSeekBar;
import com.mints.goodmoney.utils.rxutil.CommonRxTask; import com.mints.goodmoney.utils.rxutil.CommonRxTask;
import com.mints.goodmoney.utils.rxutil.RxjavaUtil; import com.mints.goodmoney.utils.rxutil.RxjavaUtil;
import com.mints.library.utils.nodoubleclick.AntiShake; import com.mints.library.utils.nodoubleclick.AntiShake;
...@@ -25,31 +24,29 @@ import com.mints.library.utils.nodoubleclick.AntiShake; ...@@ -25,31 +24,29 @@ import com.mints.library.utils.nodoubleclick.AntiShake;
public class MealView extends FrameLayout implements View.OnClickListener { public class MealView extends FrameLayout implements View.OnClickListener {
// 按钮监听 // 按钮监听
private StepView.StepViewListener stepViewListener; private MealViewListener mealViewListener;
// 浮云金币 // 浮云金币
private TextView tvOneWater; private TextView tvOneWater;
private TextView tvTwoWater; private TextView tvTwoWater;
private TextView tvThreeWater; private TextView tvThreeWater;
private TextView tvFouroneWater; private TextView tvFouroneWater;
private TextView tvFiveoneWater;
private LinearLayout llOneWater; private LinearLayout llOneWater;
private LinearLayout llTwoWater; private LinearLayout llTwoWater;
private LinearLayout llThreeWater; private LinearLayout llThreeWater;
private LinearLayout llFourWater; private LinearLayout llFourWater;
private LinearLayout llFiveWater;
private int threeCoin;
// 喝水提示
private TextView tvStep;
private TextView tvNext;
private BubbleSeekBar bsStep;
private RelativeLayout rlNext; private RelativeLayout rlNext;
private TextView tvNext;
// 浮云金币动画 // 浮云金币动画
private ObjectAnimator oneAnimator; private ObjectAnimator oneAnimator;
private ObjectAnimator twoAnimator; private ObjectAnimator twoAnimator;
private ObjectAnimator threeAnimator; private ObjectAnimator threeAnimator;
private ObjectAnimator fourAnimator; private ObjectAnimator fourAnimator;
private ObjectAnimator fiveAnimator;
public MealView(Context context) { public MealView(Context context) {
this(context, null); this(context, null);
...@@ -70,31 +67,50 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -70,31 +67,50 @@ public class MealView extends FrameLayout implements View.OnClickListener {
public void onClick(View v) { public void onClick(View v) {
if (AntiShake.check(v.getId())) return; if (AntiShake.check(v.getId())) return;
if (stepViewListener != null) { if (mealViewListener != null) {
switch (v.getId()) { switch (v.getId()) {
case R.id.tv_water_one: case R.id.tv_water_one:
stepViewListener.clickWater(1, tvOneWater.getText().toString()); mealViewListener.clickWater(1, tvOneWater.getText().toString());
cancelWaterAnim(llOneWater);
break; break;
case R.id.tv_water_two: case R.id.tv_water_two:
stepViewListener.clickWater(2, tvTwoWater.getText().toString()); mealViewListener.clickWater(2, tvTwoWater.getText().toString());
cancelWaterAnim(llTwoWater);
break; break;
case R.id.tv_water_three: case R.id.tv_water_three:
stepViewListener.clickWater(3, tvTwoWater.getText().toString()); mealViewListener.clickWater(3, tvTwoWater.getText().toString());
cancelWaterAnim(llThreeWater);
break; break;
case R.id.tv_water_four: case R.id.tv_water_four:
stepViewListener.clickWater(4, tvFouroneWater.getText().toString()); mealViewListener.clickWater(4, tvFouroneWater.getText().toString());
cancelWaterAnim(llFourWater); break;
case R.id.tv_water_five:
mealViewListener.clickWater(5, tvFouroneWater.getText().toString());
break; break;
case R.id.tv_water_next: case R.id.tv_water_next:
stepViewListener.clickWater(0, "-1"); mealViewListener.clickWater(0, "-1");
break; break;
} }
} }
} }
public void setCancelAnim(int position) {
switch (position) {
case 1:
cancelWaterAnim(llOneWater);
break;
case 2:
cancelWaterAnim(llTwoWater);
break;
case 3:
cancelWaterAnim(llThreeWater);
break;
case 4:
cancelWaterAnim(llFourWater);
break;
case 5:
cancelWaterAnim(llFiveWater);
break;
}
}
/** /**
* 初始化view * 初始化view
...@@ -109,24 +125,21 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -109,24 +125,21 @@ public class MealView extends FrameLayout implements View.OnClickListener {
tvTwoWater = view.findViewById(R.id.tv_water_two); tvTwoWater = view.findViewById(R.id.tv_water_two);
tvThreeWater = view.findViewById(R.id.tv_water_three); tvThreeWater = view.findViewById(R.id.tv_water_three);
tvFouroneWater = view.findViewById(R.id.tv_water_four); tvFouroneWater = view.findViewById(R.id.tv_water_four);
tvFiveoneWater = view.findViewById(R.id.tv_water_five);
llOneWater = view.findViewById(R.id.ll_water_one); llOneWater = view.findViewById(R.id.ll_water_one);
llTwoWater = view.findViewById(R.id.ll_water_two); llTwoWater = view.findViewById(R.id.ll_water_two);
llThreeWater = view.findViewById(R.id.ll_water_three); llThreeWater = view.findViewById(R.id.ll_water_three);
llFourWater = view.findViewById(R.id.ll_water_four); llFourWater = view.findViewById(R.id.ll_water_four);
llFiveWater = view.findViewById(R.id.ll_water_five);
oneAnimator = startOne(llOneWater, 18.7f, 2400); oneAnimator = startOne(llOneWater, 18.7f, 2400);
twoAnimator = startOne(llTwoWater, 17.7f, 2200); twoAnimator = startOne(llTwoWater, 17.7f, 2200);
threeAnimator = startOne(llThreeWater, 19f, 2300); threeAnimator = startOne(llThreeWater, 19f, 2300);
fourAnimator = startOne(llFourWater, 17f, 2500); fourAnimator = startOne(llFourWater, 17f, 2500);
fiveAnimator = startOne(llFiveWater, 17f, 2500);
tvStep = view.findViewById(R.id.tv_step);
tvNext = view.findViewById(R.id.tv_water_next); tvNext = view.findViewById(R.id.tv_water_next);
bsStep = view.findViewById(R.id.bs_step);
rlNext = view.findViewById(R.id.rl_water_next); rlNext = view.findViewById(R.id.rl_water_next);
bsStep.setClickable(false);
bsStep.setEnabled(false);
bsStep.setSelected(false);
} }
/** /**
...@@ -137,6 +150,7 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -137,6 +150,7 @@ public class MealView extends FrameLayout implements View.OnClickListener {
tvTwoWater.setOnClickListener(this); tvTwoWater.setOnClickListener(this);
tvThreeWater.setOnClickListener(this); tvThreeWater.setOnClickListener(this);
tvFouroneWater.setOnClickListener(this); tvFouroneWater.setOnClickListener(this);
tvFiveoneWater.setOnClickListener(this);
tvNext.setOnClickListener(this); tvNext.setOnClickListener(this);
} }
...@@ -190,37 +204,13 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -190,37 +204,13 @@ public class MealView extends FrameLayout implements View.OnClickListener {
llFourWater.setVisibility(VISIBLE); llFourWater.setVisibility(VISIBLE);
tvFouroneWater.setBackground(getResources().getDrawable(R.mipmap.ic_water)); tvFouroneWater.setBackground(getResources().getDrawable(R.mipmap.ic_water));
break; break;
case 5:
llFiveWater.setVisibility(VISIBLE);
tvFiveoneWater.setBackground(getResources().getDrawable(R.mipmap.ic_water));
break;
} }
} }
/**
* 设置喝水进度
*
* @param progress
*/
public void setWaterProgress(int progress, int maxProgress) {
if (bsStep != null) {
if (progress <= maxProgress) {
bsStep.setProgress(progress);
} else {
bsStep.setProgress(maxProgress);
}
}
if (tvStep != null) {
tvStep.setText(progress + "");
}
}
/**
* 设置喝水总进度
*
* @param maxProgress
*/
public void setWaterMaxProgress(int maxProgress) {
if (bsStep != null) {
bsStep.setmMax(maxProgress);
}
}
/** /**
* 上下浮云动画 * 上下浮云动画
...@@ -244,14 +234,6 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -244,14 +234,6 @@ public class MealView extends FrameLayout implements View.OnClickListener {
* @param llView * @param llView
*/ */
private void cancelWaterAnim(LinearLayout llView) { private void cancelWaterAnim(LinearLayout llView) {
// YoYo.with(Techniques.FadeOutDown)
// .repeat(0)
// .playOn(tvView);
// if (animator != null) {
// animator.cancel();
// }
if (llView != null) { if (llView != null) {
llView.setVisibility(INVISIBLE); llView.setVisibility(INVISIBLE);
} }
...@@ -280,16 +262,20 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -280,16 +262,20 @@ public class MealView extends FrameLayout implements View.OnClickListener {
fourAnimator.cancel(); fourAnimator.cancel();
fourAnimator = null; fourAnimator = null;
} }
if (fiveAnimator != null) {
fiveAnimator.cancel();
fiveAnimator = null;
}
} }
public void setStepViewListener(StepView.StepViewListener stepViewListener) { public void setMealViewListener(MealViewListener mealViewListener) {
this.stepViewListener = stepViewListener; this.mealViewListener = mealViewListener;
} }
/** /**
* 按钮监听 * 按钮监听
*/ */
public interface StepViewListener { public interface MealViewListener {
/** /**
* 点击水滴 * 点击水滴
* *
...@@ -349,6 +335,10 @@ public class MealView extends FrameLayout implements View.OnClickListener { ...@@ -349,6 +335,10 @@ public class MealView extends FrameLayout implements View.OnClickListener {
if (llFourWater != null) { if (llFourWater != null) {
llFourWater.setVisibility(INVISIBLE); llFourWater.setVisibility(INVISIBLE);
} }
if (llFiveWater != null) {
llFiveWater.setVisibility(INVISIBLE);
}
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="100dp" />
<solid android:color="@color/color_E1B867" />
</shape>
\ No newline at end of file
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<solid android:color="#ffff9837" /> <solid android:color="#ffff9837" />
<corners android:radius="25dp" /> <corners android:radius="25dp" />
<gradient <gradient
android:angle="180" android:angle="90"
android:endColor="#ffff7f2c" android:endColor="#ffffb032"
android:startColor="#ffffb032" android:startColor="#ffff7f2c"
android:type="linear" android:type="linear"
android:useLevel="true" /> android:useLevel="true" />
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/color_FAF6E8" />
<corners android:radius="10dp" />
<stroke
android:width="3dp"
android:color="@color/color_F3E7C5" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#ffffffff" /> <solid android:color="#ffffffff" />
<corners android:radius="15dp" /> <corners android:radius="10dp" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
</shape>
\ No newline at end of file
...@@ -7,6 +7,16 @@ ...@@ -7,6 +7,16 @@
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView <TextView
android:id="@+id/tvAboutasVersion" android:id="@+id/tvAboutasVersion"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -90,7 +100,7 @@ ...@@ -90,7 +100,7 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout>
</com.mints.goodmoney.ui.widgets.ElasticScrollView>
</LinearLayout> </LinearLayout>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<ScrollView <com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
...@@ -39,9 +39,9 @@ ...@@ -39,9 +39,9 @@
android:id="@+id/tvDrawcashGold" android:id="@+id/tvDrawcashGold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="0" android:text="0"
android:layout_alignParentRight="true"
android:textColor="@color/main_mints" android:textColor="@color/main_mints"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
android:textColor="@color/black_text" android:textColor="@color/black_text"
android:textSize="14sp" /> android:textSize="14sp" />
</LinearLayout> </LinearLayout>
</ScrollView> </com.mints.goodmoney.ui.widgets.ElasticScrollView>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -7,8 +7,15 @@ ...@@ -7,8 +7,15 @@
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.github.lzyzsd.jsbridge.BridgeWebView <com.github.lzyzsd.jsbridge.BridgeWebView
android:id="@+id/blEarseWebview" android:id="@+id/blEarseWebview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</com.mints.goodmoney.ui.widgets.ElasticScrollView>
</LinearLayout> </LinearLayout>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="400dp" android:layout_height="400dp"
android:background="@mipmap/bg_walk"> android:background="@mipmap/bg_eat">
<ImageView <ImageView
android:id="@+id/ivWalkBack" android:id="@+id/ivWalkBack"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
android:layout_width="375dp" android:layout_width="375dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="120dp" /> android:layout_marginTop="100dp" />
</FrameLayout> </FrameLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/srl_my"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srlAccentColor="@color/gray"
app:srlPrimaryColor="@color/white">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.androidkun.xtablayout.XTabLayout
android:id="@+id/tab_friends"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
app:xTabDisplayNum="2"
app:xTabIndicatorColor="#FB560C"
app:xTabIndicatorHeight="3dp"
app:xTabIndicatorWidth="30dp"
app:xTabMode="fixed"
app:xTabSelectedTextColor="#FB560C"
app:xTabSelectedTextSize="18sp"
app:xTabTextColor="#666666"
app:xTabTextSize="15sp" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/view_pager_friends"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
\ No newline at end of file
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<TextView <TextView
android:id="@+id/tvGameHint" android:id="@+id/tvGameHint"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/my_color_gray" android:background="@color/my_color_gray"
...@@ -21,9 +20,10 @@ ...@@ -21,9 +20,10 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:textSize="14sp" /> android:textSize="14sp"
android:visibility="gone" />
<androidx.core.widget.NestedScrollView <com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/white"
...@@ -53,6 +53,6 @@ ...@@ -53,6 +53,6 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </com.mints.goodmoney.ui.widgets.ElasticScrollView>
</LinearLayout> </LinearLayout>
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/tab_rl_pan" android:id="@+id/tab_rl_friends"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1.0" android:layout_weight="1.0"
...@@ -81,22 +81,22 @@ ...@@ -81,22 +81,22 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/tab_iv_pan" android:id="@+id/tab_iv_friends"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:src="@drawable/tab_pan_btn" /> android:src="@drawable/tab_friends_btn" />
<TextView <TextView
android:id="@+id/tab_tv_pan" android:id="@+id/tab_tv_friends"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/bottom_tab_pan" android:text="@string/bottom_tab_friends"
android:textColor="@drawable/item_txt_sel" android:textColor="@drawable/item_txt_sel"
android:textSize="11sp" /> android:textSize="11sp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/tab_rl_friends" android:id="@+id/tab_rl_pan"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1.0" android:layout_weight="1.0"
...@@ -104,16 +104,16 @@ ...@@ -104,16 +104,16 @@
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:id="@+id/tab_iv_friends" android:id="@+id/tab_iv_pan"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:src="@drawable/tab_friends_btn" /> android:src="@drawable/tab_pan_btn" />
<TextView <TextView
android:id="@+id/tab_tv_friends" android:id="@+id/tab_tv_pan"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/bottom_tab_friends" android:text="@string/bottom_tab_pan"
android:textColor="@drawable/item_txt_sel" android:textColor="@drawable/item_txt_sel"
android:textSize="11sp" /> android:textSize="11sp" />
</LinearLayout> </LinearLayout>
......
...@@ -6,6 +6,15 @@ ...@@ -6,6 +6,15 @@
<include layout="@layout/header_layout" /> <include layout="@layout/header_layout" />
<com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include <include
android:id="@+id/item_phone" android:id="@+id/item_phone"
layout="@layout/item_settings" /> layout="@layout/item_settings" />
...@@ -48,4 +57,8 @@ ...@@ -48,4 +57,8 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="16sp" />
</LinearLayout>
</com.mints.goodmoney.ui.widgets.ElasticScrollView>
</LinearLayout> </LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:background="@drawable/shape_dialog_friends"
android:gravity="center_horizontal"
android:orientation="vertical"
android:padding="20dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/gray"
android:textSize="16sp" />
<Button
android:id="@+id/btn_submit"
android:layout_width="200dp"
android:layout_height="42dp"
android:layout_marginTop="20dp"
android:background="@drawable/shape_btn_friends"
android:textColor="@color/white"
android:textSize="18sp" />
</LinearLayout>
\ No newline at end of file
...@@ -37,12 +37,9 @@ ...@@ -37,12 +37,9 @@
<include layout="@layout/item_divider_gray" /> <include layout="@layout/item_divider_gray" />
<include <include layout="@layout/item_fragment_main_my_promotions" />
layout="@layout/item_fragment_main_my_promotions"/>
<include <include layout="@layout/item_divider_gray" />
layout="@layout/item_divider_gray"
android:visibility="gone" />
<include layout="@layout/view_title" /> <include layout="@layout/view_title" />
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card" android:background="@drawable/shape_gold_card"
android:elevation="1.5dip" android:elevation="1dip"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingStart="15dp" android:paddingStart="15dp"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="375dp" android:layout_width="375dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"> android:layout_gravity="center_horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="60dp"
android:layout_marginRight="60dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_step"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="#00895B"
android:textSize="24sp" />
<com.mints.goodmoney.ui.widgets.seekbar.BubbleSeekBar
android:id="@+id/bs_step"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
app:bsb_auto_adjust_section_mark="true"
app:bsb_max="6000"
app:bsb_min="0"
app:bsb_progress="0"
app:bsb_second_track_color="#00895B"
app:bsb_section_count="4"
app:bsb_section_text_position="below_section_mark"
app:bsb_show_section_mark="true"
app:bsb_show_section_text="true"
app:bsb_show_thumb_text="true"
app:bsb_thumb_text_size="18sp"
app:bsb_touch_to_seek="true"
app:bsb_track_color="@color/white"
app:bsb_track_size="4dp" />
</LinearLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_water_next" android:id="@+id/rl_water_next"
android:layout_width="125dp" android:layout_width="125dp"
android:layout_height="35dp" android:layout_height="35dp"
android:layout_gravity="bottom|center_horizontal" android:layout_gravity="bottom|center_horizontal"
android:layout_marginRight="2dp"
android:layout_marginBottom="15dp"
android:background="@drawable/shape_tv_app_write"> android:background="@drawable/shape_tv_app_write">
<TextView <TextView
...@@ -67,13 +27,13 @@ ...@@ -67,13 +27,13 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="240dp"> android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:id="@+id/ll_water_one" android:id="@+id/ll_water_one"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginStart="35dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="invisible"> android:visibility="invisible">
...@@ -94,9 +54,40 @@ ...@@ -94,9 +54,40 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:text="金币奖励" android:text="金币奖励"
android:visibility="gone"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_water_five"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="20dp"
android:layout_marginTop="100dp"
android:orientation="vertical"
android:visibility="invisible">
<TextView
android:id="@+id/tv_water_five"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:background="@mipmap/ic_water"
android:gravity="center"
android:textColor="@color/white"
android:textSize="10sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp"
android:text="金币奖励"
android:textColor="@color/white"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -104,10 +95,11 @@ ...@@ -104,10 +95,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_marginTop="10dp" android:layout_marginTop="60dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="invisible"> android:visibility="invisible"
tools:ignore="RtlHardcoded">
<TextView <TextView
android:id="@+id/tv_water_two" android:id="@+id/tv_water_two"
...@@ -124,18 +116,19 @@ ...@@ -124,18 +116,19 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:visibility="gone"
android:text="金币奖励" android:text="金币奖励"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> android:textSize="12sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_water_three" android:id="@+id/ll_water_three"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginStart="40dp"
android:layout_marginTop="152dp" android:layout_marginTop="190dp"
android:layout_marginBottom="20dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="invisible"> android:visibility="invisible">
...@@ -154,10 +147,10 @@ ...@@ -154,10 +147,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:visibility="gone"
android:text="金币奖励" android:text="金币奖励"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> android:textSize="12sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -186,16 +179,12 @@ ...@@ -186,16 +179,12 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:text="金币奖励" android:text="金币奖励"
android:visibility="gone"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="12sp" /> android:textSize="12sp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<ImageView
android:layout_width="wrap_content"
android:src="@mipmap/ic_walk"
android:layout_gravity="center_horizontal"
android:layout_marginTop="100dp"
android:layout_height="wrap_content"/>
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<color name="blue">#0000FF</color> <color name="blue">#0000FF</color>
<color name="grayc">#cccccc</color> <color name="grayc">#cccccc</color>
<color name="graya">#AAAAAA</color> <color name="graya">#AAAAAA</color>
<color name="gray_fc">#FCFCFC</color>
<color name="lightblue">#0083FF</color> <color name="lightblue">#0083FF</color>
<color name="full_transparent">#00000000</color> <color name="full_transparent">#00000000</color>
<color name="ban_transparent">#60000000</color> <color name="ban_transparent">#60000000</color>
...@@ -132,4 +133,7 @@ ...@@ -132,4 +133,7 @@
<color name="color_E72C2B">#E72C2B</color> <color name="color_E72C2B">#E72C2B</color>
<color name="color_FFC7C7">#FFC7C7</color> <color name="color_FFC7C7">#FFC7C7</color>
<color name="color_FF7C00">#FF7C00</color> <color name="color_FF7C00">#FF7C00</color>
<color name="color_FAF6E8">#FAF6E8</color>
<color name="color_F3E7C5">#F3E7C5</color>
<color name="color_E1B867">#E1B867</color>
</resources> </resources>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<string name="bottom_tab_main">首页</string> <string name="bottom_tab_main">首页</string>
<string name="bottom_tab_pan">大转盘</string> <string name="bottom_tab_pan">大转盘</string>
<string name="bottom_tab_channel">短视频</string> <string name="bottom_tab_channel">短视频</string>
<string name="bottom_tab_friends">邀请好友</string> <string name="bottom_tab_friends">平台分红</string>
<string name="bottom_tab_my">个人中心</string> <string name="bottom_tab_my">个人中心</string>
<string name="app_sign">6d194270</string> <string name="app_sign">6d194270</string>
......
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