mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-30 05:11:02 +00:00
feat: delete comment and subscription notification
This commit is contained in:
@@ -49,7 +49,10 @@ class StatusActivity : AppCompatActivity(), StoriesCallback {
|
||||
if (activity.getOrNull(position) != null) {
|
||||
val startFrom = findFirstNonMatch(watchedActivity, activity[position].activity )
|
||||
val startIndex = if ( startFrom > 0) startFrom else 0
|
||||
binding.stories.setStoriesList(activity[position].activity, this, startIndex + 1)
|
||||
binding.stories.setStoriesList(
|
||||
activityList = activity[position].activity,
|
||||
startIndex = startIndex + 1
|
||||
)
|
||||
} else {
|
||||
Logger.log("index out of bounds for position $position of size ${activity.size}")
|
||||
finish()
|
||||
@@ -92,7 +95,7 @@ class StatusActivity : AppCompatActivity(), StoriesCallback {
|
||||
val startFrom = findFirstNonMatch(watchedActivity, activity[position].activity )
|
||||
val startIndex= if ( startFrom > 0) startFrom else 0
|
||||
binding.stories.startAnimation(slideOutLeft)
|
||||
binding.stories.setStoriesList(activity[position].activity, this, startIndex + 1)
|
||||
binding.stories.setStoriesList(activity[position].activity, startIndex + 1)
|
||||
binding.stories.startAnimation(slideInRight)
|
||||
} else {
|
||||
finish()
|
||||
@@ -107,7 +110,7 @@ class StatusActivity : AppCompatActivity(), StoriesCallback {
|
||||
val startFrom = findFirstNonMatch(watchedActivity, activity[position].activity )
|
||||
val startIndex = if ( startFrom > 0) startFrom else 0
|
||||
binding.stories.startAnimation(slideOutRight)
|
||||
binding.stories.setStoriesList(activity[position].activity, this, startIndex + 1)
|
||||
binding.stories.setStoriesList(activity[position].activity,startIndex + 1)
|
||||
binding.stories.startAnimation(slideInLeft)
|
||||
} else {
|
||||
finish()
|
||||
|
||||
@@ -49,7 +49,6 @@ import kotlin.math.abs
|
||||
class Stories @JvmOverloads constructor(
|
||||
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), View.OnTouchListener {
|
||||
private lateinit var activity: FragmentActivity
|
||||
private lateinit var binding: FragmentStatusBinding
|
||||
private lateinit var activityList: List<Activity>
|
||||
private lateinit var storiesListener: StoriesCallback
|
||||
@@ -80,10 +79,9 @@ class Stories @JvmOverloads constructor(
|
||||
|
||||
|
||||
fun setStoriesList(
|
||||
activityList: List<Activity>, activity: FragmentActivity, startIndex: Int = 1
|
||||
activityList: List<Activity>, startIndex: Int = 1
|
||||
) {
|
||||
this.activityList = activityList
|
||||
this.activity = activity
|
||||
this.storyIndex = startIndex
|
||||
addLoadingViews(activityList)
|
||||
}
|
||||
@@ -368,7 +366,9 @@ class Stories @JvmOverloads constructor(
|
||||
if (
|
||||
story.status?.contains("completed") == false &&
|
||||
!story.status.contains("plans") &&
|
||||
!story.status.contains("repeating")
|
||||
!story.status.contains("repeating")&&
|
||||
!story.status.contains("paused")&&
|
||||
!story.status.contains("dropped")
|
||||
) {
|
||||
"of ${story.media?.title?.userPreferred}"
|
||||
} else {
|
||||
@@ -389,7 +389,7 @@ class Stories @JvmOverloads constructor(
|
||||
story.media?.id
|
||||
),
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(
|
||||
activity,
|
||||
(it.context as FragmentActivity),
|
||||
binding.coverImage,
|
||||
ViewCompat.getTransitionName(binding.coverImage)!!
|
||||
).toBundle()
|
||||
@@ -427,7 +427,7 @@ class Stories @JvmOverloads constructor(
|
||||
binding.activityReplies.setColorFilter(ContextCompat.getColor(context, R.color.bg_opp))
|
||||
binding.activityRepliesContainer.setOnClickListener {
|
||||
RepliesBottomDialog.newInstance(story.id)
|
||||
.show(activity.supportFragmentManager, "replies")
|
||||
.show((it.context as FragmentActivity).supportFragmentManager, "replies")
|
||||
}
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.activityLikeCount.text = story.likeCount.toString()
|
||||
@@ -435,10 +435,9 @@ class Stories @JvmOverloads constructor(
|
||||
like()
|
||||
}
|
||||
binding.activityLikeContainer.setOnLongClickListener {
|
||||
val context = activity
|
||||
UsersDialogFragment().apply {
|
||||
userList(userList)
|
||||
show(context.supportFragmentManager, "dialog")
|
||||
show((it.context as FragmentActivity).supportFragmentManager, "dialog")
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user