Commit d74004da authored by zhengyingbing's avatar zhengyingbing
Browse files

(feat)app: 1.更新FastSdk版本 2.增加海外新接口调用示例 3.更新过时接口 4.界面优化

parent 8167bdc4
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 29 compileSdkVersion 30
defaultConfig { defaultConfig {
applicationId "com.hoolai.demo" applicationId "com.hoolai.demo"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }
...@@ -33,5 +33,5 @@ android { ...@@ -33,5 +33,5 @@ android {
} }
dependencies { dependencies {
implementation 'com.hoolai.access.open:hoolai-core:1.0.3.13' implementation 'com.hoolai.access.open:hoolai-core:1.0.3.18'
} }
\ No newline at end of file
U5D6xeVbpFwWQ1mWngHD1tk8ZfRe5b2AHfHIfiHkH+saDUbOm4IaliwNG8OrlZYQwlwM/a2VRx9UPrmY8PfMvOtVhmEAr3QhvvPePyjaxlD5bV3JPCdRtDXHY016AJJkOA0z19r+ykw7InaQl6EPQqBMrG40JdcoLX1bUExcP6kUErM235MqneofskC5jNJs/IOGUmNGWEIaYJYXNdIN08Z1Tn6CQgIYGdxTlcziJ1kCzWDOa8N0jN+r1qxAChgGVPFctW4rA9qj7AGG/xMyELEVJMTu4dSQh5BdfCgY0RrqaZclgxXtK4pYEcec7pB5+caZVeyspgHaxCEGshYeYkl66JnOO2doPTKYt51px0IVx4PoW+IzMKe7Q30xuf0937UrEMSFnYMA77Zs7GnTaZswkKh1kbrzxks8Cf7ZwCN7sKfqXjBFeE/8ojWFoRIUVDdBr4CzShjvI42wRsTky9flFhjHy7SQFXv/17udeETDuruV8PJCZOzZ04h+hLrvrCbZK9PHJV+bpd/ydGkXsB8sP25IRUVSpiEAPRvB955DBQepTrCz+kgQnlWimq0pRauP8PiPxGsomOGdV8aW26ujm/FmicteW9j2Gn1vdF0U5njXYlM+5bLnlYeU8MvKZvjTahbXY5fXRjPMv8z5JKHJZAeXnYIiuKtRV/MiABY= U5D6xeVbpFwWQ1mWngHD1tk8ZfRe5b2AHfHIfiHkH+saDUbOm4IaliwNG8OrlZYQwlwM/a2VRx9UPrmY8PfMvOtVhmEAr3QhvvPePyjaxlD5bV3JPCdRtDXHY016AJJkOA0z19r+ykw7InaQl6EPQqBMrG40JdcoLX1bUExcP6kUErM235MqneofskC5jNJs/IOGUmNGWEIaYJYXNdIN08Z1Tn6CQgIYGdxTlcziJ1kCzWDOa8N0jN+r1qxAChgGVPFctW4rA9qj7AGG/xMyELEVJMTu4dSQh5BdfCgY0RrqaZclgxXtK4pYEcec7pB5+caZVeyspgHaxCEGshYeYkEeAVnvJxwM2w7Cl74le4b/biHCWwwoqJEnAd2dwVdgx/y3yzJm46VJTeMcndrxV9rkN3S4a0xRMhPh2xW6eSUs1u8aJ5j9lCx8yV2g1Sr5e5MuYiJqF79AEwH3PHEEevMbhFriSzn8Vwk/+aD9E66LpFuby9uKzxePC+3aIE8/Awepb5FRD/udQj1mktA6KhtdXOPnFrwpAAXi3z66eIsK6sJ0PEAlRrzYefP6eJ9iGyDRPrjernWDjH83n5V/1QTaBqdQu1ZJHiid9oaQRkoZdpL3TodZI/Zd7BEJ+ysvQxsS+g8iHFDyRJWZlvo3gMrKxMPncf2h19PkMniGuAlwu77kb13TCxw/fAz6UTDK5sxveFOM4zyCfM5NLNfJJKMC1A4TyrpMv7GTjZHn2pIBkEJmn3BHg0KuJmYOFil9/D0RSGlPpBej/VOAnPZ+B/MzDs9XEhvIwuJR8B76Mt/lRJnv11hqus93usKfIG4k8MgP+LAAGCa80vrGu30Dx1j9wH0s9Fdf/DYxwLJ/V4PG6K5nosQNx1Bh09wiR6Zsno+2YipX1I8G5cbY+Kf2YyZrYH6d2cA2SSzxJDNUDrA5UPJNWp31duByk9tkOslJMm95b357yfOiNWJRGofvtTbXXdbHfu89v3TSHAsIFyOhayaSSzm0U6pQ39PxqBgD
\ No newline at end of file \ No newline at end of file
...@@ -7,8 +7,11 @@ import android.content.Intent; ...@@ -7,8 +7,11 @@ import android.content.Intent;
import android.content.pm.PackageManager; 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.view.View; import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.LinearLayout;
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;
...@@ -19,6 +22,7 @@ import com.hoolai.access.open.fastaccess.channel.request.PlayerInfo; ...@@ -19,6 +22,7 @@ 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.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.HLDeepLinkListener;
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.HLShareListener;
import com.hoolai.access.open.fastaccess.interf.HLSystemListener; import com.hoolai.access.open.fastaccess.interf.HLSystemListener;
...@@ -39,6 +43,8 @@ public class MainActivity extends Activity { ...@@ -39,6 +43,8 @@ public class MainActivity extends Activity {
private boolean isInit, isLogin; private boolean isInit, isLogin;
private TextView textView; private TextView textView;
private Button initBtn; private Button initBtn;
private ScrollView scrollView;
private LinearLayout linearLayout;
private String str = ""; private String str = "";
@Override @Override
...@@ -47,16 +53,23 @@ public class MainActivity extends Activity { ...@@ -47,16 +53,23 @@ public class MainActivity extends Activity {
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
textView = findViewById(R.id.textview); textView = findViewById(R.id.textview);
initBtn = findViewById(R.id.initBtn); initBtn = findViewById(R.id.initBtn);
scrollView = findViewById(R.id.scrollView);
linearLayout = findViewById(R.id.linearLayout);
setText("调用初始化");
//先注册回调监听,再调用初始化
registerListeners();
FastSdk.onCreate(MainActivity.this);
}
//声明系统回调(初始化,退出,版本升级)监听 private void registerListeners(){
//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(">>初始化成功"); setText(">>初始化成功:" + initResult.toString());
initBtn.setVisibility(View.GONE); initBtn.setVisibility(View.GONE);
// 如用到敏感权限,调用以下方法
//单个权限申请 //单个权限申请
boolean hasPermission = FastSdk.checkPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE); boolean hasPermission = FastSdk.checkPermission(MainActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
//批量权限申请,showRefusedTip:拒绝后是否弹框提示(一般当拒绝权限会影响功能时设置为true) //批量权限申请,showRefusedTip:拒绝后是否弹框提示(一般当拒绝权限会影响功能时设置为true)
...@@ -70,8 +83,8 @@ public class MainActivity extends Activity { ...@@ -70,8 +83,8 @@ public class MainActivity extends Activity {
@Override @Override
public void onInitFailed(String reason) { public void onInitFailed(String reason) {
Logger.data(TAG,"初始化失败:"+reason); Logger.data(TAG,"初始化失败:" + reason);
setText(">>初始化失败"); setText(">>初始化失败:" + reason);
initBtn.setVisibility(View.VISIBLE); initBtn.setVisibility(View.VISIBLE);
} }
...@@ -106,7 +119,7 @@ public class MainActivity extends Activity { ...@@ -106,7 +119,7 @@ public class MainActivity extends Activity {
Logger.data(TAG,"升级:" + data); Logger.data(TAG,"升级:" + data);
} }
}; };
//声明账号回调监听 //TODO:账号回调监听(必接)
FastSdk.hlAccountListener = new HLAccountListener() { FastSdk.hlAccountListener = new HLAccountListener() {
@Override @Override
public void onRefreshUser(LoginResult result) { public void onRefreshUser(LoginResult result) {
...@@ -123,7 +136,7 @@ public class MainActivity extends Activity { ...@@ -123,7 +136,7 @@ public class MainActivity extends Activity {
@Override @Override
public void onLoginFailed(String reason) { public void onLoginFailed(String reason) {
Logger.data(TAG,"登录失败:" + reason); Logger.data(TAG,"登录失败:" + reason);
setText(">>登录失败"); setText(">>登录失败:" + reason);
} }
@Override @Override
...@@ -133,6 +146,7 @@ public class MainActivity extends Activity { ...@@ -133,6 +146,7 @@ public class MainActivity extends Activity {
isLogin = false; isLogin = false;
} }
}; };
//TODO:支付回调监听(必接)
FastSdk.hlPaymentListener = new HLPaymentListener() { FastSdk.hlPaymentListener = new HLPaymentListener() {
@Override @Override
public void onPaySuccess(String result) { public void onPaySuccess(String result) {
...@@ -143,7 +157,7 @@ public class MainActivity extends Activity { ...@@ -143,7 +157,7 @@ public class MainActivity extends Activity {
@Override @Override
public void onPayFailed(String reason) { public void onPayFailed(String reason) {
Logger.data(TAG,"支付失败:" + reason); Logger.data(TAG,"支付失败:" + reason);
setText(">>支付失败"); setText(">>支付失败:" + reason);
} }
@Override @Override
...@@ -153,6 +167,7 @@ public class MainActivity extends Activity { ...@@ -153,6 +167,7 @@ public class MainActivity extends Activity {
setText(">>商品信息获取成功"); setText(">>商品信息获取成功");
} }
}; };
//TODO:如果没有分享功能可忽略
FastSdk.hlShareListener = new HLShareListener() { FastSdk.hlShareListener = new HLShareListener() {
@Override @Override
public void onShareSuccess() { public void onShareSuccess() {
...@@ -164,11 +179,113 @@ public class MainActivity extends Activity { ...@@ -164,11 +179,113 @@ public class MainActivity extends Activity {
} }
}; };
FastSdk.onCreate(MainActivity.this); //TODO:如果没有Facebook的deeplink功能可忽略
FastSdk.hlDeepLinkListener = new HLDeepLinkListener() {
@Override
public void onDeepLinkSuccess(String result) {
HLDeepLinkListener.super.onDeepLinkSuccess(result);
}
};
}
public void init(View v){
setText("调用初始化"); setText("调用初始化");
FastSdk.onCreate(this);
}
public void login(View v){
if (isInit){
setText("调用登录");
FastSdk.login();
}else{
ToastUtils.toast("请先初始化");
}
}
public void baseTrack(View v){
if (isLogin){
setText("创角,进服,升级报送");
FastSdk.report(EventType.CreateRole, getPlayerInfo());
FastSdk.report(EventType.EnterServer, getPlayerInfo());
FastSdk.report(EventType.LevelUp, getPlayerInfo());
setText(">>报送内容:" + getPlayerInfo());
}else{
loginFirst();
}
}
public void customTrack(View v){
if (isInit){
setText("自定义报送");
FastSdk.report(EventType.CustomerAction, getPlayerInfo());
setText(">>报送内容:" + getPlayerInfo());
}else{
ToastUtils.toast("请先初始化");
}
}
/**
* 方舟报送-自定义报点
* action:报点名称
* @param v
*/
public void fangZhouReport(View v){
setText("方舟报送");
String action = "game_xxx";
Map<String, Object> hashMap = new HashMap<>();
hashMap.put("xxx", 123);
hashMap.put("ooo", "321");
FastSdk.gameDataReport(action, hashMap);
}
public void logout(View v){
if (isLogin){
setText("调用登出");
FastSdk.logout();
}else{
loginFirst();
}
}
public void getPriceInfo(View v){
if (isLogin){
setText("查询商品");
FastSdk.queryGoodsInfo();
}else{
loginFirst();
}
}
public void doPay(View v){
if (isLogin){
int amount = 1;//单位:分
setText("调用支付:" + getPayParams(amount));
FastSdk.pay(getPayParams(amount));
}else{
loginFirst();
}
}
public void exit(View v){
setText("调用退出");
FastSdk.exit();
}
public void openAccountCenter(View v){
setText("打开用户中心");
FastSdk.openAccountCenter(this);
}
public void openKeFu(View v){
setText("打开客服");
FastSdk.openService(this);
}
public void share(View v){
ShareActivity.start(this);
} }
//TODO +++++++++++++++++++++++++++++++++++生命周期方法接入start+++++++++++++++++++++++++++++++++++
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
FastSdk.onSaveInstanceState(outState); FastSdk.onSaveInstanceState(outState);
...@@ -221,6 +338,7 @@ public class MainActivity extends Activity { ...@@ -221,6 +338,7 @@ public class MainActivity extends Activity {
@Override @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) { protected void onActivityResult(int requestCode, int resultCode, Intent data) {
Logger.i("MainActivity.onActivityResult");
FastSdk.onActivityResult(this, requestCode, resultCode, data); FastSdk.onActivityResult(this, requestCode, resultCode, data);
} }
...@@ -236,9 +354,6 @@ public class MainActivity extends Activity { ...@@ -236,9 +354,6 @@ public class MainActivity extends Activity {
Logger.i("权限已被拒绝"); Logger.i("权限已被拒绝");
} }
} }
// else if (requestCode == Math.abs(Manifest.permission.CAMERA.hashCode())){
//
// }
} }
@Override @Override
...@@ -247,6 +362,7 @@ public class MainActivity extends Activity { ...@@ -247,6 +362,7 @@ public class MainActivity extends Activity {
FastSdk.onConfigurationChanged(this, newConfig, getResources()); FastSdk.onConfigurationChanged(this, newConfig, getResources());
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
setText("调用返回"); setText("调用返回");
...@@ -265,84 +381,9 @@ public class MainActivity extends Activity { ...@@ -265,84 +381,9 @@ public class MainActivity extends Activity {
FastSdk.onWindowFocusChanged(hasFocus); FastSdk.onWindowFocusChanged(hasFocus);
} }
public void init(View v){ //TODO ++++++++++++++++++++++++++++++++++ 生命周期方法接入end +++++++++++++++++++++++++++++++++++
setText("调用初始化");
FastSdk.onCreate(this);
}
public void login(View v){
if (isInit){
setText("调用登录");
FastSdk.login();
}else{
ToastUtils.toast("请先初始化");
}
}
public void createRole(View v){
if (isLogin){
setText("创角,进服,升级报送");
FastSdk.report(EventType.CreateRole, getPlayerInfo());
FastSdk.report(EventType.EnterServer, getPlayerInfo());
FastSdk.report(EventType.LevelUp, getPlayerInfo());
}else{
loginFirst();
}
}
public void customTrack(View v){
if (isInit){
setText("自定义报送");
FastSdk.report(EventType.CustomerAction, getPlayerInfo());
}else{
ToastUtils.toast("请先初始化");
}
}
public void fangZhouReport(View v){
String action = "game_xxx";
Map<String, Object> hashMap = new HashMap<>();
hashMap.put("xxx", 123);
hashMap.put("ooo", "321");
FastSdk.gameDataReport(action, hashMap);
}
public void logout(View v){
if (isLogin){
setText("调用登出");
FastSdk.logout();
}else{
loginFirst();
}
}
public void getPriceInfo(View v){
if (isLogin){
setText("查询商品");
FastSdk.queryGoodsInfo();
}else{
loginFirst();
}
}
public void doPay(View v){
if (isLogin){
int amount = 1;//单位:分
setText("调用支付");
FastSdk.pay(this, getPayParams(amount));
}else{
loginFirst();
}
}
public void exit(View v){
setText("调用退出");
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
...@@ -356,10 +397,10 @@ public class MainActivity extends Activity { ...@@ -356,10 +397,10 @@ public class MainActivity extends Activity {
playerInfo.setVip("1"); playerInfo.setVip("1");
playerInfo.setPartyName("帮派名称"); playerInfo.setPartyName("帮派名称");
playerInfo.setClassField("aaaa"); playerInfo.setClassField("aaaa");
//扩展信息,格式:key:value,key:value,需要探测的地址放到此参数中 //extra格式:key:value,key:value,需要探测的地址放到此参数中
//注意:探测地址的冒号用@替换,key必须使用以下三个字段:gameResourceUrl/gameLoginServerUrl/gameServerUrl //注意:探测地址的冒号用@替换,key必须使用以下三个字段:gameResourceUrl/gameLoginServerUrl/gameServerUrl
//TODO 详情:https://wanda.feishu.cn/wiki/wikcniSxQbyvqU3bzuXeOtpEcGc //TODO 详情:https://wanda.feishu.cn/wiki/wikcniSxQbyvqU3bzuXeOtpEcGc
playerInfo.setExtra("a:arm,b:bom,gameResourceUrl:aaa,gameLoginServerUrl:bbb,gameServerUrl:ccc"); playerInfo.setExtra("a:arm,b:bom,gameResourceUrl:http@game1.com,gameLoginServerUrl:tcp@game2.com,gameServerUrl:https@game3.com");
playerInfo.setPhylum("1"); playerInfo.setPhylum("1");
return playerInfo; return playerInfo;
} }
...@@ -376,8 +417,23 @@ public class MainActivity extends Activity { ...@@ -376,8 +417,23 @@ public class MainActivity extends Activity {
return payParams; return payParams;
} }
private void setText(String temp){ private void setText(String temp){
str = str + temp + "\n"; str = str + temp + "\n\n";
textView.setText(str); textView.setText(str);
Handler mHandler = new Handler();
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
if (scrollView == null || linearLayout == null) {
return;
}
//end要显示的位置,可以根据自己的需要来计算
int end = (linearLayout.getMeasuredHeight() - scrollView.getHeight());
if (end < 0) {
end = 0;
}
scrollView.scrollTo(0, end);
}
}, 500);//延迟500ms启动
} }
private void loginFirst(){ private void loginFirst(){
......
...@@ -23,6 +23,7 @@ public class ProductUtils { ...@@ -23,6 +23,7 @@ public class ProductUtils {
return; return;
} }
AlertDialog.Builder builder = new AlertDialog.Builder(activity); AlertDialog.Builder builder = new AlertDialog.Builder(activity);
AlertDialog dialog = builder.create();
ListView listView = new ListView(activity); ListView listView = new ListView(activity);
listView.setAdapter(new ArrayAdapter(activity, android.R.layout.simple_list_item_1, android.R.id.text1, list)); listView.setAdapter(new ArrayAdapter(activity, android.R.layout.simple_list_item_1, android.R.id.text1, list));
listView.setOnItemClickListener((parent, view1, position, id) -> { listView.setOnItemClickListener((parent, view1, position, id) -> {
...@@ -46,11 +47,12 @@ public class ProductUtils { ...@@ -46,11 +47,12 @@ public class ProductUtils {
Map<String, String> map = new ConcurrentHashMap<>(); Map<String, String> map = new ConcurrentHashMap<>();
map.put("isSupportThirdPayment", "true");//是否支持google之外的三方支付 map.put("isSupportThirdPayment", "true");//是否支持google之外的三方支付
map.put("payType", "1");// 1 钱包(默认此类型) 2 点卡 map.put("payType", "1");// 1 钱包(默认此类型) 2 点卡
map.put("currency", payInfo.getShowTag());//币种 map.put("currency", "CNY");//币种
payParams.setOpt(map); payParams.setOpt(map);
FastSdk.pay(activity, payParams); FastSdk.pay(payParams);
dialog.dismiss();
}); });
builder.setView(listView); dialog.setView(listView);
builder.show(); dialog.show();
} }
} }
...@@ -12,9 +12,6 @@ import android.net.Uri; ...@@ -12,9 +12,6 @@ import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.view.View; import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import com.hoolai.access.open.fastaccess.channel.FastSdk; import com.hoolai.access.open.fastaccess.channel.FastSdk;
...@@ -26,10 +23,6 @@ public class ShareActivity extends Activity { ...@@ -26,10 +23,6 @@ public class ShareActivity extends Activity {
private TextView picPathTv, contentTv; private TextView picPathTv, contentTv;
private String picPath = "";//图片url private String picPath = "";//图片url
private ShareParams params;//分享参数 private ShareParams params;//分享参数
private ShareType shareType;//分享类型
private EditText share_title, share_content, share_url;
private CheckBox share_check;
private int qqShareType;//qq分享类型,1:图片+文字 2:图片
private static final int REQUEST_CODE = 100; private static final int REQUEST_CODE = 100;
...@@ -39,17 +32,6 @@ public class ShareActivity extends Activity { ...@@ -39,17 +32,6 @@ public class ShareActivity extends Activity {
setContentView(R.layout.activity_share); setContentView(R.layout.activity_share);
picPathTv = findViewById(R.id.pic_path); picPathTv = findViewById(R.id.pic_path);
contentTv = findViewById(R.id.main_tv); 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() { FastSdk.hlShareListener = new HLShareListener() {
@Override @Override
public void onShareSuccess() { public void onShareSuccess() {
...@@ -86,14 +68,13 @@ public class ShareActivity extends Activity { ...@@ -86,14 +68,13 @@ public class ShareActivity extends Activity {
if (requestCode == Manifest.permission.WRITE_EXTERNAL_STORAGE.hashCode()){ if (requestCode == Manifest.permission.WRITE_EXTERNAL_STORAGE.hashCode()){
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
params = new ShareParams(); params = new ShareParams();
params.setTitle(share_title.getText().toString()); params.setTitle("分享标题");
params.setContent(share_content.getText().toString()); params.setContent("分享内容");
params.setShareUrl("dongqiudi://share/circle/"); params.setShareUrl("dongqiudi://share/circle/");
params.setCallbackUrl("game://share/callback"); params.setCallbackUrl("game://share/callback");
params.setId("100"); params.setId("100");
params.setPicPath(picPath); params.setPicPath(picPath);
shareType = ShareType.DQD; FastSdk.share(ShareType.DQD, ShareType.ChildType.DQD, params);
share();
} }
} }
} }
...@@ -104,88 +85,59 @@ public class ShareActivity extends Activity { ...@@ -104,88 +85,59 @@ public class ShareActivity extends Activity {
startActivityForResult(intent, 100); startActivityForResult(intent, 100);
} }
//分享懂球帝 //懂球帝分享
public void shareDQD(View v){ public void shareDQD(){
if(FastSdk.checkPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)){ if(FastSdk.checkPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)){
params = new ShareParams(); params = new ShareParams();
params.setTitle(share_title.getText().toString()); params.setTitle("分享标题");
params.setContent(share_content.getText().toString()); params.setContent("分享内容");
params.setShareUrl("dongqiudi://share/circle/"); params.setShareUrl("dongqiudi://share/circle/");
params.setCallbackUrl("game://share/callback"); params.setCallbackUrl("game://share/callback");
params.setId("100"); params.setId("100");
params.setPicPath(picPath); params.setPicPath(picPath);
shareType = ShareType.DQD; FastSdk.share(ShareType.DQD, ShareType.ChildType.DQD, params);
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 //QQ分享(文字、图片)
public void shareQQ(View v){ public void shareQQ(View v){
shareType = ShareType.QQ; ShareParams params = new ShareParams();
params = new ShareParams(); params.setTitle("分享标题");
params.setTitle(share_title.getText().toString()); params.setContent("分享内容");
params.setContent(share_content.getText().toString());
params.setQqType(qqShareType);
params.setShowQQZone(false);
params.setPicPath(picPath); params.setPicPath(picPath);
params.setShareUrl(share_url.getText().toString()); FastSdk.share(ShareType.QQ, ShareType.ChildType.QQ_IMG, params);
share();
} }
//分享微信-聊天 //微信分享(文字、图片)
public void shareWX(View v){ public void shareWX(View v){
Bitmap bmp = BitmapFactory.decodeResource(this.getResources(), R.drawable.icon); Bitmap bmp = BitmapFactory.decodeResource(this.getResources(), R.drawable.icon);
shareType = ShareType.WX; ShareParams params = new ShareParams();
params = new ShareParams(); params.setTitle("分享标题");
params.setTitle(share_title.getText().toString()); params.setContent("分享内容");
params.setContent(share_content.getText().toString()); params.setShareUrl("分享链接");
params.setShareUrl(share_url.getText().toString()); params.setPicPath("图片地址");
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.setBmp(bmp);
params.setWxType(3); FastSdk.share(ShareType.WX, ShareType.ChildType.WX_CHAT, params);
share(); }
}
//Facebook分享(链接、图片、视频)
private void share(){ public void shareFacebook(View v){
FastSdk.share(this, shareType, params); ShareParams params = new ShareParams();
params.setTitle("分享标题");
params.setContent("分享内容");
params.setShareUrl("分享链接");
params.setPicPath("图片/视频链接");
FastSdk.share(ShareType.FACEBOOK, ShareType.ChildType.FACEBOOK_IMG, params);
}
//系统分享(文字、图片、文件)
public void shareSystem(View v){
ShareParams params = new ShareParams();
params.setTitle("分享标题");
params.setContent("分享内容");
params.setShareUrl("分享链接");
params.setPicPath("图片/视频链接");
FastSdk.share(ShareType.SYSTEM, ShareType.ChildType.SYSTEM_IMG, params);
} }
private String getImagePath(Uri uri) { private String getImagePath(Uri uri) {
......
...@@ -6,104 +6,137 @@ ...@@ -6,104 +6,137 @@
android:orientation="horizontal"> android:orientation="horizontal">
<ScrollView <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_weight="1"
android:layout_margin="10dp" android:layout_margin="10dp"
android:padding="20dp" android:layout_weight="1"
android:fadeScrollbars="false"
android:background="#eee" android:background="#eee"
android:fadeScrollbars="false"
android:fillViewport="true"> android:fillViewport="true">
<LinearLayout <LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:padding="20dp">
<TextView <TextView
android:id="@+id/textview" android:id="@+id/textview"
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:textSize="12dp" android:textColor="#111"
android:textColor="#111"/> android:textSize="12dp" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="5dp" android:paddingRight="5dp">
android:orientation="vertical">
<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">
<Button <Button
android:id="@+id/initBtn" android:id="@+id/initBtn"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" android:layout_weight="1"
android:onClick="init" android:onClick="init"
android:text="初始化" /> android:text="初始化"
android:visibility="gone" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:onClick="login" android:onClick="login"
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">
<Button
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="2"
android:onClick="baseTrack"
android:text="创角/进服/升级" />
<Button <Button
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="1" android:layout_weight="1"
android:onClick="logout" android:onClick="customTrack"
android:text="登出" /> android:text="自定义" />
<Button <Button
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="1" android:layout_weight="1"
android:onClick="exit" android:onClick="fangZhouReport"
android:text="退出" /> android:text="方舟报送" />
</LinearLayout> </LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_gravity="center"
android:onClick="doPay"
android:text="支付" />
<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">
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="2"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="createRole" android:layout_weight="1"
android:text="创角/进服/升级" /> android:onClick="share"
android:text="分享" />
<Button <Button
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="1" android:layout_weight="1"
android:onClick="customTrack" android:onClick="logout"
android:text="自定义" /> android:text="登出" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="fangZhouReport" android:layout_weight="1"
android:text="方舟报送" /> android:onClick="exit"
android:text="退出" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="————以下接口仅海外项目参考————"
android:textColor="#e00" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
...@@ -115,28 +148,33 @@ ...@@ -115,28 +148,33 @@
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:onClick="getPriceInfo" android:onClick="getPriceInfo"
android:text="商品信息(海外)" /> 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>
<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">
<Button <Button
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="1" android:layout_weight="1"
android:onClick="share" android:onClick="openAccountCenter"
android:text="分享" /> android:text="用户中心" />
<Button
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="openKeFu"
android:text="客服(可选)" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -32,111 +32,68 @@ ...@@ -32,111 +32,68 @@
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<EditText
android:id="@+id/share_title"
android:layout_width="match_parent"
android:layout_height="42dp"
android:text="我是标题"
android:hint="标题" />
<EditText
android:id="@+id/share_content"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="我是内容"
android:hint="内容" />
<EditText
android:id="@+id/share_url"
android:layout_width="match_parent"
android:layout_height="42dp"
android:hint="链接"
android:text="https://xx.com" />
<Button <Button
android:id="@+id/share_select" android:id="@+id/share_select"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="42dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_margin="10dp"
android:onClick="shareSelect" android:onClick="shareSelect"
android:text="选择图片" /> android:text="选择图片" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:orientation="horizontal"
android:paddingRight="10dp">
<TextView <TextView
android:id="@+id/pic_path" android:id="@+id/pic_path"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:textSize="12sp" android:layout_margin="10dp"
android:layout_weight="1"/> android:textColor="#009FEC"/>
<CheckBox
android:id="@+id/share_check"
android:layout_width="100dp"
android:layout_height="match_parent"
android:text="QQ图文"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1" 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_gravity="center"
android:layout_weight="1"
android:onClick="shareQQ" android:onClick="shareQQ"
android:text="分享QQ" /> android:text="QQ分享" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:onClick="shareQQZone" android:layout_gravity="center"
android:text="分享QQ+空间" /> android:onClick="shareWX"
</LinearLayout> android:text="微信分享" />
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1" 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_gravity="center"
android:layout_weight="1" android:onClick="shareFacebook"
android:onClick="sharePYQ" android:text="FaceBook分享" />
android:text="分享朋友圈" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:onClick="shareWXSC" android:layout_gravity="center"
android:text="分享微信收藏" /> android:onClick="shareSystem"
android:text="系统分享" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -6,50 +6,59 @@ ...@@ -6,50 +6,59 @@
android:orientation="vertical"> android:orientation="vertical">
<ScrollView <ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"
android:layout_margin="10dp" android:layout_margin="10dp"
android:padding="20dp" android:layout_weight="1"
android:fadeScrollbars="false"
android:background="#eee" android:background="#eee"
android:fadeScrollbars="false"
android:fillViewport="true"> android:fillViewport="true">
<LinearLayout <LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:padding="20dp">
<TextView <TextView
android:id="@+id/textview" android:id="@+id/textview"
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:textSize="12dp" android:textColor="#111"
android:textColor="#111"/> android:textSize="12dp" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<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">
<Button <Button
android:id="@+id/initBtn" android:id="@+id/initBtn"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" android:layout_weight="1"
android:onClick="init" android:onClick="init"
android:text="初始化" /> android:text="初始化"
android:visibility="gone" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:onClick="login" android:onClick="login"
android:text="登录" /> android:text="登录" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
...@@ -57,6 +66,7 @@ ...@@ -57,6 +66,7 @@
android:layout_weight="1" android:layout_weight="1"
android:onClick="logout" android:onClick="logout"
android:text="登出" /> android:text="登出" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
...@@ -74,22 +84,24 @@ ...@@ -74,22 +84,24 @@
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="2"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="createRole" android:layout_weight="2"
android:onClick="baseTrack"
android:text="创角/进服/升级" /> android:text="创角/进服/升级" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:onClick="customTrack" android:onClick="customTrack"
android:text="自定义" /> android:text="自定义" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1"
android:onClick="fangZhouReport" android:onClick="fangZhouReport"
android:text="方舟报送" /> android:text="方舟报送" />
</LinearLayout> </LinearLayout>
...@@ -99,33 +111,66 @@ ...@@ -99,33 +111,66 @@
android:layout_height="48dp" android:layout_height="48dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
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="1" android:layout_weight="1"
android:onClick="getPriceInfo" android:onClick="doPay"
android:text="商品信息(海外)" /> android:text="定额支付" />
</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"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_weight="1" android:layout_weight="1"
android:onClick="doPay" android:onClick="share"
android:text="定额支付" /> android:text="分享" />
</LinearLayout> </LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="————以下接口仅海外项目参考————"
android:textColor="#e00" />
<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">
<Button <Button
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="1" android:layout_weight="1"
android:onClick="share" android:onClick="getPriceInfo"
android:text="分享" /> android:text="商品信息" />
<Button
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="openAccountCenter"
android:text="用户中心" />
<Button
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="openKeFu"
android:text="客服(可选)" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
......
...@@ -20,114 +20,73 @@ ...@@ -20,114 +20,73 @@
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:textColor="#333" android:textColor="#333"
android:text="分享结果" android:text="分享结果"
android:textSize="18sp" /> android:textSize="14sp" />
</ScrollView> </ScrollView>
<EditText
android:id="@+id/share_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="我是标题"
android:hint="标题"/>
<EditText
android:id="@+id/share_content"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_margin="10dp"
android:text="我是内容"
android:hint="内容"/>
<EditText
android:id="@+id/share_url"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="https://xx.com"
android:hint="链接"/>
<Button <Button
android:id="@+id/share_select" android:id="@+id/share_select"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_margin="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="shareSelect" android:onClick="shareSelect"
android:text="选择图片" /> android:text="选择图片" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:orientation="horizontal"
android:paddingRight="10dp">
<TextView <TextView
android:id="@+id/pic_path" android:id="@+id/pic_path"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_weight="1"/> android:layout_margin="10dp"
<CheckBox android:textColor="#009FEC"/>
android:id="@+id/share_check"
android:layout_width="80dp"
android:layout_height="match_parent"
android:text="图文"/>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:orientation="horizontal"> 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 <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="shareQQ" android:onClick="shareQQ"
android:text="分享QQ" /> android:text="QQ分享" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="shareQQZone" android:onClick="shareWX"
android:text="分享QQ+空间" /> android:text="微信分享" />
</LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="48dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="shareWX" android:onClick="shareFacebook"
android:text="分享微信" /> android:text="FaceBook分享" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:onClick="sharePYQ"
android:text="分享朋友圈" />
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:layout_gravity="center" android:layout_gravity="center"
android:onClick="shareWXSC" android:onClick="shareSystem"
android:text="分享微信收藏" /> android:text="系统分享" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment