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
52aaa9c8
Commit
52aaa9c8
authored
May 28, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
33556277
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
ShaiziPresenter.java
...a/com/mints/goodmoney/mvp/presenters/ShaiziPresenter.java
+1
-0
ShaiziView.java
...c/main/java/com/mints/goodmoney/mvp/views/ShaiziView.java
+2
-0
ShaiziActivity.kt
...n/java/com/mints/goodmoney/ui/activitys/ShaiziActivity.kt
+14
-8
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/ShaiziPresenter.java
View file @
52aaa9c8
...
...
@@ -167,6 +167,7 @@ public class ShaiziPresenter extends BasePresenter<ShaiziView> {
int
code
=
baseResponse
.
getStatus
();
switch
(
code
)
{
case
200
:
//成功
view
.
drawCashSuc
();
break
;
default
:
view
.
showToast
(
baseResponse
.
getMessage
());
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/ShaiziView.java
View file @
52aaa9c8
...
...
@@ -13,4 +13,6 @@ public interface ShaiziView extends BaseView {
void
getShaiziMsgHomefail
();
void
drawCashSuc
();
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/ShaiziActivity.kt
View file @
52aaa9c8
...
...
@@ -23,7 +23,8 @@ class ShaiziActivity : BaseActivity(), View.OnClickListener, ShaiziView {
private
var
moneys
:
Double
=
0.0
private
val
shaiziPresenter
by
lazy
{
ShaiziPresenter
()
}
private
var
starttime
:
Long
?
=
null
private
var
shaiziFlag
:
Int
=
0
// 骰子大小 0-小 1-大
private
var
shaiziFlag
:
Int
=
0
// 骰子大小 0-小 1-
private
var
dialog
:
Dialog
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_shaizi
...
...
@@ -88,10 +89,10 @@ class ShaiziActivity : BaseActivity(), View.OnClickListener, ShaiziView {
6
->
Glide
.
with
(
context
).
load
(
R
.
mipmap
.
iv_tx_sz6
).
into
(
iv_saizi
);
}
if
(
success
==
1
)
{
showresultDialog
(
"恭喜您!"
,
"本次开奖结果为小,您的收益已翻倍!"
,
true
)
if
(
success
==
1
)
{
showresultDialog
(
"恭喜您!"
,
"本次开奖结果为小,您的收益已翻倍!"
,
true
)
}
else
{
showresultDialog
(
"很遗憾!"
,
"本次开奖结果为大,您未中奖,金币已收回。"
,
false
)
showresultDialog
(
"很遗憾!"
,
"本次开奖结果为大,您未中奖,金币已收回。"
,
false
)
}
// if (shaiziFlag == 1) {
// if (count >= 4) {
...
...
@@ -117,13 +118,13 @@ class ShaiziActivity : BaseActivity(), View.OnClickListener, ShaiziView {
*/
private
fun
showresultDialog
(
s
:
String
,
s1
:
String
,
b
:
Boolean
)
{
DialogUtils
.
showWinDialog
(
this
@ShaiziActivity
,
s
,
s1
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
override
fun
onClick
(
my
dialog
:
Dialog
?,
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
tv_know
->
{
//向服务器传递 提现金额 骰子Id
if
(
b
)
shaiziPresenter
.
saveTerminalInfo
(
moneys
,
diceId
!!
)
dialog
?.
dismiss
()
finish
()
dialog
=
mydialog
}
}
}
...
...
@@ -163,7 +164,7 @@ class ShaiziActivity : BaseActivity(), View.OnClickListener, ShaiziView {
diceId
=
data
.
diceId
//执行延时,旋转骰子,显示结果
startShaizi
(
System
.
currentTimeMillis
(),
data
.
success
)
startShaizi
(
System
.
currentTimeMillis
(),
data
.
success
)
}
/**
...
...
@@ -188,6 +189,11 @@ class ShaiziActivity : BaseActivity(), View.OnClickListener, ShaiziView {
}
}
override
fun
drawCashSuc
()
{
dialog
?.
dismiss
()
finish
()
}
}
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