Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
8304195e
Commit
8304195e
authored
Nov 20, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增饭补页面及分红页面
parent
d4883bee
Changes
44
Show whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
1650 additions
and
518 deletions
+1650
-518
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+3
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+4
-0
FriendHallMsgBean.java
...java/com/mints/goodmoney/mvp/model/FriendHallMsgBean.java
+46
-0
FriendsActivityPresenter.kt
...ints/goodmoney/mvp/presenters/FriendsActivityPresenter.kt
+77
-0
FriendsPresenter.kt
...va/com/mints/goodmoney/mvp/presenters/FriendsPresenter.kt
+67
-53
FriendsActivityView.kt
...java/com/mints/goodmoney/mvp/views/FriendsActivityView.kt
+8
-0
FriendsView.kt
...rc/main/java/com/mints/goodmoney/mvp/views/FriendsView.kt
+2
-6
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+33
-1
AboutusActivity.kt
.../java/com/mints/goodmoney/ui/activitys/AboutusActivity.kt
+1
-2
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+6
-2
CoinRecordActivity.kt
...va/com/mints/goodmoney/ui/activitys/CoinRecordActivity.kt
+6
-0
DrawcashRecordActivity.kt
...om/mints/goodmoney/ui/activitys/DrawcashRecordActivity.kt
+6
-0
FoodSubsidyActivity.kt
...a/com/mints/goodmoney/ui/activitys/FoodSubsidyActivity.kt
+37
-22
FriendsActivity.kt
.../java/com/mints/goodmoney/ui/activitys/FriendsActivity.kt
+137
-0
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+18
-18
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+1
-5
FriendsPagerAdapter.kt
...ava/com/mints/goodmoney/ui/adapter/FriendsPagerAdapter.kt
+4
-7
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+177
-30
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+3
-0
BonusDialog.kt
...c/main/java/com/mints/goodmoney/ui/widgets/BonusDialog.kt
+62
-0
ElasticScrollView.java
...ava/com/mints/goodmoney/ui/widgets/ElasticScrollView.java
+178
-0
FlingBehavior.java
...in/java/com/mints/goodmoney/ui/widgets/FlingBehavior.java
+133
-19
MealView.java
...rc/main/java/com/mints/goodmoney/ui/widgets/MealView.java
+53
-63
shape_btn_friends.xml
GoodMoney/app/src/main/res/drawable/shape_btn_friends.xml
+8
-0
shape_btn_switch.xml
GoodMoney/app/src/main/res/drawable/shape_btn_switch.xml
+3
-3
shape_dialog_friends.xml
GoodMoney/app/src/main/res/drawable/shape_dialog_friends.xml
+12
-0
shape_gold_card.xml
GoodMoney/app/src/main/res/drawable/shape_gold_card.xml
+2
-1
shape_tab_friends.xml
GoodMoney/app/src/main/res/drawable/shape_tab_friends.xml
+10
-0
activity_aboutus.xml
GoodMoney/app/src/main/res/layout/activity_aboutus.xml
+74
-64
activity_drawcash.xml
GoodMoney/app/src/main/res/layout/activity_drawcash.xml
+3
-3
activity_erase.xml
GoodMoney/app/src/main/res/layout/activity_erase.xml
+10
-3
activity_food_subsidy.xml
GoodMoney/app/src/main/res/layout/activity_food_subsidy.xml
+2
-2
activity_friends.xml
GoodMoney/app/src/main/res/layout/activity_friends.xml
+50
-0
activity_liebao_game.xml
GoodMoney/app/src/main/res/layout/activity_liebao_game.xml
+4
-4
activity_main.xml
GoodMoney/app/src/main/res/layout/activity_main.xml
+10
-10
activity_settings.xml
GoodMoney/app/src/main/res/layout/activity_settings.xml
+54
-41
dialog_friends.xml
GoodMoney/app/src/main/res/layout/dialog_friends.xml
+39
-0
fragment_main_friends.xml
GoodMoney/app/src/main/res/layout/fragment_main_friends.xml
+249
-91
fragment_main_my.xml
GoodMoney/app/src/main/res/layout/fragment_main_my.xml
+2
-5
item_fragment_main_my_title.xml
...y/app/src/main/res/layout/item_fragment_main_my_title.xml
+1
-1
view_meal.xml
GoodMoney/app/src/main/res/layout/view_meal.xml
+50
-61
bg_eat.png
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_eat.png
+0
-0
colors.xml
GoodMoney/app/src/main/res/values/colors.xml
+4
-0
strings.xml
GoodMoney/app/src/main/res/values/strings.xml
+1
-1
No files found.
GoodMoney/app/src/main/AndroidManifest.xml
View file @
8304195e
...
@@ -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"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
8304195e
...
@@ -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"
// 打开激活
// 打开激活
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/FriendHallMsgBean.java
View file @
8304195e
...
@@ -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
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/FriendsActivityPresenter.kt
0 → 100644
View file @
8304195e
package
com.mints.goodmoney.mvp.presenters
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.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
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/FriendsPresenter.kt
View file @
8304195e
...
@@ -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
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/FriendsActivityView.kt
0 → 100644
View file @
8304195e
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
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/FriendsView.kt
View file @
8304195e
...
@@ -8,16 +8,12 @@ interface FriendsView : BaseView {
...
@@ -8,16 +8,12 @@ interface FriendsView : BaseView {
//
//
// fun getFriendsRankSuc(data: FriendsTaskBean)
// fun getFriendsRankSuc(data: FriendsTaskBean)
fun
get
FriendsHallMsg
Suc
(
data
:
FriendHallMsgBean
)
fun
get
ContributionBigLeaders
Suc
(
data
:
FriendHallMsgBean
)
// fun getFriendsHallMsgFail(
)
fun
getFriendsHallMsgSuc
(
data
:
FriendHallMsgBean
)
fun
getContributionLeadersSuc
(
data
:
FriendHallMsgBean
)
fun
getContributionLeadersSuc
(
data
:
FriendHallMsgBean
)
// fun getContributionLeadersFail()
fun
getContributionOutToCashSuc
()
fun
getContributionOutToCashSuc
()
// fun getContributionOutToCash()
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
8304195e
...
@@ -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
*/
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AboutusActivity.kt
View file @
8304195e
...
@@ -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
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
8304195e
...
@@ -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
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/CoinRecordActivity.kt
View file @
8304195e
...
@@ -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
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawcashRecordActivity.kt
View file @
8304195e
...
@@ -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
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/FoodSubsidyActivity.kt
View file @
8304195e
...
@@ -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
.
set
Step
ViewListener
(
this
)
svWalk
.
set
Meal
ViewListener
(
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
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/FriendsActivity.kt
0 → 100644
View file @
8304195e
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
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
8304195e
...
@@ -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
(
pan
Fragment
==
null
)
{
if
(
friends
Fragment
==
null
)
{
panFragment
=
Pan
Fragment
()
friendsFragment
=
Friends
Fragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
pan
Fragment
!!
)
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
friends
Fragment
!!
)
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
=
tru
e
tab_iv_pan
.
isSelected
=
fals
e
tab_tv_pan
.
isSelected
=
tru
e
tab_tv_pan
.
isSelected
=
fals
e
tab_iv_friends
.
isSelected
=
fals
e
tab_iv_friends
.
isSelected
=
tru
e
tab_tv_friends
.
isSelected
=
fals
e
tab_tv_friends
.
isSelected
=
tru
e
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
(
friends
Fragment
==
null
)
{
if
(
pan
Fragment
==
null
)
{
friendsFragment
=
Friends
Fragment
()
panFragment
=
Pan
Fragment
()
}
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
friends
Fragment
!!
)
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
pan
Fragment
!!
)
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
=
fals
e
tab_iv_pan
.
isSelected
=
tru
e
tab_tv_pan
.
isSelected
=
fals
e
tab_tv_pan
.
isSelected
=
tru
e
tab_iv_friends
.
isSelected
=
tru
e
tab_iv_friends
.
isSelected
=
fals
e
tab_tv_friends
.
isSelected
=
tru
e
tab_tv_friends
.
isSelected
=
fals
e
tab_iv_my
.
isSelected
=
false
tab_iv_my
.
isSelected
=
false
tab_tv_my
.
isSelected
=
false
tab_tv_my
.
isSelected
=
false
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
8304195e
...
@@ -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
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/FriendsPagerAdapter.kt
View file @
8304195e
...
@@ -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
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
8304195e
package
com.mints.goodmoney.ui.fragment
package
com.mints.goodmoney.ui.fragment
import
android.annotation.SuppressLint
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.View
import
android.view.View
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.recyclerview.widget.DividerItemDecoration
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
androidx.viewpager.widget.ViewPager
import
androidx.viewpager.widget.ViewPager
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
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
...
@@ -12,9 +17,13 @@ import com.mints.goodmoney.manager.UserManager
...
@@ -12,9 +17,13 @@ import com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.FriendHallMsgBean
import
com.mints.goodmoney.mvp.model.FriendHallMsgBean
import
com.mints.goodmoney.mvp.presenters.FriendsPresenter
import
com.mints.goodmoney.mvp.presenters.FriendsPresenter
import
com.mints.goodmoney.mvp.views.FriendsView
import
com.mints.goodmoney.mvp.views.FriendsView
import
com.mints.goodmoney.ui.activitys.FriendsActivity
import
com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
import
com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
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.BonusDialog
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.utils.ImageUtil
import
com.mints.goodmoney.utils.SpanUtils
import
com.mints.goodmoney.utils.SpanUtils
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
...
@@ -30,20 +39,22 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -30,20 +39,22 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
private
val
friendsPresenter
by
lazy
{
FriendsPresenter
()
}
private
val
friendsPresenter
by
lazy
{
FriendsPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
var
viewPagerAdapter
:
FriendsPagerAdapter
?
=
null
private
var
viewPagerAdapter
:
FriendsPagerAdapter
?
=
null
private
var
allData
:
MutableList
<
FriendHallMsgBean
.
ListBean
>
=
mutableListOf
()
private
var
friendsData
:
MutableList
<
FriendHallMsgBean
.
ListBean
>
=
mutableListOf
()
private
var
friendsData
:
MutableList
<
FriendHallMsgBean
.
ListBean
>
=
mutableListOf
()
private
var
worldData
:
MutableList
<
FriendHallMsgBean
.
ListBean
>
=
mutableListOf
()
private
var
worldData
:
MutableList
<
FriendHallMsgBean
.
ListBean
>
=
mutableListOf
()
private
val
recyList
:
MutableList
<
RecyclerView
>
=
mutableListOf
()
private
val
recyList
:
MutableList
<
RecyclerView
>
=
mutableListOf
()
private
var
allAdapter
:
InvitedAdapter
?
=
null
private
var
friendsAdapter
:
InvitedAdapter
?
=
null
private
var
friendsAdapter
:
InvitedAdapter
?
=
null
private
var
worldAdapter
:
InvitedAdapter
?
=
null
private
var
worldAdapter
:
InvitedAdapter
?
=
null
private
var
mFriendsHallMsgBean
:
FriendHallMsgBean
?
=
null
private
var
mFriendsHallMsgBean
:
FriendHallMsgBean
?
=
null
private
var
bonusDialog
:
BonusDialog
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_friends
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_friends
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
...
@@ -52,10 +63,9 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -52,10 +63,9 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
initView
()
initView
()
initRecy
()
initRecy
()
friendsPresenter
.
getFriendHallMsg
()
}
}
@SuppressLint
(
"ClickableViewAccessibility"
)
private
fun
initView
()
{
private
fun
initView
()
{
tv_right_subtitle
.
visibility
=
View
.
VISIBLE
tv_right_subtitle
.
visibility
=
View
.
VISIBLE
tv_right_subtitle
.
text
=
"玩法规则"
tv_right_subtitle
.
text
=
"玩法规则"
...
@@ -66,34 +76,56 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -66,34 +76,56 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
iv_question
.
setOnClickListener
(
this
)
iv_question
.
setOnClickListener
(
this
)
btn_get_bonus
.
setOnClickListener
(
this
)
btn_get_bonus
.
setOnClickListener
(
this
)
tv_right_subtitle
.
setOnClickListener
(
this
)
tv_right_subtitle
.
setOnClickListener
(
this
)
btn_invite
.
setOnClickListener
(
this
)
tv_detail
.
setOnClickListener
(
this
)
tv_friends_directly
.
setOnClickListener
(
this
)
tv_friends_indirect
.
setOnClickListener
(
this
)
}
}
private
fun
initRecy
()
{
private
fun
initRecy
()
{
val
recyAll
=
View
.
inflate
(
mContext
,
R
.
layout
.
item_friends_recy
,
null
)
as
RecyclerView
val
recyFriends
=
View
.
inflate
(
mContext
,
R
.
layout
.
item_friends_recy
,
null
)
as
RecyclerView
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
val
recyWorld
=
View
.
inflate
(
mContext
,
R
.
layout
.
item_friends_recy
,
null
)
as
RecyclerView
recyAll
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
recyFriends
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
recyFriends
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
recyWorld
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
recyWorld
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
allAdapter
=
InvitedAdapter
(
mContext
,
allData
)
friendsAdapter
=
InvitedAdapter
(
mContext
,
friendsData
)
friendsAdapter
=
InvitedAdapter
(
mContext
,
friendsData
)
worldAdapter
=
InvitedAdapter
(
mContext
,
worldData
)
worldAdapter
=
InvitedAdapter
(
mContext
,
worldData
)
recyAll
.
adapter
=
allAdapter
recyFriends
.
adapter
=
friendsAdapter
recyFriends
.
adapter
=
friendsAdapter
recyWorld
.
adapter
=
worldAdapter
recyWorld
.
adapter
=
worldAdapter
recyList
.
add
(
recyAll
)
recyList
.
add
(
recyFriends
)
recyList
.
add
(
recyFriends
)
recyList
.
add
(
recyWorld
)
recyList
.
add
(
recyWorld
)
viewPagerAdapter
=
FriendsPagerAdapter
(
recyList
)
val
titleList
=
arrayListOf
(
"总收益榜"
,
"今日贡献榜"
,
"昨日收益榜"
)
viewPagerAdapter
=
FriendsPagerAdapter
(
titleList
,
recyList
)
view_pager_friends
.
adapter
=
viewPagerAdapter
view_pager_friends
.
adapter
=
viewPagerAdapter
view_pager_friends
.
addOnPageChangeListener
(
object
:
ViewPager
.
OnPageChangeListener
{
view_pager_friends
.
addOnPageChangeListener
(
object
:
ViewPager
.
OnPageChangeListener
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
override
fun
onPageScrolled
(
position
:
Int
,
positionOffset
:
Float
,
positionOffsetPixels
:
Int
)
{
}
}
override
fun
onPageSelected
(
position
:
Int
)
{
override
fun
onPageSelected
(
position
:
Int
)
{
if
(
position
==
1
)
{
when
(
position
)
{
0
->
{
if
(
allData
.
size
<=
0
)
{
friendsPresenter
.
getContributionBigLeaders
()
}
}
1
->
{
if
(
friendsData
.
size
<=
0
)
{
friendsPresenter
.
getFriendsGiveTodayList
()
}
}
2
->
{
if
(
worldData
.
size
<=
0
)
{
friendsPresenter
.
getContributionLeaders
()
friendsPresenter
.
getContributionLeaders
()
}
else
{
}
friendsPresenter
.
getFriendHallMsg
()
}
}
}
}
}
...
@@ -118,12 +150,23 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -118,12 +150,23 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
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
.
getInstance
()
.
userID
))
{
if
(
view_pager_friends
.
currentItem
==
0
)
{
// 刷新分红数据
friendsPresenter
.
getFriendHallMsg
()
friendsPresenter
.
getFriendHallMsg
()
}
else
{
when
(
view_pager_friends
.
currentItem
)
{
0
->
{
friendsPresenter
.
getContributionBigLeaders
()
}
1
->
{
friendsPresenter
.
getFriendsGiveTodayList
()
}
2
->
{
friendsPresenter
.
getContributionLeaders
()
friendsPresenter
.
getContributionLeaders
()
}
}
else
->
{
}
}
}
}
}
}
}
}
...
@@ -134,14 +177,23 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -134,14 +177,23 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
if
(
userManager
.
userID
.
isNotEmpty
())
{
if
(
UserManager
.
getInstance
()
.
userID
.
isNotEmpty
())
{
if
(
view_pager_friends
.
currentItem
==
0
)
{
// 刷新分红数据
friendsPresenter
.
getFriendHallMsg
()
friendsPresenter
.
getFriendHallMsg
()
}
else
{
when
(
view_pager_friends
.
currentItem
)
{
0
->
{
friendsPresenter
.
getContributionBigLeaders
()
}
1
->
{
friendsPresenter
.
getFriendsGiveTodayList
()
}
2
->
{
friendsPresenter
.
getContributionLeaders
()
friendsPresenter
.
getContributionLeaders
()
}
}
// view_pager_friends.currentItem = 0
else
->
{
}
}
}
}
}
}
...
@@ -150,6 +202,10 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -150,6 +202,10 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
btn_get_bonus
.
text
=
"结算中"
btn_get_bonus
.
text
=
"结算中"
}
}
friends_sum
.
text
=
""
+
data
.
friendCount
friends_directly_sum
.
text
=
""
+
data
.
directFriendsCount
friends_indirect_sum
.
text
=
""
+
data
.
indirectFriendsCount
btn_get_bonus
.
isEnabled
=
data
.
status
==
0
&&
data
.
cash
.
toInt
()
>
0
btn_get_bonus
.
isEnabled
=
data
.
status
==
0
&&
data
.
cash
.
toInt
()
>
0
tv_bonus_date
.
text
=
data
.
periods
tv_bonus_date
.
text
=
data
.
periods
...
@@ -179,15 +235,104 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -179,15 +235,104 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
.
create
()
.
create
()
}
}
private
fun
hintDialog
(
flag
:
Boolean
)
{
bonusDialog
=
BonusDialog
(
requireActivity
(),
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
R
.
id
.
btn_submit
->
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
bonusDialog
!=
null
&&
bonusDialog
!!
.
isShowing
)
{
bonusDialog
!!
.
dismiss
()
}
}
}
}
})
bonusDialog
?.
let
{
if
(
flag
)
{
it
.
setTitle
(
"什么是直接亲友?"
)
it
.
setContent
(
"经你本人直接邀请的亲友,就是你的直接亲友。"
)
it
.
setBtnStr
(
"知道了"
)
}
else
{
it
.
setTitle
(
"什么是间接亲友?"
)
it
.
setContent
(
"经你直接亲友邀请的亲友,就是你的间接亲友。"
)
it
.
setBtnStr
(
"知道了"
)
}
it
.
show
()
}
}
private
fun
ruleDialog
(
flag
:
Boolean
)
{
if
(
mFriendsHallMsgBean
?.
gameRule
!=
null
&&
mFriendsHallMsgBean
?.
rankRule
!=
null
)
{
bonusDialog
=
BonusDialog
(
requireActivity
(),
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
R
.
id
.
btn_submit
->
{
if
(
activity
!=
null
&&
!
activity
!!
.
isFinishing
&&
bonusDialog
!=
null
&&
bonusDialog
!!
.
isShowing
)
{
bonusDialog
!!
.
dismiss
()
}
}
}
}
})
bonusDialog
?.
let
{
if
(
flag
)
{
it
.
setTitle
(
"玩法规则"
)
it
.
setContent
(
mFriendsHallMsgBean
?.
gameRule
!!
)
it
.
setBtnStr
(
"知道了"
)
it
.
show
()
}
else
{
it
.
setTitle
(
"收益规则"
)
it
.
setContent
(
mFriendsHallMsgBean
?.
rankRule
!!
)
it
.
setBtnStr
(
"知道了"
)
it
.
show
()
}
}
}
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_question
->
{
R
.
id
.
tv_detail
->
{
// 收益提示
// 亲友团详情
readyGo
(
FriendsActivity
::
class
.
java
)
}
R
.
id
.
tv_friends_directly
->
{
// 直接亲友弹框
hintDialog
(
true
)
}
R
.
id
.
tv_friends_indirect
->
{
// 间接亲友弹框
hintDialog
(
false
)
}
R
.
id
.
btn_invite
->
{
// 邀请好友
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_WEBPAGE
wechatSp
.
title
=
Constant
.
SHARE_TITLE
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
wechatSp
.
imageData
=
ImageUtil
.
drawableToBitmap
(
ContextCompat
.
getDrawable
(
requireContext
(),
R
.
mipmap
.
ic_launcher
))
wechatSp
.
url
=
Constant
.
SHARE_URL
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(
wechat
.
isClientValid
)
{
// 执行图文分享
wechat
.
share
(
wechatSp
)
}
else
{
showToast
(
"请先安装微信"
)
}
}
}
R
.
id
.
tv_right_subtitle
->
{
R
.
id
.
tv_right_subtitle
->
{
// 玩法规则
// 玩法规则
ruleDialog
(
true
)
}
R
.
id
.
iv_question
->
{
// 收益规则
ruleDialog
(
false
)
}
}
R
.
id
.
btn_get_bonus
->
{
R
.
id
.
btn_get_bonus
->
{
// 领取收益
// 领取收益
...
@@ -204,15 +349,17 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
...
@@ -204,15 +349,17 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
}
}
}
}
override
fun
get
FriendsHallMsg
Suc
(
data
:
FriendHallMsgBean
)
{
override
fun
get
ContributionBigLeaders
Suc
(
data
:
FriendHallMsgBean
)
{
srl_my
.
finishRefresh
(
true
)
srl_my
.
finishRefresh
(
true
)
mFriendsHallMsgBean
=
data
allData
.
clear
()
allData
.
addAll
(
data
.
list
)
friendsData
.
clear
()
allAdapter
?.
notifyDataSetChanged
()
friendsData
.
addAll
(
data
.
list
)
}
friendsAdapter
?.
notifyDataSetChanged
()
override
fun
getFriendsHallMsgSuc
(
data
:
FriendHallMsgBean
)
{
srl_my
.
finishRefresh
(
true
)
mFriendsHallMsgBean
=
data
generateData
(
data
)
generateData
(
data
)
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
8304195e
...
@@ -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
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/BonusDialog.kt
0 → 100644
View file @
8304195e
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
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/ElasticScrollView.java
0 → 100644
View file @
8304195e
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
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/FlingBehavior.java
View file @
8304195e
...
@@ -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
;
}
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/MealView.java
View file @
8304195e
...
@@ -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
step
ViewListener
;
private
MealViewListener
meal
ViewListener
;
// 浮云金币
// 浮云金币
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
(
step
ViewListener
!=
null
)
{
if
(
meal
ViewListener
!=
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
:
step
ViewListener
.
clickWater
(
0
,
"-1"
);
meal
ViewListener
.
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
,
19
f
,
2300
);
threeAnimator
=
startOne
(
llThreeWater
,
19
f
,
2300
);
fourAnimator
=
startOne
(
llFourWater
,
17
f
,
2500
);
fourAnimator
=
startOne
(
llFourWater
,
17
f
,
2500
);
fiveAnimator
=
startOne
(
llFiveWater
,
17
f
,
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
set
StepViewListener
(
StepView
.
StepViewListener
step
ViewListener
)
{
public
void
set
MealViewListener
(
MealViewListener
meal
ViewListener
)
{
this
.
stepViewListener
=
step
ViewListener
;
this
.
mealViewListener
=
meal
ViewListener
;
}
}
/**
/**
* 按钮监听
* 按钮监听
*/
*/
public
interface
Step
ViewListener
{
public
interface
Meal
ViewListener
{
/**
/**
* 点击水滴
* 点击水滴
*
*
...
@@ -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
);
}
}
}
}
}
GoodMoney/app/src/main/res/drawable/shape_btn_friends.xml
0 → 100644
View file @
8304195e
<?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
GoodMoney/app/src/main/res/drawable/shape_btn_switch.xml
View file @
8304195e
...
@@ -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=
"
18
0"
android:angle=
"
9
0"
android:endColor=
"#ffff
7f2c
"
android:endColor=
"#ffff
b032
"
android:startColor=
"#ffff
b032
"
android:startColor=
"#ffff
7f2c
"
android:type=
"linear"
android:type=
"linear"
android:useLevel=
"true"
/>
android:useLevel=
"true"
/>
...
...
GoodMoney/app/src/main/res/drawable/shape_dialog_friends.xml
0 → 100644
View file @
8304195e
<?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
GoodMoney/app/src/main/res/drawable/shape_gold_card.xml
View file @
8304195e
<?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=
"1
5
dp"
/>
<corners
android:radius=
"1
0
dp"
/>
</shape>
</shape>
\ No newline at end of file
GoodMoney/app/src/main/res/drawable/shape_tab_friends.xml
0 → 100644
View file @
8304195e
<?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
GoodMoney/app/src/main/res/layout/activity_aboutus.xml
View file @
8304195e
...
@@ -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>
GoodMoney/app/src/main/res/layout/activity_drawcash.xml
View file @
8304195e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<include
layout=
"@layout/header_layout"
/>
<include
layout=
"@layout/header_layout"
/>
<ScrollView
<
com.mints.goodmoney.ui.widgets.Elastic
ScrollView
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.Elastic
ScrollView>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
GoodMoney/app/src/main/res/layout/activity_erase.xml
View file @
8304195e
...
@@ -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>
GoodMoney/app/src/main/res/layout/activity_food_subsidy.xml
View file @
8304195e
...
@@ -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=
"1
2
0dp"
/>
android:layout_marginTop=
"1
0
0dp"
/>
</FrameLayout>
</FrameLayout>
...
...
GoodMoney/app/src/main/res/layout/activity_friends.xml
0 → 100644
View file @
8304195e
<?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
GoodMoney/app/src/main/res/layout/activity_liebao_game.xml
View file @
8304195e
...
@@ -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.Nested
ScrollView
<
com.mints.goodmoney.ui.widgets.Elastic
ScrollView
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.Nested
ScrollView>
</
com.mints.goodmoney.ui.widgets.Elastic
ScrollView>
</LinearLayout>
</LinearLayout>
GoodMoney/app/src/main/res/layout/activity_main.xml
View file @
8304195e
...
@@ -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>
...
...
GoodMoney/app/src/main/res/layout/activity_settings.xml
View file @
8304195e
...
@@ -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
GoodMoney/app/src/main/res/layout/dialog_friends.xml
0 → 100644
View file @
8304195e
<?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
GoodMoney/app/src/main/res/layout/fragment_main_friends.xml
View file @
8304195e
<?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"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
@@ -25,7 +26,8 @@
...
@@ -25,7 +26,8 @@
<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/my_color_gray3"
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"
...
@@ -41,6 +43,7 @@
...
@@ -41,6 +43,7 @@
<LinearLayout
<LinearLayout
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_gray3"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<RelativeLayout
<RelativeLayout
...
@@ -97,12 +100,19 @@
...
@@ -97,12 +100,19 @@
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"15dp"
android:background=
"@drawable/shape_gold_card"
android:elevation=
"1dp"
android:orientation=
"vertical"
android:padding=
"15dp"
>
<TextView
<TextView
android:id=
"@+id/tv_bonus_rate"
android:id=
"@+id/tv_bonus_rate"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"15dp"
android:layout_marginBottom=
"15dp"
android:layout_marginBottom=
"15dp"
android:text=
"@string/dot"
android:text=
"@string/dot"
android:textSize=
"16sp"
/>
android:textSize=
"16sp"
/>
...
@@ -111,8 +121,6 @@
...
@@ -111,8 +121,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginStart=
"20dp"
android:layout_marginEnd=
"20dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<LinearLayout
<LinearLayout
...
@@ -175,7 +183,6 @@
...
@@ -175,7 +183,6 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
<RelativeLayout
...
@@ -218,10 +225,157 @@
...
@@ -218,10 +225,157 @@
</LinearLayout>
</LinearLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"15dp"
android:layout_marginEnd=
"15dp"
android:layout_marginBottom=
"15dp"
android:background=
"@drawable/shape_gold_card"
android:elevation=
"1dp"
android:padding=
"15dp"
>
<TextView
android:id=
"@+id/textView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:text=
"亲友团成员"
android:textColor=
"@color/black"
android:textSize=
"18sp"
app:layout_constraintBottom_toTopOf=
"@+id/line"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_detail"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"详情 >"
app:layout_constraintBottom_toBottomOf=
"@+id/textView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/textView"
/>
<View
android:id=
"@+id/line"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_marginTop=
"15dp"
android:background=
"@color/my_color_gray3"
app:layout_constraintTop_toBottomOf=
"@id/textView"
/>
<LinearLayout
android:id=
"@+id/ll1"
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"15dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
app:layout_constraintEnd_toStartOf=
"@id/ll2"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/line"
tools:layout_editor_absoluteY=
"9dp"
>
<TextView
android:id=
"@+id/friends_sum"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/dot"
android:textColor=
"@color/black"
android:textSize=
"20sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:text=
"总人数"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll2"
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"15dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
app:layout_constraintEnd_toStartOf=
"@id/ll3"
app:layout_constraintStart_toEndOf=
"@id/ll1"
app:layout_constraintTop_toBottomOf=
"@id/line"
tools:layout_editor_absoluteY=
"9dp"
>
<TextView
android:id=
"@+id/friends_directly_sum"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/dot"
android:textColor=
"@color/black"
android:textSize=
"20sp"
/>
<TextView
android:id=
"@+id/tv_friends_directly"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawableEnd=
"@mipmap/ic_question"
android:drawablePadding=
"6dp"
android:text=
"直接亲友"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll3"
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"15dp"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/ll2"
app:layout_constraintTop_toBottomOf=
"@id/line"
tools:layout_editor_absoluteY=
"9dp"
>
<TextView
android:id=
"@+id/friends_indirect_sum"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/dot"
android:textColor=
"@color/black"
android:textSize=
"20sp"
/>
<TextView
android:id=
"@+id/tv_friends_indirect"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:drawableEnd=
"@mipmap/ic_question"
android:drawablePadding=
"6dp"
android:text=
"间接亲友"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_invite"
android:layout_width=
"160dp"
android:layout_height=
"40dp"
android:layout_marginTop=
"15dp"
android:layout_marginBottom=
"6dp"
android:background=
"@drawable/shape_btn_switch"
android:text=
"邀请亲友"
android:textSize=
"16sp"
android:textColor=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ll2"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_height=
"1dp"
android:layout_marginTop=
"20dp"
android:background=
"@color/my_color_gray3"
/>
android:background=
"@color/my_color_gray3"
/>
</LinearLayout>
</LinearLayout>
...
@@ -229,19 +383,21 @@
...
@@ -229,19 +383,21 @@
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
<RelativeLayout
<RelativeLayout
android:elevation=
"2dp"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_tab_friends"
>
<com.androidkun.xtablayout.XTabLayout
<com.androidkun.xtablayout.XTabLayout
android:id=
"@+id/tab_friends"
android:id=
"@+id/tab_friends"
android:layout_width=
"
220dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
a
pp:xTabDisplayNum=
"2
"
a
ndroid:paddingStart=
"10dp
"
app:xTabIndicatorColor=
"#FB560C"
app:xTabIndicatorColor=
"#FB560C"
app:xTabIndicatorHeight=
"3dp"
app:xTabIndicatorHeight=
"3dp"
app:xTabIndicatorWidth=
"3
0
dp"
app:xTabIndicatorWidth=
"3
6
dp"
app:xTabMode=
"fixed"
app:xTabMode=
"fixed"
app:xTabSelectedTextColor=
"#FB560C"
app:xTabSelectedTextColor=
"#FB560C"
app:xTabSelectedTextSize=
"18sp"
app:xTabSelectedTextSize=
"18sp"
...
@@ -253,16 +409,18 @@
...
@@ -253,16 +409,18 @@
android:layout_width=
"15dp"
android:layout_width=
"15dp"
android:layout_height=
"15dp"
android:layout_height=
"15dp"
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:layout_marginStart=
"5dp"
android:layout_toEndOf=
"@id/tab_friends"
android:layout_toEndOf=
"@id/tab_friends"
android:src=
"@mipmap/ic_question"
/>
android:src=
"@mipmap/ic_question"
/>
</RelativeLayout>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_height=
"1dp"
android:layout_alignParentBottom=
"true"
android:background=
"@color/my_color_gray3"
/>
android:background=
"@color/my_color_gray3"
/>
</RelativeLayout>
</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
<androidx.viewpager.widget.ViewPager
...
...
GoodMoney/app/src/main/res/layout/fragment_main_my.xml
View file @
8304195e
...
@@ -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"
/>
...
...
GoodMoney/app/src/main/res/layout/item_fragment_main_my_title.xml
View file @
8304195e
...
@@ -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
.5
dip"
android:elevation=
"1dip"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:paddingStart=
"15dp"
android:paddingStart=
"15dp"
...
...
GoodMoney/app/src/main/res/layout/view_meal.xml
View file @
8304195e
<?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_margin
Left=
"30
dp"
android:layout_margin
Start=
"35
dp"
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=
"
1
0dp"
android:layout_marginTop=
"
6
0dp"
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
GoodMoney/app/src/main/res/mipmap-xhdpi/bg_eat.png
0 → 100644
View file @
8304195e
524 KB
GoodMoney/app/src/main/res/values/colors.xml
View file @
8304195e
...
@@ -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
GoodMoney/app/src/main/res/values/strings.xml
View file @
8304195e
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment