fix: reply text background color
This commit is contained in:
parent
b0b51c4347
commit
a3b1d3db57
11 changed files with 124 additions and 103 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
)
|
||||
binding.replyButton.setOnClickListener {
|
||||
val context = requireContext()
|
||||
binding.replyButton.setOnClickListener {
|
||||
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.activityLikeCount.text = story.likeCount.toString()
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.activityLikeContainer.setOnClickListener {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,55 +1,62 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="14dp"
|
||||
app:cardBackgroundColor="?attr/colorPrimary"
|
||||
app:cardCornerRadius="2dp"
|
||||
app:cardElevation="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="64dp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="32dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:fontFamily="@font/poppins"
|
||||
android:gravity="bottom|center_horizontal"
|
||||
android:text="@string/replies"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/replyButton"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="-48dp"
|
||||
android:contentDescription="@string/reply"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/ic_add"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/title"
|
||||
app:tint="?attr/colorPrimary" />
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/repliesRefresh"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="32dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title" />
|
||||
android:visibility="gone" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/repliesRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingVertical="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/replyButton" />
|
||||
tools:listitem="@layout/item_activity_reply" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
|
@ -8,6 +8,7 @@
|
|||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/scantitle"
|
||||
android:layout_width="265dp"
|
||||
android:layout_height="48dp"
|
||||
android:ellipsize="end"
|
||||
|
|
|
@ -176,39 +176,6 @@
|
|||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/activityRepliesContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="-8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
|
||||
app:layout_constraintEnd_toEndOf="@+id/linearLayout">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activityReplies"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_round_comment_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/replyCount"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:background="@drawable/notification_circle"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:gravity="center"
|
||||
android:textColor="#F3F3F3"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="1"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
|
@ -238,31 +205,59 @@
|
|||
tools:ignore="SpUsage"
|
||||
tools:text="@string/slogan" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activityRepliesContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activityReplies"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_round_comment_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/replyCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="4dp"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textSize="15sp"
|
||||
tools:text="12" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/activityLikeContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="12dp"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activityLikeCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textSize="15sp"
|
||||
tools:text="12" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/activityLike"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center|end"
|
||||
android:layout_marginStart="12dp"
|
||||
android:src="@drawable/ic_round_favorite_24"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/activityLikeCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="4dp"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:textSize="15sp"
|
||||
tools:text="12" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="?attr/colorSurface"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -105,7 +104,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="64dp"
|
||||
android:background="?android:colorBackground"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/lorem_ipsum"
|
||||
android:textSize="12sp" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue