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
4ae4c218
Commit
4ae4c218
authored
Feb 20, 2024
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
eda5d071
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
67 deletions
+95
-67
AppConfig.java
...p/src/main/java/com/duben/shortplay/common/AppConfig.java
+1
-0
Constant.kt
.../app/src/main/java/com/duben/shortplay/common/Constant.kt
+1
-0
VipActivity.kt
...main/java/com/duben/shortplay/ui/activitys/VipActivity.kt
+78
-64
VipPayCancelDialog.kt
...java/com/duben/shortplay/ui/widgets/VipPayCancelDialog.kt
+1
-0
dialog_vip_pay_cancel.xml
video/app/src/main/res/layout/dialog_vip_pay_cancel.xml
+14
-3
No files found.
video/app/src/main/java/com/duben/shortplay/common/AppConfig.java
View file @
4ae4c218
...
...
@@ -17,6 +17,7 @@ public class AppConfig {
*/
public
static
int
fragmentClickFlag
=
0
;
public
static
int
vedioId
=
0
;
public
static
int
alipayCancelCount
=
0
;
// 退出登录首页刷新
public
static
boolean
exitLoginMainRefresh
=
false
;
...
...
video/app/src/main/java/com/duben/shortplay/common/Constant.kt
View file @
4ae4c218
...
...
@@ -29,6 +29,7 @@ object Constant {
const
val
MAIN_TWO_RECOMMEND
=
"MAIN_TWO_RECOMMEND"
const
val
VEDIO_AD_COUNT
=
"VEDIO_AD_COUNT"
const
val
VEDIO_MAIN_COUNT
=
"VEDIO_MAIN_COUNT"
const
val
ALIPAY_COUNT
=
"ALIPAY_COUNT"
const
val
CARRIERTYPE_CSJ_VEDIO
=
"1"
...
...
video/app/src/main/java/com/duben/shortplay/ui/activitys/VipActivity.kt
View file @
4ae4c218
...
...
@@ -68,6 +68,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
const
val
THIRD_ID
=
"THIRD_ID"
const
val
VEDIO_ID
=
"VEDIO_ID"
}
var
timer
:
CountDownTimerSupport
?
=
null
private
var
breathAnim
:
YoYo
.
YoYoString
?
=
null
...
...
@@ -487,13 +488,18 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
// 挽留弹窗存在也不弹
if
(
payYesDialog
!=
null
&&
payYesDialog
!!
.
isShowing
)
return
@postDelayed
if
(
vipList
!=
null
&&
vipList
!!
.
size
>
0
)
{
val
vipBean
=
vipList
!!
[
vipAdapter
.
getPosition
()]
// 0.01
if
(
vipBean
.
trial
!=
0
)
{
val
alipayCount
=
AppPreferencesManager
.
get
().
getInt
(
Constant
.
ALIPAY_COUNT
,
0
)
AppPreferencesManager
.
get
().
put
(
Constant
.
ALIPAY_COUNT
,
alipayCount
+
1
)
showPayCancelDialog
()
}
}
// if (vipList != null && vipList!!.size > 0) {
// val vipBean = vipList!![vipAdapter.getPosition()]
// // 0.01
// if (vipBean.trial != 0) {
// showPayCancelDialog()
// }
// }
},
2000
...
...
@@ -535,6 +541,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
* 返回支付弹窗-签约
*/
private
fun
backPayYesDialog
(
vipBean
:
VipBean
.
ListBean
)
{
// 金额
payYesDialog
=
PayYesDialog
(
context
,
vipBean
,
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
if
(!
isFinishing
()
&&
payYesDialog
!=
null
&&
payYesDialog
!!
.
isShowing
())
{
...
...
@@ -731,13 +738,20 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
}
private
fun
showPayCancelDialog
()
{
// 金额
val
alipayCount
=
AppPreferencesManager
.
get
().
getInt
(
Constant
.
ALIPAY_COUNT
,
0
)
if
(
alipayCount
==
1
)
{
}
else
if
(
alipayCount
==
2
)
{
}
val
vipBean
=
vipList
!!
[
0
]
VipPayCancelDialog
(
this
,
vipBean
.
price
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
vipPresenter
.
getVipPayParams
(
"ALIPAY"
,
vipBean
.
pid
,
isAliPayInstalled
()
...
...
@@ -756,7 +770,7 @@ class VipActivity : BaseActivity(), VipView, View.OnClickListener,
timer
!!
.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
override
fun
onTick
(
millisUntilFinished
:
Long
)
{
if
(!
isFinishing
)
{
if
(
millisUntilFinished
==
4000L
)
{
if
(
millisUntilFinished
==
4000L
)
{
vipPresenter
.
getMyInfo
()
}
}
...
...
video/app/src/main/java/com/duben/shortplay/ui/widgets/VipPayCancelDialog.kt
View file @
4ae4c218
...
...
@@ -42,6 +42,7 @@ class VipPayCancelDialog(
dismiss
()
}
tv_cancel_cash
.
text
=
"${cash}元"
tv_cancel_coupon
.
text
=
"赠送${cash}元体验券"
listener
.
setDialog
(
this
)
findViewById
<
View
>(
R
.
id
.
btn
).
setOnClickListener
(
listener
)
...
...
video/app/src/main/res/layout/dialog_vip_pay_cancel.xml
View file @
4ae4c218
...
...
@@ -43,6 +43,15 @@
android:layout_marginTop=
"193dp"
android:textColor=
"@color/tv_message_recente_money"
android:layout_height=
"wrap_content"
></TextView>
<TextView
android:id=
"@+id/tv_count_down"
android:layout_width=
"wrap_content"
android:textSize=
"18dp"
android:text=
"-"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"272dp"
android:textColor=
"@color/gray"
android:layout_height=
"wrap_content"
></TextView>
</FrameLayout>
...
...
@@ -57,12 +66,14 @@
app:layout_constraintTop_toTopOf=
"@+id/guideline3"
/>
<TextView
android:id=
"@+id/tv_c
ount_dow
n"
android:id=
"@+id/tv_c
ancel_coupo
n"
android:layout_width=
"160dp"
android:layout_height=
"36dp"
android:background=
"@drawable/shape_linear_yellow"
android:gravity=
"center"
android:textColor=
"@color/color_FD7E0E"
android:text=
"赠送-元体验券"
android:textSize=
"18sp"
android:textColor=
"@color/red"
app:layout_constraintBottom_toTopOf=
"@id/guideline2"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -80,7 +91,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
app:layout_constraintGuide_begin=
"3
1
4dp"
/>
app:layout_constraintGuide_begin=
"3
3
4dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
...
...
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