Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
a9546cc2
Commit
a9546cc2
authored
Nov 21, 2023
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
32253ee1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
MyFragment.kt
...src/main/java/com/duben/heliapp/ui/fragment/MyFragment.kt
+10
-14
VipDialog.kt
...p/src/main/java/com/duben/heliapp/ui/widgets/VipDialog.kt
+18
-2
No files found.
video/app/src/main/java/com/duben/heliapp/ui/fragment/MyFragment.kt
View file @
a9546cc2
...
...
@@ -448,20 +448,16 @@ class MyFragment : LazyLoadBaseFragment(), MyView, View.OnClickListener {
var
vipDialog
:
VipDialog
?
=
null
private
fun
vipDialog
()
{
vipDialog
=
VipDialog
(
requireContext
(),
object
:
DialogListener
()
{
@SuppressLint
(
"NonConstantResourceId"
)
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
// R.id.btn_dialogper_next -> {
// if (vipDialog != null && vipDialog!!.isShowing) {
// vipDialog!!.dismiss()
// }
// AppPreferencesManager.get().put(Constant.LOAN_PERMISSION_FLAG, false)
// baseApplication.thirdConfig()
// TrackManager.getInstance().visitorlogin()
// initData()
// }
vipDialog
=
VipDialog
(
requireContext
(),
object
:
VipDialog
.
VipStatusListener
{
override
fun
close
()
{
onFragmentResume
()
}
override
fun
paySuccess
()
{
onFragmentResume
()
}
override
fun
payFail
()
{
}
})
vipDialog
!!
.
show
()
...
...
video/app/src/main/java/com/duben/heliapp/ui/widgets/VipDialog.kt
View file @
a9546cc2
...
...
@@ -28,6 +28,7 @@ import com.duben.heliapp.mvp.presenters.VipPresenter
import
com.duben.heliapp.mvp.views.VipView
import
com.duben.heliapp.ui.activitys.VipActivity
import
com.duben.heliapp.ui.activitys.WebActivity
import
com.duben.heliapp.ui.adapter.TopAdapter
import
com.duben.heliapp.ui.adapter.VipAdapter
import
com.duben.heliapp.utils.BubbleUtils
import
com.duben.heliapp.utils.ForegroundOrBackground
...
...
@@ -46,7 +47,7 @@ import com.jobo.wxpay.WXPayInfoImpl
*/
class
VipDialog
(
context
:
Context
,
private
val
listener
:
Dialog
Listener
,
private
val
listener
:
VipStatus
Listener
,
val
showPoint
:
Int
?
=
0
)
:
Dialog
(
context
,
R
.
style
.
dialog
),
VipView
,
CompoundButton
.
OnCheckedChangeListener
,
...
...
@@ -62,6 +63,7 @@ class VipDialog(
private
var
payType
=
VipActivity
.
WEIXIN_PAY
// 支付类型
private
var
isCheckAgreeFlag
:
Boolean
=
true
lateinit
var
mOnVipStatusListener
:
VipStatusListener
private
val
lp
:
WindowManager
.
LayoutParams
...
...
@@ -167,6 +169,7 @@ class VipDialog(
override
fun
queryVipOrderSuc
(
isPay
:
Boolean
)
{
if
(
isPay
)
{
mOnVipStatusListener
?.
paySuccess
()
ToastUtil
.
show
(
context
,
"支付成功"
)
dismiss
()
}
...
...
@@ -227,6 +230,7 @@ class VipDialog(
when
(
v
?.
id
)
{
R
.
id
.
iv_vip_dialog_close
->
{
mOnVipStatusListener
?.
close
()
dismiss
()
}
R
.
id
.
tvVipPay
->
{
...
...
@@ -313,7 +317,7 @@ class VipDialog(
override
fun
failed
(
code
:
Int
,
message
:
String
?)
{
vipPresenter
.
queryVipOrder
(
wxParanBean
.
tid
.
toString
(),
false
)
mOnVipStatusListener
?.
payFail
()
}
override
fun
cancel
()
{
...
...
@@ -353,6 +357,7 @@ class VipDialog(
if
(!
TextUtils
.
isEmpty
(
message
))
{
showToast
(
message
)
}
mOnVipStatusListener
?.
payFail
()
}
override
fun
cancel
()
{
...
...
@@ -386,4 +391,15 @@ class VipDialog(
val
intent
=
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
url
))
context
.
startActivity
(
intent
)
}
interface
VipStatusListener
{
fun
close
()
fun
paySuccess
()
fun
payFail
()
}
fun
setOnVipStatusListener
(
listener
:
VipStatusListener
)
{
mOnVipStatusListener
=
listener
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment