콘텐츠 상세 미리듣기 버튼 변경
This commit is contained in:
@@ -95,6 +95,8 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||
binding.scrollView.scrollTo(0, 0)
|
||||
binding.sbProgress.progress = 0
|
||||
binding.ivPlayOrPause.setImageResource(0)
|
||||
binding.ivPlayOrPause.visibility = View.GONE
|
||||
binding.llPreview.visibility = View.GONE
|
||||
binding.tvTotalDuration.text = getString(
|
||||
R.string.screen_audio_content_detail_time_total_default
|
||||
)
|
||||
@@ -765,6 +767,7 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||
binding.flSoldOut.visibility = View.GONE
|
||||
binding.tvSoldOutBig.visibility = View.GONE
|
||||
binding.ivPlayOrPause.visibility = View.GONE
|
||||
binding.llPreview.visibility = View.GONE
|
||||
binding.ivSeekBackward10.visibility = View.GONE
|
||||
binding.ivSeekForward10.visibility = View.GONE
|
||||
binding.llPreviewNo.visibility = View.GONE
|
||||
@@ -789,8 +792,13 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||
!isAlertPreview ||
|
||||
(response.isActivePreview && response.contentUrl.isNotBlank())
|
||||
) {
|
||||
if (isAlertPreview) {
|
||||
binding.llPreview.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.ivPlayOrPause.visibility = View.VISIBLE
|
||||
binding.ivPlayOrPause.setOnClickListener {
|
||||
}
|
||||
|
||||
val playClickAction = View.OnClickListener {
|
||||
startService(
|
||||
Intent(
|
||||
applicationContext,
|
||||
@@ -834,13 +842,9 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||
)
|
||||
}
|
||||
|
||||
binding.ivPlayOrPause.setImageResource(
|
||||
if (!isAlertPreview) {
|
||||
R.drawable.btn_audio_content_play
|
||||
} else {
|
||||
R.drawable.btn_audio_content_preview_play
|
||||
}
|
||||
)
|
||||
binding.ivPlayOrPause.setImageResource(R.drawable.btn_audio_content_play)
|
||||
binding.ivPlayOrPause.setOnClickListener(playClickAction)
|
||||
binding.llPreview.setOnClickListener(playClickAction)
|
||||
|
||||
if (!isAlertPreview) {
|
||||
binding.ivSeekForward10.visibility = View.VISIBLE
|
||||
@@ -1220,17 +1224,20 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||
if (this@AudioContentDetailActivity.audioContentId == contentId) {
|
||||
runOnUiThread {
|
||||
if (changeUi != null && changeUi) {
|
||||
binding.ivPlayOrPause.setImageResource(
|
||||
if (isPlaying != null && isPlaying) {
|
||||
R.drawable.btn_audio_content_pause
|
||||
binding.ivPlayOrPause.visibility = View.VISIBLE
|
||||
binding.llPreview.visibility = View.GONE
|
||||
binding.ivPlayOrPause.setImageResource(R.drawable.btn_audio_content_pause)
|
||||
} else {
|
||||
if (isAlertPreview) {
|
||||
R.drawable.btn_audio_content_preview_play
|
||||
binding.ivPlayOrPause.visibility = View.GONE
|
||||
binding.llPreview.visibility = View.VISIBLE
|
||||
} else {
|
||||
R.drawable.btn_audio_content_play
|
||||
binding.ivPlayOrPause.visibility = View.VISIBLE
|
||||
binding.llPreview.visibility = View.GONE
|
||||
binding.ivPlayOrPause.setImageResource(R.drawable.btn_audio_content_play)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.8 KiB |
@@ -115,27 +115,59 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_toStartOf="@+id/iv_play_or_pause"
|
||||
android:layout_toStartOf="@+id/fl_play_or_pause"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_player_prev_10"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_play_or_pause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play_or_pause"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@null"
|
||||
android:visibility="gone"
|
||||
tools:src="@drawable/btn_audio_content_play" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_round_corner_46_7_66000000"
|
||||
android:gravity="center"
|
||||
android:minWidth="212dp"
|
||||
android:paddingVertical="13.3dp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_noti_play" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/screen_audio_content_detail_preview_available"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16.7sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_seek_forward_10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_toEndOf="@+id/iv_play_or_pause"
|
||||
android:layout_toEndOf="@+id/fl_play_or_pause"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_player_next_10"
|
||||
android:visibility="gone" />
|
||||
|
||||
Reference in New Issue
Block a user