fix: idr
This commit is contained in:
parent
df2867c7db
commit
bfa847130e
7 changed files with 81 additions and 44 deletions
|
@ -1505,7 +1505,7 @@ Page(page:$page,perPage:50) {
|
|||
return author
|
||||
}
|
||||
|
||||
suspend fun getReviews(mediaId: Int, page: Int = 1, sort: String = "UPDATED_AT_DESC"): Query.ReviewsResponse? {
|
||||
suspend fun getReviews(mediaId: Int, page: Int = 1, sort: String = "CREATED_AT_DESC"): Query.ReviewsResponse? {
|
||||
return executeQuery<Query.ReviewsResponse>(
|
||||
"""{Page(page:$page,perPage:10){pageInfo{currentPage,hasNextPage,total}reviews(mediaId:$mediaId,sort:$sort){id,mediaId,mediaType,summary,body(asHtml:true)rating,ratingAmount,userRating,score,private,siteUrl,createdAt,updatedAt,user{id,name,bannerImage avatar{medium,large}}}}}""",
|
||||
force = true
|
||||
|
|
|
@ -84,15 +84,15 @@ class Contributors {
|
|||
"https://anilist.co/user/6244220"
|
||||
),
|
||||
Developer(
|
||||
"Zaidsenior",
|
||||
"Ziadsenior",
|
||||
"https://s4.anilist.co/file/anilistcdn/user/avatar/large/b6049773-8cjYeUOFUguv.jpg",
|
||||
"Comment Moderator",
|
||||
"Comment Moderator and Arabic Translator",
|
||||
"https://anilist.co/user/6049773"
|
||||
),
|
||||
Developer(
|
||||
"hastsu",
|
||||
"https://cdn.discordapp.com/avatars/602422545077108749/20b4a6efa4314550e4ed51cdbe4fef3d.webp?size=160",
|
||||
"Comment Moderator",
|
||||
"Comment Moderator and Arabic Translator",
|
||||
"https://anilist.co/user/6183359"
|
||||
),
|
||||
)
|
||||
|
|
|
@ -42,6 +42,7 @@ import kotlinx.coroutines.launch
|
|||
import kotlinx.coroutines.withContext
|
||||
import java.util.Calendar
|
||||
import java.util.Locale
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
class Stories @JvmOverloads constructor(
|
||||
|
@ -264,29 +265,44 @@ class Stories @JvmOverloads constructor(
|
|||
|
||||
|
||||
private var startClickTime = 0L
|
||||
private var startX = 0f
|
||||
private var startY = 0f
|
||||
private var isLongPress = false
|
||||
private val swipeThreshold = 100
|
||||
override fun onTouch(view: View?, event: MotionEvent?): Boolean {
|
||||
val maxClickDuration = 200
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
startX = event.x
|
||||
startY = event.y
|
||||
startClickTime = Calendar.getInstance().timeInMillis
|
||||
pause()
|
||||
isLongPress = false
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val deltaX = event.x - startX
|
||||
val deltaY = event.y - startY
|
||||
if (!isLongPress && (abs(deltaX) > swipeThreshold || abs(deltaY) > swipeThreshold)) {
|
||||
isLongPress = true
|
||||
}
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP -> {
|
||||
val clickDuration = Calendar.getInstance().timeInMillis - startClickTime
|
||||
if (clickDuration < maxClickDuration) {
|
||||
//click occurred
|
||||
view?.let {
|
||||
if (it.id == R.id.leftTouchPanel) {
|
||||
leftPanelTouch()
|
||||
} else if (it.id == R.id.rightTouchPanel) {
|
||||
rightPanelTouch()
|
||||
}
|
||||
if (clickDuration < maxClickDuration && !isLongPress) {
|
||||
when (view?.id) {
|
||||
R.id.leftTouchPanel -> leftPanelTouch()
|
||||
R.id.rightTouchPanel -> rightPanelTouch()
|
||||
}
|
||||
} else {
|
||||
//hold click occurred
|
||||
resume()
|
||||
}
|
||||
val deltaX = event.x - startX
|
||||
if (abs(deltaX) > swipeThreshold) {
|
||||
if (deltaX > 0) onStoriesPrevious()
|
||||
else onStoriesCompleted()
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
@ -359,16 +375,14 @@ class Stories @JvmOverloads constructor(
|
|||
)
|
||||
}
|
||||
fun visible(isList: Boolean) {
|
||||
val visible = if (isList) View.VISIBLE else View.GONE
|
||||
val gone = if (isList) View.GONE else View.VISIBLE
|
||||
binding.textActivity.visibility = gone
|
||||
binding.textActivityContainer.visibility = gone
|
||||
binding.infoText.visibility = visible
|
||||
binding.coverImage.visibility = visible
|
||||
binding.textActivity.isVisible = !isList
|
||||
binding.textActivityContainer.isVisible = !isList
|
||||
binding.infoText.isVisible = isList
|
||||
binding.coverImage.isVisible = isList
|
||||
binding.infoText.visibility = if (isList) View.VISIBLE else View.INVISIBLE
|
||||
binding.infoText.text = ""
|
||||
binding.contentImageViewKen.visibility = visible
|
||||
binding.contentImageView.visibility = visible
|
||||
binding.contentImageViewKen.isVisible = isList
|
||||
binding.contentImageView.isVisible = isList
|
||||
}
|
||||
|
||||
when (story.typename) {
|
||||
|
@ -387,8 +401,7 @@ class Stories @JvmOverloads constructor(
|
|||
story.status?.contains("completed") == false &&
|
||||
!story.status.contains("plans") &&
|
||||
!story.status.contains("repeating")
|
||||
)
|
||||
{
|
||||
) {
|
||||
"of ${story.media?.title?.userPreferred}"
|
||||
} else {
|
||||
""
|
||||
|
@ -413,9 +426,7 @@ class Stories @JvmOverloads constructor(
|
|||
ViewCompat.getTransitionName(binding.coverImage)!!
|
||||
).toBundle()
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
"TextActivity" -> {
|
||||
|
@ -445,11 +456,13 @@ class Stories @JvmOverloads constructor(
|
|||
val likeColor = ContextCompat.getColor(context, R.color.yt_red)
|
||||
val notLikeColor = ContextCompat.getColor(context, R.color.bg_opp)
|
||||
binding.activityRepliesContainer.setOnClickListener {
|
||||
RepliesBottomDialog.newInstance(story.id).show(activity.supportFragmentManager, "replies")
|
||||
RepliesBottomDialog.newInstance(story.id)
|
||||
.show(activity.supportFragmentManager, "replies")
|
||||
}
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.replyCount.text = story.replyCount.toString()
|
||||
binding.activityLikeCount.text = story.likeCount.toString()
|
||||
binding.activityLike.setColorFilter(if (story.isLiked == true) likeColor else notLikeColor)
|
||||
binding.activityLike.setColorFilter(ContextCompat.getColor(context, R.color.bg_opp))
|
||||
binding.activityLikeContainer.setOnClickListener {
|
||||
like()
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.view.View
|
|||
import androidx.core.content.ContextCompat
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.ItemSubscriptionBinding
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.notifications.subscription.SubscriptionHelper
|
||||
import com.xwray.groupie.GroupieAdapter
|
||||
|
@ -25,7 +26,7 @@ class SubscriptionItem(
|
|||
else
|
||||
SubscriptionHelper.getMangaParser(media.id).name
|
||||
val mediaName = media.name
|
||||
val showName = "$mediaName - $parserName"
|
||||
val showName = "$mediaName ($parserName)"
|
||||
binding.subscriptionName.text = showName
|
||||
binding.root.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
|
@ -36,6 +37,7 @@ class SubscriptionItem(
|
|||
null
|
||||
)
|
||||
}
|
||||
binding.subscriptionCover.loadImage(media.image)
|
||||
binding.deleteSubscription.setOnClickListener {
|
||||
SubscriptionHelper.deleteSubscription(id, true)
|
||||
adapter.remove(this)
|
||||
|
|
|
@ -74,11 +74,12 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:ellipsize="end"
|
||||
android:alpha="0.75"
|
||||
android:maxLines="2"
|
||||
android:text="@string/lorem_ipsum"
|
||||
android:textSize="14sp"
|
||||
android:textSize="12sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_circle_cancel"
|
||||
android:src="@drawable/ic_round_close_24"
|
||||
android:textSize="14sp"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
|
|
@ -8,14 +8,35 @@
|
|||
android:layout_marginHorizontal="8dp"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/subscriptionCoverContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:backgroundTint="@color/bg_white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:strokeColor="@color/transparent">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/subscriptionCover"
|
||||
android:layout_width="108dp"
|
||||
android:layout_height="160dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic"
|
||||
tools:tint="@color/transparent" />
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<TextView
|
||||
android:id="@+id/subscriptionName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:fontFamily="@font/poppins_semi_bold"
|
||||
android:text="@string/placeholder"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
@ -26,7 +47,7 @@
|
|||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:contentDescription="@string/delete"
|
||||
android:src="@drawable/ic_circle_cancel"
|
||||
android:src="@drawable/ic_round_close_24"
|
||||
app:tint="?attr/colorOnBackground" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue