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
3452ce96
Commit
3452ce96
authored
Oct 24, 2022
by
zhengyingbing
Browse files
feat(app): 增加分享功能,增加权限管理
parent
a8e3b987
Changes
10
Hide whitespace changes
Inline
Side-by-side
app/build.gradle
View file @
3452ce96
...
@@ -18,5 +18,7 @@ android {
...
@@ -18,5 +18,7 @@ android {
}
}
dependencies
{
dependencies
{
implementation
'com.hoolai.access.open:hoolai-core:1.0.1.1'
implementation
'com.hoolai.access.open:hoolai-core:1.0.1.19'
implementation
'androidx.core:core:1.3.0'
}
}
\ No newline at end of file
app/src/main/AndroidManifest.xml
View file @
3452ce96
...
@@ -2,24 +2,49 @@
...
@@ -2,24 +2,49 @@
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.hl.demo"
>
package=
"com.hl.demo"
>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<!-- 如果无自定义Application,可直接引用com.hoolai.access.open.fastaccess.HLApplication -->
<application
<application
android:name=
".GameApplication"
android:name=
"
com.hl.demo
.GameApplication"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:label=
"fastSdkDemo"
android:label=
"fastSdkDemo"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:usesCleartextTraffic=
"true"
>
android:usesCleartextTraffic=
"true"
>
<!-- 游戏主类 -->
<activity
<activity
android:name=
".MainActivity"
android:name=
"com.hl.demo.MainActivity"
android:screenOrientation=
"landscape"
android:exported=
"true"
>
android:exported=
"true"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
<!-- 懂球帝分享配置 -->
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<!--game可自定义,与请求参数保持一致即可 -->
<data
android:scheme=
"game"
/>
</intent-filter>
</activity>
</activity>
<!-- 此配置必须加 -->
<meta-data
android:name=
"MAIN_ACTIVITY"
android:value=
"com.hl.demo.MainActivity"
/>
<!-- demo分享类,无需拷贝 -->
<activity
android:name=
".ShareActivity"
android:theme=
"@style/HlAccountTransparent"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
app/src/main/java/com/hl/demo/MainActivity.java
View file @
3452ce96
package
com.hl.demo
;
package
com.hl.demo
;
import
android.Manifest
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.app.AlertDialog
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -14,9 +15,11 @@ import com.hoolai.access.open.fastaccess.channel.request.EventType;
...
@@ -14,9 +15,11 @@ 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
;
import
com.hoolai.access.open.fastaccess.channel.request.PlayerInfo
;
import
com.hoolai.access.open.fastaccess.channel.request.PlayerInfo
;
import
com.hoolai.access.open.fastaccess.channel.result.InitResult
;
import
com.hoolai.access.open.fastaccess.channel.result.LoginResult
;
import
com.hoolai.access.open.fastaccess.channel.result.LoginResult
;
import
com.hoolai.access.open.fastaccess.interf.HLAccountListener
;
import
com.hoolai.access.open.fastaccess.interf.HLAccountListener
;
import
com.hoolai.access.open.fastaccess.interf.HLPaymentListener
;
import
com.hoolai.access.open.fastaccess.interf.HLPaymentListener
;
import
com.hoolai.access.open.fastaccess.interf.HLShareListener
;
import
com.hoolai.access.open.fastaccess.interf.HLSystemListener
;
import
com.hoolai.access.open.fastaccess.interf.HLSystemListener
;
import
com.hoolai.access.open.fastaccess.utils.Logger
;
import
com.hoolai.access.open.fastaccess.utils.Logger
;
import
com.hoolai.access.open.fastaccess.utils.ToastUtils
;
import
com.hoolai.access.open.fastaccess.utils.ToastUtils
;
...
@@ -39,7 +42,7 @@ public class MainActivity extends Activity {
...
@@ -39,7 +42,7 @@ public class MainActivity extends Activity {
//声明系统回调(初始化,退出,版本升级)监听
//声明系统回调(初始化,退出,版本升级)监听
FastSdk
.
hlSystemListener
=
new
HLSystemListener
()
{
FastSdk
.
hlSystemListener
=
new
HLSystemListener
()
{
@Override
@Override
public
void
onInitSuccess
()
{
public
void
onInitSuccess
(
InitResult
initResult
)
{
isInit
=
true
;
isInit
=
true
;
Logger
.
data
(
"fastsdkdemo"
,
"初始化成功"
);
Logger
.
data
(
"fastsdkdemo"
,
"初始化成功"
);
setText
(
">>初始化成功"
);
setText
(
">>初始化成功"
);
...
@@ -131,6 +134,17 @@ public class MainActivity extends Activity {
...
@@ -131,6 +134,17 @@ public class MainActivity extends Activity {
setText
(
">>商品信息获取成功"
);
setText
(
">>商品信息获取成功"
);
}
}
};
};
FastSdk
.
hlShareListener
=
new
HLShareListener
()
{
@Override
public
void
onShareSuccess
()
{
}
@Override
public
void
onShareFailed
(
String
s
)
{
}
};
FastSdk
.
onCreate
(
MainActivity
.
this
);
FastSdk
.
onCreate
(
MainActivity
.
this
);
setText
(
"调用初始化"
);
setText
(
"调用初始化"
);
}
}
...
@@ -286,11 +300,14 @@ public class MainActivity extends Activity {
...
@@ -286,11 +300,14 @@ public class MainActivity extends Activity {
}
}
}
}
public
void
onE
xit
(
View
v
){
public
void
e
xit
(
View
v
){
setText
(
"调用退出"
);
setText
(
"调用退出"
);
FastSdk
.
exit
();
FastSdk
.
exit
();
}
}
public
void
share
(
View
v
){
ShareActivity
.
start
(
this
);
}
private
PlayerInfo
getPlayerInfo
(){
private
PlayerInfo
getPlayerInfo
(){
PlayerInfo
playerInfo
=
new
PlayerInfo
();
PlayerInfo
playerInfo
=
new
PlayerInfo
();
playerInfo
.
setRoleId
(
"1235761"
);
//角色唯一标识id
playerInfo
.
setRoleId
(
"1235761"
);
//角色唯一标识id
...
...
app/src/main/java/com/hl/demo/ProductUtils.java
View file @
3452ce96
...
@@ -9,14 +9,17 @@ import android.widget.Toast;
...
@@ -9,14 +9,17 @@ import android.widget.Toast;
import
com.hoolai.access.open.fastaccess.channel.FastSdk
;
import
com.hoolai.access.open.fastaccess.channel.FastSdk
;
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
;
import
com.hoolai.access.open.fastaccess.utils.ToastUtils
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
public
class
ProductUtils
{
public
class
ProductUtils
{
public
static
void
showProducts
(
Activity
activity
,
List
<
GoodsInfo
>
list
){
public
static
void
showProducts
(
Activity
activity
,
List
<
GoodsInfo
>
list
){
if
(
list
.
size
()
==
0
)
{
if
(
list
.
size
()
==
0
)
{
Toast
.
makeText
(
activity
,
"商品信息获取为空"
,
Toast
.
LENGTH_SHORT
).
show
(
);
Toast
Utils
.
toast
(
"商品信息获取为空"
);
return
;
return
;
}
}
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
activity
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
activity
);
...
@@ -32,10 +35,11 @@ public class ProductUtils {
...
@@ -32,10 +35,11 @@ public class ProductUtils {
payParams
.
setCount
(
Integer
.
valueOf
(
payInfo
.
getItemCount
()));
payParams
.
setCount
(
Integer
.
valueOf
(
payInfo
.
getItemCount
()));
//扩展信息,回调时原样返回,因为各渠道回调参数限制不一致。回调参数暂时只支持长度50。callBackInfo中不要使用这些符号:“|”、“=”、“+”、“/”。
//扩展信息,回调时原样返回,因为各渠道回调参数限制不一致。回调参数暂时只支持长度50。callBackInfo中不要使用这些符号:“|”、“=”、“+”、“/”。
payParams
.
setCallbackInfo
(
"支付扩展信息,游戏透传参数"
+
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
payParams
.
setCallbackInfo
(
"支付扩展信息,游戏透传参数"
+
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
payParams
.
addExtendParam
(
"isSupportThirdPayment"
,
"true"
);
//是否支持google之外的三方支付
Map
<
String
,
String
>
map
=
new
HashMap
<>();
payParams
.
addExtendParam
(
"payType"
,
"1"
);
// 1 钱包(默认此类型) 2 点卡,短代类支付,需要通过FastSdk.supportShortterm查询
map
.
put
(
"isSupportThirdPayment"
,
"true"
);
//是否支持google之外的三方支付
payParams
.
addExtendParam
(
"currency"
,
payInfo
.
getShowTag
());
//币种
map
.
put
(
"payType"
,
"1"
);
// 1 钱包(默认此类型) 2 点卡,短代类支付,需要通过FastSdk.supportShortterm查询
map
.
put
(
"currency"
,
payInfo
.
getShowTag
());
//币种
payParams
.
setOpt
(
map
);
FastSdk
.
pay
(
activity
,
payParams
);
FastSdk
.
pay
(
activity
,
payParams
);
});
});
builder
.
setView
(
listView
);
builder
.
setView
(
listView
);
...
...
app/src/main/java/com/hl/demo/ShareActivity.java
0 → 100644
View file @
3452ce96
package
com.hl.demo
;
import
android.Manifest
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.database.Cursor
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.provider.MediaStore
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
com.hoolai.access.open.fastaccess.channel.FastSdk
;
import
com.hoolai.access.open.fastaccess.channel.request.ShareParams
;
import
com.hoolai.access.open.fastaccess.channel.request.ShareType
;
import
com.hoolai.access.open.fastaccess.interf.HLShareListener
;
public
class
ShareActivity
extends
Activity
{
private
TextView
picPathTv
,
contentTv
;
private
String
picPath
=
""
;
private
ShareParams
params
;
private
ShareType
shareType
;
private
EditText
share_title
,
share_content
,
share_url
;
private
CheckBox
share_check
;
private
int
qqShareType
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_share
);
picPathTv
=
findViewById
(
R
.
id
.
pic_path
);
contentTv
=
findViewById
(
R
.
id
.
main_tv
);
share_title
=
findViewById
(
R
.
id
.
share_title
);
share_content
=
findViewById
(
R
.
id
.
share_content
);
share_url
=
findViewById
(
R
.
id
.
share_url
);
share_check
=
findViewById
(
R
.
id
.
share_check
);
qqShareType
=
1
;
share_check
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
qqShareType
=
isChecked
?
1
:
2
;
}
});
FastSdk
.
hlShareListener
=
new
HLShareListener
()
{
@Override
public
void
onShareSuccess
()
{
contentTv
.
setText
(
"分享成功"
);
}
@Override
public
void
onShareFailed
(
String
s
)
{
contentTv
.
setText
(
"分享失败:"
+
s
);
}
};
}
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
requestCode
==
100
)
{
if
(
data
!=
null
)
{
Uri
uri
=
data
.
getData
();
picPath
=
getImagePath
(
uri
);
picPathTv
.
setText
(
picPath
);
}
}
}
public
static
void
start
(
Context
context
)
{
Intent
starter
=
new
Intent
(
context
,
ShareActivity
.
class
);
context
.
startActivity
(
starter
);
}
@Override
public
void
onRequestPermissionsResult
(
int
requestCode
,
String
[]
permissions
,
int
[]
grantResults
)
{
super
.
onRequestPermissionsResult
(
requestCode
,
permissions
,
grantResults
);
if
(
requestCode
==
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
.
hashCode
()){
if
(
grantResults
[
0
]
==
PackageManager
.
PERMISSION_GRANTED
)
{
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setShareUrl
(
"dongqiudi://share/circle/"
);
params
.
setCallbackUrl
(
"game://share/callback"
);
params
.
setId
(
"100"
);
params
.
setPicPath
(
picPath
);
shareType
=
ShareType
.
DQD
;
share
();
}
}
}
public
void
shareSelect
(
View
v
){
Intent
intent
=
new
Intent
(
Intent
.
ACTION_PICK
);
intent
.
setDataAndType
(
MediaStore
.
Images
.
Media
.
EXTERNAL_CONTENT_URI
,
"image/*"
);
startActivityForResult
(
intent
,
100
);
}
//分享懂球帝
public
void
shareDQD
(
View
v
){
if
(
FastSdk
.
checkPermission
(
this
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)){
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setShareUrl
(
"dongqiudi://share/circle/"
);
params
.
setCallbackUrl
(
"game://share/callback"
);
params
.
setId
(
"100"
);
params
.
setPicPath
(
picPath
);
shareType
=
ShareType
.
DQD
;
share
();
}
}
//分享QQ列表包含QQZone
public
void
shareQQZone
(
View
v
){
shareType
=
ShareType
.
QQ
;
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setQqType
(
qqShareType
);
params
.
setShowQQZone
(
true
);
params
.
setPicPath
(
picPath
);
params
.
setShareUrl
(
share_url
.
getText
().
toString
());
share
();
}
//分享QQ列表不包含QQZone
public
void
shareQQ
(
View
v
){
shareType
=
ShareType
.
QQ
;
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setQqType
(
qqShareType
);
params
.
setShowQQZone
(
false
);
params
.
setPicPath
(
picPath
);
params
.
setShareUrl
(
share_url
.
getText
().
toString
());
share
();
}
//分享微信-聊天
public
void
shareWX
(
View
v
){
Bitmap
bmp
=
BitmapFactory
.
decodeResource
(
this
.
getResources
(),
R
.
drawable
.
icon
);
shareType
=
ShareType
.
WX
;
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setShareUrl
(
share_url
.
getText
().
toString
());
params
.
setBmp
(
bmp
);
params
.
setWxType
(
1
);
share
();
}
//分享微信-朋友圈
public
void
sharePYQ
(
View
v
){
Bitmap
bmp
=
BitmapFactory
.
decodeResource
(
this
.
getResources
(),
R
.
drawable
.
icon
);
shareType
=
ShareType
.
WX
;
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setShareUrl
(
share_url
.
getText
().
toString
());
params
.
setBmp
(
bmp
);
params
.
setWxType
(
2
);
share
();
}
//分享微信-收藏
public
void
shareWXSC
(
View
v
){
Bitmap
bmp
=
BitmapFactory
.
decodeResource
(
this
.
getResources
(),
R
.
drawable
.
icon
);
shareType
=
ShareType
.
WX
;
params
=
new
ShareParams
();
params
.
setTitle
(
share_title
.
getText
().
toString
());
params
.
setContent
(
share_content
.
getText
().
toString
());
params
.
setShareUrl
(
share_url
.
getText
().
toString
());
params
.
setBmp
(
bmp
);
params
.
setWxType
(
3
);
share
();
}
private
void
share
(){
FastSdk
.
share
(
this
,
shareType
,
params
);
}
private
String
getImagePath
(
Uri
uri
)
{
if
(
uri
!=
null
)
{
String
[]
imgs
=
{
MediaStore
.
Images
.
Media
.
_ID
,
MediaStore
.
Images
.
Media
.
DATA
};
Cursor
cursor
=
getContentResolver
().
query
(
uri
,
imgs
,
null
,
null
,
null
);
try
{
if
(
cursor
!=
null
&&
cursor
.
moveToFirst
())
{
return
cursor
.
getString
(
1
);
}
}
finally
{
if
(
cursor
!=
null
)
cursor
.
close
();
}
}
return
null
;
}
}
app/src/main/res/drawable/icon.png
0 → 100644
View file @
3452ce96
86.2 KB
app/src/main/res/layout-land/activity_main.xml
0 → 100644
View file @
3452ce96
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#aaa"
android:orientation=
"horizontal"
>
<ScrollView
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_margin=
"10dp"
android:padding=
"20dp"
android:fadeScrollbars=
"false"
android:background=
"#eee"
android:fillViewport=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/textview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"4dp"
android:textSize=
"12dp"
android:textColor=
"#111"
/>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:id=
"@+id/initBtn"
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:visibility=
"gone"
android:onClick=
"init"
android:text=
"初始化"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"login"
android:text=
"登录"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"logout"
android:text=
"登出"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"exit"
android:text=
"退出"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"createRole"
android:text=
"创角"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"enterSever"
android:text=
"进服"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"levelUp"
android:text=
"升级"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"customTrack"
android:text=
"自定义"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"getPriceInfo"
android:text=
"商品信息(海外)"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"doPay"
android:text=
"定额支付"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"share"
android:text=
"分享"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout-land/activity_share.xml
0 → 100644
View file @
3452ce96
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#ccc"
android:orientation=
"horizontal"
android:padding=
"20dp"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:background=
"#fff"
android:layout_marginRight=
"10dp"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/main_tv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"5dp"
android:padding=
"5dp"
android:text=
"用户信息用户信息用户信息用户信息用户信息用户信"
android:textColor=
"#333"
android:textSize=
"18sp"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:orientation=
"vertical"
>
<EditText
android:id=
"@+id/share_title"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:text=
"111"
android:hint=
"标题"
/>
<EditText
android:id=
"@+id/share_content"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:text=
"222"
android:hint=
"内容"
/>
<EditText
android:id=
"@+id/share_url"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:hint=
"链接"
android:text=
"http://www.baidu.com"
/>
<Button
android:id=
"@+id/share_select"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:onClick=
"shareSelect"
android:text=
"选择图片"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"70dp"
android:orientation=
"horizontal"
android:paddingRight=
"10dp"
>
<TextView
android:id=
"@+id/pic_path"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:textSize=
"12sp"
android:layout_weight=
"1"
/>
<CheckBox
android:id=
"@+id/share_check"
android:layout_width=
"100dp"
android:layout_height=
"match_parent"
android:text=
"QQ图文"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"shareDQD"
android:text=
"分享懂球帝"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"shareQQ"
android:text=
"分享QQ"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"shareQQZone"
android:text=
"分享QQ+空间"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"shareWX"
android:text=
"分享微信"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"sharePYQ"
android:text=
"分享朋友圈"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"shareWXSC"
android:text=
"分享微信收藏"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
3452ce96
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"4dp"
android:layout_margin=
"4dp"
android:text=
"12"
android:textSize=
"12dp"
android:textSize=
"12dp"
android:textColor=
"#111"
/>
android:textColor=
"#111"
/>
</LinearLayout>
</LinearLayout>
...
@@ -51,6 +50,20 @@
...
@@ -51,6 +50,20 @@
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:onClick=
"login"
android:onClick=
"login"
android:text=
"登录"
/>
android:text=
"登录"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"logout"
android:text=
"登出"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"exit"
android:text=
"退出"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -87,12 +100,6 @@
...
@@ -87,12 +100,6 @@
android:onClick=
"customTrack"
android:onClick=
"customTrack"
android:text=
"自定义"
/>
android:text=
"自定义"
/>
</LinearLayout>
</LinearLayout>
<Button
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:onClick=
"logout"
android:text=
"登出"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -115,11 +122,18 @@
...
@@ -115,11 +122,18 @@
android:onClick=
"doPay"
android:onClick=
"doPay"
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:layout_gravity=
"center"
android:orientation=
"horizontal"
>
android:onClick=
"onExit"
<Button
android:text=
"退出"
/>
android:layout_width=
"0dp"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:layout_weight=
"1"
android:onClick=
"share"
android:text=
"分享"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/activity_share.xml
0 → 100644
View file @
3452ce96
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#ccc"
android:orientation=
"vertical"
android:paddingTop=
"40dp"
android:paddingLeft=
"20dp"
android:paddingRight=
"20dp"
>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"2"
android:background=
"#fff"
android:padding=
"3dp"
>
<TextView
android:id=
"@+id/main_tv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"5dp"
android:textColor=
"#333"
android:text=
"用户信息用户信息用户信息用户信息用户信息用户信"
android:textSize=
"18sp"
/>
</ScrollView>
<EditText
android:id=
"@+id/share_title"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"4dp"
android:text=
"111"
android:hint=
"标题"
/>
<EditText
android:id=
"@+id/share_content"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_marginBottom=
"4dp"
android:text=
"222"
android:hint=
"内容"
/>
<EditText
android:id=
"@+id/share_url"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:text=
"http://www.baidu.com"
android:hint=
"链接"
/>
<Button
android:id=
"@+id/share_select"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_gravity=
"center"
android:onClick=
"shareSelect"
android:text=
"选择图片"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:orientation=
"horizontal"
android:paddingRight=
"10dp"
>
<TextView
android:id=
"@+id/pic_path"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
/>
<CheckBox
android:id=
"@+id/share_check"
android:layout_width=
"80dp"
android:layout_height=
"match_parent"
android:text=
"图文"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"shareDQD"
android:text=
"分享懂球帝"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"shareQQ"
android:text=
"分享QQ"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"shareQQZone"
android:text=
"分享QQ+空间"
/>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"shareWX"
android:text=
"分享微信"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"sharePYQ"
android:text=
"分享朋友圈"
/>
<Button
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:layout_gravity=
"center"
android:onClick=
"shareWXSC"
android:text=
"分享微信收藏"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
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