package com.gh.gamecenter.core.utils;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

import androidx.annotation.NonNull;

/**
 * @author CsHeng
 * @Date 17/05/2017
 * @Time 5:23 PM
 */

public class IntentUtils {

    public static Intent getWifiIntent() {
        return new Intent("android.settings.WIFI_SETTINGS");
    }

    @NonNull
    public static Intent getWechatShareIntent(Context context, String picName) {
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("image/*");
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + context.getExternalCacheDir().getPath() + "/ShareImg/" + picName));
        intent.setComponent(new ComponentName("com.tencent.mm", "com.tencent.mm.ui.tools.ShareImgUI"));
        return intent;
    }

    @NonNull
    public static Intent getSMSIntent(String smsBody) {
        Intent sendIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("smsto:"));
        sendIntent.putExtra("sms_body", smsBody);
        sendIntent.setType("vnd.android-dir/mms-sms");

        sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        return sendIntent;
    }

    @NonNull
    public static Intent getEmailToGHIntent() {
        Intent data = new Intent(Intent.ACTION_SENDTO);
        data.setData(Uri.parse("mailto:"));
        data.putExtra(Intent.EXTRA_SUBJECT, "快来试试光环助手");
        data.putExtra(Intent.EXTRA_TEXT, "我用光环助手一段时间了，在里面可以下载各种热门卡牌手游的加速版，绿色安全，超级省心，做日常效率提高3-5倍！\n" +
                "\n" +
                "不用肝的感觉真好，快来试试。\n" +
                "\n" +
                "光环助手官网地址：\n" +
                "\n" +
                "https://www.ghzs.com?source=appshare333");
        return data;
    }
}
