parent
e38778d9e7
commit
6640130ef9
|
@ -113,6 +113,17 @@
|
||||||
<option name="screenX" value="1440" />
|
<option name="screenX" value="1440" />
|
||||||
<option name="screenY" value="3088" />
|
<option name="screenY" value="3088" />
|
||||||
</PersistentDeviceSelectionData>
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="samsung" />
|
||||||
|
<option name="codename" value="e1q" />
|
||||||
|
<option name="id" value="e1q" />
|
||||||
|
<option name="manufacturer" value="Samsung" />
|
||||||
|
<option name="name" value="Galaxy S24" />
|
||||||
|
<option name="screenDensity" value="480" />
|
||||||
|
<option name="screenX" value="1080" />
|
||||||
|
<option name="screenY" value="2340" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
<PersistentDeviceSelectionData>
|
<PersistentDeviceSelectionData>
|
||||||
<option name="api" value="33" />
|
<option name="api" value="33" />
|
||||||
<option name="brand" value="google" />
|
<option name="brand" value="google" />
|
||||||
|
@ -124,6 +135,17 @@
|
||||||
<option name="screenX" value="2208" />
|
<option name="screenX" value="2208" />
|
||||||
<option name="screenY" value="1840" />
|
<option name="screenY" value="1840" />
|
||||||
</PersistentDeviceSelectionData>
|
</PersistentDeviceSelectionData>
|
||||||
|
<PersistentDeviceSelectionData>
|
||||||
|
<option name="api" value="34" />
|
||||||
|
<option name="brand" value="google" />
|
||||||
|
<option name="codename" value="felix" />
|
||||||
|
<option name="id" value="felix" />
|
||||||
|
<option name="manufacturer" value="Google" />
|
||||||
|
<option name="name" value="Pixel Fold" />
|
||||||
|
<option name="screenDensity" value="420" />
|
||||||
|
<option name="screenX" value="2208" />
|
||||||
|
<option name="screenY" value="1840" />
|
||||||
|
</PersistentDeviceSelectionData>
|
||||||
<PersistentDeviceSelectionData>
|
<PersistentDeviceSelectionData>
|
||||||
<option name="api" value="33" />
|
<option name="api" value="33" />
|
||||||
<option name="brand" value="google" />
|
<option name="brand" value="google" />
|
||||||
|
|
|
@ -8,12 +8,14 @@ class AudioContentCommentRepository(private val api: AudioContentApi) {
|
||||||
contentId: Long,
|
contentId: Long,
|
||||||
comment: String,
|
comment: String,
|
||||||
parentId: Long? = null,
|
parentId: Long? = null,
|
||||||
|
isSecret: Boolean = false,
|
||||||
token: String
|
token: String
|
||||||
) = api.registerComment(
|
) = api.registerComment(
|
||||||
request = RegisterAudioContentCommentRequest(
|
request = RegisterAudioContentCommentRequest(
|
||||||
comment = comment,
|
comment = comment,
|
||||||
contentId = contentId,
|
contentId = contentId,
|
||||||
parentId = parentId
|
parentId = parentId,
|
||||||
|
isSecret = isSecret
|
||||||
),
|
),
|
||||||
authHeader = token
|
authHeader = token
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package kr.co.vividnext.sodalive.audio_content.comment
|
package kr.co.vividnext.sodalive.audio_content.comment
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
|
||||||
|
|
||||||
import androidx.annotation.Keep
|
import androidx.annotation.Keep
|
||||||
|
import com.google.gson.annotations.SerializedName
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
data class RegisterAudioContentCommentRequest(
|
data class RegisterAudioContentCommentRequest(
|
||||||
@SerializedName("comment") val comment: String,
|
@SerializedName("comment") val comment: String,
|
||||||
@SerializedName("contentId") val contentId: Long,
|
@SerializedName("contentId") val contentId: Long,
|
||||||
@SerializedName("parentId") val parentId: Long?
|
@SerializedName("parentId") val parentId: Long?,
|
||||||
|
@SerializedName("isSecret") val isSecret: Boolean
|
||||||
)
|
)
|
||||||
|
|
|
@ -469,6 +469,7 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
binding.tvCommentText.text = response.commentList[0].comment
|
binding.tvCommentText.text = response.commentList[0].comment
|
||||||
binding.tvCommentText.visibility = View.VISIBLE
|
binding.tvCommentText.visibility = View.VISIBLE
|
||||||
binding.rlInputComment.visibility = View.GONE
|
binding.rlInputComment.visibility = View.GONE
|
||||||
|
binding.tvSecret.visibility = View.GONE
|
||||||
|
|
||||||
binding.llComment.setOnClickListener { showCommentBottomSheetDialog() }
|
binding.llComment.setOnClickListener { showCommentBottomSheetDialog() }
|
||||||
} else {
|
} else {
|
||||||
|
@ -482,8 +483,20 @@ class AudioContentDetailActivity : BaseActivity<ActivityAudioContentDetailBindin
|
||||||
|
|
||||||
binding.ivCommentSend.setOnClickListener {
|
binding.ivCommentSend.setOnClickListener {
|
||||||
val comment = binding.etComment.text.toString()
|
val comment = binding.etComment.text.toString()
|
||||||
|
val isSecret = binding.tvSecret.isSelected
|
||||||
|
viewModel.registerComment(audioContentId, comment, isSecret)
|
||||||
|
|
||||||
binding.etComment.setText("")
|
binding.etComment.setText("")
|
||||||
viewModel.registerComment(audioContentId, comment)
|
binding.tvSecret.isSelected = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.existOrdered) {
|
||||||
|
binding.tvSecret.visibility = View.VISIBLE
|
||||||
|
binding.tvSecret.setOnClickListener {
|
||||||
|
binding.tvSecret.isSelected = !binding.tvSecret.isSelected
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
binding.tvSecret.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.llComment.setOnClickListener {}
|
binding.llComment.setOnClickListener {}
|
||||||
|
|
|
@ -254,7 +254,7 @@ class AudioContentDetailViewModel(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun registerComment(audioContentId: Long, comment: String) {
|
fun registerComment(audioContentId: Long, comment: String, isSecret: Boolean) {
|
||||||
if (!isLoading.value!!) {
|
if (!isLoading.value!!) {
|
||||||
isLoading.value = true
|
isLoading.value = true
|
||||||
}
|
}
|
||||||
|
@ -263,6 +263,7 @@ class AudioContentDetailViewModel(
|
||||||
commentRepository.registerComment(
|
commentRepository.registerComment(
|
||||||
contentId = audioContentId,
|
contentId = audioContentId,
|
||||||
comment = comment,
|
comment = comment,
|
||||||
|
isSecret = isSecret,
|
||||||
token = "Bearer ${SharedPreferenceManager.token}"
|
token = "Bearer ${SharedPreferenceManager.token}"
|
||||||
)
|
)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
|
|
|
@ -604,29 +604,50 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="10.3dp">
|
android:padding="10.3dp">
|
||||||
|
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:orientation="horizontal">
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:text="댓글"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_comment_count"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="5.3dp"
|
||||||
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
|
android:textColor="@color/color_909090"
|
||||||
|
android:textSize="12sp"
|
||||||
|
tools:text="1,204" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_secret"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:button="@null"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
android:fontFamily="@font/gmarket_sans_medium"
|
||||||
android:text="댓글"
|
android:gravity="center"
|
||||||
android:textColor="@color/white"
|
android:text="비밀댓글"
|
||||||
android:textSize="12sp" />
|
android:textColor="@color/color_eeeeee"
|
||||||
|
android:textSize="12.5sp"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:drawableStartCompat="@drawable/ic_select" />
|
||||||
|
|
||||||
<TextView
|
</RelativeLayout>
|
||||||
android:id="@+id/tv_comment_count"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="5.3dp"
|
|
||||||
android:fontFamily="@font/gmarket_sans_medium"
|
|
||||||
android:textColor="@color/color_909090"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="1,204" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
Loading…
Reference in New Issue