宙连内核更改
This commit is contained in:
parent
31d2a20ebf
commit
7ad3a68d6b
|
|
@ -77,6 +77,17 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
|||
var isGlo: Boolean = false
|
||||
var clashRunning: Boolean = false
|
||||
|
||||
var clashRec: BroadcastReceiver? = null
|
||||
fun cleanRec(context: Context) {
|
||||
clashRec?.let {
|
||||
try {
|
||||
context.unregisterReceiver(clashRec)
|
||||
}catch (e: Exception){
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lateinit var accelerateViewModel: AccelerateViewModel
|
||||
|
|
@ -134,13 +145,14 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
|||
intentFilter.addAction(Intents.ACTION_CLASH_REQUEST_STOP)
|
||||
intentFilter.addAction(Intents.ACTION_Glo_Mode)
|
||||
intentFilter.addAction(Intents.ACTION_OVERRIDE_CHANGED)
|
||||
clashRec=ClashBP()
|
||||
if (Build.VERSION.SDK_INT >= 34 && requireContext().applicationInfo.targetSdkVersion >= 34) {
|
||||
requireContext().registerReceiver(
|
||||
ClashBP(), intentFilter, Context.RECEIVER_EXPORTED
|
||||
clashRec, intentFilter, Context.RECEIVER_EXPORTED
|
||||
)
|
||||
} else {
|
||||
requireContext().registerReceiver(
|
||||
ClashBP(), intentFilter
|
||||
clashRec, intentFilter
|
||||
)
|
||||
}
|
||||
// context?.registerReceiver(
|
||||
|
|
@ -780,4 +792,8 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
|||
baseLoading?.cancel()
|
||||
}
|
||||
}
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
cleanRec(requireContext())
|
||||
}
|
||||
}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
package com.yingmao.clash.view.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
|
||||
import com.yingmao.clash.R
|
||||
import com.yingmao.clash.conf.PayType
|
||||
|
||||
/**
|
||||
* @author tamsiree
|
||||
* @date 2016/7/19
|
||||
* 确认 取消 Dialog
|
||||
*/
|
||||
open class DialogPayTypeChoose : RxDialog {
|
||||
lateinit var titleView: TextView
|
||||
private set
|
||||
lateinit var rb_wxpay: View
|
||||
private set
|
||||
lateinit var rb_alipay: View
|
||||
private set
|
||||
lateinit var rb_typay: View
|
||||
private set
|
||||
lateinit var rb_alipay_app: View
|
||||
private set
|
||||
lateinit var rg_pay_type: LinearLayout
|
||||
private set
|
||||
lateinit var onPayTypeCheckedListener: OnPayTypeCheckedListener
|
||||
private set
|
||||
private var title: String = ""
|
||||
|
||||
constructor(context: Context?, themeResId: Int) : super(context!!, themeResId) {
|
||||
initView()
|
||||
}
|
||||
|
||||
constructor(
|
||||
context: Context?,
|
||||
cancelable: Boolean,
|
||||
cancelListener: DialogInterface.OnCancelListener?,
|
||||
) : super(context!!, cancelable, cancelListener) {
|
||||
initView()
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context!!) {
|
||||
initView()
|
||||
}
|
||||
|
||||
constructor(context: Activity?) : super(context!!) {
|
||||
initView()
|
||||
}
|
||||
|
||||
constructor(context: Context?, alpha: Float, gravity: Int) : super(context, alpha, gravity) {
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_pay_type_choose, null)
|
||||
titleView = dialogView.findViewById(R.id.tv_title)
|
||||
rg_pay_type = dialogView.findViewById(R.id.rg_pay_type)
|
||||
rb_alipay = dialogView.findViewById(R.id.rb_alipay)
|
||||
rb_typay = dialogView.findViewById(R.id.rb_typay)
|
||||
rb_alipay_app = dialogView.findViewById(R.id.rb_alipay_app)
|
||||
rb_wxpay = dialogView.findViewById(R.id.rb_wxpay)
|
||||
if (title.isBlank()) {
|
||||
titleView.visibility = View.GONE
|
||||
}
|
||||
setContentView(dialogView)
|
||||
rb_alipay_app.setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_ALI_APP)
|
||||
}
|
||||
rb_alipay.setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_ALI)
|
||||
}
|
||||
rb_wxpay.setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_WX)
|
||||
}
|
||||
rb_typay.setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_Stripe)
|
||||
}
|
||||
|
||||
dialogView.findViewById<ImageView>(R.id.iv_bilai_zfb).setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB)
|
||||
}
|
||||
dialogView.findViewById<ImageView>(R.id.iv_bilai_wx).setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_WX)
|
||||
}
|
||||
dialogView.findViewById<ImageView>(R.id.iv_bilai_jd).setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB)
|
||||
}
|
||||
dialogView.findViewById<LinearLayout>(R.id.ll_bilai_url).setOnClickListener {
|
||||
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_WEB)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setOnPayTypeCheckedListener(onPayTypeCheckedListener: OnPayTypeCheckedListener) {
|
||||
this.onPayTypeCheckedListener = onPayTypeCheckedListener
|
||||
}
|
||||
|
||||
interface OnPayTypeCheckedListener {
|
||||
fun onPayTypeChecked(payType: String)
|
||||
}
|
||||
|
||||
fun setTitle(titleStr: String) {
|
||||
title = titleStr
|
||||
if (title.isBlank()) {
|
||||
titleView.visibility = View.GONE
|
||||
return
|
||||
}
|
||||
titleView.visibility = View.VISIBLE
|
||||
titleView.text = title
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -100,7 +100,7 @@ subprojects {
|
|||
}
|
||||
productFlavors {
|
||||
flavorDimensions("feature")
|
||||
create("1002") {
|
||||
create("1101") {
|
||||
isDefault = true
|
||||
dimension = flavorDimensionList[0]
|
||||
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
|
||||
|
|
@ -111,7 +111,7 @@ subprojects {
|
|||
buildConfigField("String", "applicationId", "\"com.yingmao.clash\"")
|
||||
buildConfigField("String", "service_url", "\"https://api.readzhe.top\"")
|
||||
buildConfigField("boolean", "is_free", "false")
|
||||
buildConfigField("String", "productId", "\"1002\"")
|
||||
buildConfigField("String", "productId", "\"1101\"")
|
||||
manifestPlaceholders(
|
||||
mapOf(
|
||||
"APP_NAME" to "@string/zl",
|
||||
|
|
@ -121,7 +121,7 @@ subprojects {
|
|||
}
|
||||
}
|
||||
sourceSets {
|
||||
getByName("1002") {
|
||||
getByName("1101") {
|
||||
java.srcDirs("src/foss/java")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue