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
03d7cfb7
Commit
03d7cfb7
authored
Nov 19, 2020
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改adpater 添加碎片接口,修复崩溃
parent
6d92ac4a
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
109 additions
and
70 deletions
+109
-70
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+0
-1
SplashActivity.kt
app/src/main/java/com/ym/game/activity/SplashActivity.kt
+10
-0
PuzzleBottomAdapter.kt
app/src/main/java/com/ym/game/adapter/PuzzleBottomAdapter.kt
+1
-1
PuzzleTopAdapter.kt
app/src/main/java/com/ym/game/adapter/PuzzleTopAdapter.kt
+1
-1
PuzzleContract.kt
app/src/main/java/com/ym/game/contract/PuzzleContract.kt
+1
-1
PuzzlePresenter.kt
app/src/main/java/com/ym/game/presenter/PuzzlePresenter.kt
+68
-63
PuzzleDialog.kt
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
+1
-1
icon_exchage_cash_bg.png
app/src/main/res/mipmap-xhdpi/icon_exchage_cash_bg.png
+0
-0
PuzzleEntity.kt
library/src/main/java/com/ym/library/module/PuzzleEntity.kt
+1
-1
IGameApi.kt
library/src/main/java/com/ym/library/net/IGameApi.kt
+20
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+6
-1
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
03d7cfb7
...
...
@@ -216,7 +216,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
* 兑换现金
*/
fun
cashExchange
()
{
Log
.
d
(
"wxw"
,
"兑换现金"
)
MainLooper
.
get
()
?.
post
(
Runnable
{
if
(
Utils
.
isFastClick2
())
{
CashExchangeDialog
.
showCashExchage
(
this
,
this
)
...
...
app/src/main/java/com/ym/game/activity/SplashActivity.kt
View file @
03d7cfb7
package
com.ym.game.activity
import
android.app.Activity
import
android.content.Intent
import
android.util.Log
import
android.view.View
...
...
@@ -21,6 +22,7 @@ import com.ym.game.utils.CenterDialog
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.*
import
com.ym.library.utils.*
import
com.ym.modulecommon.base.BaseActivity
class
SplashActivity
:
BaseActivity
(),
SplashContract
.
View
{
...
...
@@ -61,6 +63,10 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
override
fun
className
():
String
{
return
SplashActivity
::
class
.
java
.
simpleName
}
override
fun
jumpPage
()
{
if
(!
SettingPreference
.
getIsShowGuide
())
{
EventUtils
.
onEvent
(
"SplashActivity_loadSplash"
)
...
...
@@ -162,6 +168,10 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
}
override
fun
activity
():
Activity
{
return
this
}
override
fun
getDestroyed
():
Boolean
{
return
false
}
...
...
app/src/main/java/com/ym/game/adapter/PuzzleBottomAdapter.kt
View file @
03d7cfb7
...
...
@@ -6,7 +6,7 @@ import android.view.ViewGroup
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.ym.ddcy.R
import
com.ym.
game
.module.PuzzleEntity
import
com.ym.
library
.module.PuzzleEntity
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.base.BaseRecyclerAdapter
import
com.ym.task.module.listener.OnRecycleItemClickListener
...
...
app/src/main/java/com/ym/game/adapter/PuzzleTopAdapter.kt
View file @
03d7cfb7
...
...
@@ -6,7 +6,7 @@ import android.view.ViewGroup
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.ym.ddcy.R
import
com.ym.
game
.module.PuzzleEntity
import
com.ym.
library
.module.PuzzleEntity
import
com.ym.modulecommon.AppliContext
import
com.ym.modulecommon.base.BaseRecyclerAdapter
...
...
app/src/main/java/com/ym/game/contract/PuzzleContract.kt
View file @
03d7cfb7
package
com.ym.game.contract
import
com.ym.
game
.module.PuzzleEntity
import
com.ym.
library
.module.PuzzleEntity
class
PuzzleContract
{
...
...
app/src/main/java/com/ym/game/presenter/PuzzlePresenter.kt
View file @
03d7cfb7
...
...
@@ -5,7 +5,9 @@ import android.app.Activity
import
android.util.Log
import
android.view.View
import
com.ym.game.contract.PuzzleContract
import
com.ym.library.module.PuzzleEntity
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
...
...
@@ -18,85 +20,88 @@ class PuzzlePresenter : PuzzleContract.Presenter {
}
// 获取卡片列表
override
fun
getPuzzleData
()
{
// AppClient.app
Api.getCollectCard().compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
//
override fun onSuccess(result: PuzzleEntity?) {
//
if (result != null) {
//
mView?.PutPuzzDataResult(result)
//
}
//
}
//
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//
})
GameApiClient
.
game
Api
.
getCollectCard
().
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
?.
PutPuzzDataResult
(
result
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
//已有宝箱卡片拼图
override
fun
putPuzzleData
(
index
:
Int
)
{
// AppClient.app
Api.getCollectCardPut(index).compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
//
override fun onSuccess(result: PuzzleEntity?) {
//
if (result != null) {
//
mView.cardsFlyUp(result,index)
//
//
}
//
}
//
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//
})
GameApiClient
.
game
Api
.
getCollectCardPut
(
index
).
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
.
cardsFlyUp
(
result
,
index
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
//看广告单个图片获取或者拼图
override
fun
noputPuzzleData
(
index
:
Int
)
{
// AppClient.app
Api.getCollectCardPutorAdd(index).compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
//
override fun onSuccess(result: PuzzleEntity?) {
//
if (result != null) {
//
mView?.PutPuzzDataResult(result)
//
}
//
}
//
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//
})
GameApiClient
.
game
Api
.
getCollectCardPutorAdd
(
index
).
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
?.
PutPuzzDataResult
(
result
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
//看广告一键拼图
override
fun
onecleanPuzzle
()
{
// AppClient.appApi.getCollectCardAdv().compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
// override fun onSuccess(result: PuzzleEntity?) {
// if (result != null) {
// mView?.PutPuzzDataResult(result)
//
// }
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
// })
GameApiClient
.
gameApi
.
getCollectCardAdv
().
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
?.
PutPuzzDataResult
(
result
)
if
(
result
.
advert
==
1
){
//去看广告
mView
?.
getPuzzlelookAd
(
result
.
diffCardsNum
)
}
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
//一键拼图
override
fun
automatic
()
{
// AppClient.app
Api.getCollectCardAutoMatic().compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
//
override fun onSuccess(result: PuzzleEntity?) {
//
if (result != null) {
//
mView?.PutPuzzDataResult(result)
//
Log.e("MXL",""+result.isWin)
//
if(result.advert==1){
//
//去看广告
//
mView?.getPuzzlelookAd(result.diffCardsNum)
//
}
//
//
}
//
}
//
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//
})
GameApiClient
.
game
Api
.
getCollectCardAutoMatic
().
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
?.
PutPuzzDataResult
(
result
)
Log
.
e
(
"MXL"
,
""
+
result
.
isWin
)
if
(
result
.
advert
==
1
){
//去看广告
mView
?.
getPuzzlelookAd
(
result
.
diffCardsNum
)
}
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
//开宝箱
override
fun
openBox
()
{
// AppClient.app
Api.openCard().compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<PuzzleEntity?>() {
//
override fun onSuccess(result: PuzzleEntity?) {
//
if (result != null) {
//
mView?.PutPuzzDataResult(result)
//
//
}
//
}
//
//
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
//
})
GameApiClient
.
game
Api
.
openCard
().
compose
(
RxSchedulers
.
observableIO2Main
()).
subscribe
(
object
:
BaseObserver
<
PuzzleEntity
?>()
{
override
fun
onSuccess
(
result
:
PuzzleEntity
?)
{
if
(
result
!=
null
)
{
mView
?.
PutPuzzDataResult
(
result
)
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
...
...
app/src/main/java/com/ym/game/view/PuzzleDialog.kt
View file @
03d7cfb7
...
...
@@ -23,9 +23,9 @@ import androidx.recyclerview.widget.RecyclerView
import
com.airbnb.lottie.LottieAnimationView
import
com.ym.ddcy.R
import
com.ym.game.contract.PuzzleContract
import
com.ym.game.module.PuzzleEntity
import
com.ym.game.presenter.PuzzlePresenter
import
com.ym.game.utils.CenterDialog
import
com.ym.library.module.PuzzleEntity
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.utils.Utils
import
com.ym.modulecommon.AppliContext
...
...
app/src/main/res/mipmap-xhdpi/icon_exchage_cash_bg.png
View replaced file @
6d92ac4a
View file @
03d7cfb7
85.1 KB
|
W:
|
H:
69.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/java/com/ym/game
/module/PuzzleEntity.kt
→
library/src/main/java/com/ym/library
/module/PuzzleEntity.kt
View file @
03d7cfb7
package
com.ym.
game
.module
package
com.ym.
library
.module
class
PuzzleEntity
{
var
isWin
:
Int
=
0
...
...
library/src/main/java/com/ym/library/net/IGameApi.kt
View file @
03d7cfb7
...
...
@@ -295,5 +295,25 @@ interface IGameApi {
@POST
(
NetConfig
.
Game
.
URL_GAME_TASK_CASH
)
fun
getTaskCash
():
Observable
<
Response
<
NewsEntity
>>
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD
)
fun
getCollectCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_PUT
)
fun
getCollectCardPut
(
@Query
(
"index"
)
index
:
Int
):
Observable
<
Response
<
PuzzleEntity
?
>>
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_ADV_PUT_OR_ADD
)
fun
getCollectCardPutorAdd
(
@Query
(
"index"
)
index
:
Int
):
Observable
<
Response
<
PuzzleEntity
?
>>
// 看广告一键拼图
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_ADV
)
fun
getCollectCardAdv
():
Observable
<
Response
<
PuzzleEntity
?
>>
// 一键拼图
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_AUTOMATIC
)
fun
getCollectCardAutoMatic
():
Observable
<
Response
<
PuzzleEntity
?
>>
// 开宝箱
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD_OPEN
)
fun
openCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
03d7cfb7
...
...
@@ -260,6 +260,11 @@ public class NetConfig {
public
static
final
String
URL_GAME_TASK_PROCESS
=
"app/v1/game/task_process"
;
//福利中心钻石进度
public
static
final
String
URL_GAME_WELFARE_VIDEO_REPORT
=
"app/v1/game/welfare_video_report"
;
//福利中心看视频任务
public
static
final
String
URL_GAME_TASK_CASH
=
"app/v1/game/task_cash"
;
//福利中心提现
public
static
final
String
URL_COLLECT_CARD
=
"app/v1/collect-card/list"
;
//宝箱卡片列表
public
static
final
String
URL_COLLECT_CARD_PUT
=
"app/v1/collect-card/put"
;
//宝箱卡片拼图
public
static
final
String
URL_COLLECT_CARD_ADV
=
"app/v1/collect-card/adv"
;
//看广告一键拼图
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_ADV_PUT_OR_ADD
=
"app/v1/collect-card/advPutOrAdd"
;
//看广告单个图片获取或者拼图
}
}
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