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
c73066aa
Commit
c73066aa
authored
Aug 22, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
9d589e76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
17 deletions
+69
-17
NineActivity.kt
...ain/java/com/mints/helivideo/ui/activitys/NineActivity.kt
+59
-10
MainFragment.kt
...main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
+3
-1
activity_nine.xml
video/app/src/main/res/layout/activity_nine.xml
+7
-6
No files found.
video/app/src/main/java/com/mints/helivideo/ui/activitys/NineActivity.kt
View file @
c73066aa
package
com.mints.helivideo.ui.activitys
package
com.mints.helivideo.ui.activitys
import
android.app.Dialog
import
android.os.Bundle
import
android.os.Bundle
import
android.os.Handler
import
android.os.Handler
import
android.os.Looper
import
android.os.Looper
...
@@ -17,6 +18,8 @@ import com.mints.helivideo.mvp.model.NineShowBean
...
@@ -17,6 +18,8 @@ import com.mints.helivideo.mvp.model.NineShowBean
import
com.mints.helivideo.mvp.presenters.NinePresenter
import
com.mints.helivideo.mvp.presenters.NinePresenter
import
com.mints.helivideo.mvp.views.NineView
import
com.mints.helivideo.mvp.views.NineView
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.ui.activitys.base.BaseActivity
import
com.mints.helivideo.ui.widgets.DialogListener
import
com.mints.helivideo.ui.widgets.NineContinueDialog
import
com.mints.helivideo.utils.AppPreferencesManager
import
com.mints.helivideo.utils.AppPreferencesManager
import
com.mints.helivideo.utils.SplitArrayUtils
import
com.mints.helivideo.utils.SplitArrayUtils
import
com.mints.helivideo.utils.rxutil.CommonRxTask
import
com.mints.helivideo.utils.rxutil.CommonRxTask
...
@@ -30,11 +33,16 @@ import kotlinx.android.synthetic.main.activity_nine.*
...
@@ -30,11 +33,16 @@ import kotlinx.android.synthetic.main.activity_nine.*
*/
*/
class
NineActivity
:
BaseActivity
(),
View
.
OnClickListener
,
NineView
{
class
NineActivity
:
BaseActivity
(),
View
.
OnClickListener
,
NineView
{
companion
object
{
val
IS_AD_SHOW
=
"IS_AD_SHOW"
}
private
val
ninePresenter
by
lazy
{
NinePresenter
()
}
private
val
ninePresenter
by
lazy
{
NinePresenter
()
}
private
var
yoyo
:
YoYo
.
YoYoString
?
=
null
private
var
yoyo
:
YoYo
.
YoYoString
?
=
null
val
luckyIndexMap
:
MutableMap
<
Int
,
String
>
=
HashMap
()
val
luckyIndexMap
:
MutableMap
<
Int
,
String
>
=
HashMap
()
private
var
nineShowBean
:
NineShowBean
?
=
null
private
var
nineShowBean
:
NineShowBean
?
=
null
var
carrierType
=
Constant
.
CARRIERTYPE_NINE
var
carrierType
=
Constant
.
CARRIERTYPE_NINE
var
isAdShow
=
false
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_nine
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_nine
...
@@ -44,6 +52,13 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -44,6 +52,13 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
override
fun
getOverridePendingTransitionMode
()
=
TransitionMode
.
SCALE
override
fun
getOverridePendingTransitionMode
()
=
TransitionMode
.
SCALE
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
isAdShow
=
it
.
getBoolean
(
IS_AD_SHOW
,
false
)
}
}
override
fun
initViewsAndEvents
()
{
override
fun
initViewsAndEvents
()
{
ninePresenter
.
attachView
(
this
)
ninePresenter
.
attachView
(
this
)
ninePresenter
.
getTurnIphoneMsg
()
ninePresenter
.
getTurnIphoneMsg
()
...
@@ -71,6 +86,7 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -71,6 +86,7 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
private
fun
initListener
()
{
private
fun
initListener
()
{
btn_action
.
setOnClickListener
(
this
)
btn_action
.
setOnClickListener
(
this
)
rl_lucky
.
setOnClickListener
(
this
)
iv_nine_back
.
setOnClickListener
(
this
)
iv_nine_back
.
setOnClickListener
(
this
)
}
}
...
@@ -86,20 +102,24 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -86,20 +102,24 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
R
.
id
.
iv_nine_back
->
{
R
.
id
.
iv_nine_back
->
{
finish
()
finish
()
}
}
R
.
id
.
btn_action
->
{
R
.
id
.
btn_action
,
R
.
id
.
rl_lucky
->
{
if
(
luckyIndexMap
.
size
==
0
)
{
if
(
luckyIndexMap
.
size
==
0
)
{
showToast
(
"界面初始异常,请重新进入"
)
showToast
(
"界面初始异常,请重新进入"
)
return
return
}
}
if
(
nineShowBean
!=
null
)
{
if
(
isAdShow
)
{
if
(
nineShowBean
!!
.
complete
>=
nineShowBean
!!
.
need
)
{
luckyAward
()
luckyAward
()
}
else
{
}
else
{
if
(
nineShowBean
!=
null
)
{
val
bundle
=
Bundle
()
if
(
nineShowBean
!!
.
complete
>=
nineShowBean
!!
.
need
)
{
bundle
.
putInt
(
NineKnowActivity
.
COMPLETE
,
nineShowBean
!!
.
complete
)
luckyAward
()
bundle
.
putInt
(
NineKnowActivity
.
NEED
,
nineShowBean
!!
.
need
)
}
else
{
readyGoThenKill
(
NineKnowActivity
::
class
.
java
,
bundle
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
NineKnowActivity
.
COMPLETE
,
nineShowBean
!!
.
complete
)
bundle
.
putInt
(
NineKnowActivity
.
NEED
,
nineShowBean
!!
.
need
)
readyGoThenKill
(
NineKnowActivity
::
class
.
java
,
bundle
)
}
}
}
}
}
}
}
...
@@ -108,6 +128,14 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -108,6 +128,14 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
override
fun
unlockSuc
()
{
override
fun
unlockSuc
()
{
ninePresenter
.
showTurn
()
ninePresenter
.
showTurn
()
if
(
isAdShow
)
{
if
(
nineShowBean
!=
null
)
{
if
(
nineShowBean
!!
.
complete
<
nineShowBean
!!
.
need
)
{
showContinueDialog
()
}
}
}
}
}
override
fun
getTurnIphoneMsgSuc
(
data
:
NineListBean
)
{
override
fun
getTurnIphoneMsgSuc
(
data
:
NineListBean
)
{
...
@@ -148,7 +176,12 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -148,7 +176,12 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
ninePresenter
.
toTurn
()
ninePresenter
.
toTurn
()
}
}
// 展示 5/20
// 展示 5/20
tv_nine_count
.
text
=
"${data.complete}/${data.need}次"
if
(
isAdShow
)
{
tv_nine_count
.
visibility
=
View
.
VISIBLE
tv_nine_count
.
text
=
"${data.complete}/${data.need}次"
}
else
{
tv_nine_count
.
visibility
=
View
.
GONE
}
}
}
private
fun
luckyAward
()
{
private
fun
luckyAward
()
{
...
@@ -260,4 +293,20 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
...
@@ -260,4 +293,20 @@ class NineActivity : BaseActivity(), View.OnClickListener, NineView {
messages
.
add
(
"恭喜用户151******64抽中 +14天会员"
)
messages
.
add
(
"恭喜用户151******64抽中 +14天会员"
)
marqueeView
.
startWithList
(
SplitArrayUtils
.
getRandomList
(
messages
)
as
List
<
Nothing
>?)
marqueeView
.
startWithList
(
SplitArrayUtils
.
getRandomList
(
messages
)
as
List
<
Nothing
>?)
}
}
// 继续观看逻辑
private
fun
showContinueDialog
()
{
nineShowBean
?.
let
{
NineContinueDialog
(
this
@NineActivity
,
it
.
need
-
it
.
complete
-
1
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
super
.
onClick
(
dialog
,
v
)
dialog
?.
dismiss
()
luckyAward
()
}
}).
show
()
}
}
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/helivideo/ui/fragment/MainFragment.kt
View file @
c73066aa
...
@@ -305,7 +305,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
...
@@ -305,7 +305,9 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val
banner
=
data
.
list
.
get
(
position
)
val
banner
=
data
.
list
.
get
(
position
)
if
(
banner
.
createType
==
4
)
{
if
(
banner
.
createType
==
4
)
{
// 九宫格
// 九宫格
readyGo
(
NineActivity
::
class
.
java
)
val
bundle
=
Bundle
()
bundle
.
putBoolean
(
NineActivity
.
IS_AD_SHOW
,
true
)
readyGo
(
NineActivity
::
class
.
java
,
bundle
)
}
else
{
}
else
{
LocalVedioManager
.
startVedioDetailActivityForType
(
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
requireActivity
(),
...
...
video/app/src/main/res/layout/activity_nine.xml
View file @
c73066aa
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/rl_lucky"
android:layout_width=
"315dp"
android:layout_width=
"315dp"
android:layout_height=
"315dp"
android:layout_height=
"315dp"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
...
@@ -48,10 +49,10 @@
...
@@ -48,10 +49,10 @@
<RelativeLayout
<RelativeLayout
android:id=
"@+id/btn_action"
android:id=
"@+id/btn_action"
android:layout_width=
"8
0
dp"
android:layout_width=
"8
2
dp"
android:layout_height=
"8
0
dp"
android:layout_height=
"8
2
dp"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:background=
"@mipmap/ic_luck
y_vedio
"
>
android:background=
"@mipmap/ic_luck
ly_btn
"
>
<TextView
<TextView
android:id=
"@+id/tv_nine_count"
android:id=
"@+id/tv_nine_count"
...
@@ -59,10 +60,10 @@
...
@@ -59,10 +60,10 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"6dp"
android:layout_marginBottom=
"20dp"
android:text=
"-/-"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"8dp"
android:textSize=
"10dp"
></TextView>
android:visibility=
"gone"
></TextView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
...
...
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