fix: reply text background color

This commit is contained in:
aayush262 2024-05-14 00:33:14 +05:30
parent b0b51c4347
commit a3b1d3db57
11 changed files with 124 additions and 103 deletions

View file

@ -58,7 +58,8 @@ class OfflineAnimeAdapter(
if (style == 0) {
val bannerView = view.findViewById<ImageView>(R.id.itemCompactBanner) // for large view
val episodes = view.findViewById<TextView>(R.id.itemTotal)
episodes.text = context.getString(R.string.episodes)
val text = " ${context.getString(R.string.episodes)}"
episodes.text = text
bannerView.setImageURI(item.banner ?: item.image)
totalEpisodes.text = item.totalEpisodeList
} else if (style == 1) {

View file

@ -57,7 +57,8 @@ class OfflineMangaAdapter(
if (style == 0) {
val bannerView = view.findViewById<ImageView>(R.id.itemCompactBanner) // for large view
val chapters = view.findViewById<TextView>(R.id.itemTotal)
chapters.text = context.getString(R.string.chapters)
val text = " ${context.getString(R.string.chapters)}"
chapters.text = text
bannerView.setImageURI(item.banner ?: item.image)
totalChapter.text = item.totalChapter
} else if (style == 1) {

View file

@ -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

View file

@ -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 {

View file

@ -77,8 +77,8 @@ class MediaListViewActivity: AppCompatActivity() {
binding.mediaGrid.setOnClickListener {
changeView(0, binding.mediaGrid)
}
binding.listTitle.text = intent.getStringExtra("title")
val text = "${intent.getStringExtra("title")} (${mediaList.count()})"
binding.listTitle.text = text
binding.mediaRecyclerView.adapter = MediaAdaptor(view, mediaList, this)
binding.mediaRecyclerView.layoutManager = GridLayoutManager(
this,

View file

@ -9,6 +9,7 @@ import android.view.ViewGroup
import android.widget.CheckBox
import android.widget.ImageButton
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
@ -73,6 +74,8 @@ class NotificationActivity : AppCompatActivity() {
val dialogView = LayoutInflater.from(currContext()).inflate(R.layout.custom_dialog_layout, null)
val checkboxContainer = dialogView.findViewById<LinearLayout>(R.id.checkboxContainer)
val tickAllButton = dialogView.findViewById<ImageButton>(R.id.toggleButton)
val title = dialogView.findViewById<TextView>(R.id.scantitle)
title.visibility = ViewGroup.GONE
fun getToggleImageResource(container: ViewGroup): Int {
var allChecked = true
var allUnchecked = true

View file

@ -57,7 +57,7 @@ class SettingsActivity : AppCompatActivity() {
settingsVersion.apply {
text = getString(R.string.version_current, BuildConfig.VERSION_NAME)
settingsVersion.setOnLongClickListener {
setOnLongClickListener {
copyToClipboard(getDeviceInfo(), false)
toast(getString(R.string.copied_device_info))
return@setOnLongClickListener true