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