[8.0.0]
[fea] [music]
@@ -7,12 +7,9 @@ import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.och.common.module.manager.audition.AuditionManager
|
||||
import com.mogo.och.common.module.manager.audition.MusicData
|
||||
import com.mogo.och.unmanned.passenger.ui.music.list.MusicListView
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_music.view.iv_toggle_list_playing
|
||||
import kotlinx.android.synthetic.main.taxi_p_music.view.mlv_list
|
||||
import kotlinx.android.synthetic.main.taxi_p_music.view.mpv_playing
|
||||
|
||||
@@ -39,27 +36,11 @@ class MusicView : ConstraintLayout, MusicViewModel.IMusicViewCallback, MusicList
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_music, this, true)
|
||||
setBackgroundResource(R.drawable.taxt_p_music_bg)
|
||||
|
||||
setListener()
|
||||
}
|
||||
|
||||
private fun setListener() {
|
||||
iv_toggle_list_playing.setOnClickListener {
|
||||
if (mpv_playing.visibility == VISIBLE && mlv_list.visibility == GONE) {
|
||||
showMusicList()
|
||||
} else if (mpv_playing.visibility == GONE && mlv_list.visibility == VISIBLE) {
|
||||
if (!AuditionManager.isPlaying()) {
|
||||
CallerLogger.i(TAG, "当前无播放音乐,不能切到MusicPlayingView")
|
||||
return@setOnClickListener
|
||||
}
|
||||
showMusicPlaying()
|
||||
mpv_playing.setData(null)
|
||||
}else{
|
||||
showMusicPlaying()
|
||||
mpv_playing.setData(null)
|
||||
}
|
||||
}
|
||||
mlv_list.setCheckItemListener(this)
|
||||
}
|
||||
|
||||
@@ -82,21 +63,9 @@ class MusicView : ConstraintLayout, MusicViewModel.IMusicViewCallback, MusicList
|
||||
}
|
||||
}
|
||||
|
||||
private fun showMusicList(){
|
||||
mpv_playing.visibility = GONE
|
||||
mlv_list.visibility = View.VISIBLE
|
||||
iv_toggle_list_playing.setImageResource(R.drawable.taxt_p_go2_playing)
|
||||
}
|
||||
private fun showMusicPlaying(){
|
||||
mpv_playing.visibility = VISIBLE
|
||||
mlv_list.visibility = GONE
|
||||
iv_toggle_list_playing.setImageResource(R.drawable.taxt_p_go2_list)
|
||||
}
|
||||
|
||||
override fun checkItem(musicData: MusicData) {
|
||||
mpv_playing.setDatafromCheck(musicData)
|
||||
// 详情页显示歌曲
|
||||
showMusicPlaying()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class MusicListItemAdapter(
|
||||
it.orientation = GradientDrawable.Orientation.LEFT_RIGHT
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
it.setColors(intArrayOf(firstColor, setondColor, thirdColor, fourceColor,fifthColor),
|
||||
floatArrayOf(0.0f,0.3f,0.6f,0.9f,1f)
|
||||
floatArrayOf(0.0f,0.1f,0.3f,0.6f,1f)
|
||||
)
|
||||
}else{
|
||||
it.colors = intArrayOf(firstColor, setondColor, thirdColor, fourceColor)
|
||||
|
||||
@@ -50,7 +50,7 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
|
||||
|
||||
private var isSeekBarTouch = false
|
||||
|
||||
private val centerWidth = AutoSizeUtils.dp2px(context,146f)
|
||||
// private val centerWidth = AutoSizeUtils.dp2px(context,146f)
|
||||
|
||||
private fun initView() {
|
||||
LayoutInflater.from(context).inflate(R.layout.taxi_p_music_playing, this, true)
|
||||
@@ -130,14 +130,14 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
|
||||
sb_musuc_progess.progress=0.toInt()
|
||||
}
|
||||
|
||||
Glide.with(context)
|
||||
.load(musicData.coverHeadImageUrl)
|
||||
.apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_head))
|
||||
.into(iv_music_cover)
|
||||
Glide.with(context)
|
||||
.load(musicData.coverBottomImageUrl)
|
||||
.apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_bottom))
|
||||
.into(iv_music_cover_bg)
|
||||
// Glide.with(context)
|
||||
// .load(musicData.coverHeadImageUrl)
|
||||
// .apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_head))
|
||||
// .into(iv_music_cover)
|
||||
// Glide.with(context)
|
||||
// .load(musicData.coverBottomImageUrl)
|
||||
// .apply(RequestOptions().placeholder(R.drawable.taxt_p_music_bg_relax_bottom))
|
||||
// .into(iv_music_cover_bg)
|
||||
}
|
||||
|
||||
private fun startAnimal(){
|
||||
@@ -146,8 +146,8 @@ class MusicPlayingView : ConstraintLayout, MusicPlayingViewModel.IMusicPlayingVi
|
||||
animator = null
|
||||
}
|
||||
animator = ObjectAnimator.ofFloat(iv_music_cover, "rotation", 0f, 360f)
|
||||
iv_music_cover.pivotX = (centerWidth).toFloat()
|
||||
iv_music_cover.pivotY = (centerWidth).toFloat()
|
||||
// iv_music_cover.pivotX = (centerWidth).toFloat()
|
||||
// iv_music_cover.pivotY = (centerWidth).toFloat()
|
||||
animator?.duration = 3000
|
||||
animator?.repeatCount = -1
|
||||
animator?.repeatMode = ValueAnimator.RESTART
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 674 B |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 625 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 125 KiB |
@@ -2,40 +2,27 @@
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_746"
|
||||
android:layout_height="@dimen/dp_916"
|
||||
android:background="@drawable/taxt_p_music_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.music.playing.MusicPlayingView
|
||||
android:id="@+id/mpv_playing"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="@dimen/dp_746"
|
||||
android:layout_height="@dimen/dp_916"/>
|
||||
android:layout_marginStart="@dimen/dp_193"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<com.mogo.och.unmanned.passenger.ui.music.list.MusicListView
|
||||
android:id="@+id/mlv_list"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="visible"
|
||||
android:layout_width="@dimen/dp_630"
|
||||
android:layout_height="@dimen/dp_800"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_toggle_list_playing"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:src="@drawable/taxt_p_go2_playing"
|
||||
android:layout_marginTop="@dimen/dp_87"
|
||||
android:layout_marginEnd="@dimen/dp_97"
|
||||
android:layout_width="@dimen/dp_78"
|
||||
android:layout_height="@dimen/dp_78"/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/mpv_playing"
|
||||
android:layout_marginStart="-146dp"
|
||||
android:layout_width="1197dp"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
</merge>
|
||||
@@ -2,22 +2,10 @@
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_630"
|
||||
android:layout_width="1197dp"
|
||||
android:layout_height="@dimen/dp_800"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_music_title"
|
||||
android:text="音乐列表"
|
||||
android:textColor="@color/taxi_cp_253A5A"
|
||||
android:textSize="@dimen/dp_32"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_55"
|
||||
android:layout_marginTop="@dimen/dp_62"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_music_list"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_music_title"
|
||||
@@ -25,12 +13,8 @@
|
||||
android:layout_marginTop="@dimen/dp_26"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<View
|
||||
android:background="@drawable/taxi_p_music_list_bottom"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_91"/>
|
||||
android:layout_marginBottom="@dimen/dp_200"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</merge>
|
||||
@@ -12,7 +12,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="@color/taxi_cp_303C52"
|
||||
android:layout_marginStart="@dimen/dp_55"
|
||||
android:layout_marginStart="@dimen/dp_187"
|
||||
android:text="音乐名称"
|
||||
android:textSize="@dimen/dp_32"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -22,16 +22,18 @@
|
||||
android:id="@+id/iv_music_playing"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_song_name"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_song_name"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_song_name"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_song_name"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:src="@drawable/taxi_p_music_list_playing"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tag"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_song_name"
|
||||
android:layout_marginStart="@dimen/dp_48"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="@color/taxi_cp_425877"
|
||||
|
||||
@@ -2,36 +2,50 @@
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="@dimen/dp_746"
|
||||
android:layout_height="@dimen/dp_916"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@drawable/taxt_p_music_bg_relax_bottom"
|
||||
android:layout_width="@dimen/dp_746"
|
||||
android:layout_height="@dimen/dp_916"/>
|
||||
android:src="@drawable/taxi_p_music_bg"
|
||||
android:layout_width="@dimen/dp_734"
|
||||
android:layout_height="@dimen/dp_734"/>
|
||||
|
||||
<ImageView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_108"
|
||||
android:src="@drawable/taxt_p_music_bg_middle"
|
||||
android:layout_width="@dimen/dp_390"
|
||||
android:layout_height="@dimen/dp_390"/>
|
||||
android:layout_width="@dimen/dp_734"
|
||||
android:layout_height="@dimen/dp_734"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music_cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_127"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_music_cover_bg"
|
||||
android:src="@drawable/taxt_p_music_bg_relax_head"
|
||||
android:layout_width="@dimen/dp_292"
|
||||
android:layout_height="@dimen/dp_292"/>
|
||||
android:layout_width="@dimen/dp_352"
|
||||
android:layout_height="@dimen/dp_352"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_music_cover_head"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_music_cover_bg"
|
||||
android:src="@drawable/taxt_p_music_bg_relax_head_top"
|
||||
android:layout_width="@dimen/dp_59"
|
||||
android:layout_height="@dimen/dp_59"/>
|
||||
|
||||
<ImageView
|
||||
android:src="@drawable/taxi_p_music_playing_pointer"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_music_cover"
|
||||
android:layout_width="@dimen/dp_501"
|
||||
android:layout_height="@dimen/dp_779"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_music_name"
|
||||
@@ -40,6 +54,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_52"
|
||||
android:textSize="@dimen/dp_38"
|
||||
android:visibility="gone"
|
||||
tools:text="Current"
|
||||
android:textColor="@color/taxi_cp_303C52"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -47,6 +62,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_tag"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_music_name"
|
||||
@@ -60,15 +76,45 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_toggle"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_music_cover_bg"
|
||||
android:layout_marginTop="@dimen/dp_66"
|
||||
android:src="@drawable/taxi_p_music_play"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_91"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_show_pre"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_toggle"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_toggle"
|
||||
android:src="@drawable/taxi_p_music_pre"
|
||||
android:layout_marginEnd="@dimen/dp_61"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_91"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_show_next"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_toggle"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_toggle"
|
||||
android:src="@drawable/taxi_p_music_next"
|
||||
android:layout_marginStart="@dimen/dp_61"
|
||||
android:layout_width="@dimen/dp_90"
|
||||
android:layout_height="@dimen/dp_91"/>
|
||||
|
||||
|
||||
<SeekBar
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:id="@+id/sb_musuc_progess"
|
||||
android:thumb="@drawable/taxi_p_music_seekbar_thumb"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_tag"
|
||||
android:layout_marginTop="@dimen/dp_41"
|
||||
app:layout_constraintStart_toStartOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_music_cover_bg"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_toggle"
|
||||
android:layout_marginTop="@dimen/dp_53"
|
||||
android:duplicateParentState="true"
|
||||
android:progressDrawable="@drawable/taxt_p_music_seekbar_style"
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
@@ -78,7 +124,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_playing_time"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintTop_toTopOf="@+id/sb_musuc_progess"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sb_musuc_progess"
|
||||
@@ -87,12 +133,12 @@
|
||||
android:layout_marginEnd="@dimen/dp_13"
|
||||
android:gravity="end"
|
||||
tools:text="02:34"
|
||||
android:layout_width="90dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_playing_during"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textSize="@dimen/dp_36"
|
||||
android:includeFontPadding="false"
|
||||
app:layout_constraintTop_toTopOf="@+id/sb_musuc_progess"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/sb_musuc_progess"
|
||||
@@ -103,35 +149,4 @@
|
||||
tools:text="05:56"
|
||||
android:layout_width="@dimen/dp_100"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_toggle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_99"
|
||||
android:src="@drawable/taxi_p_music_play"
|
||||
android:layout_width="@dimen/dp_146"
|
||||
android:layout_height="@dimen/dp_146"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_show_pre"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_toggle"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_toggle"
|
||||
android:src="@drawable/taxi_p_music_pre"
|
||||
android:layout_marginEnd="@dimen/dp_61"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_show_next"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_toggle"
|
||||
android:layout_marginTop="@dimen/dp_35"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_toggle"
|
||||
android:src="@drawable/taxi_p_music_next"
|
||||
android:layout_marginStart="@dimen/dp_61"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"/>
|
||||
</merge>
|
||||