parent
bddf7b750b
commit
62b15609ff
|
@ -26,6 +26,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.load
|
||||
import coil.transform.CircleCropTransformation
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.google.gson.Gson
|
||||
|
@ -417,6 +418,7 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
setupInfoArea(it)
|
||||
setupPurchaseButton(it)
|
||||
setupCommentArea(it)
|
||||
setupPreviousNextContentArea(it.previousContent, it.nextContent)
|
||||
setupCreatorOtherContentListArea(it.creatorOtherContentList)
|
||||
setupSameThemeOtherContentList(it.sameThemeOtherContentList)
|
||||
}
|
||||
|
@ -464,6 +466,78 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
|||
}
|
||||
}
|
||||
|
||||
private fun setupPreviousNextContentArea(
|
||||
previousContent: OtherContentResponse?,
|
||||
nextContent: OtherContentResponse?
|
||||
) {
|
||||
binding.llPreviousNextContent.visibility = if (
|
||||
previousContent != null ||
|
||||
nextContent != null
|
||||
) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
if (previousContent != null) {
|
||||
binding.llPreviousContent.visibility = View.VISIBLE
|
||||
binding.viewPreviousNone.visibility = View.GONE
|
||||
|
||||
binding.ivPreviousCover.load(previousContent.coverUrl) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.bg_placeholder)
|
||||
transformations(RoundedCornersTransformation(5.3f.dpToPx()))
|
||||
}
|
||||
|
||||
binding.tvPreviousTitle.text = previousContent.title
|
||||
|
||||
binding.llPreviousContent.setOnClickListener {
|
||||
startActivity(
|
||||
Intent(
|
||||
applicationContext,
|
||||
AudioContentDetailActivity::class.java
|
||||
).apply {
|
||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, previousContent.contentId)
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
binding.viewPreviousNone.visibility = View.VISIBLE
|
||||
binding.llPreviousContent.visibility = View.GONE
|
||||
}
|
||||
|
||||
if (nextContent != null) {
|
||||
binding.llNextContent.visibility = View.VISIBLE
|
||||
binding.viewNextNone.visibility = View.GONE
|
||||
|
||||
binding.ivNextCover.load(nextContent.coverUrl) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.bg_placeholder)
|
||||
transformations(RoundedCornersTransformation(5.3f.dpToPx()))
|
||||
}
|
||||
|
||||
binding.tvNextTitle.text = nextContent.title
|
||||
|
||||
binding.llNextContent.setOnClickListener {
|
||||
startActivity(
|
||||
Intent(
|
||||
applicationContext,
|
||||
AudioContentDetailActivity::class.java
|
||||
).apply {
|
||||
putExtra(Constants.EXTRA_AUDIO_CONTENT_ID, nextContent.contentId)
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
binding.viewNextNone.visibility = View.VISIBLE
|
||||
binding.llNextContent.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupCommentArea(response: GetAudioContentDetailResponse) {
|
||||
if (
|
||||
response.isCommentAvailable &&
|
||||
|
|
|
@ -39,7 +39,9 @@ data class GetAudioContentDetailResponse(
|
|||
@SerializedName("commentCount") val commentCount: Int,
|
||||
@SerializedName("isPin") val isPin: Boolean,
|
||||
@SerializedName("isAvailablePin") val isAvailablePin: Boolean,
|
||||
@SerializedName("creator") val creator: AudioContentCreator
|
||||
@SerializedName("creator") val creator: AudioContentCreator,
|
||||
@SerializedName("previousContent") val previousContent: OtherContentResponse?,
|
||||
@SerializedName("nextContent") val nextContent: OtherContentResponse?
|
||||
)
|
||||
|
||||
@Keep
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/color_222222" />
|
||||
<corners android:radius="5.3dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_555555" />
|
||||
</shape>
|
|
@ -199,6 +199,121 @@
|
|||
tools:src="@drawable/btn_player_repeat" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_previous_next_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="13.3dp"
|
||||
android:layout_marginTop="13.3dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_previous_none"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_previous_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_round_corner_5_3_222222_555555"
|
||||
android:padding="5.3dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_previous_cover"
|
||||
android:layout_width="33.3dp"
|
||||
android:layout_height="33.3dp"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5.3dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_previous_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/color_d2d2d2"
|
||||
android:textSize="11sp"
|
||||
tools:ignore="TooManyViews"
|
||||
tools:text="1화\n남편은 분명 성기사였다" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5.3dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="이전화"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textSize="13.3sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_next_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_round_corner_5_3_222222_555555"
|
||||
android:padding="5.3dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_next_cover"
|
||||
android:layout_width="33.3dp"
|
||||
android:layout_height="33.3dp"
|
||||
android:contentDescription="@null" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5.3dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_next_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/color_d2d2d2"
|
||||
android:textSize="11sp"
|
||||
tools:ignore="TooManyViews"
|
||||
tools:text="1화\n남편은 분명 성기사였다" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5.3dp"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:text="다음화"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textSize="13.3sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_next_none"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -478,9 +593,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:lineSpacingExtra="5dp"
|
||||
android:maxLines="2"
|
||||
android:textColor="@color/color_909090"
|
||||
android:textSize="14sp"
|
||||
tools:text="작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명 작품설명" />
|
||||
|
|
Loading…
Reference in New Issue