mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-20 17:23:57 +00:00
chore: resolve profile SetTextI18n
This commit is contained in:
@@ -83,7 +83,7 @@ class CommentItem(val comment: Comment,
|
||||
if (comment.replyCount == 1)
|
||||
getString(R.string.view_reply)
|
||||
else
|
||||
getString(R.string.view_replies, comment.replyCount)
|
||||
getString(R.string.view_replies_count, comment.replyCount)
|
||||
}
|
||||
} else {
|
||||
viewBinding.commentTotalReplies.visibility = View.GONE
|
||||
@@ -98,7 +98,7 @@ class CommentItem(val comment: Comment,
|
||||
viewBinding.commentTotalReplies.text = if (comment.replyCount == 1)
|
||||
getString(R.string.view_reply)
|
||||
else
|
||||
getString(R.string.view_replies, comment.replyCount)
|
||||
getString(R.string.view_replies_count, comment.replyCount)
|
||||
}
|
||||
repliesVisible = false
|
||||
} else {
|
||||
|
||||
@@ -47,7 +47,6 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
private var selected: Int = 0
|
||||
private lateinit var navBar: AnimatedBottomBar
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
@@ -105,20 +104,30 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
val userLevel = intent.getStringExtra("userLVL") ?: ""
|
||||
binding.followButton.visibility =
|
||||
if (user.id == Anilist.userid || Anilist.userid == null) View.GONE else View.VISIBLE
|
||||
binding.followButton.text =
|
||||
if (user.isFollowing) "Unfollow" else if (user.isFollower) "Follows you" else "Follow"
|
||||
if (user.isFollowing && user.isFollower) binding.followButton.text = "Mutual"
|
||||
binding.followButton.text = getString(
|
||||
when {
|
||||
user.isFollowing -> R.string.unfollow
|
||||
user.isFollower -> R.string.follows_you
|
||||
else -> R.string.follow
|
||||
}
|
||||
)
|
||||
if (user.isFollowing && user.isFollower) binding.followButton.text = getString(R.string.mutual)
|
||||
binding.followButton.setOnClickListener {
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
val res = Anilist.query.toggleFollow(user.id)
|
||||
if (res?.data?.toggleFollow != null) {
|
||||
withContext(Dispatchers.Main) {
|
||||
snackString("Success")
|
||||
snackString(R.string.success)
|
||||
user.isFollowing = res.data.toggleFollow.isFollowing
|
||||
binding.followButton.text =
|
||||
if (user.isFollowing) "Unfollow" else if (user.isFollower) "Follows you" else "Follow"
|
||||
if (user.isFollowing && user.isFollower) binding.followButton.text =
|
||||
"Mutual"
|
||||
binding.followButton.text = getString(
|
||||
when {
|
||||
user.isFollowing -> R.string.unfollow
|
||||
user.isFollower -> R.string.follows_you
|
||||
else -> R.string.follow
|
||||
}
|
||||
)
|
||||
if (user.isFollowing && user.isFollower)
|
||||
binding.followButton.text = getString(R.string.mutual)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,7 +181,8 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
)
|
||||
}
|
||||
|
||||
binding.profileUserName.text = "${user.name} $userLevel"
|
||||
val userLevelText = "${user.name} $userLevel"
|
||||
binding.profileUserName.text = userLevelText
|
||||
if (!(PrefManager.getVal(PrefName.BannerAnimations) as Boolean)) binding.profileBannerImage.pause()
|
||||
blurImage(binding.profileBannerImage, user.bannerImage ?: user.avatar?.medium)
|
||||
binding.profileBannerImage.updateLayoutParams { height += statusBarHeight }
|
||||
@@ -196,7 +206,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
ContextCompat.startActivity(
|
||||
this@ProfileActivity,
|
||||
Intent(this@ProfileActivity, FollowActivity::class.java)
|
||||
.putExtra("title", "Followers")
|
||||
.putExtra("title", getString(R.string.followers))
|
||||
.putExtra("userId", user.id),
|
||||
null
|
||||
)
|
||||
|
||||
@@ -38,7 +38,6 @@ class ActivityItem(
|
||||
private lateinit var binding: ItemActivityBinding
|
||||
private lateinit var repliesAdapter: GroupieAdapter
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun bind(viewBinding: ItemActivityBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
setAnimation(binding.root.context, binding.root)
|
||||
@@ -73,13 +72,13 @@ class ActivityItem(
|
||||
} ?: emptyList()
|
||||
repliesAdapter.addAll(replyItems)
|
||||
binding.activityReplies.visibility = View.VISIBLE
|
||||
binding.commentTotalReplies.text = "Hide replies"
|
||||
binding.commentTotalReplies.setText(R.string.hide_replies)
|
||||
}
|
||||
|
||||
else -> {
|
||||
repliesAdapter.clear()
|
||||
binding.activityReplies.visibility = View.GONE
|
||||
binding.commentTotalReplies.text = "View replies"
|
||||
binding.commentTotalReplies.setText(R.string.view_replies)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -127,7 +126,9 @@ class ActivityItem(
|
||||
binding.activityContent.visibility = View.GONE
|
||||
binding.activityBannerContainer.visibility = View.VISIBLE
|
||||
binding.activityMediaName.text = activity.media?.title?.userPreferred
|
||||
binding.activityText.text = "${activity.user!!.name} ${activity.status} ${activity.progress ?: activity.media?.title?.userPreferred}"
|
||||
val activityText = "${activity.user!!.name} ${activity.status} ${activity.progress
|
||||
?: activity.media?.title?.userPreferred}"
|
||||
binding.activityText.text = activityText
|
||||
binding.activityCover.loadImage(cover)
|
||||
blurImage(binding.activityBannerImage, banner ?: cover)
|
||||
binding.activityAvatarContainer.setOnClickListener {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.core.view.isVisible
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
import ani.dantotsu.databinding.ActivityFollowBinding
|
||||
@@ -37,14 +38,14 @@ class NotificationActivity : AppCompatActivity() {
|
||||
private var currentPage: Int = 1
|
||||
private var hasNextPage: Boolean = true
|
||||
|
||||
@SuppressLint("SetTextI18n", "ClickableViewAccessibility")
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
initActivity(this)
|
||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
binding.listTitle.text = "Notifications"
|
||||
binding.listTitle.text = getString(R.string.notifications)
|
||||
binding.listToolbar.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
}
|
||||
|
||||
@@ -72,6 +72,9 @@
|
||||
<item>All</item>
|
||||
</string-array>
|
||||
|
||||
<string name="no_notifications">No more notifications</string>
|
||||
<string name="followers">Followers</string>
|
||||
|
||||
<string name="status">STATUS</string>
|
||||
<string-array name="status" translatable="false">
|
||||
<item>PLANNING</item>
|
||||
@@ -693,6 +696,10 @@
|
||||
<string name="manga_mean_score">Manga Mean Score</string>
|
||||
<string name="about_me">About me</string>
|
||||
<string name="follow">Follow</string>
|
||||
<string name="unfollow">Unfollow</string>
|
||||
<string name="follows_you">Follows you</string>
|
||||
<string name="mutual">Mutual</string>
|
||||
<string name="success">Success</string>
|
||||
<string name="lorem_ipsum">
|
||||
|
||||
Lorem ipsum dolor sit amet. Est consectetur sint qui internos optio nam Quis excepturi qui voluptatem animi. Qui labore quasi vel suscipit deleniti et doloremque omnis in velit suscipit et quasi eaque. Et doloribus recusandae id laudantium Quis qui natus velit in voluptatem voluptatem!
|
||||
@@ -718,9 +725,10 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
|
||||
|
||||
<string name="delete_fail_reason">Failed to delete because of… %1$s</string>
|
||||
|
||||
<string name="hide_replies">Hide Replies</string>
|
||||
<string name="hide_replies">Hide replies</string>
|
||||
<string name="view_reply">View reply</string>
|
||||
<string name="view_replies">View %1$d replies</string>
|
||||
<string name="view_replies">View replies</string>
|
||||
<string name="view_replies_count">View %1$d replies</string>
|
||||
<string name="replying_to">Replying to %1$s</string>
|
||||
|
||||
<string name="delete_comment">Delete Comment</string>
|
||||
|
||||
Reference in New Issue
Block a user