Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
3d71c3e9
Commit
3d71c3e9
authored
Aug 31, 2020
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak
parent
b1d21069
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
46 deletions
+36
-46
Classes/gframe/game.cpp
Classes/gframe/game.cpp
+10
-10
gradle.properties
gradle.properties
+8
-12
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
.../java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
+0
-5
mobile/src/main/java/cn/garymb/ygomobile/utils/PayUtils.java
mobile/src/main/java/cn/garymb/ygomobile/utils/PayUtils.java
+17
-18
No files found.
Classes/gframe/game.cpp
View file @
3d71c3e9
...
@@ -576,7 +576,7 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -576,7 +576,7 @@ bool Game::Initialize(ANDROID_APP app) {
ChangeToIGUIImageWindow
(
wMessage
,
bgMessage
,
imageManager
.
tDialog_L
);
ChangeToIGUIImageWindow
(
wMessage
,
bgMessage
,
imageManager
.
tDialog_L
);
stMessage
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
390
*
xScale
,
100
*
yScale
),
false
,
true
,
wMessage
,
-
1
,
false
);
stMessage
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
390
*
xScale
,
100
*
yScale
),
false
,
true
,
wMessage
,
-
1
,
false
);
stMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
stMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
btnMsgOK
=
env
->
addButton
(
rect
<
s32
>
(
130
*
xScale
,
1
15
*
yScale
,
260
*
xScale
,
165
*
yScale
),
wMessage
,
BUTTON_MSG_OK
,
dataManager
.
GetSysString
(
1211
));
btnMsgOK
=
env
->
addButton
(
rect
<
s32
>
(
130
*
xScale
,
1
20
*
yScale
,
260
*
xScale
,
170
*
yScale
),
wMessage
,
BUTTON_MSG_OK
,
dataManager
.
GetSysString
(
1211
));
ChangeToIGUIImageButton
(
btnMsgOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnMsgOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//auto fade message (370)
//auto fade message (370)
wACMessage
=
env
->
addWindow
(
rect
<
s32
>
(
490
*
xScale
,
240
*
yScale
,
840
*
xScale
,
300
*
yScale
),
false
,
L""
);
wACMessage
=
env
->
addWindow
(
rect
<
s32
>
(
490
*
xScale
,
240
*
yScale
,
840
*
xScale
,
300
*
yScale
),
false
,
L""
);
...
@@ -593,9 +593,9 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -593,9 +593,9 @@ bool Game::Initialize(ANDROID_APP app) {
ChangeToIGUIImageWindow
(
wQuery
,
bgQuery
,
imageManager
.
tDialog_L
);
ChangeToIGUIImageWindow
(
wQuery
,
bgQuery
,
imageManager
.
tDialog_L
);
stQMessage
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
390
*
xScale
,
100
*
yScale
),
false
,
true
,
wQuery
,
-
1
,
false
);
stQMessage
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
390
*
xScale
,
100
*
yScale
),
false
,
true
,
wQuery
,
-
1
,
false
);
stQMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
stQMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
btnYes
=
env
->
addButton
(
rect
<
s32
>
(
60
*
xScale
,
1
3
0
*
yScale
,
170
*
xScale
,
170
*
yScale
),
wQuery
,
BUTTON_YES
,
dataManager
.
GetSysString
(
1213
));
btnYes
=
env
->
addButton
(
rect
<
s32
>
(
60
*
xScale
,
1
2
0
*
yScale
,
170
*
xScale
,
170
*
yScale
),
wQuery
,
BUTTON_YES
,
dataManager
.
GetSysString
(
1213
));
ChangeToIGUIImageButton
(
btnYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnNo
=
env
->
addButton
(
rect
<
s32
>
(
200
*
xScale
,
1
3
0
*
yScale
,
310
*
xScale
,
170
*
yScale
),
wQuery
,
BUTTON_NO
,
dataManager
.
GetSysString
(
1214
));
btnNo
=
env
->
addButton
(
rect
<
s32
>
(
200
*
xScale
,
1
2
0
*
yScale
,
310
*
xScale
,
170
*
yScale
),
wQuery
,
BUTTON_NO
,
dataManager
.
GetSysString
(
1214
));
ChangeToIGUIImageButton
(
btnNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//surrender yes/no (310)
//surrender yes/no (310)
wSurrender
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
dataManager
.
GetSysString
(
560
));
wSurrender
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
dataManager
.
GetSysString
(
560
));
...
@@ -604,9 +604,9 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -604,9 +604,9 @@ bool Game::Initialize(ANDROID_APP app) {
ChangeToIGUIImageWindow
(
wSurrender
,
bgSurrender
,
imageManager
.
tDialog_L
);
ChangeToIGUIImageWindow
(
wSurrender
,
bgSurrender
,
imageManager
.
tDialog_L
);
stSurrenderMessage
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1359
),
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
350
*
xScale
,
100
*
yScale
),
false
,
true
,
wSurrender
,
-
1
,
false
);
stSurrenderMessage
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1359
),
rect
<
s32
>
(
20
*
xScale
,
20
*
yScale
,
350
*
xScale
,
100
*
yScale
),
false
,
true
,
wSurrender
,
-
1
,
false
);
stSurrenderMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
stSurrenderMessage
->
setTextAlignment
(
irr
::
gui
::
EGUIA_UPPERLEFT
,
irr
::
gui
::
EGUIA_CENTER
);
btnSurrenderYes
=
env
->
addButton
(
rect
<
s32
>
(
60
*
xScale
,
1
3
0
*
yScale
,
170
*
xScale
,
170
*
yScale
),
wSurrender
,
BUTTON_SURRENDER_YES
,
dataManager
.
GetSysString
(
1213
));
btnSurrenderYes
=
env
->
addButton
(
rect
<
s32
>
(
60
*
xScale
,
1
2
0
*
yScale
,
170
*
xScale
,
170
*
yScale
),
wSurrender
,
BUTTON_SURRENDER_YES
,
dataManager
.
GetSysString
(
1213
));
ChangeToIGUIImageButton
(
btnSurrenderYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnSurrenderYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnSurrenderNo
=
env
->
addButton
(
rect
<
s32
>
(
200
*
xScale
,
1
3
0
*
yScale
,
310
*
xScale
,
170
*
yScale
),
wSurrender
,
BUTTON_SURRENDER_NO
,
dataManager
.
GetSysString
(
1214
));
btnSurrenderNo
=
env
->
addButton
(
rect
<
s32
>
(
200
*
xScale
,
1
2
0
*
yScale
,
310
*
xScale
,
170
*
yScale
),
wSurrender
,
BUTTON_SURRENDER_NO
,
dataManager
.
GetSysString
(
1214
));
ChangeToIGUIImageButton
(
btnSurrenderNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnSurrenderNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//options (350)
//options (350)
wOptions
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
L""
);
wOptions
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
L""
);
...
@@ -701,7 +701,7 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -701,7 +701,7 @@ bool Game::Initialize(ANDROID_APP app) {
ChangeToIGUIImageButton
(
btnANNumber
[
i
],
imageManager
.
tButton_C
,
imageManager
.
tButton_C_pressed
,
titleFont
);
ChangeToIGUIImageButton
(
btnANNumber
[
i
],
imageManager
.
tButton_C
,
imageManager
.
tButton_C_pressed
,
titleFont
);
btnANNumber
[
i
]
->
setIsPushButton
(
true
);
btnANNumber
[
i
]
->
setIsPushButton
(
true
);
}
}
btnANNumberOK
=
env
->
addButton
(
rect
<
s32
>
(
95
*
xScale
,
3
7
0
*
yScale
,
205
*
xScale
,
410
*
yScale
),
wANNumber
,
BUTTON_ANNUMBER_OK
,
dataManager
.
GetSysString
(
1211
));
btnANNumberOK
=
env
->
addButton
(
rect
<
s32
>
(
95
*
xScale
,
3
6
0
*
yScale
,
205
*
xScale
,
410
*
yScale
),
wANNumber
,
BUTTON_ANNUMBER_OK
,
dataManager
.
GetSysString
(
1211
));
ChangeToIGUIImageButton
(
btnANNumberOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnANNumberOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//announce card
//announce card
wANCard
=
env
->
addWindow
(
rect
<
s32
>
(
500
*
xScale
,
50
*
yScale
,
800
*
xScale
,
550
*
yScale
),
false
,
L""
);
wANCard
=
env
->
addWindow
(
rect
<
s32
>
(
500
*
xScale
,
50
*
yScale
,
800
*
xScale
,
550
*
yScale
),
false
,
L""
);
...
@@ -712,8 +712,8 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -712,8 +712,8 @@ bool Game::Initialize(ANDROID_APP app) {
stANCard
->
setTextAlignment
(
EGUIA_CENTER
,
EGUIA_CENTER
);
stANCard
->
setTextAlignment
(
EGUIA_CENTER
,
EGUIA_CENTER
);
ebANCard
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
10
*
xScale
,
50
*
yScale
,
290
*
xScale
,
90
*
yScale
),
wANCard
,
EDITBOX_ANCARD
);
ebANCard
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
10
*
xScale
,
50
*
yScale
,
290
*
xScale
,
90
*
yScale
),
wANCard
,
EDITBOX_ANCARD
);
ebANCard
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
ebANCard
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
lstANCard
=
env
->
addListBox
(
rect
<
s32
>
(
10
*
xScale
,
100
*
yScale
,
290
*
xScale
,
4
4
0
*
yScale
),
wANCard
,
LISTBOX_ANCARD
,
true
);
lstANCard
=
env
->
addListBox
(
rect
<
s32
>
(
10
*
xScale
,
100
*
yScale
,
290
*
xScale
,
4
3
0
*
yScale
),
wANCard
,
LISTBOX_ANCARD
,
true
);
btnANCardOK
=
env
->
addButton
(
rect
<
s32
>
(
95
*
xScale
,
4
5
0
*
yScale
,
205
*
xScale
,
490
*
yScale
),
wANCard
,
BUTTON_ANCARD_OK
,
dataManager
.
GetSysString
(
1211
));
btnANCardOK
=
env
->
addButton
(
rect
<
s32
>
(
95
*
xScale
,
4
4
0
*
yScale
,
205
*
xScale
,
490
*
yScale
),
wANCard
,
BUTTON_ANCARD_OK
,
dataManager
.
GetSysString
(
1211
));
ChangeToIGUIImageButton
(
btnANCardOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnANCardOK
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//announce attribute
//announce attribute
wANAttribute
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
dataManager
.
GetSysString
(
562
));
wANAttribute
=
env
->
addWindow
(
rect
<
s32
>
(
470
*
xScale
,
180
*
yScale
,
860
*
xScale
,
360
*
yScale
),
false
,
dataManager
.
GetSysString
(
562
));
...
@@ -1051,9 +1051,9 @@ bool Game::Initialize(ANDROID_APP app) {
...
@@ -1051,9 +1051,9 @@ bool Game::Initialize(ANDROID_APP app) {
env
->
addStaticText
(
dataManager
.
GetSysString
(
1342
),
rect
<
s32
>
(
20
*
xScale
,
25
*
yScale
,
290
*
xScale
,
45
*
yScale
),
false
,
false
,
wReplaySave
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1342
),
rect
<
s32
>
(
20
*
xScale
,
25
*
yScale
,
290
*
xScale
,
45
*
yScale
),
false
,
false
,
wReplaySave
);
ebRSName
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
20
*
xScale
,
50
*
yScale
,
370
*
xScale
,
90
*
yScale
),
wReplaySave
,
-
1
);
ebRSName
=
CAndroidGUIEditBox
::
addAndroidEditBox
(
L""
,
true
,
env
,
rect
<
s32
>
(
20
*
xScale
,
50
*
yScale
,
370
*
xScale
,
90
*
yScale
),
wReplaySave
,
-
1
);
ebRSName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
ebRSName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
btnRSYes
=
env
->
addButton
(
rect
<
s32
>
(
70
*
xScale
,
1
3
0
*
yScale
,
180
*
xScale
,
170
*
yScale
),
wReplaySave
,
BUTTON_REPLAY_SAVE
,
dataManager
.
GetSysString
(
1341
));
btnRSYes
=
env
->
addButton
(
rect
<
s32
>
(
70
*
xScale
,
1
2
0
*
yScale
,
180
*
xScale
,
170
*
yScale
),
wReplaySave
,
BUTTON_REPLAY_SAVE
,
dataManager
.
GetSysString
(
1341
));
ChangeToIGUIImageButton
(
btnRSYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnRSYes
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
btnRSNo
=
env
->
addButton
(
rect
<
s32
>
(
210
*
xScale
,
1
3
0
*
yScale
,
320
*
xScale
,
170
*
yScale
),
wReplaySave
,
BUTTON_REPLAY_CANCEL
,
dataManager
.
GetSysString
(
1212
));
btnRSNo
=
env
->
addButton
(
rect
<
s32
>
(
210
*
xScale
,
1
2
0
*
yScale
,
320
*
xScale
,
170
*
yScale
),
wReplaySave
,
BUTTON_REPLAY_CANCEL
,
dataManager
.
GetSysString
(
1212
));
ChangeToIGUIImageButton
(
btnRSNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
ChangeToIGUIImageButton
(
btnRSNo
,
imageManager
.
tButton_S
,
imageManager
.
tButton_S_pressed
);
//replay control
//replay control
wReplayControl
=
env
->
addWindow
(
rect
<
s32
>
(
200
*
yScale
,
5
*
yScale
,
310
*
yScale
,
270
*
yScale
),
false
,
L""
);
wReplayControl
=
env
->
addWindow
(
rect
<
s32
>
(
200
*
yScale
,
5
*
yScale
,
310
*
yScale
,
270
*
yScale
),
false
,
L""
);
...
...
gradle.properties
View file @
3d71c3e9
# Project-wide Gradle settings.
## For more details on how to configure your build environment visit
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs
=
-Xmx1024m
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true
#android.useDeprecatedNdk=true
#Mon Aug 31 19:03:54 CST 2020
android.enableJetifier
=
true
android.useAndroidX
=
true
android.useAndroidX
=
true
android.enableJetifier
=
true
org.gradle.jvmargs
=
-Xmx2048M -Dkotlin.daemon.jvm.options
\=
"-Xmx2048M"
\ No newline at end of file
mobile/build.gradle
View file @
3d71c3e9
...
@@ -112,7 +112,7 @@ dependencies {
...
@@ -112,7 +112,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.1.0'
implementation
'androidx.appcompat:appcompat:1.1.0'
implementation
'com.google.android.material:material:1.0.0'
implementation
'com.google.android.material:material:1.0.0'
//图片选择
//图片选择
implementation
'com.yuyh.imgsel:library:2.0.
6
'
implementation
'com.yuyh.imgsel:library:2.0.
7
'
//跨进程SharedPreferencesPlus工具
//跨进程SharedPreferencesPlus工具
implementation
'com.github.zhangliangming:PreferencesProvider:v1.3'
implementation
'com.github.zhangliangming:PreferencesProvider:v1.3'
//Tencent bugly
//Tencent bugly
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/activities/LogoActivity.java
View file @
3d71c3e9
...
@@ -40,10 +40,6 @@ public class LogoActivity extends BaseActivity {
...
@@ -40,10 +40,6 @@ public class LogoActivity extends BaseActivity {
if
(
requestCode
==
REQUEST_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
if
(
requestCode
==
REQUEST_PERMISSIONS
&&
resultCode
==
PermissionsActivity
.
PERMISSIONS_DENIED
)
{
finish
();
finish
();
}
else
{
}
else
{
// if (BuildConfig.DEBUG) {
// startActivity(new Intent(LogoActivity.this, MainActivity.class));
// finish();
// } else {
handler
=
new
Handler
();
handler
=
new
Handler
();
runnable
=
new
Runnable
()
{
runnable
=
new
Runnable
()
{
@Override
@Override
...
@@ -54,7 +50,6 @@ public class LogoActivity extends BaseActivity {
...
@@ -54,7 +50,6 @@ public class LogoActivity extends BaseActivity {
};
};
handler
.
postDelayed
(
runnable
,
1000
);
handler
.
postDelayed
(
runnable
,
1000
);
Toast
.
makeText
(
LogoActivity
.
this
,
R
.
string
.
logo_text
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
LogoActivity
.
this
,
R
.
string
.
logo_text
,
Toast
.
LENGTH_SHORT
).
show
();
// }
}
}
}
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/PayUtils.java
View file @
3d71c3e9
package
cn.garymb.ygomobile.utils
;
package
cn.garymb.ygomobile.utils
;
import
android.annotation.SuppressLint
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.text.InputType
;
import
android.telephony.TelephonyManager
;
import
android.view.Gravity
;
import
android.text.InputType
;
import
android.widget.EditText
;
import
android.view.Gravity
;
import
android.widget.EditText
;
import
com.base.bj.paysdk.domain.TrPayResult
;
import
com.base.bj.paysdk.domain.TrPayResult
;
import
com.base.bj.paysdk.listener.PayResultListener
;
import
com.base.bj.paysdk.listener.PayResultListener
;
import
com.base.bj.paysdk.utils.TrPay
;
import
com.base.bj.paysdk.utils.TrPay
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.util.UUID
;
import
java.util.UUID
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
cn.garymb.ygomobile.ui.plus.DialogPlus
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ALIPAY_URL
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ALIPAY_URL
;
public
class
PayUtils
{
public
class
PayUtils
{
/***
/***
...
@@ -78,7 +76,7 @@ public class PayUtils {
...
@@ -78,7 +76,7 @@ public class PayUtils {
public
static
void
callPay
(
Activity
activity
,
Long
money
)
{
public
static
void
callPay
(
Activity
activity
,
Long
money
)
{
String
id
=
UUID
.
randomUUID
()
+
""
;
String
id
=
UUID
.
randomUUID
()
+
""
;
String
notifyurl
=
"192.168.1.1"
;
String
notifyurl
=
"192.168.1.1"
;
TrPay
.
getInstance
(
activity
).
callPay
(
"感谢您对YGOMobile的支持"
,
id
,
money
,
""
,
notifyurl
,
PayUtils
.
getID
(
activity
)
,
new
PayResultListener
()
{
TrPay
.
getInstance
(
activity
).
callPay
(
"感谢您对YGOMobile的支持"
,
id
,
money
,
""
,
notifyurl
,
"user"
,
new
PayResultListener
()
{
public
void
onPayFinish
(
Context
context
,
String
outtradeno
,
int
resultCode
,
String
resultString
,
int
payType
,
Long
amount
,
String
tradename
)
{
public
void
onPayFinish
(
Context
context
,
String
outtradeno
,
int
resultCode
,
String
resultString
,
int
payType
,
Long
amount
,
String
tradename
)
{
if
(
resultCode
==
TrPayResult
.
RESULT_CODE_SUCC
.
getId
())
{
if
(
resultCode
==
TrPayResult
.
RESULT_CODE_SUCC
.
getId
())
{
}
else
if
(
resultCode
==
TrPayResult
.
RESULT_CODE_FAIL
.
getId
())
{
}
else
if
(
resultCode
==
TrPayResult
.
RESULT_CODE_FAIL
.
getId
())
{
...
@@ -87,9 +85,10 @@ public class PayUtils {
...
@@ -87,9 +85,10 @@ public class PayUtils {
});
});
}
}
/*
public static String getID(Context context) {
public static String getID(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
@SuppressLint("MissingPermission") String imei = telephonyManager.getDeviceId();
@SuppressLint("MissingPermission") String imei = telephonyManager.getDeviceId();
return imei;
return imei;
}
}
*/
}
}
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