Commit 729994a5 authored by mengcuiguang2's avatar mengcuiguang2

添加支付宝任务 1.3.6发版

parent bd678a3d
......@@ -15,8 +15,8 @@ android {
applicationId "com.mints.goodmoney"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 35
versionName "1.3.5"
versionCode 36
versionName "1.3.6"
flavorDimensions "default"
// dex突破65535的限制
......
......@@ -200,6 +200,8 @@ public class MyInfo implements Serializable {
private String carrierType;
private String downloadUrl;
private String pkg;
private String pkgName;
private String toUrl;
private String key;
private String doubleCarrierType;
private int complete;
......@@ -208,6 +210,14 @@ public class MyInfo implements Serializable {
private int readCoin;
private int needSeconds;
public String getPkgName() {
return pkgName;
}
public String getTourl() {
return toUrl;
}
public String getDownloadUrl() {
return downloadUrl;
}
......
......@@ -65,6 +65,8 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
const val TO_MOKU = "TO_MOKU"
//愉悦赚
const val TO_YYZ="TO_YYZ"
// 三方积分墙
const val TO_OTHERAPP ="TO_OTHERAPP"
}
private var mContext: Context = context
......
......@@ -4,6 +4,7 @@ import android.Manifest
import android.annotation.SuppressLint
import android.app.Dialog
import android.content.*
import android.net.Uri
import android.os.Bundle
import android.text.TextUtils
import android.view.LayoutInflater
......@@ -605,6 +606,24 @@ class MyFragment : BaseFragment(),
R.id.item_task_click -> {
val taskBean = dataList[position]
when (taskBean.baseConfig.taskId) {
// 积分任务
MainMyAdapter.TO_OTHERAPP -> {
if (!TextUtils.isEmpty(taskBean.otherConfig.pkg) && !AppUtil.checkPackInfo(requireActivity(),taskBean.otherConfig.pkg)) {
showToast("请先安装"+taskBean.otherConfig.pkgName)
return
}
if(!TextUtils.isEmpty(taskBean.otherConfig.tourl)){
try {
val uri = Uri.parse(taskBean.otherConfig.tourl)
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}catch (e:Exception){
AppUtil.openBrowser(requireContext(),taskBean.otherConfig.tourl)
}
}
}
// 跳转珊瑚CPD下载试玩任务
MainMyAdapter.TO_CPD -> {
if (!UserManager.getInstance().userIsLogin()) {
......
......@@ -9,13 +9,11 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.provider.Settings
import com.fly.scenemodule.util.StringUtilMy
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import java.text.SimpleDateFormat
import java.util.*
/**
......@@ -162,5 +160,26 @@ object AppUtil {
return false
}
/**
* 跳转外部浏览器
*/
fun openBrowser(context: Context, url: String?) {
try {
val intent = Intent()
intent.action = Intent.ACTION_VIEW
intent.data = Uri.parse(url)
// 注意此处的判断intent.resolveActivity()可以返回显示该Intent的Activity对应的组件名
// 官方解释 : Name of the component implementing an activity that can display the intent
if (intent.resolveActivity(context.packageManager) != null) {
val componentName = intent.resolveActivity(context.packageManager)
LogUtil.d("suyan = " + componentName.className)
context.startActivity(Intent.createChooser(intent, "请选择浏览器"))
} else {
ToastUtil.show(context, "链接错误或无浏览器")
}
}catch (e:Exception){
e.printStackTrace()
}
}
}
\ 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