Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
6cfd79f2
Commit
6cfd79f2
authored
Nov 20, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加首页角标查询
parent
2a88c3e0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
7 deletions
+80
-7
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+39
-5
IUnitySendMessageCallback.kt
app/src/main/java/com/ym/game/IUnitySendMessageCallback.kt
+6
-0
PuzzleDialog.kt
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
+5
-2
icon_activity_desc.png
app/src/main/res/drawable-xhdpi/icon_activity_desc.png
+0
-0
AddCardEntity.kt
library/src/main/java/com/ym/library/module/AddCardEntity.kt
+6
-0
HomeListEntity.kt
...ary/src/main/java/com/ym/library/module/HomeListEntity.kt
+11
-0
IGameApi.kt
library/src/main/java/com/ym/library/net/IGameApi.kt
+11
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+2
-0
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
6cfd79f2
...
@@ -208,7 +208,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -208,7 +208,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
MainLooper
.
get
()
?.
post
(
Runnable
{
MainLooper
.
get
()
?.
post
(
Runnable
{
if
(
Utils
.
isFastClick2
())
{
if
(
Utils
.
isFastClick2
())
{
//CashExchangeDialog.showCashExchage(this, this)
//CashExchangeDialog.showCashExchage(this, this)
PuzzleDialog
.
showPuzzleDialog
(
this
)
PuzzleDialog
.
showPuzzleDialog
(
this
,
this
)
}
}
})
})
}
}
...
@@ -650,12 +650,13 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -650,12 +650,13 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//订单数据
//订单数据
fun
getOrderData
(
callback
:
IUnitySendMessageCallback
?)
{
fun
getOrderData
(
callback
:
IUnitySendMessageCallback
?)
{
GameApiClient
.
gameApi
.
get
OrderData
().
compose
(
RxSchedulers
.
observableIO2Main
())
GameApiClient
.
gameApi
.
get
HomeWList
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
OrderListEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
List
<
HomeListEntity
>
>()
{
override
fun
onSuccess
(
result
:
OrderListEntity
?)
{
override
fun
onSuccess
(
result
:
List
<
HomeListEntity
>
?)
{
mOrderString
=
Utils
.
obj2Str
(
result
)
mOrderString
=
Utils
.
obj2Str
(
result
)
Log
.
d
(
"wxw"
,
"订单数据"
+
Utils
.
obj2Str
(
result
))
Log
.
d
(
"wxw"
,
"订单数据"
+
Utils
.
obj2Str
(
result
))
callback
?.
onOrderListSuccess
(
true
,
Utils
.
obj2Str
(
result
))
callback
?.
onOrderListSuccess
(
true
,
"{\"homeList\":"
+
Utils
.
obj2Str
(
result
)
+
"}"
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
...
@@ -899,7 +900,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -899,7 +900,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
override
fun
onCloseViewSuccess
(
isSuccess
:
Boolean
)
{
override
fun
onCloseViewSuccess
(
isSuccess
:
Boolean
)
{
//关闭view
//关闭view
Log
.
e
(
"MXL"
,
"CLOSE"
)
callUnity
(
"TitleView"
,
"getHomeInfo"
,
""
)
callUnity
(
"TitleView"
,
"getHomeInfo"
,
""
)
callUnity
(
"DailyWelfarm"
,
"getCardList"
,
""
)
}
}
fun
getUserInfo
()
{
fun
getUserInfo
()
{
...
@@ -963,5 +966,36 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -963,5 +966,36 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
}
}
//卡片收集
fun
addCard
(
callback
:
IUnitySendMessageCallback
?)
{
GameApiClient
.
gameApi
.
addCard
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
AddCardEntity
>()
{
override
fun
onSuccess
(
result
:
AddCardEntity
?)
{
mOrderString
=
Utils
.
obj2Str
(
result
)
Log
.
d
(
"wxw"
,
"收集卡片"
+
Utils
.
obj2Str
(
result
))
callback
?.
onAddCardSuccess
(
true
,
Utils
.
obj2Str
(
result
)
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
Log
.
d
(
"wxw"
,
"收集卡片 error"
)
callback
?.
onAddCardSuccess
(
false
,
errorMsg
+
""
)
}
})
}
//查询卡片角标
fun
getCardList
(
callback
:
IUnitySendMessageCallback
?)
{
GameApiClient
.
gameApi
.
getCollectCard
().
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
mOrderString
=
Utils
.
obj2Str
(
result
)
Log
.
d
(
"wxw"
,
"查询卡片角标"
+
Utils
.
obj2Str
(
result
))
callback
?.
onGetCardList
(
true
,
Utils
.
obj2Str
(
result
)
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
Log
.
d
(
"wxw"
,
"查询卡片角标 error"
)
callback
?.
onGetCardList
(
false
,
errorMsg
+
""
)
}
})
}
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/IUnitySendMessageCallback.kt
View file @
6cfd79f2
...
@@ -50,4 +50,10 @@ interface IUnitySendMessageCallback {
...
@@ -50,4 +50,10 @@ interface IUnitySendMessageCallback {
//判断是否云朵加速
//判断是否云朵加速
fun
onGetCheckCloud
(
isSuccess
:
Boolean
,
result
:
String
)
fun
onGetCheckCloud
(
isSuccess
:
Boolean
,
result
:
String
)
//收集卡片
fun
onAddCardSuccess
(
isSuccess
:
Boolean
,
result
:
String
)
//查询碎片角标
fun
onGetCardList
(
isSuccess
:
Boolean
,
result
:
String
)
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
View file @
6cfd79f2
...
@@ -23,6 +23,7 @@ import androidx.recyclerview.widget.RecyclerView
...
@@ -23,6 +23,7 @@ import androidx.recyclerview.widget.RecyclerView
import
com.airbnb.lottie.LottieAnimationView
import
com.airbnb.lottie.LottieAnimationView
import
com.ym.ddcy.R
import
com.ym.ddcy.R
import
com.ym.game.contract.PuzzleContract
import
com.ym.game.contract.PuzzleContract
import
com.ym.game.listener.IDialogViewCloseCallback
import
com.ym.game.presenter.PuzzlePresenter
import
com.ym.game.presenter.PuzzlePresenter
import
com.ym.game.utils.CenterDialog
import
com.ym.game.utils.CenterDialog
import
com.ym.library.module.PuzzleEntity
import
com.ym.library.module.PuzzleEntity
...
@@ -51,7 +52,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
...
@@ -51,7 +52,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
var
anim_mask_layout
:
ViewGroup
?
=
null
var
anim_mask_layout
:
ViewGroup
?
=
null
//展示拼图窗口
//展示拼图窗口
fun
showPuzzleDialog
(
context
:
Context
?)
{
fun
showPuzzleDialog
(
context
:
Context
?
,
mListener
:
IDialogViewCloseCallback
)
{
if
(
context
==
null
)
{
if
(
context
==
null
)
{
return
return
}
}
...
@@ -85,7 +86,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
...
@@ -85,7 +86,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_dialog_close
).
setOnClickListener
{
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
iv_dialog_close
).
setOnClickListener
{
mDialog
?.
dismiss
()
mDialog
?.
dismiss
()
//
mListener.onCloseViewSuccess(true);
mListener
.
onCloseViewSuccess
(
true
);
// RxBusUtil.getDefault().unregister(this)
// RxBusUtil.getDefault().unregister(this)
}
}
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
id_img_one_click_puzzle
).
setOnClickListener
{
mDialogView
?.
findViewById
<
ImageView
>(
R
.
id
.
id_img_one_click_puzzle
).
setOnClickListener
{
...
@@ -303,4 +304,6 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
...
@@ -303,4 +304,6 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
}
}
}
}
\ No newline at end of file
app/src/main/res/drawable-xhdpi/icon_activity_desc.png
View replaced file @
2a88c3e0
View file @
6cfd79f2
53.1 KB
|
W:
|
H:
30 KB
|
W:
|
H:
2-up
Swipe
Onion skin
library/src/main/java/com/ym/library/module/AddCardEntity.kt
0 → 100644
View file @
6cfd79f2
package
com.ym.library.module
class
AddCardEntity
{
var
cardIndex
:
Int
=
0
var
totalCards
:
Int
=
0
}
\ No newline at end of file
library/src/main/java/com/ym/library/module/HomeListEntity.kt
0 → 100644
View file @
6cfd79f2
package
com.ym.library.module
class
HomeListEntity
{
var
id
:
Int
=
0
var
ownNum
:
Int
=
0
var
targetNum
:
Int
=
0
var
name
:
String
=
""
var
imgUrl
:
String
=
""
var
cashStr
:
String
=
""
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/IGameApi.kt
View file @
6cfd79f2
...
@@ -316,4 +316,15 @@ interface IGameApi {
...
@@ -316,4 +316,15 @@ interface IGameApi {
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_OPEN
)
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_OPEN
)
fun
openCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
fun
openCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
// 收金币获得卡片
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_ADD_CARD
)
fun
addCard
():
Observable
<
Response
<
AddCardEntity
?
>>
/**
* 首页列表数据
* @param
* @paramq
* @return
*/
@GET
(
NetConfig
.
Game
.
URL_GAME_HOME_WD_LIST
)
fun
getHomeWList
():
Observable
<
Response
<
List
<
HomeListEntity
>>>
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
6cfd79f2
...
@@ -266,5 +266,7 @@ public class NetConfig {
...
@@ -266,5 +266,7 @@ public class NetConfig {
public
static
final
String
URL_COLLECT_CARD_AUTOMATIC
=
"app/v1/collect-card/automatic"
;
//已有的卡片自动拼接到宝箱上
public
static
final
String
URL_COLLECT_CARD_AUTOMATIC
=
"app/v1/collect-card/automatic"
;
//已有的卡片自动拼接到宝箱上
public
static
final
String
URL_COLLECT_CARD_OPEN
=
"app/v1/collect-card/open"
;
//开宝箱
public
static
final
String
URL_COLLECT_CARD_OPEN
=
"app/v1/collect-card/open"
;
//开宝箱
public
static
final
String
URL_COLLECT_CARD_ADV_PUT_OR_ADD
=
"app/v1/collect-card/advPutOrAdd"
;
//看广告单个图片获取或者拼图
public
static
final
String
URL_COLLECT_CARD_ADV_PUT_OR_ADD
=
"app/v1/collect-card/advPutOrAdd"
;
//看广告单个图片获取或者拼图
public
static
final
String
URL_COLLECT_CARD_ADD_CARD
=
"app/v1/collect-card/addCard"
;
//收金币获得卡片
public
static
final
String
URL_GAME_HOME_WD_LIST
=
"app/v1/game/ddcy/home_wd_list"
;
//首页展示果实列表
}
}
}
}
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