fix: reply text background color
This commit is contained in:
parent
b0b51c4347
commit
a3b1d3db57
11 changed files with 124 additions and 103 deletions
|
@ -13,6 +13,7 @@ import ani.dantotsu.BottomSheetDialogFragment
|
|||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.connections.anilist.api.ActivityReply
|
||||
import ani.dantotsu.databinding.BottomSheetRecyclerBinding
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.profile.activity.ActivityReplyItem
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.util.MarkdownCreatorActivity
|
||||
|
@ -40,12 +41,12 @@ class RepliesBottomDialog : BottomSheetDialogFragment() {
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
binding.repliesRecyclerView.adapter = adapter
|
||||
binding.repliesRecyclerView.layoutManager = LinearLayoutManager(
|
||||
requireContext(),
|
||||
context,
|
||||
LinearLayoutManager.VERTICAL,
|
||||
false
|
||||
)
|
||||
val context = requireContext()
|
||||
binding.replyButton.setOnClickListener {
|
||||
val context = requireContext()
|
||||
ContextCompat.startActivity(
|
||||
context,
|
||||
Intent(context, MarkdownCreatorActivity::class.java)
|
||||
|
@ -63,7 +64,17 @@ class RepliesBottomDialog : BottomSheetDialogFragment() {
|
|||
if (response != null) {
|
||||
replies.clear()
|
||||
replies.addAll(response.data.page.activityReplies)
|
||||
adapter.update(replies.map { ActivityReplyItem(it, requireActivity()) { _, _ -> } })
|
||||
adapter.update(
|
||||
replies.map {
|
||||
ActivityReplyItem(
|
||||
it,
|
||||
requireActivity(),
|
||||
clickCallback = { int, _ ->
|
||||
onClick(int)
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
snackString("Failed to load replies")
|
||||
}
|
||||
|
@ -72,6 +83,14 @@ class RepliesBottomDialog : BottomSheetDialogFragment() {
|
|||
|
||||
}
|
||||
|
||||
private fun onClick(int: Int) {
|
||||
ContextCompat.startActivity(
|
||||
requireContext(),
|
||||
Intent(requireContext(), ProfileActivity::class.java).putExtra("userId", int),
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
private fun loading(load: Boolean) {
|
||||
binding.repliesRefresh.isVisible = load
|
||||
binding.repliesRecyclerView.isVisible = !load
|
||||
|
|
|
@ -382,12 +382,13 @@ class Stories @JvmOverloads constructor(
|
|||
it.toString()
|
||||
}
|
||||
}
|
||||
} ${story.progress ?: story.media?.title?.userPreferred} " + if (story.status?.contains(
|
||||
"completed"
|
||||
) == false && !story.status.contains("plans") && !story.status.contains(
|
||||
"repeating"
|
||||
} ${story.progress ?: story.media?.title?.userPreferred} " +
|
||||
if (
|
||||
story.status?.contains("completed") == false &&
|
||||
!story.status.contains("plans") &&
|
||||
!story.status.contains("repeating")
|
||||
)
|
||||
) {
|
||||
{
|
||||
"of ${story.media?.title?.userPreferred}"
|
||||
} else {
|
||||
""
|
||||
|
@ -446,12 +447,7 @@ class Stories @JvmOverloads constructor(
|
|||
binding.activityRepliesContainer.setOnClickListener {
|
||||
RepliesBottomDialog.newInstance(story.id).show(activity.supportFragmentManager, "replies")
|
||||
}
|
||||
if (story.replyCount > 0) {
|
||||
binding.replyCount.text = story.replyCount.toString()
|
||||
binding.replyCount.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.replyCount.visibility = View.GONE
|
||||
}
|
||||
binding.replyCount.text = story.replyCount.toString()
|
||||
binding.activityLikeCount.text = story.likeCount.toString()
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.activityLikeContainer.setOnClickListener {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue