79 lines
2.7 KiB
Java
79 lines
2.7 KiB
Java
package com.gh.gamecenter;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.text.Html;
|
|
import android.widget.ImageView;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import com.gh.base.ToolBarActivity;
|
|
import com.gh.common.util.ExtensionsKt;
|
|
import com.gh.common.util.MessageShareUtils;
|
|
import com.gh.common.util.MtaHelper;
|
|
import com.gh.common.util.QRCodeUtils;
|
|
import com.gh.common.util.ShareUtils;
|
|
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 ToolBarActivity {
|
|
|
|
@BindView(R.id.gh_address_qrcode)
|
|
ImageView mGhQrcode;
|
|
@BindView(R.id.gh_address_tv)
|
|
TextView mGhAddress;
|
|
@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);
|
|
setNavigationTitle(getString(R.string.title_share_gh));
|
|
ButterKnife.bind(this);
|
|
|
|
mGhAddress.setText(Html.fromHtml("<u>" + "www.ghzs.com" + "</u>"));
|
|
QRCodeUtils.setQRCode(this, getString(R.string.gh_website_url_100), mGhQrcode);
|
|
ShareUtils.getInstance(this).showShareWindows(this, mShareRl, getString(R.string.gh_website_url_300)
|
|
, getString(R.string.gh_icon_url), "玩手游不用肝的感觉真好"
|
|
, "绿色安全的手游加速助手", ShareUtils.ShareEntrance.shareGh, "");
|
|
}
|
|
|
|
@OnClick(R.id.gh_address_tv)
|
|
public void copyAddress() {
|
|
MtaHelper.onEvent("我的光环_新", "分享光环", "复制官网");
|
|
ExtensionsKt.copyTextAndToast(getString(R.string.gh_website_url_100), "网址复制成功,请到微信/QQ粘贴分享");
|
|
}
|
|
}
|