chore: code cleanup
This commit is contained in:
parent
386e02a564
commit
24147e746a
198 changed files with 1367 additions and 965 deletions
|
@ -15,7 +15,8 @@ import com.xwray.groupie.viewbinding.GroupieViewHolder
|
|||
class ChartItem(
|
||||
private val title: String,
|
||||
private val aaOptions: AAOptions,
|
||||
private val activity: ProfileActivity): BindableItem<ItemChartBinding>() {
|
||||
private val activity: ProfileActivity
|
||||
) : BindableItem<ItemChartBinding>() {
|
||||
private lateinit var binding: ItemChartBinding
|
||||
override fun bind(viewBinding: ItemChartBinding, position: Int) {
|
||||
binding = viewBinding
|
||||
|
@ -78,6 +79,7 @@ class ChartItem(
|
|||
viewHolder.setIsRecyclable(false)
|
||||
super.bind(viewHolder, position, payloads, onItemClickListener, onItemLongClickListener)
|
||||
}
|
||||
|
||||
override fun getViewType(): Int {
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ import kotlinx.coroutines.launch
|
|||
import kotlinx.coroutines.withContext
|
||||
|
||||
|
||||
class FollowActivity : AppCompatActivity(){
|
||||
class FollowActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityFollowBinding
|
||||
val adapter = GroupieAdapter()
|
||||
var users: List<User>? = null
|
||||
|
@ -37,7 +37,9 @@ class FollowActivity : AppCompatActivity(){
|
|||
initActivity(this)
|
||||
binding = ActivityFollowBinding.inflate(layoutInflater)
|
||||
binding.listToolbar.updateLayoutParams<MarginLayoutParams> { topMargin = statusBarHeight }
|
||||
binding.listFrameLayout.updateLayoutParams<MarginLayoutParams> { bottomMargin = navBarHeight }
|
||||
binding.listFrameLayout.updateLayoutParams<MarginLayoutParams> {
|
||||
bottomMargin = navBarHeight
|
||||
}
|
||||
setContentView(binding.root)
|
||||
val layoutType = PrefManager.getVal<Int>(PrefName.FollowerLayout)
|
||||
selected = getSelected(layoutType)
|
||||
|
@ -54,7 +56,7 @@ class FollowActivity : AppCompatActivity(){
|
|||
binding.listBack.setOnClickListener { finish() }
|
||||
|
||||
val title = intent.getStringExtra("title")
|
||||
val userID= intent.getIntExtra("userId", 0)
|
||||
val userID = intent.getIntExtra("userId", 0)
|
||||
binding.listTitle.text = title
|
||||
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
|
@ -93,9 +95,20 @@ class FollowActivity : AppCompatActivity(){
|
|||
}
|
||||
users?.forEach { user ->
|
||||
if (getLayoutType(selected) == 0) {
|
||||
adapter.add(FollowerItem(user.id, user.name ?: "Unknown", user.avatar?.medium, user.bannerImage ?: user.avatar?.medium ) { onUserClick(it) })
|
||||
adapter.add(
|
||||
FollowerItem(
|
||||
user.id,
|
||||
user.name ?: "Unknown",
|
||||
user.avatar?.medium,
|
||||
user.bannerImage ?: user.avatar?.medium
|
||||
) { onUserClick(it) })
|
||||
} else {
|
||||
adapter.add(GridFollowerItem(user.id, user.name ?: "Unknown", user.avatar?.medium) { onUserClick(it) })
|
||||
adapter.add(
|
||||
GridFollowerItem(
|
||||
user.id,
|
||||
user.name ?: "Unknown",
|
||||
user.avatar?.medium
|
||||
) { onUserClick(it) })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ class FollowerItem(
|
|||
private val avatar: String?,
|
||||
private val banner: String?,
|
||||
val clickCallback: (Int) -> Unit
|
||||
): BindableItem<ItemFollowerBinding>() {
|
||||
) : BindableItem<ItemFollowerBinding>() {
|
||||
private lateinit var binding: ItemFollowerBinding
|
||||
|
||||
override fun bind(viewBinding: ItemFollowerBinding, position: Int) {
|
||||
|
|
|
@ -6,12 +6,12 @@ import ani.dantotsu.databinding.ItemFollowerGridBinding
|
|||
import ani.dantotsu.loadImage
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
|
||||
class GridFollowerItem (
|
||||
class GridFollowerItem(
|
||||
private val id: Int,
|
||||
private val name: String,
|
||||
private val avatar: String?,
|
||||
val clickCallback: (Int) -> Unit
|
||||
): BindableItem<ItemFollowerGridBinding>() {
|
||||
) : BindableItem<ItemFollowerGridBinding>() {
|
||||
private lateinit var binding: ItemFollowerGridBinding
|
||||
|
||||
override fun bind(viewBinding: ItemFollowerGridBinding, position: Int) {
|
||||
|
|
|
@ -59,9 +59,11 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
|||
screenWidth = resources.displayMetrics.widthPixels.toFloat()
|
||||
navBar = binding.profileNavBar
|
||||
val navBarRightMargin = if (resources.configuration.orientation ==
|
||||
Configuration.ORIENTATION_LANDSCAPE) navBarHeight else 0
|
||||
Configuration.ORIENTATION_LANDSCAPE
|
||||
) navBarHeight else 0
|
||||
val navBarBottomMargin = if (resources.configuration.orientation ==
|
||||
Configuration.ORIENTATION_LANDSCAPE) 0 else navBarHeight
|
||||
Configuration.ORIENTATION_LANDSCAPE
|
||||
) 0 else navBarHeight
|
||||
navBar.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
rightMargin = navBarRightMargin
|
||||
bottomMargin = navBarBottomMargin
|
||||
|
@ -284,7 +286,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
|||
if (mMaxScrollSize == 0) mMaxScrollSize = appBar.totalScrollRange
|
||||
val percentage = abs(i) * 100 / mMaxScrollSize
|
||||
|
||||
with (bindingProfileAppBar) {
|
||||
with(bindingProfileAppBar) {
|
||||
profileUserAvatarContainer.visibility =
|
||||
if (profileUserAvatarContainer.scaleX == 0f) View.GONE else View.VISIBLE
|
||||
val duration = (200 * (PrefManager.getVal(PrefName.AnimationSpeed) as Float)).toLong()
|
||||
|
@ -315,10 +317,12 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
|||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
val rightMargin = if (resources.configuration.orientation ==
|
||||
Configuration.ORIENTATION_LANDSCAPE) navBarHeight else 0
|
||||
Configuration.ORIENTATION_LANDSCAPE
|
||||
) navBarHeight else 0
|
||||
val bottomMargin = if (resources.configuration.orientation ==
|
||||
Configuration.ORIENTATION_LANDSCAPE) 0 else navBarHeight
|
||||
val params : ViewGroup.MarginLayoutParams =
|
||||
Configuration.ORIENTATION_LANDSCAPE
|
||||
) 0 else navBarHeight
|
||||
val params: ViewGroup.MarginLayoutParams =
|
||||
navBar.layoutParams as ViewGroup.MarginLayoutParams
|
||||
params.updateMargins(right = rightMargin, bottom = bottomMargin)
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package ani.dantotsu.profile
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -22,19 +20,16 @@ import ani.dantotsu.R
|
|||
import ani.dantotsu.connections.anilist.ProfileViewModel
|
||||
import ani.dantotsu.connections.anilist.api.Query
|
||||
import ani.dantotsu.databinding.FragmentProfileBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.media.Author
|
||||
import ani.dantotsu.media.AuthorAdapter
|
||||
import ani.dantotsu.media.Character
|
||||
import ani.dantotsu.media.CharacterAdapter
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaAdaptor
|
||||
import ani.dantotsu.media.user.ListActivity
|
||||
import ani.dantotsu.setBaseline
|
||||
import ani.dantotsu.setSlideIn
|
||||
import ani.dantotsu.setSlideUp
|
||||
import ani.dantotsu.util.AniMarkdown.Companion.getFullAniHTML
|
||||
import ani.dantotsu.util.Logger
|
||||
import eu.kanade.tachiyomi.util.system.getSerializableCompat
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -137,7 +132,7 @@ class ProfileFragment : Fragment() {
|
|||
}
|
||||
|
||||
user.favourites?.staff?.nodes?.forEach { i ->
|
||||
favStaff.add(Author(i.id, i.name.full, i.image.large , "" ))
|
||||
favStaff.add(Author(i.id, i.name.full, i.image.large, ""))
|
||||
}
|
||||
|
||||
setFavPeople()
|
||||
|
@ -159,7 +154,8 @@ class ProfileFragment : Fragment() {
|
|||
binding.profileFavStaffRecycler.layoutManager = LinearLayoutManager(
|
||||
activity, LinearLayoutManager.HORIZONTAL, false
|
||||
)
|
||||
binding.profileFavStaffRecycler.layoutAnimation = LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
binding.profileFavStaffRecycler.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
|
||||
if (favCharacter.isEmpty()) {
|
||||
|
@ -169,7 +165,8 @@ class ProfileFragment : Fragment() {
|
|||
binding.profileFavCharactersRecycler.layoutManager = LinearLayoutManager(
|
||||
activity, LinearLayoutManager.HORIZONTAL, false
|
||||
)
|
||||
binding.profileFavCharactersRecycler.layoutAnimation = LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
binding.profileFavCharactersRecycler.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,7 +186,7 @@ class ProfileFragment : Fragment() {
|
|||
recyclerView.visibility = View.GONE
|
||||
if (it != null) {
|
||||
if (it.isNotEmpty()) {
|
||||
recyclerView.adapter = MediaAdaptor(0, it, activity, fav=true)
|
||||
recyclerView.adapter = MediaAdaptor(0, it, activity, fav = true)
|
||||
recyclerView.layoutManager = LinearLayoutManager(
|
||||
activity,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
|
|
|
@ -10,8 +10,7 @@ import ani.dantotsu.themes.ThemeManager
|
|||
import ani.dantotsu.toast
|
||||
import com.github.aachartmodel.aainfographics.aachartcreator.AAOptions
|
||||
|
||||
class SingleStatActivity : AppCompatActivity()
|
||||
{
|
||||
class SingleStatActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivitySingleStatBinding
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -58,10 +58,13 @@ class StatsFragment :
|
|||
binding.statisticList.adapter = adapter
|
||||
binding.statisticList.recycledViewPool.setMaxRecycledViews(0, 0)
|
||||
binding.statisticList.isNestedScrollingEnabled = true
|
||||
binding.statisticList.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.statisticList.layoutManager =
|
||||
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
|
||||
binding.statisticProgressBar.visibility = View.VISIBLE
|
||||
binding.compare.visibility = if (user.id == Anilist.userid) View.GONE else View.VISIBLE
|
||||
binding.filterContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> { topMargin = statusBarHeight }
|
||||
binding.filterContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
}
|
||||
|
||||
binding.sourceType.setAdapter(
|
||||
ArrayAdapter(
|
||||
|
|
|
@ -12,8 +12,8 @@ data class User(
|
|||
val status: String? = null,
|
||||
val score: Float? = null,
|
||||
val progress: Int? = null,
|
||||
val totalEpisodes : Int? = null,
|
||||
val nextAiringEpisode : Int? = null,
|
||||
val totalEpisodes: Int? = null,
|
||||
val nextAiringEpisode: Int? = null,
|
||||
) : java.io.Serializable {
|
||||
companion object {
|
||||
private const val serialVersionUID: Long = 1
|
||||
|
|
|
@ -5,13 +5,13 @@ import android.view.LayoutInflater
|
|||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ani.dantotsu.blurImage
|
||||
import ani.dantotsu.databinding.ItemFollowerBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.setAnimation
|
||||
|
||||
|
||||
class UsersAdapter(private val user: ArrayList<User>) : RecyclerView.Adapter<UsersAdapter.UsersViewHolder>() {
|
||||
class UsersAdapter(private val user: ArrayList<User>) :
|
||||
RecyclerView.Adapter<UsersAdapter.UsersViewHolder>() {
|
||||
|
||||
inner class UsersViewHolder(val binding: ItemFollowerBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
|
|
|
@ -14,9 +14,10 @@ class UsersDialogFragment : BottomSheetDialogFragment() {
|
|||
private val binding get() = _binding!!
|
||||
|
||||
private var userList = arrayListOf<User>()
|
||||
fun userList(user: ArrayList<User>){
|
||||
fun userList(user: ArrayList<User>) {
|
||||
userList = user
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
|
@ -25,6 +26,7 @@ class UsersDialogFragment : BottomSheetDialogFragment() {
|
|||
_binding = BottomSheetUsersBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.isVisible
|
||||
|
@ -18,13 +17,8 @@ import ani.dantotsu.profile.UsersDialogFragment
|
|||
import ani.dantotsu.setAnimation
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.util.AniMarkdown.Companion.getBasicAniHTML
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
import com.xwray.groupie.viewbinding.BindableItem
|
||||
import jp.wasabeef.glide.transformations.BlurTransformation
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
|
@ -108,11 +102,12 @@ class ActivityItem(
|
|||
}
|
||||
val context = binding.root.context
|
||||
val userList = arrayListOf<User>()
|
||||
activity.likes?.forEach{ i ->
|
||||
activity.likes?.forEach { i ->
|
||||
userList.add(User(i.id, i.name.toString(), i.avatar?.medium, i.bannerImage))
|
||||
}
|
||||
binding.activityLike.setOnLongClickListener{
|
||||
UsersDialogFragment().apply { userList(userList)
|
||||
binding.activityLike.setOnLongClickListener {
|
||||
UsersDialogFragment().apply {
|
||||
userList(userList)
|
||||
show(fragActivity.supportFragmentManager, "dialog")
|
||||
}
|
||||
true
|
||||
|
@ -126,8 +121,10 @@ class ActivityItem(
|
|||
binding.activityContent.visibility = View.GONE
|
||||
binding.activityBannerContainer.visibility = View.VISIBLE
|
||||
binding.activityMediaName.text = activity.media?.title?.userPreferred
|
||||
val activityText = "${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)
|
||||
|
|
|
@ -5,6 +5,7 @@ import ani.dantotsu.connections.anilist.api.NotificationType
|
|||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
class ActivityItemBuilder {
|
||||
|
||||
companion object {
|
||||
|
@ -109,6 +110,7 @@ class ActivityItemBuilder {
|
|||
else -> "Just now"
|
||||
}
|
||||
}
|
||||
|
||||
1L -> "1 day ago"
|
||||
in 2..6 -> "$daysDifference days ago"
|
||||
else -> SimpleDateFormat("dd MMM yyyy", Locale.getDefault()).format(targetDate)
|
||||
|
|
|
@ -31,7 +31,8 @@ class FeedActivity : AppCompatActivity() {
|
|||
setContentView(binding.root)
|
||||
navBar = binding.feedNavBar
|
||||
val navBarMargin = if (resources.configuration.orientation ==
|
||||
Configuration.ORIENTATION_LANDSCAPE) 0 else navBarHeight
|
||||
Configuration.ORIENTATION_LANDSCAPE
|
||||
) 0 else navBarHeight
|
||||
navBar.updateLayoutParams<ViewGroup.MarginLayoutParams> { bottomMargin = navBarMargin }
|
||||
val personalTab = navBar.createTab(R.drawable.ic_round_person_24, "Following")
|
||||
val globalTab = navBar.createTab(R.drawable.ic_globe_24, "Global")
|
||||
|
@ -67,10 +68,12 @@ class FeedActivity : AppCompatActivity() {
|
|||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
val margin = if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) 0 else navBarHeight
|
||||
val params : ViewGroup.MarginLayoutParams =
|
||||
val margin =
|
||||
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) 0 else navBarHeight
|
||||
val params: ViewGroup.MarginLayoutParams =
|
||||
binding.feedViewPager.layoutParams as ViewGroup.MarginLayoutParams
|
||||
val paramsNav : ViewGroup.MarginLayoutParams = navBar.layoutParams as ViewGroup.MarginLayoutParams
|
||||
val paramsNav: ViewGroup.MarginLayoutParams =
|
||||
navBar.layoutParams as ViewGroup.MarginLayoutParams
|
||||
params.updateMargins(bottom = margin)
|
||||
paramsNav.updateMargins(bottom = margin)
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import ani.dantotsu.databinding.FragmentFeedBinding
|
|||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.setBaseline
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.util.Logger
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -57,7 +56,7 @@ class FeedFragment : Fragment() {
|
|||
|
||||
val navBar = if (userId != null) {
|
||||
(activity as ProfileActivity).navBar
|
||||
}else{
|
||||
} else {
|
||||
(activity as FeedActivity).navBar
|
||||
}
|
||||
binding.listRecyclerView.setBaseline(navBar)
|
||||
|
@ -74,7 +73,7 @@ class FeedFragment : Fragment() {
|
|||
binding.root.requestLayout()
|
||||
val navBar = if (userId != null) {
|
||||
(activity as ProfileActivity).navBar
|
||||
}else{
|
||||
} else {
|
||||
(activity as FeedActivity).navBar
|
||||
}
|
||||
binding.listRecyclerView.setBaseline(navBar)
|
||||
|
@ -85,10 +84,17 @@ class FeedFragment : Fragment() {
|
|||
withContext(Dispatchers.Main) {
|
||||
res?.data?.page?.activities?.let { activities ->
|
||||
activityList = activities
|
||||
val filtered = activityList.filterNot { //filter out messages that are not directed to the user
|
||||
it.recipient?.id != null && it.recipient.id != Anilist.userid
|
||||
}
|
||||
adapter.update(filtered.map { ActivityItem(it, ::onActivityClick,requireActivity()) })
|
||||
val filtered =
|
||||
activityList.filterNot { //filter out messages that are not directed to the user
|
||||
it.recipient?.id != null && it.recipient.id != Anilist.userid
|
||||
}
|
||||
adapter.update(filtered.map {
|
||||
ActivityItem(
|
||||
it,
|
||||
::onActivityClick,
|
||||
requireActivity()
|
||||
)
|
||||
})
|
||||
}
|
||||
binding.listProgressBar.visibility = ViewGroup.GONE
|
||||
val scrollView = binding.listRecyclerView
|
||||
|
@ -134,7 +140,13 @@ class FeedFragment : Fragment() {
|
|||
val filtered = activities.filterNot {
|
||||
it.recipient?.id != null && it.recipient.id != Anilist.userid
|
||||
}
|
||||
adapter.addAll(filtered.map { ActivityItem(it, ::onActivityClick,requireActivity()) })
|
||||
adapter.addAll(filtered.map {
|
||||
ActivityItem(
|
||||
it,
|
||||
::onActivityClick,
|
||||
requireActivity()
|
||||
)
|
||||
})
|
||||
}
|
||||
binding.feedSwipeRefresh.isRefreshing = false
|
||||
onFinish()
|
||||
|
@ -150,6 +162,7 @@ class FeedFragment : Fragment() {
|
|||
.putExtra("userId", id), null
|
||||
)
|
||||
}
|
||||
|
||||
"MEDIA" -> {
|
||||
ContextCompat.startActivity(
|
||||
activity, Intent(activity, MediaDetailsActivity::class.java)
|
||||
|
|
|
@ -22,7 +22,6 @@ import ani.dantotsu.notifications.comment.CommentStore
|
|||
import ani.dantotsu.profile.ProfileActivity
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import ani.dantotsu.util.Logger
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package ani.dantotsu.profile.activity
|
||||
|
||||
import android.util.TypedValue
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.blurImage
|
||||
import ani.dantotsu.connections.anilist.api.Notification
|
||||
|
@ -60,7 +58,8 @@ class NotificationItem(
|
|||
}
|
||||
binding.notificationBannerImage.layoutParams.height = userHeight
|
||||
binding.notificationGradiant.layoutParams.height = userHeight
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart = userHeight
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart =
|
||||
userHeight
|
||||
} else {
|
||||
binding.notificationCover.visibility = View.VISIBLE
|
||||
binding.notificationCoverUser.visibility = View.VISIBLE
|
||||
|
@ -68,7 +67,8 @@ class NotificationItem(
|
|||
binding.notificationCover.loadImage(notification.media?.coverImage?.large)
|
||||
binding.notificationBannerImage.layoutParams.height = defaultHeight
|
||||
binding.notificationGradiant.layoutParams.height = defaultHeight
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart = textMarginStart
|
||||
(binding.notificationTextContainer.layoutParams as ViewGroup.MarginLayoutParams).marginStart =
|
||||
textMarginStart
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,9 @@ class NotificationItem(
|
|||
if (notification.commentId != null && notification.mediaId != null) {
|
||||
binding.notificationBannerImage.setOnClickListener {
|
||||
clickCallback(
|
||||
notification.mediaId, notification.commentId, NotificationClickType.COMMENT
|
||||
notification.mediaId,
|
||||
notification.commentId,
|
||||
NotificationClickType.COMMENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue