87 lines
2.8 KiB
Java
87 lines
2.8 KiB
Java
package com.gh.gamecenter;
|
|
|
|
import android.content.ClipboardManager;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.support.annotation.NonNull;
|
|
import android.text.Html;
|
|
import android.widget.Button;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
|
|
import com.gh.base.BaseActivity;
|
|
import com.gh.common.util.MessageShareUtils;
|
|
import com.gh.common.util.QRCodeUtils;
|
|
import com.gh.common.util.ShareUtils;
|
|
import com.lightgame.utils.Utils;
|
|
import com.tencent.tauth.Tencent;
|
|
|
|
import butterknife.BindView;
|
|
import butterknife.ButterKnife;
|
|
import butterknife.OnClick;
|
|
|
|
/**
|
|
* Created by khy on 2017/2/6.
|
|
*/
|
|
public class ShareGhActivity extends BaseActivity {
|
|
|
|
@BindView(R.id.gh_address_qrcode)
|
|
ImageView mGhQrcode;
|
|
@BindView(R.id.gh_address_tv)
|
|
TextView mGhAddress;
|
|
@BindView(R.id.wifi_share_btn)
|
|
Button mWifiShareBtn;
|
|
@BindView(R.id.content_ll)
|
|
LinearLayout mContentLl;
|
|
@BindView(R.id.share_rl)
|
|
RelativeLayout mShareRl;
|
|
|
|
@NonNull
|
|
public static Intent getIntent(Context context) {
|
|
Intent intent = new Intent(context, ShareGhActivity.class);
|
|
return intent;
|
|
}
|
|
|
|
@Override
|
|
protected int getLayoutId() {
|
|
return R.layout.activity_share_gh;
|
|
}
|
|
|
|
@Override
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
if (requestCode == com.tencent.connect.common.Constants.REQUEST_QQ_SHARE
|
|
|| requestCode == com.tencent.connect.common.Constants.REQUEST_QZONE_SHARE) {
|
|
Tencent.onActivityResultData(requestCode, resultCode, data, MessageShareUtils.getInstance(this).QqShareListener);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
initTitle(getString(R.string.title_share_gh));
|
|
ButterKnife.bind(this);
|
|
|
|
mGhAddress.setText(Html.fromHtml("<u>" + "www.ghzs.com" + "</u>"));
|
|
QRCodeUtils.setQRCode(this, "http://www.ghzs.com/link?source=appshare100", mGhQrcode);
|
|
ShareUtils.getInstance(this).showShareWindows(mShareRl, "http://www.ghzs.com/link?source=appshare300", "光环助手"
|
|
, "http://image.ghzs666.com/pic/57d604808ab49e467d8b4568.png", null, false, false, false);
|
|
}
|
|
|
|
@OnClick(R.id.wifi_share_btn)
|
|
public void skipWifiShare() {
|
|
startActivity(ShareGhWfifActivity.getIntent(this));
|
|
}
|
|
|
|
@OnClick(R.id.gh_address_tv)
|
|
public void copyAddress() {
|
|
ClipboardManager cmb = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
|
cmb.setText("http://www.ghzs.com/link?source=appshare100");
|
|
|
|
Utils.toast(this, "网址复制成功,请到微信/QQ粘贴分享");
|
|
}
|
|
}
|