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
6144cdc1
Commit
6144cdc1
authored
Sep 19, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
98d483b2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
335 additions
and
79 deletions
+335
-79
MusicPresenter.kt
...ava/com/duben/dayplaylet/mvp/presenters/MusicPresenter.kt
+4
-1
MusicView.kt
...src/main/java/com/duben/dayplaylet/mvp/views/MusicView.kt
+1
-0
LoanService.java
...p/src/main/java/com/duben/dayplaylet/net/LoanService.java
+1
-1
MainFragment.kt
...ain/java/com/duben/dayplaylet/ui/fragment/MainFragment.kt
+1
-1
MusicFragment.kt
...in/java/com/duben/dayplaylet/ui/fragment/MusicFragment.kt
+174
-50
fragment_music.xml
video/app/src/main/res/layout/fragment_music.xml
+125
-0
media_layout_quiz.xml
video/app/src/main/res/layout/media_layout_quiz.xml
+29
-26
pic_dttx.png
video/app/src/main/res/mipmap-xhdpi/pic_dttx.png
+0
-0
vs_icon_anim_star.png
video/app/src/main/res/mipmap-xhdpi/vs_icon_anim_star.png
+0
-0
No files found.
video/app/src/main/java/com/duben/dayplaylet/mvp/presenters/MusicPresenter.kt
View file @
6144cdc1
...
...
@@ -22,6 +22,7 @@ class MusicPresenter : BasePresenter<MusicView>() {
override
fun
onError
(
e
:
Throwable
)
{
if
(
isLinkView
)
return
view
.
showToast
(
e
.
message
)
view
.
rdSongMsgFail
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MusicBean
>)
{
...
...
@@ -35,6 +36,7 @@ class MusicPresenter : BasePresenter<MusicView>() {
view
.
rdSongMsgSuc
(
baseResponse
.
data
)
}
else
->
{
view
.
rdSongMsgFail
()
view
.
showToast
(
message
)
}
}
...
...
@@ -43,8 +45,9 @@ class MusicPresenter : BasePresenter<MusicView>() {
}
// 添加金币
fun
reportAddCoinMsg
(
carrierType
:
String
)
{
fun
reportAddCoinMsg
(
carrierType
:
String
,
ecpmId
:
String
=
""
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"ecpmId"
]
=
ecpmId
vo
[
"carrierType"
]
=
carrierType
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
reportAddCoinMsg
(
vo
),
...
...
video/app/src/main/java/com/duben/dayplaylet/mvp/views/MusicView.kt
View file @
6144cdc1
...
...
@@ -4,5 +4,6 @@ import com.duben.dayplaylet.mvp.model.MusicBean
interface
MusicView
:
BaseView
{
fun
rdSongMsgSuc
(
data
:
MusicBean
)
fun
rdSongMsgFail
()
fun
reportAddCoinMsgSuc
()
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/net/LoanService.java
View file @
6144cdc1
...
...
@@ -217,7 +217,7 @@ public interface LoanService {
*
* @return
*/
@POST
(
"api/reportAddCoinMsg"
)
@POST
(
"api/re
ward/re
portAddCoinMsg"
)
Observable
<
BaseResponse
<
JsonObject
>>
reportAddCoinMsg
(
@Body
Map
<
String
,
Object
>
vo
);
/**
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/fragment/MainFragment.kt
View file @
6144cdc1
...
...
@@ -281,7 +281,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
// 弹出新人红包
if
(!
isShowNewuserFlag
)
{
isShowNewuserFlag
=
true
showNewcomerDialog
(
data
.
userMsg
.
rewardCoin
)
//
showNewcomerDialog(data.userMsg.rewardCoin)
}
}
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/fragment/MusicFragment.kt
View file @
6144cdc1
...
...
@@ -38,9 +38,10 @@ import com.duben.dayplaylet.mvp.views.MusicView
import
com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import
com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.duben.dayplaylet.ui.widgets.countdowntimer.OnCountDownTimerListener
import
com.duben.dayplaylet.utils.BubbleUtils
import
com.duben.dayplaylet.utils.LogUtil
import
com.duben.dayplaylet.utils.SpanUtils
import
kotlinx.android.synthetic.main.fragment_music.*
import
kotlinx.android.synthetic.main.layout_draw_header.*
/**
* 猜歌
...
...
@@ -51,12 +52,14 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
private
val
musicPresenter
by
lazy
{
MusicPresenter
()
}
private
var
mIsFirstInit
=
false
private
var
mIDPWidget
:
IDPWidget
?
=
null
private
var
mDrawFragment
:
Fragment
?
=
null
private
val
mainHandler
=
Handler
(
Looper
.
getMainLooper
())
private
var
mMusicBean
:
MusicBean
?
=
null
private
var
mTimer
:
CountDownTimerSupport
?
=
null
private
var
rope
:
YoYoString
?
=
null
private
var
mPos
=
0
...
...
@@ -64,18 +67,14 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
override
fun
initViewsAndEvents
()
{
musicPresenter
.
attachView
(
this
)
rl_open_cash
.
setOnClickListener
{
showRewardAnim
(
10
,
10
)
}
}
override
fun
onFragmentFirstVisible
()
{
if
(
DPSdk
.
isStartSuccess
())
{
//初始化draw组件
initDrawWidget
()
mDrawFragment
=
mIDPWidget
?.
fragment
supportFragmentManager
.
beginTransaction
()
.
replace
(
R
.
id
.
draw_style1_frame
,
mDrawFragment
!!
)
.
commitAllowingStateLoss
()
}
}
override
fun
onFragmentResume
()
{
...
...
@@ -106,6 +105,19 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
// dpWidget?.fragment?.userVisibleHint = isVisibleToUser
}
private
fun
firstDrawWidget
()
{
if
(
DPSdk
.
isStartSuccess
())
{
mIsFirstInit
=
true
//初始化draw组件
initDrawWidget
()
mDrawFragment
=
mIDPWidget
?.
fragment
supportFragmentManager
.
beginTransaction
()
.
replace
(
R
.
id
.
draw_style1_frame
,
mDrawFragment
!!
)
.
commitAllowingStateLoss
()
}
}
private
fun
initDrawWidget
()
{
mIDPWidget
=
DPHolder
.
getInstance
()
...
...
@@ -159,6 +171,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
val
quizTvPop
=
view
.
findViewById
<
TextView
>(
R
.
id
.
quiz_tv_pop
)
val
finger
=
view
.
findViewById
<
LottieAnimationView
>(
R
.
id
.
finger_view
)
val
rlOption0
=
view
.
findViewById
<
RelativeLayout
>(
R
.
id
.
rl_option0
)
val
rlOption1
=
view
.
findViewById
<
RelativeLayout
>(
R
.
id
.
rl_option1
)
val
quizIvRedbox0
=
view
.
findViewById
<
ImageView
>(
R
.
id
.
quiz_iv_redbox0
)
val
quizIvRedbox1
=
view
.
findViewById
<
ImageView
>(
R
.
id
.
quiz_iv_redbox1
)
val
quizIvOption0
=
view
.
findViewById
<
ImageView
>(
R
.
id
.
quiz_iv_option0
)
...
...
@@ -166,9 +180,9 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
val
quizIv
=
view
.
findViewById
<
ImageView
>(
R
.
id
.
quiz_iv
)
val
option0
=
view
.
findViewById
<
TextView
>(
R
.
id
.
quiz_option0
)
val
option1
=
view
.
findViewById
<
TextView
>(
R
.
id
.
quiz_option1
)
val
optionsList
:
MutableList
<
TextView
>
=
ArrayList
()
optionsList
.
add
(
o
ption0
)
optionsList
.
add
(
o
ption1
)
val
optionsList
:
MutableList
<
RelativeLayout
>
=
ArrayList
()
optionsList
.
add
(
rlO
ption0
)
optionsList
.
add
(
rlO
ption1
)
quizIvOption0
.
visibility
=
View
.
GONE
quizIvOption1
.
visibility
=
View
.
GONE
quizIvRedbox0
.
visibility
=
View
.
GONE
...
...
@@ -178,14 +192,20 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
finger
.
visibility
=
View
.
GONE
mainHandler
.
postDelayed
({
// 点击过后不展示
if
(!
rlOption0
.
isClickable
)
return
@postDelayed
val
ls
=
finger
.
layoutParams
as
RelativeLayout
.
LayoutParams
val
ls2
=
quizLLPop
.
layoutParams
as
RelativeLayout
.
LayoutParams
if
(
answer
==
0
)
{
ls
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
fl_option0
)
ls
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
rl_option0
)
ls2
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
rl_option0
)
}
else
{
ls
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
fl_option1
)
ls
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
rl_option1
)
ls2
.
addRule
(
RelativeLayout
.
ALIGN_TOP
,
R
.
id
.
rl_option1
)
}
playFingerAnim
(
finger
)
},
3
000
)
},
5
000
)
for
(
i
in
optionsList
.
indices
)
{
val
right
=
answer
==
i
...
...
@@ -208,10 +228,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
background2
=
R
.
drawable
.
icon_quiz_error
}
val
button
=
optionsList
[
i
]
button
.
text
=
options
[
i
]
button
.
setBackgroundResource
(
R
.
drawable
.
icon_quiz_button_bg
)
if
(
i
==
0
)
{
option0
.
text
=
options
[
i
]
}
else
{
option1
.
text
=
options
[
i
]
}
button
.
setOnClickListener
{
quizIvRedbox0
.
visibility
=
View
.
GONE
quizIvRedbox1
.
visibility
=
View
.
GONE
finger
.
visibility
=
View
.
GONE
rlOption0
.
isClickable
=
false
rlOption1
.
isClickable
=
false
if
(
lastAnswer
!=
-
1
)
return
@setOnClickListener
...
...
@@ -221,9 +248,6 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
else
{
quizIv
.
setBackgroundResource
(
R
.
drawable
.
icon_quiz_error_toast_bg
)
}
for
(
btn
in
optionsList
)
{
btn
.
setBackgroundResource
(
R
.
drawable
.
icon_quiz_button_bg
)
}
if
(
i
==
0
)
{
// 答案1
quizIvOption0
.
visibility
=
View
.
VISIBLE
...
...
@@ -234,6 +258,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
quizIvOption1
.
setBackgroundResource
(
background2
)
}
button
.
setBackgroundResource
(
background
)
quizHandler
.
reportResult
(
i
)
mMusicBean
?.
let
{
...
...
@@ -256,6 +281,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
if
(
lastAnswer
==
i
)
{
rlOption0
.
isClickable
=
false
rlOption1
.
isClickable
=
false
if
(
lastAnswer
==
0
)
{
quizIvOption0
.
visibility
=
View
.
VISIBLE
quizIvOption0
.
setBackgroundResource
(
background2
)
...
...
@@ -407,11 +434,92 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
)
}
//计算path路径中点的坐标
private
var
mPathMeasure
:
PathMeasure
?
=
null
override
fun
rdSongMsgSuc
(
data
:
MusicBean
)
{
if
(!
mIsFirstInit
)
{
firstDrawWidget
()
}
mMusicBean
=
data
mMusicBean
?.
let
{
if
(
it
.
openCash
)
{
rl_open_cash
.
visibility
=
View
.
VISIBLE
tv_open_cash_progress
.
text
=
String
.
format
(
"%2d/%2d"
,
it
.
completeCount
,
it
.
turnNeedCount
)
pb_open_cash
.
max
=
it
.
turnNeedCount
pb_open_cash
.
progress
=
it
.
completeCount
if
(
it
.
completeCount
>=
it
.
turnNeedCount
)
{
tv_open_cash_info
.
visibility
=
View
.
GONE
}
else
{
tv_open_cash_info
.
visibility
=
View
.
VISIBLE
tv_open_cash_info
.
text
=
SpanUtils
()
.
append
(
"再答"
)
.
append
(
""
+
(
it
.
turnNeedCount
-
it
.
completeCount
))
.
setForegroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
red
))
.
append
(
"题立即提现"
)
.
create
()
}
}
else
{
rl_open_cash
.
visibility
=
View
.
GONE
}
}
}
override
fun
rdSongMsgFail
()
{
rl_open_cash
.
visibility
=
View
.
GONE
if
(!
mIsFirstInit
)
{
firstDrawWidget
()
}
}
private
fun
showRewardAnim
(
cashReward
:
Int
,
goldReward
:
Int
)
{
if
(
cashReward
<=
0
&&
goldReward
<=
0
)
return
cl_reward
.
visibility
=
View
.
VISIBLE
iv_cash_reward
.
visibility
=
View
.
VISIBLE
tv_cash_reward
.
visibility
=
View
.
VISIBLE
iv_gold_reward
.
visibility
=
View
.
VISIBLE
tv_gold_reward
.
visibility
=
View
.
VISIBLE
if
(
cashReward
<=
0
)
{
iv_cash_reward
.
visibility
=
View
.
GONE
tv_cash_reward
.
visibility
=
View
.
GONE
}
else
{
tv_cash_reward
.
text
=
"+$cashReward"
mainHandler
.
postDelayed
({
addAnimation
(
iv_cash_reward
,
iv_cash
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_cash_reward
,
iv_cash
)
},
200
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_cash_reward
,
iv_cash
)
},
400
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_cash_reward
,
iv_cash
)
},
800
)
},
100
)
}
if
(
goldReward
<=
0
)
{
iv_gold_reward
.
visibility
=
View
.
GONE
tv_gold_reward
.
visibility
=
View
.
GONE
}
else
{
tv_gold_reward
.
text
=
"+$goldReward"
mainHandler
.
postDelayed
({
addAnimation
(
iv_gold_reward
,
iv_gold
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_gold_reward
,
iv_gold
)
},
200
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_gold_reward
,
iv_gold
)
},
400
)
mainHandler
.
postDelayed
({
addAnimation
(
iv_gold_reward
,
iv_gold
)
},
800
)
},
100
)
}
mainHandler
.
postDelayed
({
cl_reward
.
visibility
=
View
.
GONE
},
1500
)
}
override
fun
reportAddCoinMsgSuc
()
{
...
...
@@ -439,25 +547,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
musicPresenter
.
reportAddCoinMsg
(
carrierType
)
musicPresenter
.
reportAddCoinMsg
(
carrierType
,
AppConfig
.
gromoreId
)
}
})
}
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
musicPresenter
.
reportAddCoinMsg
(
carrierType
)
musicPresenter
.
reportAddCoinMsg
(
carrierType
,
AppConfig
.
gromoreId
)
}
})
}
private
fun
showAddReward
()
{
}
private
var
mTimer
:
CountDownTimerSupport
?
=
null
private
var
rope
:
YoYoString
?
=
null
private
fun
showAdPop
(
quizLLPop
:
LinearLayout
,
quizTvPop
:
TextView
,
...
...
@@ -517,23 +617,34 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
view
.
setImageDrawable
(
lottieDrawable
)
}
/**
* 贝塞尔曲线中间过程的点的坐标
*/
private
val
mCurrentPosition
=
FloatArray
(
2
)
/**
* 动画
*/
private
fun
addAnimation
(
view
:
View
,
targetView
:
View
)
{
private
fun
addAnimation
(
view
:
ImageView
,
targetView
:
View
)
{
/**
* 贝塞尔曲线中间过程的点的坐标
*/
val
mCurrentPosition
=
FloatArray
(
2
)
// 一、创造出执行动画的主题---imageview
//代码new一个imageview,图片资源是上面的imageview的图片
// (这个图片就是执行动画的图片,从开始位置出发,经过一个抛物线(贝塞尔曲线),移动到购物车里)
val
goods
=
ImageView
(
mContext
)
goods
.
setImageDrawable
(
ContextCompat
.
getDrawable
(
mContext
,
R
.
mipmap
.
ic_launcher_main
)
)
val
params
=
RelativeLayout
.
LayoutParams
(
BubbleUtils
.
dp2px
(
30
),
BubbleUtils
.
dp2px
(
30
)
)
val
goods
=
ImageView
(
requireContext
()
)
goods
.
setImageDrawable
(
view
.
drawable
)
val
params
=
RelativeLayout
.
LayoutParams
(
view
.
width
,
view
.
height
)
rl
.
addView
(
goods
,
params
)
val
offsetWidth
=
if
(
view
.
width
>=
targetView
.
width
)
{
view
.
width
-
targetView
.
width
}
else
{
targetView
.
width
-
view
.
width
}
// val offsetHeight = if (view.height >= targetView.height) {
// view.height - targetView.height
// } else {
// targetView.height - view.height
// }
// 二、计算动画开始/结束点的坐标的准备工作
//得到父布局的起始点坐标(用于辅助计算动画开始/结束时的点的坐标)
val
parentLocation
=
IntArray
(
2
)
...
...
@@ -570,10 +681,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
path
.
quadTo
((
startX
+
toX
)
/
2
,
startY
,
toX
,
toY
)
//mPathMeasure用来计算贝塞尔曲线的曲线长度和贝塞尔曲线中间插值的坐标,
// 如果是true,path会形成一个闭环,Path用来计算path路径中的点的坐标
mPathMeasure
=
PathMeasure
(
path
,
false
)
//计算path路径中点的坐标
val
mPathMeasure
=
PathMeasure
(
path
,
false
)
//★★★属性动画实现(从0到贝塞尔曲线的长度之间进行插值计算,获取中间过程的距离值)
val
valueAnimator
=
ValueAnimator
.
ofFloat
(
0f
,
mPathMeasure
!!
.
length
)
val
valueAnimator
=
ValueAnimator
.
ofFloat
(
0f
,
mPathMeasure
.
length
)
valueAnimator
.
duration
=
500
// 匀速线性插值器
valueAnimator
.
interpolator
=
LinearInterpolator
()
...
...
@@ -584,14 +696,26 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
// boolean getPosTan(float distance, float[] pos, float[] tan) :
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距
// 离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
mPathMeasure
!!
.
getPosTan
(
value
,
mCurrentPosition
,
null
)
//mCurrentPosition此时就是中间距离点的坐标值
mPathMeasure
.
getPosTan
(
value
,
mCurrentPosition
,
null
)
//mCurrentPosition此时就是中间距离点的坐标值
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
goods
.
translationX
=
mCurrentPosition
[
0
]
goods
.
translationY
=
mCurrentPosition
[
1
]
val
transWidth
=
if
(
view
.
width
>
targetView
.
width
)
{
(
targetView
.
width
+
(
offsetWidth
*
((
mPathMeasure
.
length
-
value
)
/
mPathMeasure
.
length
))).
toInt
()
}
else
{
(
targetView
.
width
-
(
offsetWidth
*
((
mPathMeasure
.
length
-
value
)
/
mPathMeasure
.
length
))).
toInt
()
}
// val transHeight = if (view.height > targetView.height) {
// (targetView.height + (offsetHeight * ((mPathMeasure.length - value) / mPathMeasure.length))).toInt()
// } else {
// (targetView.height - (offsetHeight * ((mPathMeasure.length - value) / mPathMeasure.length))).toInt()
// }
val
ls
=
goods
.
layoutParams
ls
.
width
=
transWidth
ls
.
height
=
transWidth
goods
.
layoutParams
=
ls
}
// 五、 开始执行动画
valueAnimator
.
start
()
...
...
video/app/src/main/res/layout/fragment_music.xml
View file @
6144cdc1
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/rl"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
@@ -11,4 +12,128 @@
<include
layout=
"@layout/layout_draw_header"
/>
<RelativeLayout
android:id=
"@+id/rl_open_cash"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"160dp"
android:layout_marginEnd=
"20dp"
>
<ImageView
android:id=
"@+id/iv_open_cash"
android:layout_width=
"100dp"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:src=
"@mipmap/pic_dttx"
/>
<ProgressBar
android:id=
"@+id/pb_open_cash"
style=
"@android:style/Widget.ProgressBar.Horizontal"
android:layout_width=
"52dp"
android:layout_height=
"14dp"
android:layout_alignBottom=
"@id/iv_open_cash"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"22dp"
android:progressDrawable=
"@drawable/progressbar_versus_changevedio_bg"
/>
<TextView
android:id=
"@+id/tv_open_cash_progress"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignBottom=
"@id/iv_open_cash"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"21dp"
android:text=
"3/5"
android:textColor=
"@color/red"
android:textSize=
"12sp"
/>
<TextView
android:id=
"@+id/tv_open_cash_info"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/iv_open_cash"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/shape_bg_write"
android:paddingStart=
"6dp"
android:paddingTop=
"2dp"
android:paddingEnd=
"6dp"
android:paddingBottom=
"2dp"
android:text=
"@string/app_name"
android:textSize=
"12sp"
/>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_reward"
android:layout_width=
"match_parent"
android:layout_height=
"260dp"
android:layout_centerInParent=
"true"
android:layout_marginStart=
"40dp"
android:layout_marginEnd=
"40dp"
android:background=
"@drawable/shape_half_trans"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_reward"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:drawablePadding=
"15dp"
android:text=
"恭喜获得"
android:textColor=
"@color/white"
android:textSize=
"22sp"
app:drawableEndCompat=
"@mipmap/vs_icon_anim_star"
app:drawableStartCompat=
"@mipmap/vs_icon_anim_star"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_cash_reward"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_marginTop=
"40dp"
android:layout_marginEnd=
"20dp"
android:src=
"@mipmap/ic_redpkg"
app:layout_constraintEnd_toStartOf=
"@id/iv_gold_reward"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_reward"
/>
<ImageView
android:id=
"@+id/iv_gold_reward"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"40dp"
android:src=
"@mipmap/ic_yuanbao"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_cash_reward"
app:layout_constraintTop_toBottomOf=
"@id/tv_reward"
/>
<TextView
android:id=
"@+id/tv_cash_reward"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"+5"
android:textColor=
"@color/red"
android:textSize=
"30sp"
app:layout_constraintEnd_toEndOf=
"@id/iv_cash_reward"
app:layout_constraintStart_toStartOf=
"@id/iv_cash_reward"
app:layout_constraintTop_toBottomOf=
"@id/iv_cash_reward"
/>
<TextView
android:id=
"@+id/tv_gold_reward"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"20dp"
android:text=
"+5"
android:textColor=
"@color/red"
android:textSize=
"30sp"
app:layout_constraintEnd_toEndOf=
"@id/iv_gold_reward"
app:layout_constraintStart_toStartOf=
"@id/iv_gold_reward"
app:layout_constraintTop_toBottomOf=
"@id/iv_gold_reward"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
\ No newline at end of file
video/app/src/main/res/layout/media_layout_quiz.xml
View file @
6144cdc1
...
...
@@ -10,39 +10,40 @@
android:id=
"@+id/quiz_iv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
/>
android:layout_centerInParent=
"true"
android:layout_marginBottom=
"10dp"
/>
<TextView
android:id=
"@+id/quiz_tv_qus"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_above=
"@id/
f
l_option0"
android:layout_above=
"@id/
r
l_option0"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"48dp"
android:layout_marginEnd=
"48dp"
android:layout_marginBottom=
"
8
0dp"
android:layout_marginBottom=
"
7
0dp"
android:background=
"@drawable/shape_mild_trans"
android:gravity=
"center"
android:padding=
"@dimen/dp_10"
android:text=
"背景音乐是什么歌 _ _ _ _ ?"
android:textColor=
"@color/white"
/>
<
Fram
eLayout
android:id=
"@+id/
f
l_option0"
<
Relativ
eLayout
android:id=
"@+id/
r
l_option0"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_above=
"@id/
f
l_option1"
android:layout_above=
"@id/
r
l_option1"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"48dp"
android:layout_marginEnd=
"48dp"
android:layout_marginBottom=
"20dp"
>
android:layout_marginBottom=
"20dp"
android:background=
"@drawable/icon_quiz_button_bg"
>
<TextView
android:id=
"@+id/quiz_option0"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/icon_quiz_button_bg"
android:gravity=
"center"
android:layout_centerInParent=
"true"
android:paddingBottom=
"5dp"
android:textColor=
"@color/main_mints"
android:textStyle=
"bold"
...
...
@@ -52,8 +53,8 @@
android:id=
"@+id/quiz_iv_redbox0"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_
gravity=
"center_vertical
"
android:layout_
marginStart=
"50dp
"
android:layout_
centerVertical=
"true
"
android:layout_
toStartOf=
"@id/quiz_option0
"
android:paddingBottom=
"5dp"
android:src=
"@mipmap/ic_redpkg"
android:visibility=
"gone"
/>
...
...
@@ -62,29 +63,30 @@
android:id=
"@+id/quiz_iv_option0"
android:layout_width=
"26dp"
android:layout_height=
"26dp"
android:layout_gravity=
"end|center_vertical"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"20dp"
android:paddingBottom=
"5dp"
android:visibility=
"gone"
/>
</
Fram
eLayout>
</
Relativ
eLayout>
<
Fram
eLayout
android:id=
"@+id/
f
l_option1"
<
Relativ
eLayout
android:id=
"@+id/
r
l_option1"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginStart=
"48dp"
android:layout_marginEnd=
"48dp"
android:layout_marginBottom=
"50dp"
>
android:layout_marginBottom=
"50dp"
android:background=
"@drawable/icon_quiz_button_bg"
>
<TextView
android:id=
"@+id/quiz_option1"
android:layout_width=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/icon_quiz_button_bg"
android:gravity=
"center"
android:layout_centerInParent=
"true"
android:paddingBottom=
"5dp"
android:textColor=
"@color/main_mints"
android:textStyle=
"bold"
...
...
@@ -94,8 +96,8 @@
android:id=
"@+id/quiz_iv_redbox1"
android:layout_width=
"40dp"
android:layout_height=
"40dp"
android:layout_
gravity=
"center_vertical
"
android:layout_
marginStart=
"50dp
"
android:layout_
centerVertical=
"true
"
android:layout_
toStartOf=
"@id/quiz_option1
"
android:paddingBottom=
"5dp"
android:src=
"@mipmap/ic_redpkg"
android:visibility=
"gone"
/>
...
...
@@ -104,12 +106,13 @@
android:id=
"@+id/quiz_iv_option1"
android:layout_width=
"26dp"
android:layout_height=
"26dp"
android:layout_gravity=
"end|center_vertical"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:layout_marginEnd=
"20dp"
android:paddingBottom=
"5dp"
android:visibility=
"gone"
/>
</
Fram
eLayout>
</
Relativ
eLayout>
<TextView
android:id=
"@+id/quiz_tv_pop"
...
...
@@ -136,7 +139,7 @@
android:id=
"@+id/quiz_ll_pop"
android:layout_width=
"128dp"
android:layout_height=
"wrap_content"
android:layout_alignTop=
"@id/
f
l_option0"
android:layout_alignTop=
"@id/
r
l_option0"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"-30dp"
android:layout_marginEnd=
"30dp"
...
...
@@ -171,7 +174,7 @@
android:id=
"@+id/finger_view"
android:layout_width=
"60dp"
android:layout_height=
"60dp"
android:layout_alignTop=
"@id/
f
l_option1"
android:layout_alignTop=
"@id/
r
l_option1"
android:layout_alignParentEnd=
"true"
android:layout_marginTop=
"26dp"
android:layout_marginEnd=
"48dp"
/>
...
...
video/app/src/main/res/mipmap-xhdpi/pic_dttx.png
0 → 100755
View file @
6144cdc1
32.2 KB
video/app/src/main/res/mipmap-xhdpi/vs_icon_anim_star.png
0 → 100755
View file @
6144cdc1
295 Bytes
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