paypal支付账号信息的展示

This commit is contained in:
2026-06-09 17:05:44 +08:00
parent f3ccb1f4ec
commit bb5bd7adf3
46 changed files with 737 additions and 317 deletions

2
.idea/gradle.xml generated
View File

@@ -6,7 +6,7 @@
<GradleProjectSettings> <GradleProjectSettings>
<option name="testRunner" value="CHOOSE_PER_TEST" /> <option name="testRunner" value="CHOOSE_PER_TEST" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="jbr-21" /> <option name="gradleJvm" value="#GRADLE_LOCAL_JAVA_HOME" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />

View File

@@ -1 +1 @@
#Tue Apr 21 16:52:55 CST 2026 #Thu Jun 04 09:43:21 CST 2026

View File

@@ -28,9 +28,9 @@ android {
applicationId "com.abbidot.tracker" applicationId "com.abbidot.tracker"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 35 targetSdkVersion 35
versionCode 2209 versionCode 2210
versionName "2.2.9" // versionName "2.2.10"
// versionName "2.2.9-Beta1" versionName "2.2.10-Beta2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -77,9 +77,9 @@
<uses-permission <uses-permission
android:name="android.permission.REQUEST_INSTALL_PACKAGES" android:name="android.permission.REQUEST_INSTALL_PACKAGES"
tools:node="remove" /> <!-- Android 13上一新增运行时权限 --> tools:node="remove" /> <!-- Android 13上一新增运行时权限 -->
<!-- <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />--> <!-- <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> -->
<!-- <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />--> <!-- <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" /> -->
<!-- <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> --> <!-- <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> -->
<!-- 通知权限 --> <!-- 通知权限 -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" /> <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <!-- Android 12新增权限适配 --> <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" /> <!-- Android 12新增权限适配 -->
@@ -106,6 +106,12 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:replace="android:supportsRtl" tools:replace="android:supportsRtl"
tools:targetApi="n"> tools:targetApi="n">
<activity
android:name=".ui.activity.account.cn.LoginV2CNActivity"
android:exported="false" />
<activity
android:name=".deprecated.ui.activity.profile.recharge.cn.RechargeOrderDetailCNActivity"
android:exported="false" />
<activity <activity
android:name=".ui.activity.device.InitializingDeviceActivity" android:name=".ui.activity.device.InitializingDeviceActivity"
android:exported="false" /> android:exported="false" />
@@ -421,9 +427,6 @@
<activity <activity
android:name=".ui.activity.account.recharge.cn.RechargeDeviceDetailCNActivity" android:name=".ui.activity.account.recharge.cn.RechargeDeviceDetailCNActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.account.recharge.cn.RechargeOrderDetailCNActivity"
android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.account.recharge.cn.RechargeAmountCNActivity" android:name=".ui.activity.account.recharge.cn.RechargeAmountCNActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />

View File

@@ -11,6 +11,7 @@ import android.view.ViewGroup
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
import com.abbidot.baselibrary.util.LogUtil import com.abbidot.baselibrary.util.LogUtil
import com.abbidot.tracker.R import com.abbidot.tracker.R
@@ -71,6 +72,14 @@ abstract class BaseFragment<T : ViewBinding>(
*/ */
open fun liveDataObserve() {} open fun liveDataObserve() {}
/**
* 获取当前activity
*/
protected fun <T : FragmentActivity> getHostActivity(clazz: Class<T>): T? {
val act = activity ?: return null
return if (clazz.isInstance(act)) clazz.cast(act) else null
}
/** /**
* 初始化 * 初始化
*/ */

View File

@@ -0,0 +1,3 @@
package com.abbidot.tracker.bean
data class PaymentIDBean(var stripeMethodInfo: CreditCardBean, var paypalMethodInfo: UserBean)

View File

@@ -72,7 +72,7 @@ class LoginRegisterCNActivity :
fun switchFragment(index: Int) { fun switchFragment(index: Int) {
setTopTitle(getString(R.string.login_txt_welcome)) setTopTitle(getString(R.string.login_txt_welcome))
setTopContent(getString(R.string.login_txt_seeyou)) setTopContent(getString(R.string.app_name))
supportFragmentManager.commit { supportFragmentManager.commit {

View File

@@ -78,7 +78,7 @@ class RechargeOrderDetailCNActivity : BaseActivity<ActivityRechargeOrderDetailCn
it.text = getString(R.string.txt_select_payment_method) it.text = getString(R.string.txt_select_payment_method)
it.detailTextView.visibility = View.VISIBLE it.detailTextView.visibility = View.VISIBLE
it.detailTextView.background = it.detailTextView.background =
ContextCompat.getDrawable(mContext!!, R.drawable.pic_wechatpay) ContextCompat.getDrawable(mContext, R.drawable.pic_wechatpay)
setOnClickListenerViews(startPayMoneyBtnCn, it) setOnClickListenerViews(startPayMoneyBtnCn, it)
} }
@@ -87,7 +87,7 @@ class RechargeOrderDetailCNActivity : BaseActivity<ActivityRechargeOrderDetailCn
//底部弹出菜单 //底部弹出菜单
val languageList = mutableListOf(R.drawable.pic_wechatpay, R.drawable.pic_alipay) val languageList = mutableListOf(R.drawable.pic_wechatpay, R.drawable.pic_alipay)
val bottomListSheetBuilder = val bottomListSheetBuilder =
ViewUtil.instance.showBottomSheetList(mContext!!, { dialog, _, position, _ -> ViewUtil.instance.showBottomSheetList(mContext, { dialog, _, position, _ ->
dialog.dismiss() dialog.dismiss()
mPayWay = position mPayWay = position
mViewBinding.rechargeOrderDetailCnPayWay.detailTextView.background = mViewBinding.rechargeOrderDetailCnPayWay.detailTextView.background =
@@ -190,7 +190,11 @@ class RechargeOrderDetailCNActivity : BaseActivity<ActivityRechargeOrderDetailCn
it.itemCardPetHead.appHeadImage.visibility = View.VISIBLE it.itemCardPetHead.appHeadImage.visibility = View.VISIBLE
it.itemCardPetName.visibility = View.VISIBLE it.itemCardPetName.visibility = View.VISIBLE
it.itemCardPetName.text = pet!!.petName it.itemCardPetName.text = pet!!.petName
ViewUtil.instance.imageLoadUrl(mContext,it.itemCardPetHead.appHeadImage, pet!!.imgurl) ViewUtil.instance.imageLoadUrl(
mContext,
it.itemCardPetHead.appHeadImage,
pet!!.imgurl
)
} }
} }
} }
@@ -210,11 +214,7 @@ class RechargeOrderDetailCNActivity : BaseActivity<ActivityRechargeOrderDetailCn
it.txtRechargeAmountName.text = name it.txtRechargeAmountName.text = name
val perMonth = if (period > 1) { val perMonth = ""
String.format(getString(R.string.pet_managet_age), period)
} else {
String.format(getString(R.string.pet_managet_age_1), period)
}
it.rechargeAmountTwoTime.text = perMonth it.rechargeAmountTwoTime.text = perMonth
// val subscriptionPlan = // val subscriptionPlan =

View File

@@ -23,6 +23,7 @@ import com.abbidot.tracker.bean.OrderBean
import com.abbidot.tracker.bean.PackageBean import com.abbidot.tracker.bean.PackageBean
import com.abbidot.tracker.bean.PackageTypeBean import com.abbidot.tracker.bean.PackageTypeBean
import com.abbidot.tracker.bean.PayResultBean import com.abbidot.tracker.bean.PayResultBean
import com.abbidot.tracker.bean.PaymentIDBean
import com.abbidot.tracker.bean.PetAllInfoBean import com.abbidot.tracker.bean.PetAllInfoBean
import com.abbidot.tracker.bean.PetBean import com.abbidot.tracker.bean.PetBean
import com.abbidot.tracker.bean.RechargeDeviceBean import com.abbidot.tracker.bean.RechargeDeviceBean
@@ -47,8 +48,6 @@ import retrofit2.http.Query
interface INetworkService { interface INetworkService {
companion object { companion object {
//宠物勋章图片url
const val BASE_PET_BADGE_URL = "http://162.62.53.38:9998/static/TrackerBadgeImages/"
private const val IP_SERVER = "https://aws.abbidot.com" private const val IP_SERVER = "https://aws.abbidot.com"
// private const val IP_SERVER = "https://192.168.0.22" // private const val IP_SERVER = "https://192.168.0.22"
// const val BASE_URL = "http://ec2-50-18-65-40.us-west-1.compute.amazonaws.com:8090/abbidot/" // const val BASE_URL = "http://ec2-50-18-65-40.us-west-1.compute.amazonaws.com:8090/abbidot/"
@@ -1141,119 +1140,12 @@ interface INetworkService {
suspend fun rsaDecodeTest( suspend fun rsaDecodeTest(
@Field("encryptedData") encryptedData: String @Field("encryptedData") encryptedData: String
): BaseResponse<String> ): BaseResponse<String>
/*******************************************以下是国内版本接口***********************************/
/**
* 获取微信登录的OpedId
*/
// @Headers("${CommonRequestInterceptor.HEADERS_NAME}:${CommonRequestInterceptor.HEADERS_value}")
// @GET("oauth2/access_token")
// suspend fun getWXOpedId(@Query("appid") appid: String,
// @Query("secret") secret: String,
// @Query("code") code: String,
// @Query("grant_type") grant_type: String): BaseResponse<String>
/** /**
* 微信登录 * 获取Stripe、paypal支付id
*/ */
@GET("user/wxLogin") @GET("user/getUserPaymentMethodID")
suspend fun wxLogin(@Query("code") code: String): BaseResponse<UserBean> suspend fun getUserPaymentMethodID(@Query("userId") userId: String): BaseResponse<PaymentIDBean>
/**
* 微信绑定
*/
@FormUrlEncoded
@POST("user/weixinBind")
suspend fun wxBind(
@Field("phone") phone: String,
@Field("verificationCode") verificationCode: String,
@Field("wxId") wxId: String
): BaseResponse<UserBean>
/**
* 发送验证码
*/
@GET("user/sendCode")
suspend fun sendCode(
@Query("phone") phone: String,
//发送类型 1是验证码登录 2微信绑定 3注册 4忘记密码
@Query("type") type: Int
): BaseResponse<String>
/**
* 验证码登录
*/
@FormUrlEncoded
@POST("user/phoneLogin")
suspend fun phoneLogin(
@Field("phone") phone: String, @Field("verificationCode") verificationCode: String
): BaseResponse<UserBean>
/**
* 手机号验证码验证
*/
@FormUrlEncoded
@POST("user/validateCode")
suspend fun validatePhoneCode(
@Field("phone") phone: String, @Field("code") code: String,
//验证码类型 1是注册 2是忘记密码
@Field("type") type: Int
): BaseResponse<String>
/**
* 账号密码登录
*/
@FormUrlEncoded
@POST("user/accountPasswordLogin")
suspend fun accountPasswordLogin(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<UserBean>
/**
* 用户注册
*/
@FormUrlEncoded
@POST("user/register")
suspend fun register(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<String>
/**
* 重置密码
*/
@FormUrlEncoded
@POST("user/resetPassword")
suspend fun resetNewPassword(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<String>
/**
* 获取微信支付Prepay_id
*/
@FormUrlEncoded
@POST("order/getWxPayOrder")
suspend fun getWxPayOrder(
@Field("feePackage") feePackage: String,
@Field("deviceId") deviceId: String,
@Field("payFee") payFee: Double,
@Field("period") period: Float,
@Field("userId") userId: String,
@Field("username") username: String
): BaseResponse<WXPayOrderBean>
/**
* 获取支付宝支付订单
*/
@FormUrlEncoded
@POST("order/getAlipayOrder")
suspend fun getAlipayOrder(
@Field("feePackage") feePackage: String,
@Field("deviceId") deviceId: String,
@Field("payFee") payFee: Double,
@Field("period") period: Float,
@Field("userId") userId: String,
@Field("username") username: String
): BaseResponse<AlipayOrderBean>
/** /**
* 获取订阅订单列表 * 获取订阅订单列表
@@ -1464,4 +1356,119 @@ interface INetworkService {
@FormUrlEncoded @FormUrlEncoded
@POST("map/setupRefreshLocation") @POST("map/setupRefreshLocation")
suspend fun setupRefreshLocation(@Field("deviceId") deviceId: String): BaseResponse<String> suspend fun setupRefreshLocation(@Field("deviceId") deviceId: String): BaseResponse<String>
/*******************************************以下是国内版本接口***********************************/
/**
* 获取微信登录的OpedId
*/
// @Headers("${CommonRequestInterceptor.HEADERS_NAME}:${CommonRequestInterceptor.HEADERS_value}")
// @GET("oauth2/access_token")
// suspend fun getWXOpedId(@Query("appid") appid: String,
// @Query("secret") secret: String,
// @Query("code") code: String,
// @Query("grant_type") grant_type: String): BaseResponse<String>
/**
* 微信登录
*/
@GET("user/wxLogin")
suspend fun wxLogin(@Query("code") code: String): BaseResponse<UserBean>
/**
* 微信绑定
*/
@FormUrlEncoded
@POST("user/weixinBind")
suspend fun wxBind(
@Field("phone") phone: String,
@Field("verificationCode") verificationCode: String,
@Field("wxId") wxId: String
): BaseResponse<UserBean>
/**
* 发送验证码
*/
@GET("user/sendCode")
suspend fun sendCode(
@Query("phone") phone: String,
//发送类型 1是验证码登录 2微信绑定 3注册 4忘记密码
@Query("type") type: Int
): BaseResponse<String>
/**
* 验证码登录
*/
@FormUrlEncoded
@POST("user/phoneLogin")
suspend fun phoneLogin(
@Field("phone") phone: String, @Field("verificationCode") verificationCode: String
): BaseResponse<UserBean>
/**
* 手机号验证码验证
*/
@FormUrlEncoded
@POST("user/validateCode")
suspend fun validatePhoneCode(
@Field("phone") phone: String, @Field("code") code: String,
//验证码类型 1是注册 2是忘记密码
@Field("type") type: Int
): BaseResponse<String>
/**
* 账号密码登录
*/
@FormUrlEncoded
@POST("user/accountPasswordLogin")
suspend fun accountPasswordLogin(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<UserBean>
/**
* 用户注册
*/
@FormUrlEncoded
@POST("user/register")
suspend fun register(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<String>
/**
* 重置密码
*/
@FormUrlEncoded
@POST("user/resetPassword")
suspend fun resetNewPassword(
@Field("phone") phone: String, @Field("password") password: String
): BaseResponse<String>
/**
* 获取微信支付Prepay_id
*/
@FormUrlEncoded
@POST("order/getWxPayOrder")
suspend fun getWxPayOrder(
@Field("feePackage") feePackage: String,
@Field("deviceId") deviceId: String,
@Field("payFee") payFee: Double,
@Field("period") period: Float,
@Field("userId") userId: String,
@Field("username") username: String
): BaseResponse<WXPayOrderBean>
/**
* 获取支付宝支付订单
*/
@FormUrlEncoded
@POST("order/getAlipayOrder")
suspend fun getAlipayOrder(
@Field("feePackage") feePackage: String,
@Field("deviceId") deviceId: String,
@Field("payFee") payFee: Double,
@Field("period") period: Float,
@Field("userId") userId: String,
@Field("username") username: String
): BaseResponse<AlipayOrderBean>
/*******************************************以上是国内版本接口end***********************************/
} }

View File

@@ -1066,83 +1066,11 @@ object NetworkApi : BaseNetworkApi<INetworkService>(INetworkService.BASE_URL) {
service.rsaDecodeTest(encryptedData) service.rsaDecodeTest(encryptedData)
} }
/*******************************************以下是国内版本接口***********************************/
/** /**
* 微信登录 * 获取Stripe、paypal支付id
*/ */
suspend fun wxLogin(code: String) = getResult { suspend fun getUserPaymentMethodID(userId: String) = getResult {
service.wxLogin(code) service.getUserPaymentMethodID(userId)
}
/**
* 微信绑定
*/
suspend fun wxBind(phone: String, verificationCode: String, wxId: String) = getResult {
service.wxBind(phone, verificationCode, wxId)
}
/**
* 发送验证码
*/
suspend fun sendCode(phone: String, type: Int) = getResult {
service.sendCode(phone, type)
}
/**
* 手机号验证码验证
*/
suspend fun validatePhoneCode(phone: String, code: String, type: Int) = getResult {
service.validatePhoneCode(phone, code, type)
}
/**
* 验证码登录
*/
suspend fun phoneLogin(phone: String, verificationCode: String) = getResult {
service.phoneLogin(phone, verificationCode)
}
/**
* 账号密码登录
*/
suspend fun accountPasswordLogin(phone: String, password: String) = getResult {
service.accountPasswordLogin(phone, password)
}
/**
* 用户注册
*/
suspend fun register(phone: String, password: String) = getResult {
service.register(phone, password)
}
/**
* 重置密码
*/
suspend fun resetNewPassword(phone: String, password: String) = getResult {
service.resetNewPassword(phone, password)
}
/**
* 获取微信Prepay_id
*/
suspend fun getWxPayOrder(
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
) = getResult {
service.getWxPayOrder(
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
)
}
/**
* 获取支付宝支付订单
*/
suspend fun getAlipayOrder(
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
) = getResult {
service.getAlipayOrder(
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
)
} }
/** /**
@@ -1350,4 +1278,85 @@ object NetworkApi : BaseNetworkApi<INetworkService>(INetworkService.BASE_URL) {
) = getResult { ) = getResult {
service.uploadDeviceLog(deviceOutId, uploadTime, macID, logFileUrl) service.uploadDeviceLog(deviceOutId, uploadTime, macID, logFileUrl)
} }
/*******************************************以下是国内版本接口***********************************/
/**
* 微信登录
*/
suspend fun wxLogin(code: String) = getResult {
service.wxLogin(code)
}
/**
* 微信绑定
*/
suspend fun wxBind(phone: String, verificationCode: String, wxId: String) = getResult {
service.wxBind(phone, verificationCode, wxId)
}
/**
* 发送验证码
*/
suspend fun sendCode(phone: String, type: Int) = getResult {
service.sendCode(phone, type)
}
/**
* 手机号验证码验证
*/
suspend fun validatePhoneCode(phone: String, code: String, type: Int) = getResult {
service.validatePhoneCode(phone, code, type)
}
/**
* 验证码登录
*/
suspend fun phoneLogin(phone: String, verificationCode: String) = getResult {
service.phoneLogin(phone, verificationCode)
}
/**
* 账号密码登录
*/
suspend fun accountPasswordLogin(phone: String, password: String) = getResult {
service.accountPasswordLogin(phone, password)
}
/**
* 用户注册
*/
suspend fun register(phone: String, password: String) = getResult {
service.register(phone, password)
}
/**
* 重置密码
*/
suspend fun resetNewPassword(phone: String, password: String) = getResult {
service.resetNewPassword(phone, password)
}
/**
* 获取微信Prepay_id
*/
suspend fun getWxPayOrder(
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
) = getResult {
service.getWxPayOrder(
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
)
}
/**
* 获取支付宝支付订单
*/
suspend fun getAlipayOrder(
setMealBean: SetMealBean, deviceId: String, userId: String, username: String
) = getResult {
service.getAlipayOrder(
setMealBean.name, deviceId, setMealBean.accountFee, setMealBean.period, userId, username
)
}
/*******************************************以上是国内版本接口end***********************************/
} }

View File

@@ -5,12 +5,14 @@ import android.view.View
import com.abbidot.baselibrary.constant.EventName import com.abbidot.baselibrary.constant.EventName
import com.abbidot.baselibrary.constant.MMKVKey import com.abbidot.baselibrary.constant.MMKVKey
import com.abbidot.baselibrary.eventbus.XEventBus import com.abbidot.baselibrary.eventbus.XEventBus
import com.abbidot.baselibrary.util.AppUtils
import com.abbidot.baselibrary.util.MMKVUtil import com.abbidot.baselibrary.util.MMKVUtil
import com.abbidot.tracker.R import com.abbidot.tracker.R
import com.abbidot.tracker.base.BaseActivity import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.databinding.ActivitySayHelloBinding import com.abbidot.tracker.databinding.ActivitySayHelloBinding
import com.abbidot.tracker.ui.activity.account.CreateAccountV2Activity import com.abbidot.tracker.ui.activity.account.CreateAccountV2Activity
import com.abbidot.tracker.ui.activity.account.LoginV2Activity import com.abbidot.tracker.ui.activity.account.LoginV2Activity
import com.abbidot.tracker.ui.activity.account.cn.LoginV2CNActivity
class SayHelloActivity : BaseActivity<ActivitySayHelloBinding>(ActivitySayHelloBinding::inflate) { class SayHelloActivity : BaseActivity<ActivitySayHelloBinding>(ActivitySayHelloBinding::inflate) {
@@ -21,7 +23,11 @@ class SayHelloActivity : BaseActivity<ActivitySayHelloBinding>(ActivitySayHelloB
mViewBinding.apply { mViewBinding.apply {
root.setBackgroundResource(R.drawable.icon_say_hi_bg) root.setBackgroundResource(R.drawable.icon_say_hi_bg)
setOnClickListenerViews(btnSayHelloLogin, btnSayHelloSignup) if (AppUtils.isChina()) {
btnSayHelloLoginWechat.visibility = View.VISIBLE
}
setOnClickListenerViews(btnSayHelloLogin, btnSayHelloSignup, btnSayHelloLoginWechat)
} }
} }
@@ -35,11 +41,16 @@ class SayHelloActivity : BaseActivity<ActivitySayHelloBinding>(ActivitySayHelloB
mViewBinding.apply { mViewBinding.apply {
when (v!!) { when (v!!) {
btnSayHelloLogin -> { btnSayHelloLogin -> {
if (AppUtils.isChina()) {
val intent = Intent(mContext, LoginV2CNActivity::class.java)
startActivity(intent)
} else {
val intent = Intent(mContext, LoginV2Activity::class.java) val intent = Intent(mContext, LoginV2Activity::class.java)
val email = MMKVUtil.getString(MMKVKey.Email) val email = MMKVUtil.getString(MMKVKey.Email)
intent.putExtra(MMKVKey.Email, email) intent.putExtra(MMKVKey.Email, email)
startActivity(intent) startActivity(intent)
} }
}
btnSayHelloSignup -> startActivity( btnSayHelloSignup -> startActivity(
Intent( Intent(

View File

@@ -203,11 +203,8 @@ class SplashActivity : QMUIActivity() {
initMapbox() initMapbox()
try { try {
//stripe支付 //stripe支付
val stripeKey = Util.getMetadata(applicationContext, KeyNames.STRIPE_TEST_KEY) val stripeKey = ThirdPartyUtil.instance.getStripeKey(applicationContext)
LogUtil.e("stripeKey=$stripeKey") PaymentConfiguration.init(applicationContext, stripeKey)
PaymentConfiguration.init(
applicationContext, stripeKey
)
} catch (e: Exception) { } catch (e: Exception) {
LogUtil.e("stripeSdk initialize初始化异常,${e.message}") LogUtil.e("stripeSdk initialize初始化异常,${e.message}")
} }

View File

@@ -17,7 +17,7 @@ open class AddEmailValidActivity :
lateinit var mFragmentList: MutableList<Fragment> lateinit var mFragmentList: MutableList<Fragment>
lateinit var mEmailValidFragment: EmailValidFragment lateinit var mEmailValidFragment: EmailValidFragment
var mIndex = 0 private var mIndex = 0
//用户邮箱 //用户邮箱
var mUserEmail = "" var mUserEmail = ""

View File

@@ -0,0 +1,53 @@
package com.abbidot.tracker.ui.activity.account.cn
import android.graphics.Paint
import android.text.InputFilter
import android.text.InputType
import com.abbidot.tracker.R
import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.databinding.ActivityLoginV2CnBinding
import com.abbidot.tracker.util.ViewUtil
class LoginV2CNActivity :
BaseActivity<ActivityLoginV2CnBinding>(ActivityLoginV2CnBinding::inflate) {
override fun getTopBar() = mViewBinding.loginV2CnTopBar.titleTopBar
override fun initData() {
super.initData()
setTopBarTitle("")
mViewBinding.apply {
root.setBackgroundResource(R.drawable.icon_login_v2_bg)
ilLoginV2CnPhone.let {
it.tvInputNameTitle.setText(R.string.login_txt_phone)
it.etInputContent.setHint(R.string.login_txt_phone)
it.etInputContent.inputType = InputType.TYPE_CLASS_PHONE
ViewUtil.instance.setInputViewErrorHideClick(
mContext, it.rlEtInputLayout, tvPhoneErrorTipLoginCn, it.etInputContent
)
}
ilLoginV2CnPassword.let {
it.tvInputNameTitle.setText(R.string.login_txt_password)
it.etInputContent.setHint(R.string.login_txt_password)
ViewUtil.instance.setShowAndHidePassword(
it.etInputContent, it.ivInputRepresentImage
)
val filters = arrayOf<InputFilter>(InputFilter.LengthFilter(60))
it.etInputContent.filters = filters
ViewUtil.instance.setInputViewErrorHideClick(
mContext, it.rlEtInputLayout, tvPasswordErrorTipLoginCn, it.etInputContent
)
}
//添加下划线
tvLoginV2CnForgotPassword.paintFlags = Paint.UNDERLINE_TEXT_FLAG
setOnClickListenerViews(
tvLoginV2CnForgotPassword,
ilLoginV2CnPassword.ivInputRepresentImage,
btnLoginV2CnLogin, btnLoginV2CnLoginCode
)
}
}
}

View File

@@ -549,9 +549,7 @@ class MyTrackerV2Activity :
private fun unAssignDeviceDialogTips(device: DeviceBean) { private fun unAssignDeviceDialogTips(device: DeviceBean) {
device.apply { device.apply {
pet?.let { pet?.let {
val string = String.format( val string = getString(R.string.app_name)
getString(R.string.txt_unassign_pet_tracker), it.petName, deviceOutId
)
ViewUtil.instance.showDialog( ViewUtil.instance.showDialog(
mContext, string, object : BaseDialog.OnDialogOkListener { mContext, string, object : BaseDialog.OnDialogOkListener {
override fun onOkClick(dialog: BaseDialog<*>) { override fun onOkClick(dialog: BaseDialog<*>) {

View File

@@ -1,33 +1,50 @@
package com.abbidot.tracker.ui.activity.subscribe package com.abbidot.tracker.ui.activity.subscribe
import androidx.activity.viewModels
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2 import androidx.viewpager2.widget.ViewPager2
import com.abbidot.baselibrary.constant.EventName import com.abbidot.baselibrary.constant.EventName
import com.abbidot.baselibrary.eventbus.XEventBus import com.abbidot.baselibrary.eventbus.XEventBus
import com.abbidot.baselibrary.util.LogUtil
import com.abbidot.tracker.R import com.abbidot.tracker.R
import com.abbidot.tracker.adapter.ViewPagerAdapter import com.abbidot.tracker.adapter.ViewPagerAdapter
import com.abbidot.tracker.base.BaseActivity import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.bean.PaymentIDBean
import com.abbidot.tracker.bean.SubscriptionsOrderBean import com.abbidot.tracker.bean.SubscriptionsOrderBean
import com.abbidot.tracker.constant.ConstantInt import com.abbidot.tracker.constant.ConstantInt
import com.abbidot.tracker.constant.ConstantString import com.abbidot.tracker.constant.ConstantString
import com.abbidot.tracker.constant.GetResultCallback
import com.abbidot.tracker.databinding.ActivityPaymentMethodBinding import com.abbidot.tracker.databinding.ActivityPaymentMethodBinding
import com.abbidot.tracker.deprecated.ui.fragment.vm.LoginCNViewModel
import com.abbidot.tracker.ui.fragment.subscribe.CreditCardPaymentFragment import com.abbidot.tracker.ui.fragment.subscribe.CreditCardPaymentFragment
import com.abbidot.tracker.ui.fragment.subscribe.PaypalPaymentFragment import com.abbidot.tracker.ui.fragment.subscribe.PaypalPaymentFragment
import com.abbidot.tracker.util.ThirdPartyUtil
import com.abbidot.tracker.util.Util import com.abbidot.tracker.util.Util
import com.abbidot.tracker.util.ViewUtil import com.abbidot.tracker.util.ViewUtil
import com.abbidot.tracker.vm.SubscriptionPayViewModel
import com.stripe.android.ApiResultCallback
import com.stripe.android.Stripe
import com.stripe.android.model.PaymentMethod
import com.stripe.android.model.PaymentMethodCreateParams
class PaymentMethodActivity : class PaymentMethodActivity :
BaseActivity<ActivityPaymentMethodBinding>(ActivityPaymentMethodBinding::inflate) { BaseActivity<ActivityPaymentMethodBinding>(ActivityPaymentMethodBinding::inflate) {
private val mSubscriptionPayViewModel: SubscriptionPayViewModel by viewModels()
private val mLoginCNViewModel: LoginCNViewModel by viewModels()
var mOrderBean: SubscriptionsOrderBean? = null var mOrderBean: SubscriptionsOrderBean? = null
//设备充值类型0=首次设备充值激活1=已添加设备再次添加设备充值2=给当前的设备续费或者升级套餐 //设备充值类型0=首次设备充值激活1=已添加设备再次添加设备充值2=给当前的设备续费或者升级套餐
var mRechargeType = ConstantInt.Type1 var mRechargeType = ConstantInt.Type1
lateinit var mFragments: MutableList<Fragment> var mFragments = mutableListOf<Fragment>()
//设备类型 //设备类型
var mType = ConstantInt.Type1 var mType = ConstantInt.Type1
//支付id
var mPaymentIDBean: PaymentIDBean? = null
override fun getTopBar() = mViewBinding.ilPaymentMethodTopBar.titleTopBar override fun getTopBar() = mViewBinding.ilPaymentMethodTopBar.titleTopBar
override fun initData() { override fun initData() {
@@ -35,6 +52,26 @@ class PaymentMethodActivity :
setTopBarTitle(R.string.txt_payment_method) setTopBarTitle(R.string.txt_payment_method)
setLeftBackImage(R.drawable.icon_white_back_svg) setLeftBackImage(R.drawable.icon_white_back_svg)
// 用 PaymentMethodCreateParams 封装银行卡不再直接new Card
val cardParams = PaymentMethodCreateParams.Card.Builder()
.setNumber("4242424242424242")
.setExpiryMonth(12)
.setExpiryYear(2028)
.setCvc("123")
.build()
val paymentMethodParams = PaymentMethodCreateParams.create(cardParams)
val stripeKey = ThirdPartyUtil.instance.getStripeKey(mContext)
Stripe(mContext, stripeKey).createPaymentMethod(
paymentMethodParams, callback = object : ApiResultCallback<PaymentMethod> {
override fun onError(e: Exception) {
LogUtil.e("ApiResultCallback,${e.message}")
}
override fun onSuccess(result: PaymentMethod) {
LogUtil.e(result.toString())
}
})
intent.extras?.apply { intent.extras?.apply {
mOrderBean = Util.getParcelableAdaptive( mOrderBean = Util.getParcelableAdaptive(
intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java intent, ConstantString.LkSetMeal, SubscriptionsOrderBean::class.java
@@ -43,10 +80,8 @@ class PaymentMethodActivity :
mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1) mRechargeType = getInt(ConstantString.RechargeType, ConstantInt.Type1)
} }
mFragments = mutableListOf( mFragments.add(CreditCardPaymentFragment.newInstance(mContext))
CreditCardPaymentFragment.newInstance(mContext), mFragments.add(PaypalPaymentFragment.newInstance(mContext))
PaypalPaymentFragment.newInstance(mContext)
)
mViewBinding.apply { mViewBinding.apply {
rgSwitchPaymentMethod.setOnCheckedChangeListener { _, checkedId -> rgSwitchPaymentMethod.setOnCheckedChangeListener { _, checkedId ->
@@ -70,12 +105,26 @@ class PaymentMethodActivity :
}) })
} }
} }
mSubscriptionPayViewModel.getUserPaymentMethodID()
} }
override fun liveDataObserve() { override fun liveDataObserve() {
XEventBus.observe(this, EventName.PayBack) { XEventBus.observe(this, EventName.PayBack) {
finish() finish()
} }
}
mSubscriptionPayViewModel.mPaymentMethodIDLiveData.observe(this) {
dealRequestResult(it, object : GetResultCallback {
override fun onResult(any: Any) {
it.getOrNull()?.let { p ->
mPaymentIDBean = p
if (mFragments.size > 1) {
(mFragments[1] as PaypalPaymentFragment).showPaypalInfo()
}
}
}
})
}
}
} }

View File

@@ -4,6 +4,7 @@ import android.content.Intent
import android.graphics.Paint import android.graphics.Paint
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import android.widget.RadioGroup
import androidx.activity.viewModels import androidx.activity.viewModels
import com.abbidot.baselibrary.constant.EventName import com.abbidot.baselibrary.constant.EventName
import com.abbidot.baselibrary.constant.MMKVKey import com.abbidot.baselibrary.constant.MMKVKey
@@ -27,6 +28,8 @@ import com.abbidot.tracker.util.ViewUtil
import com.abbidot.tracker.vm.GeoCoderViewModel import com.abbidot.tracker.vm.GeoCoderViewModel
import com.abbidot.tracker.vm.GoogleLocationViewModel import com.abbidot.tracker.vm.GoogleLocationViewModel
import com.abbidot.tracker.vm.SubscriptionManageViewModel import com.abbidot.tracker.vm.SubscriptionManageViewModel
import com.abbidot.tracker.widget.TypefaceRoundButton
import com.google.android.material.bottomsheet.BottomSheetDialog
import kotlin.math.abs import kotlin.math.abs
class SureSubscriptionPlanActivity : class SureSubscriptionPlanActivity :
@@ -67,6 +70,10 @@ class SureSubscriptionPlanActivity :
private var mType = ConstantInt.Type1 private var mType = ConstantInt.Type1
private lateinit var mSummaryAdapter: SureSubscribeSummaryAdapter private lateinit var mSummaryAdapter: SureSubscribeSummaryAdapter
private var mRechargePayOptionsCn: BottomSheetDialog? = null
//国内支付方式
private var mPayCnOption = ConstantInt.Type0
override fun getTopBar() = mViewBinding.sureSubscribePlan1TopBar.titleTopBar override fun getTopBar() = mViewBinding.sureSubscribePlan1TopBar.titleTopBar
@@ -482,10 +489,35 @@ class SureSubscriptionPlanActivity :
override fun onClick(v: View?) { override fun onClick(v: View?) {
mViewBinding.apply { mViewBinding.apply {
when (v!!) { when (v!!) {
btnSureSubscribePlan1Continue -> createOrder() btnSureSubscribePlan1Continue -> {
if (!AppUtils.isChina()) {
if (null == mRechargePayOptionsCn) {
mRechargePayOptionsCn = ViewUtil.instance.showBottomSheet(
mContext,
R.layout.layout_recharge_pay_options_cn
).apply {
setOnClickListenerViews(findViewById<TypefaceRoundButton>(R.id.btn_pay_cn_chose_sure))
findViewById<RadioGroup>(R.id.rg_pay_cn_chose)?.let {
it.setOnCheckedChangeListener { _, checkedId ->
when (checkedId) {
R.id.rb_pay_cn_chose_alipay -> mPayCnOption =
ConstantInt.Type0
R.id.rb_pay_cn_chose_wxpay -> mPayCnOption =
ConstantInt.Type1
}
}
}
}
}
return
}
createOrder()
}
ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions -> { ilSubscribePlanDetail.tvSureSubscribePlanTermsConditions -> {
val url = if (AppUtils.isChina()) { val url = if (AppUtils.isChina()) {
"file:///android_asset/subscription_terms_conditions_en.html" "file:///android_asset/subscription_terms_conditions_cn.html"
} else { } else {
"file:///android_asset/subscription_terms_conditions_en.html" "file:///android_asset/subscription_terms_conditions_en.html"
} }
@@ -496,7 +528,7 @@ class SureSubscriptionPlanActivity :
ilSubscribePlanInsurance.ivSureSubscribePlanInsurance -> { ilSubscribePlanInsurance.ivSureSubscribePlanInsurance -> {
val url = if (AppUtils.isChina()) { val url = if (AppUtils.isChina()) {
"file:///android_asset/annual_protection_plan_en.html" "file:///android_asset/annual_protection_plan_cn.html"
} else { } else {
"file:///android_asset/annual_protection_plan_en.html" "file:///android_asset/annual_protection_plan_en.html"
} }
@@ -506,5 +538,11 @@ class SureSubscriptionPlanActivity :
} }
} }
} }
when (v!!.id) {
R.id.btn_pay_cn_chose_sure -> {
showToast("$mPayCnOption")
}
}
} }
} }

View File

@@ -63,6 +63,7 @@ class HomeMapGoogleMapFragmentV3 : BaseGoogleMapFragment() {
//是否需要反编译地理位置 //是否需要反编译地理位置
private var isReverseGeocode = false private var isReverseGeocode = false
//其他没有选择的宠物 //其他没有选择的宠物
private val mOtherPetMarkerList = mutableListOf<Marker?>() private val mOtherPetMarkerList = mutableListOf<Marker?>()
@@ -106,13 +107,19 @@ class HomeMapGoogleMapFragmentV3 : BaseGoogleMapFragment() {
// mMarker?.tag = history // mMarker?.tag = history
// showMarkerInfoWindow(history) // showMarkerInfoWindow(history)
if (TextUtils.isEmpty(it)) {
mPetLocationLayoutBinding.root.visibility = View.INVISIBLE
} else {
ViewUtil.instance.viewShow(mPetLocationLayoutBinding.root)
}
val address = val address =
if (inWifiZone == ConstantInt.Type1 && !TextUtils.isEmpty(wifiZoneName)) { if (inWifiZone == ConstantInt.Type1 && !TextUtils.isEmpty(wifiZoneName)) {
"$wifiZoneName · $it" "$wifiZoneName · $it"
} else { } else {
String.format(mContext!!.getString(R.string.txt_near), it) String.format(mContext!!.getString(R.string.txt_near), it)
} }
ViewUtil.instance.viewShow(mPetLocationLayoutBinding.root)
mPetLocationLayoutBinding.let { layout -> mPetLocationLayoutBinding.let { layout ->
layout.tvPetLocationReverseGeocode.text = address layout.tvPetLocationReverseGeocode.text = address
layout.tvPetLocationUpdateTime.text = timeString layout.tvPetLocationUpdateTime.text = timeString

View File

@@ -35,7 +35,6 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
private val mSubscriptionPayViewModel: SubscriptionPayViewModel by viewModels() private val mSubscriptionPayViewModel: SubscriptionPayViewModel by viewModels()
private lateinit var mCreditCardAdapter: CreditCardAdapter private lateinit var mCreditCardAdapter: CreditCardAdapter
private lateinit var mPaymentMethodActivity: PaymentMethodActivity
companion object { companion object {
@JvmStatic @JvmStatic
@@ -46,7 +45,6 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
override fun initData() { override fun initData() {
mViewBinding.apply { mViewBinding.apply {
mPaymentMethodActivity = mActivity!! as PaymentMethodActivity
root.setBackgroundResource(R.color.transparent) root.setBackgroundResource(R.color.transparent)
mCreditCardAdapter = CreditCardAdapter(mContext!!, null).apply { mCreditCardAdapter = CreditCardAdapter(mContext!!, null).apply {
setOnAgainClickListener(object : BaseRecyclerAdapter.OnAgainClickListener { setOnAgainClickListener(object : BaseRecyclerAdapter.OnAgainClickListener {
@@ -60,7 +58,7 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
override fun onItemClick(itemView: View?, pos: Int) { override fun onItemClick(itemView: View?, pos: Int) {
val card = getData()[pos] val card = getData()[pos]
//卡管理 不需要点击效果 //卡管理 不需要点击效果
if (null == mPaymentMethodActivity.mOrderBean) { if (null == getHostActivity(PaymentMethodActivity::class.java)?.mOrderBean) {
goEditCard(card) goEditCard(card)
} else { } else {
if (card.checked) return if (card.checked) return
@@ -114,7 +112,7 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
dealRequestResult(it, object : GetResultCallback { dealRequestResult(it, object : GetResultCallback {
override fun onResult(any: Any) { override fun onResult(any: Any) {
it.getOrNull()?.let { o -> it.getOrNull()?.let { o ->
mPaymentMethodActivity.mOrderBean?.apply { getHostActivity(PaymentMethodActivity::class.java)?.mOrderBean?.apply {
customerId = o.customerId customerId = o.customerId
mSubscriptionPayViewModel.createStripeOrder(this) mSubscriptionPayViewModel.createStripeOrder(this)
} }
@@ -132,16 +130,18 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
dealRequestResult(it, object : GetResultCallback { dealRequestResult(it, object : GetResultCallback {
override fun onResult(any: Any) { override fun onResult(any: Any) {
it.getOrNull()?.apply { it.getOrNull()?.apply {
getHostActivity(PaymentMethodActivity::class.java)?.let { p ->
val intent = Intent(mContext, PaymentSuccessActivity::class.java) val intent = Intent(mContext, PaymentSuccessActivity::class.java)
rechargeType = mPaymentMethodActivity.mRechargeType rechargeType = p.mRechargeType
mPaymentMethodActivity.mOrderBean?.let { o -> p.mOrderBean?.let { o ->
deviceId = o.deviceId deviceId = o.deviceId
} }
deviceType = mPaymentMethodActivity.mType deviceType = p.mType
intent.putExtra(ConstantString.Amount, this) intent.putExtra(ConstantString.Amount, this)
startActivity(intent) startActivity(intent)
} }
} }
}
}) })
} }
} }
@@ -156,7 +156,7 @@ class CreditCardPaymentFragment : BaseFragment<FragmentCreditCardPaymentBinding>
return return
} }
//卡管理 不需要点击效果 //卡管理 不需要点击效果
if (null == mPaymentMethodActivity.mOrderBean) { if (null == getHostActivity(PaymentMethodActivity::class.java)?.mOrderBean) {
mViewBinding.btnMakePaymentCreditCard.visibility = View.GONE mViewBinding.btnMakePaymentCreditCard.visibility = View.GONE
} else { } else {
var haveCheck = false var haveCheck = false

View File

@@ -2,6 +2,7 @@ package com.abbidot.tracker.ui.fragment.subscribe
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.text.TextUtils
import android.view.View import android.view.View
import androidx.fragment.app.viewModels import androidx.fragment.app.viewModels
import com.abbidot.tracker.R import com.abbidot.tracker.R
@@ -21,7 +22,6 @@ class PaypalPaymentFragment :
BaseFragment<FragmentPaypalPaymentBinding>(FragmentPaypalPaymentBinding::inflate) { BaseFragment<FragmentPaypalPaymentBinding>(FragmentPaypalPaymentBinding::inflate) {
private val mSubscriptionPayViewModel: SubscriptionPayViewModel by viewModels() private val mSubscriptionPayViewModel: SubscriptionPayViewModel by viewModels()
private lateinit var mPaymentMethodActivity: PaymentMethodActivity
companion object { companion object {
@JvmStatic @JvmStatic
@@ -31,10 +31,31 @@ class PaypalPaymentFragment :
} }
override fun initData() { override fun initData() {
mPaymentMethodActivity = mActivity!! as PaymentMethodActivity
mViewBinding.apply { mViewBinding.apply {
root.setBackgroundResource(R.color.transparent) root.setBackgroundResource(R.color.transparent)
setOnClickListenerViews(btnSureRedirectPaypal) setOnClickListenerViews(btnSureRedirectPaypal)
if (null == getHostActivity(PaymentMethodActivity::class.java)?.mOrderBean) {
tvPaypalPaymentGoTip.visibility = View.GONE
btnSureRedirectPaypal.visibility = View.GONE
ivSureRedirectPaypalBg.visibility = View.GONE
} else {
tvNoPaypalPaymentEmail.visibility = View.GONE
}
showPaypalInfo()
}
}
fun showPaypalInfo() {
getHostActivity(PaymentMethodActivity::class.java)?.let {
it.mPaymentIDBean?.let { pId ->
mViewBinding.tvPaypalPaymentEmail.text = pId.paypalMethodInfo.email
mViewBinding.tvNoPaypalPaymentEmail.visibility =
if (TextUtils.isEmpty(pId.paypalMethodInfo.email))
View.VISIBLE
else
View.GONE
}
} }
} }
@@ -44,19 +65,22 @@ class PaypalPaymentFragment :
dealRequestResult(it, object : GetResultCallback { dealRequestResult(it, object : GetResultCallback {
override fun onResult(any: Any) { override fun onResult(any: Any) {
it.getOrNull()?.apply { it.getOrNull()?.apply {
getHostActivity(PaymentMethodActivity::class.java)?.let { p ->
val intent = Intent(mContext, WebViewActivity::class.java) val intent = Intent(mContext, WebViewActivity::class.java)
intent.putExtra( intent.putExtra(
ConstantString.Title, getString(R.string.txt_pay_order_payment_title) ConstantString.Title,
getString(R.string.txt_pay_order_payment_title)
) )
intent.putExtra(ConstantString.Url, url) intent.putExtra(ConstantString.Url, url)
rechargeType = mPaymentMethodActivity.mRechargeType rechargeType = p.mRechargeType
deviceType = mPaymentMethodActivity.mType deviceType = p.mType
mPaymentMethodActivity.mOrderBean?.let { o -> p.mOrderBean?.let { o ->
deviceId = o.deviceId deviceId = o.deviceId
} }
intent.putExtra(ConstantString.Amount, this) intent.putExtra(ConstantString.Amount, this)
mPaymentMethodActivity.startActivity(intent) p.startActivity(intent)
}
} }
} }
}) })
@@ -66,7 +90,7 @@ class PaypalPaymentFragment :
override fun onClick(v: View?) { override fun onClick(v: View?) {
mViewBinding.apply { mViewBinding.apply {
when (v!!) { when (v!!) {
btnSureRedirectPaypal -> mPaymentMethodActivity.mOrderBean?.let { btnSureRedirectPaypal -> getHostActivity(PaymentMethodActivity::class.java)?.mOrderBean?.let {
showNoCancelableLoading(true) showNoCancelableLoading(true)
mSubscriptionPayViewModel.createPaypalOrder(it) mSubscriptionPayViewModel.createPaypalOrder(it)
} }

View File

@@ -1,8 +1,11 @@
package com.abbidot.tracker.util package com.abbidot.tracker.util
import android.content.Context
import com.abbidot.baselibrary.util.AppUtils
import com.abbidot.baselibrary.util.LogUtil import com.abbidot.baselibrary.util.LogUtil
import com.abbidot.tracker.MyApplication import com.abbidot.tracker.MyApplication
import com.abbidot.tracker.base.BaseActivity import com.abbidot.tracker.base.BaseActivity
import com.abbidot.tracker.constant.KeyNames
import com.hjq.toast.Toaster import com.hjq.toast.Toaster
import com.tencent.mm.opensdk.modelmsg.SendAuth import com.tencent.mm.opensdk.modelmsg.SendAuth
import com.tencent.mm.opensdk.openapi.IWXAPI import com.tencent.mm.opensdk.openapi.IWXAPI
@@ -31,6 +34,14 @@ class ThirdPartyUtil {
} }
} }
/**
* 获取Stripe正式和测试key
*/
fun getStripeKey(context: Context): String {
return if (AppUtils.isDebug()) Util.getMetadata(context, KeyNames.STRIPE_TEST_KEY)
else Util.getMetadata(context, KeyNames.STRIPE_RELEASE_KEY)
}
/** /**
* 开始微信登录 * 开始微信登录
*/ */

View File

@@ -526,15 +526,16 @@ class ViewUtil private constructor() {
context: Context, layoutId: Int, behaviorState: Int = 0 context: Context, layoutId: Int, behaviorState: Int = 0
): BottomSheetDialog { ): BottomSheetDialog {
val view = View.inflate(context, layoutId, null) val view = View.inflate(context, layoutId, null)
val bottomSheetDialog = BottomSheetDialog(context) return BottomSheetDialog(context).apply {
bottomSheetDialog.setContentView(view) setContentView(view)
setCancelable(false)
//改变弹出位置方式 //改变弹出位置方式
if (behaviorState > 0) { if (behaviorState > 0) {
val behavior = BottomSheetBehavior.from(view.parent as View) val behavior = BottomSheetBehavior.from(view.parent as View)
behavior.state = behaviorState behavior.state = behaviorState
} }
bottomSheetDialog.show() show()
return bottomSheetDialog }
} }
/** /**

View File

@@ -173,6 +173,7 @@ class GeoCoderViewModel : ViewModel() {
override fun onGetReverseGeoCodeResult(result: ReverseGeoCodeResult?) { override fun onGetReverseGeoCodeResult(result: ReverseGeoCodeResult?) {
if (null == result || result.error != com.baidu.mapapi.search.core.SearchResult.ERRORNO.NO_ERROR) { if (null == result || result.error != com.baidu.mapapi.search.core.SearchResult.ERRORNO.NO_ERROR) {
LogUtil.e("百度地图反向地理编码没有找到检索结果,${result?.error}")
//没有找到检索结果 //没有找到检索结果
return return
} else { } else {

View File

@@ -179,7 +179,7 @@ class MapViewModel : ViewModel() {
//警告状态 //警告状态
DataBean().apply { DataBean().apply {
value = context.getString(R.string.txt_in_sleep_mode) // value = context.getString(R.string.txt_in_sleep_mode)
deviceMsgList.add(this) deviceMsgList.add(this)
} }
} }

View File

@@ -9,6 +9,7 @@ import com.abbidot.baselibrary.util.MMKVUtil
import com.abbidot.baselibrary.util.rsa.RSA import com.abbidot.baselibrary.util.rsa.RSA
import com.abbidot.tracker.bean.CreditCardBean import com.abbidot.tracker.bean.CreditCardBean
import com.abbidot.tracker.bean.PayResultBean import com.abbidot.tracker.bean.PayResultBean
import com.abbidot.tracker.bean.PaymentIDBean
import com.abbidot.tracker.bean.StripeSubscriptionPriceBean import com.abbidot.tracker.bean.StripeSubscriptionPriceBean
import com.abbidot.tracker.bean.SubscriptionsOrderBean import com.abbidot.tracker.bean.SubscriptionsOrderBean
import com.abbidot.tracker.retrofit2.NetworkApi import com.abbidot.tracker.retrofit2.NetworkApi
@@ -26,6 +27,7 @@ class SubscriptionPayViewModel : ViewModel() {
val mSubscriptionCustomerLiveData = MutableLiveData<Result<StripeSubscriptionPriceBean>>() val mSubscriptionCustomerLiveData = MutableLiveData<Result<StripeSubscriptionPriceBean>>()
val mCreateStripeOrderLiveData = MutableLiveData<Result<PayResultBean>>() val mCreateStripeOrderLiveData = MutableLiveData<Result<PayResultBean>>()
val mCreatePaypalOrderLiveData = MutableLiveData<Result<PayResultBean>>() val mCreatePaypalOrderLiveData = MutableLiveData<Result<PayResultBean>>()
val mPaymentMethodIDLiveData = MutableLiveData<Result<PaymentIDBean>>()
/** /**
* Stripe支付创建消费用户 * Stripe支付创建消费用户
@@ -72,4 +74,12 @@ class SubscriptionPayViewModel : ViewModel() {
mCreatePaypalOrderLiveData.value = result mCreatePaypalOrderLiveData.value = result
} }
} }
fun getUserPaymentMethodID() {
viewModelScope.launch {
val userId = MMKVUtil.getString(MMKVKey.UserId)
val result = NetworkApi.getUserPaymentMethodID(userId)
mPaymentMethodIDLiveData.value = result
}
}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -32,7 +32,7 @@
<com.abbidot.tracker.widget.TypefaceTextView <com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/login_cn_top_content" android:id="@+id/login_cn_top_content"
style="@style/my_TextView_style" style="@style/my_TextView_style"
android:text="@string/login_txt_seeyou" android:text="@string/app_name"
android:textSize="@dimen/textSize24" android:textSize="@dimen/textSize24"
app:typeface="@string/roboto_regular_font" /> app:typeface="@string/roboto_regular_font" />

View File

@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.activity.account.cn.LoginV2CNActivity">
<include
android:id="@+id/login_v2_cn_top_bar"
layout="@layout/layout_top_bar" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<RelativeLayout
style="@style/root_layout_style"
android:layout_height="wrap_content"
android:padding="@dimen/dp_16">
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_login_v2_cn_welcome_back_title"
style="@style/my_TextView_style_v2"
android:text="@string/txt_welcome_back"
android:textSize="@dimen/textSize28"
android:textStyle="bold" />
<include
android:id="@+id/il_login_v2_cn_phone"
layout="@layout/layout_input_edit_view"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_66"
android:layout_below="@id/tv_login_v2_cn_welcome_back_title"
android:layout_marginTop="@dimen/dp_18" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_phone_error_tip_login_cn"
style="@style/my_TextView_style_v2"
android:layout_below="@id/il_login_v2_cn_phone"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/txt_use_valid_phone"
android:textColor="@color/red_color2"
android:textSize="@dimen/textSize14"
android:visibility="gone"
app:typeface="@string/roboto_regular_font" />
<include
android:id="@+id/il_login_v2_cn_password"
layout="@layout/layout_input_edit_view"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_66"
android:layout_below="@id/tv_phone_error_tip_login_cn"
android:layout_marginTop="@dimen/dp_12" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_password_error_tip_login_cn"
style="@style/my_TextView_style_v2"
android:layout_below="@id/il_login_v2_cn_password"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/txt_please_enter_pws"
android:textColor="@color/red_color2"
android:textSize="@dimen/textSize14"
android:visibility="gone"
app:typeface="@string/roboto_regular_font" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_login_v2_cn_forgot_password"
style="@style/my_TextView_style_v2"
android:layout_below="@id/tv_password_error_tip_login_cn"
android:layout_alignParentEnd="true"
android:layout_marginTop="@dimen/dp_28"
android:background="@drawable/selector_transparent_pressed"
android:text="@string/login_txt_fogot"
android:textSize="@dimen/textSize14"
app:typeface="@string/roboto_bold_font" />
<com.abbidot.tracker.widget.TypefaceButton
android:id="@+id/btn_login_v2_cn_login"
style="@style/my_match_RoundRect_Button_style"
android:layout_below="@id/tv_login_v2_cn_forgot_password"
android:layout_marginTop="@dimen/dp_45"
android:layout_marginBottom="@dimen/dp_16"
android:text="@string/txt_login"
app:qmui_radius="@dimen/dp_64"
app:typeface="@string/roboto_bold_font" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/btn_login_v2_cn_login_code"
style="@style/my_TextView_style_v2"
android:layout_below="@id/btn_login_v2_cn_login"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginBottom="@dimen/dp_60"
android:text="@string/login_txt_login_code"
android:textColor="@color/gray_color50"
android:textSize="@dimen/textSize16"
app:typeface="@string/roboto_regular_font" />
</RelativeLayout>
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@@ -33,13 +33,31 @@
android:textSize="@dimen/textSize10" android:textSize="@dimen/textSize10"
app:typeface="@string/roboto_regular_font" /> app:typeface="@string/roboto_regular_font" />
<com.abbidot.tracker.widget.TypefaceButton
android:id="@+id/btn_say_hello_login_wechat"
style="@style/my_QMUIRoundButton_very_small_style"
android:layout_above="@id/tv_say_hello_powered_by"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_40"
android:background="@color/transparent"
android:drawableEnd="@drawable/icon_login_cn_wechat_image"
android:drawablePadding="@dimen/dp_8"
android:text="@string/login_txt_login_wechat"
android:textColor="@color/select_color"
android:textSize="@dimen/textSize12"
android:visibility="gone"
app:qmui_borderColor="@color/line_color1"
app:qmui_borderWidth="@dimen/dp_1"
app:qmui_radius="@dimen/dp_38"
app:typeface="@string/roboto_bold_font" />
<com.abbidot.tracker.widget.TypefaceButton <com.abbidot.tracker.widget.TypefaceButton
android:id="@+id/btn_say_hello_login" android:id="@+id/btn_say_hello_login"
style="@style/my_RoundRect_Button_style" style="@style/my_RoundRect_Button_style"
android:layout_height="@dimen/dp_56" android:layout_height="@dimen/dp_56"
android:layout_above="@id/tv_say_hello_powered_by" android:layout_above="@id/btn_say_hello_login_wechat"
android:layout_marginEnd="-2dp" android:layout_marginEnd="-2dp"
android:layout_marginBottom="@dimen/dp_66" android:layout_marginBottom="@dimen/dp_70"
android:layout_toStartOf="@id/view_say_hello_center_placeholder" android:layout_toStartOf="@id/view_say_hello_center_placeholder"
android:background="@color/white_gray_color" android:background="@color/white_gray_color"
android:text="@string/txt_login" android:text="@string/txt_login"
@@ -61,11 +79,12 @@
app:qmui_radius="@dimen/dp_64" app:qmui_radius="@dimen/dp_64"
app:typeface="@string/roboto_bold_font" /> app:typeface="@string/roboto_bold_font" />
<com.abbidot.tracker.widget.TypefaceTextView <com.abbidot.tracker.widget.TypefaceTextView
style="@style/my_TextView_style_v2" style="@style/my_TextView_style_v2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_above="@id/btn_say_hello_signup" android:layout_above="@id/btn_say_hello_signup"
android:layout_marginBottom="@dimen/dp_32" android:layout_marginBottom="@dimen/dp_24"
android:text="@string/txt_say_hi_tip" android:text="@string/txt_say_hi_tip"
android:textSize="@dimen/textSize32" android:textSize="@dimen/textSize32"
android:textStyle="bold" /> android:textStyle="bold" />

View File

@@ -75,7 +75,7 @@
android:layout_alignStart="@id/btn_start_login_cn_account" android:layout_alignStart="@id/btn_start_login_cn_account"
android:layout_marginTop="@dimen/dp_32" android:layout_marginTop="@dimen/dp_32"
android:background="@drawable/text_view_pressed" android:background="@drawable/text_view_pressed"
android:drawableTop="@drawable/ico_loading_wechat" android:drawableTop="@drawable/icon_login_cn_wechat_image"
android:drawablePadding="@dimen/dp_6" android:drawablePadding="@dimen/dp_6"
android:text="@string/login_txt_login_wechat" android:text="@string/login_txt_login_wechat"
android:textColor="@color/gray_forget_color" android:textColor="@color/gray_forget_color"

View File

@@ -20,14 +20,14 @@
android:layout_below="@id/ll_login_cn_policy_terms" android:layout_below="@id/ll_login_cn_policy_terms"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:background="@drawable/shape28_yellow_bg" android:background="@drawable/shape28_yellow_bg"
android:drawableStart="@drawable/ico_loading_wechat2" android:drawableStart="@drawable/icon_login_cn_wechat_image"
android:drawablePadding="@dimen/dp_8" android:drawablePadding="@dimen/dp_8"
android:gravity="center" android:gravity="center"
android:paddingStart="@dimen/dp_36" android:paddingStart="@dimen/dp_36"
android:paddingTop="@dimen/dp_16" android:paddingTop="@dimen/dp_16"
android:paddingEnd="@dimen/dp_36" android:paddingEnd="@dimen/dp_36"
android:paddingBottom="@dimen/dp_14" android:paddingBottom="@dimen/dp_14"
android:text="@string/login_txt_btn_wechat" android:text="@string/app_name"
android:textSize="@dimen/textSize20" android:textSize="@dimen/textSize20"
app:typeface="@string/roboto_regular_font" /> app:typeface="@string/roboto_regular_font" />

View File

@@ -5,12 +5,32 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="@dimen/dp_200" android:paddingTop="@dimen/dp_50"
tools:context=".ui.fragment.subscribe.PaypalPaymentFragment"> tools:context=".ui.fragment.subscribe.PaypalPaymentFragment">
<com.abbidot.tracker.widget.TypefaceTextView <com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_no_paypal_payment_email"
style="@style/my_TextView_style_v2" style="@style/my_TextView_style_v2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_centerInParent="true"
android:text="@string/no_data"
android:textColor="@color/section_color_bg1"
android:textSize="@dimen/textSize16"
app:typeface="@string/roboto_regular_font" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_paypal_payment_email"
style="@style/my_TextView_style_v2"
android:layout_width="match_parent"
android:textSize="@dimen/textSize20"
app:typeface="@string/roboto_regular_font" />
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_paypal_payment_go_tip"
style="@style/my_TextView_style_v2"
android:layout_width="match_parent"
android:layout_below="@id/tv_paypal_payment_email"
android:layout_marginTop="@dimen/dp_60"
android:text="@string/txt_redirect_paypal" android:text="@string/txt_redirect_paypal"
android:textSize="@dimen/textSize20" android:textSize="@dimen/textSize20"
android:textStyle="bold" /> android:textStyle="bold" />
@@ -18,13 +38,15 @@
<com.abbidot.tracker.widget.TypefaceButton <com.abbidot.tracker.widget.TypefaceButton
android:id="@+id/btn_sure_redirect_paypal" android:id="@+id/btn_sure_redirect_paypal"
style="@style/my_match_RoundRect_Button_style" style="@style/my_match_RoundRect_Button_style"
android:layout_below="@id/tv_paypal_payment_go_tip"
android:layout_marginHorizontal="@dimen/dp_16" android:layout_marginHorizontal="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_42" android:layout_marginTop="@dimen/dp_10"
android:background="@color/orange_color2" android:background="@color/orange_color2"
app:qmui_radius="@dimen/dp_64" app:qmui_radius="@dimen/dp_64"
app:typeface="@string/roboto_bold_font" /> app:typeface="@string/roboto_bold_font" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_sure_redirect_paypal_bg"
android:layout_width="@dimen/dp_80" android:layout_width="@dimen/dp_80"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@id/btn_sure_redirect_paypal" android:layout_alignTop="@id/btn_sure_redirect_paypal"

View File

@@ -10,7 +10,7 @@
android:id="@+id/baidu_map_poi_name" android:id="@+id/baidu_map_poi_name"
style="@style/my_TextView_style" style="@style/my_TextView_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:text="@string/register_txt_start" android:text="@string/app_name"
android:textSize="@dimen/textSize18" android:textSize="@dimen/textSize18"
app:typeface="@string/roboto_bold_font" /> app:typeface="@string/roboto_bold_font" />
@@ -19,7 +19,7 @@
style="@style/my_TextView_style" style="@style/my_TextView_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginTop="@dimen/dp_2" android:layout_marginTop="@dimen/dp_2"
android:text="@string/register_txt_start" android:text="@string/app_name"
android:textColor="@color/deepGray" android:textColor="@color/deepGray"
android:textSize="@dimen/textSize14" android:textSize="@dimen/textSize14"
app:typeface="@string/roboto_regular_font" /> app:typeface="@string/roboto_regular_font" />

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.abbidot.tracker.widget.TypefaceTextView
android:id="@+id/tv_need_pay_money_cn"
style="@style/my_TextView_style"
android:layout_width="match_parent"
android:layout_marginTop="@dimen/dp_12"
android:text="@string/txt_payment_method"
android:textSize="@dimen/textSize14"
app:typeface="@string/roboto_bold_font" />
<RadioGroup
android:id="@+id/rg_pay_cn_chose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_28"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/rb_pay_cn_chose_alipay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_payment_method_check"
android:checked="true"
android:drawableEnd="@drawable/pic_alipay"
android:drawablePadding="@dimen/dp_18" />
<androidx.appcompat.widget.AppCompatRadioButton
android:id="@+id/rb_pay_cn_chose_wxpay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/selector_payment_method_check"
android:drawableEnd="@drawable/pic_wechatpay"
android:drawablePadding="@dimen/dp_18" />
</RadioGroup>
<com.abbidot.tracker.widget.TypefaceRoundButton
android:id="@+id/btn_pay_cn_chose_sure"
style="@style/my_QMUIRoundButton_big_style"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginBottom="@dimen/dp_28"
android:text="@string/txt_sure"
android:textColor="@drawable/selector_button_enabled_text_color"
android:textSize="@dimen/textSize18"
app:qmui_backgroundColor="@color/btn_yellow_color"
app:typeface="@string/roboto_bold_font" />
</androidx.appcompat.widget.LinearLayoutCompat>

View File

@@ -1059,4 +1059,6 @@
<string name="txt_show_all_pet">显示所有宠物</string> <string name="txt_show_all_pet">显示所有宠物</string>
<string name="txt_already_min_size">已是最小尺寸</string> <string name="txt_already_min_size">已是最小尺寸</string>
<string name="txt_use_valid_phone">请使用有效的手机号码</string>
</resources> </resources>

View File

@@ -1117,4 +1117,6 @@
<string name="txt_show_all_pet">Display All Pets</string> <string name="txt_show_all_pet">Display All Pets</string>
<string name="txt_already_min_size">Already at minimum size</string> <string name="txt_already_min_size">Already at minimum size</string>
<string name="txt_use_valid_phone">请使用有效的手机号码</string>
</resources> </resources>

View File

@@ -93,7 +93,7 @@ class AppUtils {
* 是否是国内 * 是否是国内
*/ */
fun isChina(type: String = SWITCH_PAGE_TYPE): Boolean { fun isChina(type: String = SWITCH_PAGE_TYPE): Boolean {
return false // return false
if (isDebug()) { if (isDebug()) {
if (type == SWITCH_MAP_TYPE && MMKVUtil.getBoolean(MMKVKey.OnlyGoogleMap, false)) { if (type == SWITCH_MAP_TYPE && MMKVUtil.getBoolean(MMKVKey.OnlyGoogleMap, false)) {
//只启用谷歌地图 //只启用谷歌地图
@@ -102,11 +102,8 @@ class AppUtils {
return MMKVUtil.getBoolean(MMKVKey.DebugIp, true) return MMKVUtil.getBoolean(MMKVKey.DebugIp, true)
} }
val locale = Locale.getDefault() val locale = Locale.getDefault()
val lang = locale.language + "-" + locale.country val lang = locale.language.uppercase() + "-" + locale.country.uppercase()
if (lang.contains("CN") || lang.contains("zh")) { return lang.contains("CN") || lang.contains("ZH")
return true
}
return false
} }
/** /**

View File

@@ -1,40 +1,28 @@
# Project-wide Gradle settings. ## For more details on how to configure your build environment visit
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. For more details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true # org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the #Tue Jun 09 14:21:45 CST 2026
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
# 表示使用 AndroidX
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# 表示将第三方库迁移到 AndroidX
android.enableJetifier = true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
#mapbox key
MAPBOX_DOWNLOADS_TOKEN=sk.eyJ1Ijoic2hhbnJlbnRlY2giLCJhIjoiY2t5bndlZnNuMDdjajJvcjBzOTcxcnVvbiJ9.VR_gh0uqZNVyUN92aACCiQ
MAPBOX_ACCESS_TOKEN=pk.eyJ1Ijoic2hhbnJlbnRlY2giLCJhIjoiY2t5bzNnNm41MWQyZzJubjd4NzN6MXJnMyJ9.NPjPb__sEUug9PK4L0hlSA
GOOGLE_MAP_KEY=AIzaSyCFEqlOoo2274NsX7tzoQjs_DA7B9N7-gY
BAIDU_MAP_KEY=YT2CmlqAkpMyzmw1AKNIBlYlBtHESEaW BAIDU_MAP_KEY=YT2CmlqAkpMyzmw1AKNIBlYlBtHESEaW
BUGLY_KEY=06fc0a9cd1 BUGLY_KEY=06fc0a9cd1
#http请求头部加密key GOOGLE_MAP_KEY=AIzaSyCFEqlOoo2274NsX7tzoQjs_DA7B9N7-gY
HTTP_REQUEST_KEY=8989JUIMSKHKehmasdfWEkjhf!*jfsadf8453 HTTP_REQUEST_KEY=8989JUIMSKHKehmasdfWEkjhf\!*jfsadf8453
MAPBOX_ACCESS_TOKEN=pk.eyJ1Ijoic2hhbnJlbnRlY2giLCJhIjoiY2t5bzNnNm41MWQyZzJubjd4NzN6MXJnMyJ9.NPjPb__sEUug9PK4L0hlSA
#stripe支付 MAPBOX_DOWNLOADS_TOKEN=sk.eyJ1Ijoic2hhbnJlbnRlY2giLCJhIjoiY2t5bndlZnNuMDdjajJvcjBzOTcxcnVvbiJ9.VR_gh0uqZNVyUN92aACCiQ
STRIPE_TEST_KEY=pk_test_51N0gBGCUI9XSagUNC3i1ZTiavE2pncKF3cBPWCu4p0OWowHNh22P1xeEpowp6TUNEeFNfv4OEHmLyj7sihmNuSQl00x2pvl4xH
STRIPE_RELEASE_KEY=pk_live_51N0gBGCUI9XSagUNNDNWc77OdwDWXVSGIdf8WHjvGfe5plUOfs7eq7uyTEQ3ma1xXHlavwInuw9WZOJQ6Z9FVjLq00VsFpc1Rv STRIPE_RELEASE_KEY=pk_live_51N0gBGCUI9XSagUNNDNWc77OdwDWXVSGIdf8WHjvGfe5plUOfs7eq7uyTEQ3ma1xXHlavwInuw9WZOJQ6Z9FVjLq00VsFpc1Rv
STRIPE_TEST_KEY=pk_test_51N0gBGCUI9XSagUNC3i1ZTiavE2pncKF3cBPWCu4p0OWowHNh22P1xeEpowp6TUNEeFNfv4OEHmLyj7sihmNuSQl00x2pvl4xH
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.suppressUnsupportedCompileSdk=34 android.suppressUnsupportedCompileSdk=34
android.useAndroidX=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx1024M -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Dfile.encoding\=UTF-8