Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdk-public
sdk-demo
Commits
4245d97a
Commit
4245d97a
authored
Oct 29, 2024
by
zhengyingbing
Browse files
feat(app): 更新fastsdk版本
parent
f29826f9
Changes
4
Show whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
4245d97a
...
@@ -33,5 +33,5 @@ android {
...
@@ -33,5 +33,5 @@ android {
}
}
dependencies
{
dependencies
{
implementation
'com.hoolai.access.open:hoolai-core:1.0.
3.18
'
implementation
'com.hoolai.access.open:hoolai-core:1.0.
5.0
'
}
}
\ No newline at end of file
app/src/main/java/com/hl/demo/MainActivity.java
View file @
4245d97a
...
@@ -8,13 +8,17 @@ import android.content.pm.PackageManager;
...
@@ -8,13 +8,17 @@ import android.content.pm.PackageManager;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.ScrollView
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.hoolai.access.open.fastaccess.channel.FastSdk
;
import
com.hoolai.access.open.fastaccess.channel.FastSdk
;
import
com.hoolai.access.open.fastaccess.channel.request.AccessActivityDataInfo
;
import
com.hoolai.access.open.fastaccess.channel.request.AccessActivityType
;
import
com.hoolai.access.open.fastaccess.channel.request.EventType
;
import
com.hoolai.access.open.fastaccess.channel.request.EventType
;
import
com.hoolai.access.open.fastaccess.channel.request.GoodsInfo
;
import
com.hoolai.access.open.fastaccess.channel.request.GoodsInfo
;
import
com.hoolai.access.open.fastaccess.channel.request.PayParams
;
import
com.hoolai.access.open.fastaccess.channel.request.PayParams
;
...
@@ -61,13 +65,13 @@ public class MainActivity extends Activity {
...
@@ -61,13 +65,13 @@ public class MainActivity extends Activity {
FastSdk
.
onCreate
(
MainActivity
.
this
);
FastSdk
.
onCreate
(
MainActivity
.
this
);
}
}
private
void
registerListeners
(){
private
void
registerListeners
()
{
//TODO:系统回调监听(必接)
//TODO:系统回调监听(必接)
FastSdk
.
hlSystemListener
=
new
HLSystemListener
()
{
FastSdk
.
hlSystemListener
=
new
HLSystemListener
()
{
@Override
@Override
public
void
onInitSuccess
(
InitResult
initResult
)
{
public
void
onInitSuccess
(
InitResult
initResult
)
{
isInit
=
true
;
isInit
=
true
;
Logger
.
data
(
TAG
,
"初始化成功"
);
Logger
.
data
(
TAG
,
"初始化成功"
);
setText
(
">>初始化成功:"
+
initResult
.
toString
());
setText
(
">>初始化成功:"
+
initResult
.
toString
());
initBtn
.
setVisibility
(
View
.
GONE
);
initBtn
.
setVisibility
(
View
.
GONE
);
//单个权限申请
//单个权限申请
...
@@ -76,14 +80,14 @@ public class MainActivity extends Activity {
...
@@ -76,14 +80,14 @@ public class MainActivity extends Activity {
// boolean hasPermission = FastSdk.checkPermissions(MainActivity.this,
// boolean hasPermission = FastSdk.checkPermissions(MainActivity.this,
// new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA},
// new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA},
// false);
// false);
if
(
hasPermission
){
if
(
hasPermission
)
{
//TODO: your code
//TODO: your code
}
}
}
}
@Override
@Override
public
void
onInitFailed
(
String
reason
)
{
public
void
onInitFailed
(
String
reason
)
{
Logger
.
data
(
TAG
,
"初始化失败:"
+
reason
);
Logger
.
data
(
TAG
,
"初始化失败:"
+
reason
);
setText
(
">>初始化失败:"
+
reason
);
setText
(
">>初始化失败:"
+
reason
);
initBtn
.
setVisibility
(
View
.
VISIBLE
);
initBtn
.
setVisibility
(
View
.
VISIBLE
);
}
}
...
@@ -91,7 +95,7 @@ public class MainActivity extends Activity {
...
@@ -91,7 +95,7 @@ public class MainActivity extends Activity {
@Override
@Override
public
void
onCustomExit
()
{
public
void
onCustomExit
()
{
//需要自己创建退出界面
//需要自己创建退出界面
Logger
.
data
(
TAG
,
"弹出游戏的退出界面"
);
Logger
.
data
(
TAG
,
"弹出游戏的退出界面"
);
setText
(
">>弹出游戏的退出界面"
);
setText
(
">>弹出游戏的退出界面"
);
new
AlertDialog
.
Builder
(
MainActivity
.
this
)
new
AlertDialog
.
Builder
(
MainActivity
.
this
)
.
setTitle
(
"游戏退出弹窗"
)
.
setTitle
(
"游戏退出弹窗"
)
...
@@ -116,7 +120,7 @@ public class MainActivity extends Activity {
...
@@ -116,7 +120,7 @@ public class MainActivity extends Activity {
@Override
@Override
public
void
onUpdate
(
String
data
)
{
public
void
onUpdate
(
String
data
)
{
Logger
.
data
(
TAG
,
"升级:"
+
data
);
Logger
.
data
(
TAG
,
"升级:"
+
data
);
}
}
};
};
//TODO:账号回调监听(必接)
//TODO:账号回调监听(必接)
...
@@ -128,20 +132,20 @@ public class MainActivity extends Activity {
...
@@ -128,20 +132,20 @@ public class MainActivity extends Activity {
@Override
@Override
public
void
onLoginSuccess
(
LoginResult
result
)
{
public
void
onLoginSuccess
(
LoginResult
result
)
{
Logger
.
data
(
TAG
,
"登录成功:"
+
result
);
Logger
.
data
(
TAG
,
"登录成功:"
+
result
);
setText
(
">>登录成功:"
+
result
.
toString
());
setText
(
">>登录成功:"
+
result
.
toString
());
isLogin
=
true
;
isLogin
=
true
;
}
}
@Override
@Override
public
void
onLoginFailed
(
String
reason
)
{
public
void
onLoginFailed
(
String
reason
)
{
Logger
.
data
(
TAG
,
"登录失败:"
+
reason
);
Logger
.
data
(
TAG
,
"登录失败:"
+
reason
);
setText
(
">>登录失败:"
+
reason
);
setText
(
">>登录失败:"
+
reason
);
}
}
@Override
@Override
public
void
onLogout
(
Object
...
var1
)
{
public
void
onLogout
(
Object
...
var1
)
{
Logger
.
data
(
TAG
,
"已登出"
);
Logger
.
data
(
TAG
,
"已登出"
);
setText
(
">>已登出"
);
setText
(
">>已登出"
);
isLogin
=
false
;
isLogin
=
false
;
}
}
...
@@ -150,19 +154,19 @@ public class MainActivity extends Activity {
...
@@ -150,19 +154,19 @@ public class MainActivity extends Activity {
FastSdk
.
hlPaymentListener
=
new
HLPaymentListener
()
{
FastSdk
.
hlPaymentListener
=
new
HLPaymentListener
()
{
@Override
@Override
public
void
onPaySuccess
(
String
result
)
{
public
void
onPaySuccess
(
String
result
)
{
Logger
.
data
(
TAG
,
"支付成功 "
+
result
);
Logger
.
data
(
TAG
,
"支付成功 "
+
result
);
setText
(
">>支付成功"
);
setText
(
">>支付成功"
);
}
}
@Override
@Override
public
void
onPayFailed
(
String
reason
)
{
public
void
onPayFailed
(
String
reason
)
{
Logger
.
data
(
TAG
,
"支付失败:"
+
reason
);
Logger
.
data
(
TAG
,
"支付失败:"
+
reason
);
setText
(
">>支付失败:"
+
reason
);
setText
(
">>支付失败:"
+
reason
);
}
}
@Override
@Override
public
void
onQuerySuccess
(
List
<
GoodsInfo
>
list
)
{
public
void
onQuerySuccess
(
List
<
GoodsInfo
>
list
)
{
Logger
.
data
(
TAG
,
"商品信息获取成功:"
+
list
.
toString
());
Logger
.
data
(
TAG
,
"商品信息获取成功:"
+
list
.
toString
());
ProductUtils
.
showProducts
(
MainActivity
.
this
,
list
);
ProductUtils
.
showProducts
(
MainActivity
.
this
,
list
);
setText
(
">>商品信息获取成功"
);
setText
(
">>商品信息获取成功"
);
}
}
...
@@ -188,38 +192,38 @@ public class MainActivity extends Activity {
...
@@ -188,38 +192,38 @@ public class MainActivity extends Activity {
};
};
}
}
public
void
init
(
View
v
){
public
void
init
(
View
v
)
{
setText
(
"调用初始化"
);
setText
(
"调用初始化"
);
FastSdk
.
onCreate
(
this
);
FastSdk
.
onCreate
(
this
);
}
}
public
void
login
(
View
v
){
public
void
login
(
View
v
)
{
if
(
isInit
){
if
(
isInit
)
{
setText
(
"调用登录"
);
setText
(
"调用登录"
);
FastSdk
.
login
();
FastSdk
.
login
();
}
else
{
}
else
{
ToastUtils
.
toast
(
"请先初始化"
);
ToastUtils
.
toast
(
"请先初始化"
);
}
}
}
}
public
void
baseTrack
(
View
v
){
public
void
baseTrack
(
View
v
)
{
if
(
isLogin
){
if
(
isLogin
)
{
setText
(
"创角,进服,升级报送"
);
setText
(
"创角,进服,升级报送"
);
FastSdk
.
report
(
EventType
.
CreateRole
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
CreateRole
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
EnterServer
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
EnterServer
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
LevelUp
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
LevelUp
,
getPlayerInfo
());
setText
(
">>报送内容:"
+
getPlayerInfo
());
setText
(
">>报送内容:"
+
getPlayerInfo
());
}
else
{
}
else
{
loginFirst
();
loginFirst
();
}
}
}
}
public
void
customTrack
(
View
v
){
public
void
customTrack
(
View
v
)
{
if
(
isInit
){
if
(
isInit
)
{
setText
(
"自定义报送"
);
setText
(
"自定义报送"
);
FastSdk
.
report
(
EventType
.
CustomerAction
,
getPlayerInfo
());
FastSdk
.
report
(
EventType
.
CustomerAction
,
getPlayerInfo
());
setText
(
">>报送内容:"
+
getPlayerInfo
());
setText
(
">>报送内容:"
+
getPlayerInfo
());
}
else
{
}
else
{
ToastUtils
.
toast
(
"请先初始化"
);
ToastUtils
.
toast
(
"请先初始化"
);
}
}
}
}
...
@@ -227,9 +231,10 @@ public class MainActivity extends Activity {
...
@@ -227,9 +231,10 @@ public class MainActivity extends Activity {
/**
/**
* 方舟报送-自定义报点
* 方舟报送-自定义报点
* action:报点名称
* action:报点名称
*
* @param v
* @param v
*/
*/
public
void
fangZhouReport
(
View
v
){
public
void
fangZhouReport
(
View
v
)
{
setText
(
"方舟报送"
);
setText
(
"方舟报送"
);
String
action
=
"game_xxx"
;
String
action
=
"game_xxx"
;
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
...
@@ -238,49 +243,62 @@ public class MainActivity extends Activity {
...
@@ -238,49 +243,62 @@ public class MainActivity extends Activity {
FastSdk
.
gameDataReport
(
action
,
hashMap
);
FastSdk
.
gameDataReport
(
action
,
hashMap
);
}
}
public
void
logout
(
View
v
){
public
void
logout
(
View
v
)
{
if
(
isLogin
){
if
(
isLogin
)
{
setText
(
"调用登出"
);
setText
(
"调用登出"
);
FastSdk
.
logout
();
FastSdk
.
logout
();
}
else
{
}
else
{
loginFirst
();
loginFirst
();
}
}
}
}
public
void
getPriceInfo
(
View
v
){
public
void
getPriceInfo
(
View
v
)
{
if
(
isLogin
){
if
(
isLogin
)
{
setText
(
"查询商品"
);
setText
(
"查询商品"
);
FastSdk
.
queryGoodsInfo
();
FastSdk
.
queryGoodsInfo
();
}
else
{
}
else
{
loginFirst
();
loginFirst
();
}
}
}
}
public
void
doPay
(
View
v
){
public
void
doPay
(
View
v
)
{
if
(
isLogin
){
if
(
isLogin
)
{
int
amount
=
1
;
//单位:分
int
amount
=
1
;
//单位:分
setText
(
"调用支付:"
+
getPayParams
(
amount
));
String
amountStr
=
((
EditText
)
findViewById
(
R
.
id
.
et_amount
)).
getText
().
toString
();
FastSdk
.
pay
(
getPayParams
(
amount
));
if
(!
TextUtils
.
isEmpty
(
amountStr
))
{
}
else
{
amount
=
Integer
.
parseInt
(
amountStr
);
}
PayParams
payParams
=
getPayParams
(
amount
);
setText
(
"调用支付:"
+
payParams
);
FastSdk
.
pay
(
payParams
);
}
else
{
loginFirst
();
loginFirst
();
}
}
}
}
public
void
exit
(
View
v
){
public
void
exchange
(
View
v
)
{
String
code
=
((
EditText
)
findViewById
(
R
.
id
.
et_code
)).
getText
().
toString
();
AccessActivityDataInfo
info
=
new
AccessActivityDataInfo
();
info
.
setCode
(
code
);
FastSdk
.
accessParticipate
(
AccessActivityType
.
CD_KEY
,
info
);
}
public
void
exit
(
View
v
)
{
setText
(
"调用退出"
);
setText
(
"调用退出"
);
FastSdk
.
exit
();
FastSdk
.
exit
();
}
}
public
void
openAccountCenter
(
View
v
){
public
void
openAccountCenter
(
View
v
)
{
setText
(
"打开用户中心"
);
setText
(
"打开用户中心"
);
FastSdk
.
openAccountCenter
(
this
);
FastSdk
.
openAccountCenter
(
this
);
}
}
public
void
openKeFu
(
View
v
){
public
void
openKeFu
(
View
v
)
{
setText
(
"打开客服"
);
setText
(
"打开客服"
);
FastSdk
.
openService
(
this
);
FastSdk
.
openService
(
this
);
}
}
public
void
share
(
View
v
){
public
void
share
(
View
v
)
{
ShareActivity
.
start
(
this
);
ShareActivity
.
start
(
this
);
}
}
...
@@ -301,7 +319,7 @@ public class MainActivity extends Activity {
...
@@ -301,7 +319,7 @@ public class MainActivity extends Activity {
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
Logger
.
data
(
TAG
,
"游戏页面onResume"
);
Logger
.
data
(
TAG
,
"游戏页面onResume"
);
FastSdk
.
onResume
(
this
);
FastSdk
.
onResume
(
this
);
}
}
...
@@ -320,7 +338,7 @@ public class MainActivity extends Activity {
...
@@ -320,7 +338,7 @@ public class MainActivity extends Activity {
@Override
@Override
protected
void
onRestart
()
{
protected
void
onRestart
()
{
super
.
onRestart
();
super
.
onRestart
();
Logger
.
data
(
TAG
,
"游戏页面onRestart"
);
Logger
.
data
(
TAG
,
"游戏页面onRestart"
);
FastSdk
.
onRestart
(
this
);
FastSdk
.
onRestart
(
this
);
}
}
...
@@ -346,11 +364,11 @@ public class MainActivity extends Activity {
...
@@ -346,11 +364,11 @@ public class MainActivity extends Activity {
public
void
onRequestPermissionsResult
(
int
requestCode
,
String
[]
permissions
,
int
[]
grantResults
)
{
public
void
onRequestPermissionsResult
(
int
requestCode
,
String
[]
permissions
,
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
FastSdk
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
FastSdk
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
Math
.
abs
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
.
hashCode
())){
if
(
requestCode
==
Math
.
abs
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
.
hashCode
()))
{
if
(
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
){
if
(
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
Logger
.
i
(
"权限已被允许"
);
Logger
.
i
(
"权限已被允许"
);
//your code
//your code
}
else
{
}
else
{
Logger
.
i
(
"权限已被拒绝"
);
Logger
.
i
(
"权限已被拒绝"
);
}
}
}
}
...
@@ -384,7 +402,7 @@ public class MainActivity extends Activity {
...
@@ -384,7 +402,7 @@ public class MainActivity extends Activity {
//TODO ++++++++++++++++++++++++++++++++++ 生命周期方法接入end +++++++++++++++++++++++++++++++++++
//TODO ++++++++++++++++++++++++++++++++++ 生命周期方法接入end +++++++++++++++++++++++++++++++++++
private
PlayerInfo
getPlayerInfo
(){
private
PlayerInfo
getPlayerInfo
()
{
PlayerInfo
playerInfo
=
new
PlayerInfo
();
PlayerInfo
playerInfo
=
new
PlayerInfo
();
playerInfo
.
setRoleId
(
"1235761"
);
//角色唯一标识id
playerInfo
.
setRoleId
(
"1235761"
);
//角色唯一标识id
playerInfo
.
setRoleName
(
"昵称2"
);
playerInfo
.
setRoleName
(
"昵称2"
);
...
@@ -405,7 +423,7 @@ public class MainActivity extends Activity {
...
@@ -405,7 +423,7 @@ public class MainActivity extends Activity {
return
playerInfo
;
return
playerInfo
;
}
}
private
PayParams
getPayParams
(
int
amount
){
private
PayParams
getPayParams
(
int
amount
)
{
PayParams
payParams
=
new
PayParams
();
PayParams
payParams
=
new
PayParams
();
payParams
.
setItemId
(
"aaa.bbb.cc"
);
//商品,要保证游戏内各个商品唯一(可以不传)
payParams
.
setItemId
(
"aaa.bbb.cc"
);
//商品,要保证游戏内各个商品唯一(可以不传)
//ItemName要求:这些特殊符号都不要有: + % # “ & / ? $ ^ *:) \ < > , |。否则会造成某些渠道支付报错如:华为渠道
//ItemName要求:这些特殊符号都不要有: + % # “ & / ? $ ^ *:) \ < > , |。否则会造成某些渠道支付报错如:华为渠道
...
@@ -416,7 +434,8 @@ public class MainActivity extends Activity {
...
@@ -416,7 +434,8 @@ public class MainActivity extends Activity {
payParams
.
setCurrency
(
"CNY"
);
//国内可不传或CNY
payParams
.
setCurrency
(
"CNY"
);
//国内可不传或CNY
return
payParams
;
return
payParams
;
}
}
private
void
setText
(
String
temp
){
private
void
setText
(
String
temp
)
{
str
=
str
+
temp
+
"\n\n"
;
str
=
str
+
temp
+
"\n\n"
;
textView
.
setText
(
str
);
textView
.
setText
(
str
);
Handler
mHandler
=
new
Handler
();
Handler
mHandler
=
new
Handler
();
...
@@ -436,7 +455,7 @@ public class MainActivity extends Activity {
...
@@ -436,7 +455,7 @@ public class MainActivity extends Activity {
},
500
);
//延迟500ms启动
},
500
);
//延迟500ms启动
}
}
private
void
loginFirst
(){
private
void
loginFirst
()
{
ToastUtils
.
toast
(
"请先登录"
);
ToastUtils
.
toast
(
"请先登录"
);
}
}
}
}
\ No newline at end of file
app/src/main/res/layout-land/activity_main.xml
View file @
4245d97a
...
@@ -3,13 +3,13 @@
...
@@ -3,13 +3,13 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#aaa"
android:background=
"#aaa"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
android:padding=
"2dp"
>
<ScrollView
<ScrollView
android:id=
"@+id/scrollView"
android:id=
"@+id/scrollView"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"10dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"#eee"
android:background=
"#eee"
android:fadeScrollbars=
"false"
android:fadeScrollbars=
"false"
...
@@ -31,13 +31,19 @@
...
@@ -31,13 +31,19 @@
</LinearLayout>
</LinearLayout>
</ScrollView>
</ScrollView>
<
LinearLayout
<
ScrollView
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"2dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:orientation=
"vertical"
android:scrollbars=
"none"
android:paddingTop=
"10dp"
android:fadeScrollbars=
"false"
android:paddingRight=
"5dp"
>
android:fillViewport=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -73,9 +79,9 @@
...
@@ -73,9 +79,9 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"
2
"
android:layout_weight=
"
1
"
android:onClick=
"baseTrack"
android:onClick=
"baseTrack"
android:text=
"
创角/进服/升级
"
/>
android:text=
"
基础报送
"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
...
@@ -83,7 +89,7 @@
...
@@ -83,7 +89,7 @@
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:onClick=
"customTrack"
android:onClick=
"customTrack"
android:text=
"自定义"
/>
android:text=
"自定义
报送
"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
...
@@ -94,17 +100,60 @@
...
@@ -94,17 +100,60 @@
android:text=
"方舟报送"
/>
android:text=
"方舟报送"
/>
</LinearLayout>
</LinearLayout>
<Button
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/et_amount"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:hint=
"支付金额(默认1分)"
android:maxLength=
"6"
android:maxLines=
"1"
android:inputType=
"number"
android:textSize=
"12sp"
/>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"2"
android:onClick=
"doPay"
android:onClick=
"doPay"
android:text=
"支付"
/>
android:text=
"支付"
/>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/et_code"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:maxLength=
"16"
android:maxLines=
"1"
android:hint=
"CDK码(需先进服)"
android:textSize=
"12sp"
/>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:layout_weight=
"2"
android:onClick=
"exchange"
android:text=
"CDK兑换"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
...
@@ -112,6 +161,7 @@
...
@@ -112,6 +161,7 @@
android:layout_weight=
"1"
android:layout_weight=
"1"
android:onClick=
"share"
android:onClick=
"share"
android:text=
"分享"
/>
android:text=
"分享"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
...
@@ -175,6 +225,6 @@
...
@@ -175,6 +225,6 @@
android:text=
"客服(可选)"
/>
android:text=
"客服(可选)"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
4245d97a
...
@@ -85,9 +85,9 @@
...
@@ -85,9 +85,9 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"
2
"
android:layout_weight=
"
1
"
android:onClick=
"baseTrack"
android:onClick=
"baseTrack"
android:text=
"
创角/进服/升级
"
/>
android:text=
"
基础报送
"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:onClick=
"customTrack"
android:onClick=
"customTrack"
android:text=
"自定义"
/>
android:text=
"自定义
报送
"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"0dp"
...
@@ -110,27 +110,54 @@
...
@@ -110,27 +110,54 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/et_amount"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:maxLength=
"6"
android:maxLines=
"1"
android:inputType=
"number"
android:hint=
"支付金额(默认1分)"
android:textSize=
"12sp"
/>
<Button
<Button
android:layout_width=
"
0dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"
48dp
"
android:layout_height=
"
match_parent
"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"
1
"
android:layout_weight=
"
2
"
android:onClick=
"doPay"
android:onClick=
"doPay"
android:text=
"
定额
支付"
/>
android:text=
"支付"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/et_code"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:maxLength=
"16"
android:maxLines=
"1"
android:hint=
"CDK码(需先进服)"
android:textSize=
"12sp"
/>
<Button
<Button
android:layout_width=
"0dp"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:layout_weight=
"2"
android:onClick=
"exchange"
android:text=
"CDK兑换"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"share"
android:onClick=
"share"
android:text=
"分享"
/>
android:text=
"分享"
/>
</LinearLayout>
</LinearLayout>
...
...
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