Merge branch 'dev' into custom-download-location

This commit is contained in:
rebel onion
2024-04-04 04:03:34 -05:00
committed by GitHub
31 changed files with 544 additions and 306 deletions

View File

@@ -127,4 +127,4 @@ jobs:
pre-release-keep-count: 3
pre-release-drop-tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -214,7 +214,8 @@ fun initActivity(a: Activity) {
window,
window.decorView
).hide(WindowInsetsCompat.Type.statusBars())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && statusBarHeight == 0 && a.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && statusBarHeight == 0
&& a.resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
window.decorView.rootWindowInsets?.displayCutout?.apply {
if (boundingRects.size > 0) {
statusBarHeight = min(boundingRects[0].width(), boundingRects[0].height())

View File

@@ -898,6 +898,7 @@ class AnilistQueries {
season: String? = null,
id: Int? = null,
hd: Boolean = false,
adultOnly: Boolean = false
): SearchResults? {
val query = """
query (${"$"}page: Int = 1, ${"$"}id: Int, ${"$"}type: MediaType, ${"$"}isAdult: Boolean = false, ${"$"}search: String, ${"$"}format: [MediaFormat], ${"$"}status: MediaStatus, ${"$"}countryOfOrigin: CountryCode, ${"$"}source: MediaSource, ${"$"}season: MediaSeason, ${"$"}seasonYear: Int, ${"$"}year: String, ${"$"}onList: Boolean, ${"$"}yearLesser: FuzzyDateInt, ${"$"}yearGreater: FuzzyDateInt, ${"$"}episodeLesser: Int, ${"$"}episodeGreater: Int, ${"$"}durationLesser: Int, ${"$"}durationGreater: Int, ${"$"}chapterLesser: Int, ${"$"}chapterGreater: Int, ${"$"}volumeLesser: Int, ${"$"}volumeGreater: Int, ${"$"}licensedBy: [String], ${"$"}isLicensed: Boolean, ${"$"}genres: [String], ${"$"}excludedGenres: [String], ${"$"}tags: [String], ${"$"}excludedTags: [String], ${"$"}minimumTagRank: Int, ${"$"}sort: [MediaSort] = [POPULARITY_DESC, SCORE_DESC, START_DATE_DESC]) {
@@ -945,6 +946,7 @@ query (${"$"}page: Int = 1, ${"$"}id: Int, ${"$"}type: MediaType, ${"$"}isAdult:
}
""".replace("\n", " ").replace(""" """, "")
val variables = """{"type":"$type","isAdult":$isAdult
${if (adultOnly) ""","isAdult":true""" else ""}
${if (onList != null) ""","onList":$onList""" else ""}
${if (page != null) ""","page":"$page"""" else ""}
${if (id != null) ""","id":"$id"""" else ""}

View File

@@ -137,7 +137,8 @@ class AnilistAnimeViewModel : ViewModel() {
sort = Anilist.sortBy[2],
season = season,
seasonYear = year,
hd = true
hd = true,
adultOnly = PrefManager.getVal(PrefName.AdultOnly)
)?.results
)
}
@@ -159,7 +160,8 @@ class AnilistAnimeViewModel : ViewModel() {
search = searchVal,
onList = if (onList) null else false,
sort = sort,
genres = genres
genres = genres,
adultOnly = PrefManager.getVal(PrefName.AdultOnly)
)
)
}
@@ -179,7 +181,8 @@ class AnilistAnimeViewModel : ViewModel() {
r.format,
r.countryOfOrigin,
r.isAdult,
r.onList
r.onList,
adultOnly = PrefManager.getVal(PrefName.AdultOnly),
)
)
@@ -244,7 +247,8 @@ class AnilistMangaViewModel : ViewModel() {
type,
perPage = 10,
sort = Anilist.sortBy[2],
hd = true
hd = true,
adultOnly = PrefManager.getVal(PrefName.AdultOnly)
)?.results
)
@@ -264,7 +268,8 @@ class AnilistMangaViewModel : ViewModel() {
search = searchVal,
onList = if (onList) null else false,
sort = sort,
genres = genres
genres = genres,
adultOnly = PrefManager.getVal(PrefName.AdultOnly)
)
)
}
@@ -289,7 +294,8 @@ class AnilistMangaViewModel : ViewModel() {
r.excludedTags,
r.startYear,
r.seasonYear,
r.season
r.season,
adultOnly = PrefManager.getVal(PrefName.AdultOnly)
)
)
@@ -353,7 +359,7 @@ class AnilistSearch : ViewModel() {
r.excludedTags,
r.startYear,
r.seasonYear,
r.season
r.season,
)
)

View File

@@ -0,0 +1,84 @@
package ani.dantotsu.connections.github
import ani.dantotsu.Mapper
import ani.dantotsu.R
import ani.dantotsu.client
import ani.dantotsu.getAppString
import ani.dantotsu.settings.Developer
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonArray
import kotlinx.serialization.json.decodeFromJsonElement
class Contributors {
fun getContributors(): Array<Developer> {
var developers = arrayOf<Developer>()
runBlocking(Dispatchers.IO) {
val repo = getAppString(R.string.repo)
val res = client.get("https://api.github.com/repos/$repo/contributors")
.parsed<JsonArray>().map {
Mapper.json.decodeFromJsonElement<GithubResponse>(it)
}
res.find { it.login == "rebelonion"}?.let { first ->
developers = developers.plus(
Developer(
first.login,
first.avatarUrl,
"Owner and Maintainer",
first.htmlUrl
)
).plus(arrayOf(
Developer(
"Wai What",
"https://avatars.githubusercontent.com/u/149729762?v=4",
"Icon Designer",
"https://github.com/WaiWhat"
),
Developer(
"MarshMeadow",
"https://avatars.githubusercontent.com/u/88599122?v=4",
"Beta Icon Designer",
"https://github.com/MarshMeadow?tab=repositories"
),
Developer(
"Zaxx69",
"https://avatars.githubusercontent.com/u/138523882?v=4",
"Telegram Admin",
"https://github.com/Zaxx69"
),
Developer(
"Arif Alam",
"https://avatars.githubusercontent.com/u/70383209?v=4",
"Head Discord Moderator",
"https://youtube.com/watch?v=dQw4w9WgXcQ"
)
))
}
res.filter {it.login != "rebelonion"}.forEach {
developers = developers.plus(
Developer(
it.login,
it.avatarUrl,
"Contributor",
it.htmlUrl
)
)
}
}
return developers
}
@Serializable
data class GithubResponse(
@SerialName("login")
val login: String,
@SerialName("avatar_url")
val avatarUrl: String,
@SerialName("html_url")
val htmlUrl: String
)
}

View File

@@ -0,0 +1,55 @@
package ani.dantotsu.connections.github
import ani.dantotsu.Mapper
import ani.dantotsu.R
import ani.dantotsu.client
import ani.dantotsu.getAppString
import ani.dantotsu.settings.Developer
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonArray
import kotlinx.serialization.json.decodeFromJsonElement
class Forks {
fun getForks(): Array<Developer> {
var forks = arrayOf<Developer>()
runBlocking(Dispatchers.IO) {
val res = client.get("https://api.github.com/repos/rebelonion/Dantotsu/forks")
.parsed<JsonArray>().map {
Mapper.json.decodeFromJsonElement<GithubResponse>(it)
}
res.forEach {
forks = forks.plus(
Developer(
it.name,
it.owner.avatarUrl,
it.owner.login,
it.htmlUrl
)
)
}
}
return forks
}
@Serializable
data class GithubResponse(
@SerialName("name")
val name: String,
val owner: Owner,
@SerialName("html_url")
val htmlUrl: String,
) {
@Serializable
data class Owner(
@SerialName("login")
val login: String,
@SerialName("avatar_url")
val avatarUrl: String
)
}
}

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.view.View
import android.widget.PopupMenu
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.R
@@ -34,13 +35,15 @@ import java.util.TimeZone
import kotlin.math.abs
import kotlin.math.sqrt
class CommentItem(val comment: Comment,
private val markwon: Markwon,
val parentSection: Section,
private val commentsFragment: CommentsFragment,
private val backgroundColor: Int,
val commentDepth: Int
) : BindableItem<ItemCommentsBinding>() {
class CommentItem(
val comment: Comment,
private val markwon: Markwon,
val parentSection: Section,
private val commentsFragment: CommentsFragment,
private val backgroundColor: Int,
val commentDepth: Int
) :
BindableItem<ItemCommentsBinding>() {
lateinit var binding: ItemCommentsBinding
val adapter = GroupieAdapter()
private var subCommentIds: MutableList<Int> = mutableListOf()
@@ -62,9 +65,6 @@ class CommentItem(val comment: Comment,
val isUserComment = CommentsAPI.userId == comment.userId
val levelColor = getAvatarColor(comment.totalVotes, backgroundColor)
markwon.setMarkdown(viewBinding.commentText, comment.content)
viewBinding.commentDelete.visibility = if (isUserComment || CommentsAPI.isAdmin || CommentsAPI.isMod) View.VISIBLE else View.GONE
viewBinding.commentBanUser.visibility = if ((CommentsAPI.isAdmin || CommentsAPI.isMod) && !isUserComment) View.VISIBLE else View.GONE
viewBinding.commentReport.visibility = if (!isUserComment) View.VISIBLE else View.GONE
viewBinding.commentEdit.visibility = if (isUserComment) View.VISIBLE else View.GONE
if (comment.tag == null) {
viewBinding.commentUserTagLayout.visibility = View.GONE
@@ -140,41 +140,71 @@ class CommentItem(val comment: Comment,
}
viewBinding.modBadge.visibility = if (comment.isMod == true) View.VISIBLE else View.GONE
viewBinding.adminBadge.visibility = if (comment.isAdmin == true) View.VISIBLE else View.GONE
viewBinding.commentDelete.setOnClickListener {
dialogBuilder(getAppString(R.string.delete_comment), getAppString(R.string.delete_comment_confirm)) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.deleteComment(comment.commentId)
if (success) {
snackString(R.string.comment_deleted)
parentSection.remove(this@CommentItem)
}
}
}
}
viewBinding.commentBanUser.setOnClickListener {
dialogBuilder(getAppString(R.string.ban_user), getAppString(R.string.ban_user_confirm)) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.banUser(comment.userId)
if (success) {
snackString(R.string.user_banned)
}
}
}
}
viewBinding.commentReport.setOnClickListener {
dialogBuilder(getAppString(R.string.report_comment), getAppString(R.string.report_comment_confirm)) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.reportComment(
comment.commentId,
comment.username,
commentsFragment.mediaName,
comment.userId
)
if (success) {
snackString(R.string.comment_reported)
viewBinding.commentInfo.setOnClickListener {
val popup = PopupMenu(commentsFragment.requireContext(), viewBinding.commentInfo)
popup.menuInflater.inflate(R.menu.profile_details_menu, popup.menu)
popup.menu.findItem(R.id.commentDelete)?.isVisible = isUserComment || CommentsAPI.isAdmin || CommentsAPI.isMod
popup.menu.findItem(R.id.commentBanUser)?.isVisible = (CommentsAPI.isAdmin || CommentsAPI.isMod) && !isUserComment
popup.menu.findItem(R.id.commentReport)?.isVisible = !isUserComment
popup.setOnMenuItemClickListener { item ->
when (item.itemId) {
R.id.commentReport -> {
dialogBuilder(
getAppString(R.string.report_comment),
getAppString(R.string.report_comment_confirm)
) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.reportComment(
comment.commentId,
comment.username,
commentsFragment.mediaName,
comment.userId
)
if (success) {
snackString(R.string.comment_reported)
}
}
}
true
}
R.id.commentDelete -> {
dialogBuilder(
getAppString(R.string.delete_comment),
getAppString(R.string.delete_comment_confirm)
) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.deleteComment(comment.commentId)
if (success) {
snackString(R.string.comment_deleted)
parentSection.remove(this@CommentItem)
}
}
}
true
}
R.id.commentBanUser -> {
dialogBuilder(
getAppString(R.string.ban_user),
getAppString(R.string.ban_user_confirm)
) {
CoroutineScope(Dispatchers.Main + SupervisorJob()).launch {
val success = CommentsAPI.banUser(comment.userId)
if (success) {
snackString(R.string.user_banned)
}
}
}
true
}
else -> {
false
}
}
}
popup.show()
}
//fill the icon if the user has liked the comment
setVoteButtons(viewBinding)
@@ -210,7 +240,6 @@ class CommentItem(val comment: Comment,
comment.upvotes -= 1
}
comment.downvotes += if (voteType == -1) 1 else -1
notifyChanged()
}
}

View File

@@ -37,7 +37,18 @@ abstract class BaseImageAdapter(
chapter: MangaChapter
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
val settings = activity.defaultSettings
val images = chapter.images()
private val chapterImages = chapter.images()
var images = chapterImages
override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {
images = if (settings.layout == CurrentReaderSettings.Layouts.PAGED
&& settings.direction == CurrentReaderSettings.Directions.BOTTOM_TO_TOP) {
chapterImages.reversed()
} else {
chapterImages
}
super.onAttachedToRecyclerView(recyclerView)
}
@SuppressLint("ClickableViewAccessibility")
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
@@ -213,5 +224,4 @@ abstract class BaseImageAdapter(
return newBitmap
}
}
}

View File

@@ -129,6 +129,11 @@ class MangaReaderActivity : AppCompatActivity() {
var sliding = false
var isAnimating = false
private val directionRLBT get() = defaultSettings.direction == RIGHT_TO_LEFT
|| defaultSettings.direction == BOTTOM_TO_TOP
private val directionPagedBT get() = defaultSettings.layout == CurrentReaderSettings.Layouts.PAGED
&& defaultSettings.direction == CurrentReaderSettings.Directions.BOTTOM_TO_TOP
override fun onAttachedToWindow() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && !PrefManager.getVal<Boolean>(PrefName.ShowSystemBars)) {
val displayCutout = window.decorView.rootWindowInsets.displayCutout
@@ -224,8 +229,13 @@ class MangaReaderActivity : AppCompatActivity() {
binding.mangaReaderRecycler.scrollToPosition((value.toInt() - 1) / (dualPage { 2 }
?: 1))
else
binding.mangaReaderPager.currentItem =
(value.toInt() - 1) / (dualPage { 2 } ?: 1)
if (defaultSettings.direction == CurrentReaderSettings.Directions.BOTTOM_TO_TOP ) {
binding.mangaReaderPager.currentItem =
(maxChapterPage.toInt() - value.toInt()) / (dualPage { 2 } ?: 1)
} else {
binding.mangaReaderPager.currentItem =
(value.toInt() - 1) / (dualPage { 2 } ?: 1)
}
pageSliderHide()
}
}
@@ -331,7 +341,7 @@ class MangaReaderActivity : AppCompatActivity() {
binding.mangaReaderNextChapter.performClick()
}
binding.mangaReaderNextChapter.setOnClickListener {
if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP) {
if (directionRLBT) {
if (currentChapterIndex > 0) change(currentChapterIndex - 1)
else snackString(getString(R.string.first_chapter))
} else {
@@ -344,7 +354,7 @@ class MangaReaderActivity : AppCompatActivity() {
binding.mangaReaderPreviousChapter.performClick()
}
binding.mangaReaderPreviousChapter.setOnClickListener {
if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP) {
if (directionRLBT) {
if (chaptersArr.size > currentChapterIndex + 1) progress { change(currentChapterIndex + 1) }
else snackString(getString(R.string.next_chapter_not_found))
} else {
@@ -361,7 +371,7 @@ class MangaReaderActivity : AppCompatActivity() {
PrefManager.setCustomVal("${media.id}_current_chp", chap.number)
currentChapterIndex = chaptersArr.indexOf(chap.number)
binding.mangaReaderChapterSelect.setSelection(currentChapterIndex)
if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP) {
if (directionRLBT) {
binding.mangaReaderNextChap.text = chaptersTitleArr.getOrNull(currentChapterIndex - 1) ?: ""
binding.mangaReaderPrevChap.text = chaptersTitleArr.getOrNull(currentChapterIndex + 1) ?: ""
} else {
@@ -459,7 +469,11 @@ class MangaReaderActivity : AppCompatActivity() {
currentChapterPage = PrefManager.getCustomVal("${media.id}_${chapter.number}", 1L)
val chapImages = chapter.images()
val chapImages = if (directionPagedBT) {
chapter.images().reversed()
} else {
chapter.images()
}
maxChapterPage = 0
if (chapImages.isNotEmpty()) {
@@ -483,7 +497,11 @@ class MangaReaderActivity : AppCompatActivity() {
}
val currentPage = currentChapterPage.toInt()
val currentPage = if (directionPagedBT) {
maxChapterPage - currentChapterPage + 1
} else {
currentChapterPage
}.toInt()
if ((defaultSettings.direction == TOP_TO_BOTTOM || defaultSettings.direction == BOTTOM_TO_TOP)) {
binding.mangaReaderSwipy.vertical = true
@@ -512,10 +530,10 @@ class MangaReaderActivity : AppCompatActivity() {
binding.TopSwipeText.text = chaptersTitleArr.getOrNull(currentChapterIndex + 1)
?: getString(R.string.no_chapter)
binding.mangaReaderSwipy.onTopSwiped = {
binding.mangaReaderNextChapter.performClick()
binding.mangaReaderPreviousChapter.performClick()
}
binding.mangaReaderSwipy.onBottomSwiped = {
binding.mangaReaderPreviousChapter.performClick()
binding.mangaReaderNextChapter.performClick()
}
}
binding.mangaReaderSwipy.topBeingSwiped = { value ->
@@ -624,7 +642,7 @@ class MangaReaderActivity : AppCompatActivity() {
RecyclerView.VERTICAL
else
RecyclerView.HORIZONTAL,
!(defaultSettings.direction == TOP_TO_BOTTOM || defaultSettings.direction == LEFT_TO_RIGHT)
directionRLBT
)
manager.preloadItemCount = 5
@@ -641,6 +659,8 @@ class MangaReaderActivity : AppCompatActivity() {
else false
}
manager.setStackFromEnd(defaultSettings.direction == BOTTOM_TO_TOP)
addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(v: RecyclerView, dx: Int, dy: Int) {
defaultSettings.apply {
@@ -695,9 +715,7 @@ class MangaReaderActivity : AppCompatActivity() {
visibility = View.VISIBLE
adapter = imageAdapter
layoutDirection =
if (defaultSettings.direction == BOTTOM_TO_TOP || defaultSettings.direction == RIGHT_TO_LEFT)
View.LAYOUT_DIRECTION_RTL
else View.LAYOUT_DIRECTION_LTR
if (directionRLBT) View.LAYOUT_DIRECTION_RTL else View.LAYOUT_DIRECTION_LTR
orientation =
if (defaultSettings.direction == LEFT_TO_RIGHT || defaultSettings.direction == RIGHT_TO_LEFT)
ViewPager2.ORIENTATION_HORIZONTAL
@@ -786,7 +804,7 @@ class MangaReaderActivity : AppCompatActivity() {
val screenWidth = Resources.getSystem().displayMetrics.widthPixels
//if in the 1st 1/5th of the screen width, left and lower than 1/5th of the screen height, left
if (screenWidth / 5 in x + 1..<y) {
pressLocation = if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP) {
pressLocation = if (defaultSettings.direction == RIGHT_TO_LEFT) {
PressPos.RIGHT
} else {
PressPos.LEFT
@@ -794,7 +812,7 @@ class MangaReaderActivity : AppCompatActivity() {
}
//if in the last 1/5th of the screen width, right and lower than 1/5th of the screen height, right
else if (x > screenWidth - screenWidth / 5 && y > screenWidth / 5) {
pressLocation = if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP) {
pressLocation = if (defaultSettings.direction == RIGHT_TO_LEFT) {
PressPos.LEFT
} else {
PressPos.RIGHT
@@ -890,9 +908,10 @@ class MangaReaderActivity : AppCompatActivity() {
}
}
binding.mangaReaderSlider.layoutDirection =
if (defaultSettings.direction == RIGHT_TO_LEFT || defaultSettings.direction == BOTTOM_TO_TOP)
if (directionRLBT)
View.LAYOUT_DIRECTION_RTL
else View.LAYOUT_DIRECTION_LTR
else
View.LAYOUT_DIRECTION_LTR
shouldShow?.apply { isContVisible = !this }
if (isContVisible) {
isContVisible = false
@@ -900,12 +919,7 @@ class MangaReaderActivity : AppCompatActivity() {
isAnimating = true
ObjectAnimator.ofFloat(binding.mangaReaderCont, "alpha", 1f, 0f)
.setDuration(controllerDuration).start()
ObjectAnimator.ofFloat(
binding.mangaReaderBottomLayout,
"translationY",
0f,
128f
)
ObjectAnimator.ofFloat(binding.mangaReaderBottomLayout, "translationY", 0f, 128f)
.apply { interpolator = overshoot;duration = controllerDuration;start() }
ObjectAnimator.ofFloat(binding.mangaReaderTopLayout, "translationY", 0f, -128f)
.apply { interpolator = overshoot;duration = controllerDuration;start() }
@@ -925,7 +939,11 @@ class MangaReaderActivity : AppCompatActivity() {
}
private var loading = false
fun updatePageNumber(page: Long) {
fun updatePageNumber(pageNumber: Long) {
var page = pageNumber
if (directionPagedBT) {
page = maxChapterPage - pageNumber + 1
}
if (currentChapterPage != page) {
currentChapterPage = page
PrefManager.setCustomVal("${media.id}_${chapter.number}", page)
@@ -1090,4 +1108,4 @@ class MangaReaderActivity : AppCompatActivity() {
}
return true
}
}
}

View File

@@ -1,14 +1,13 @@
package ani.dantotsu.profile.activity
package ani.dantotsu.profile
import android.content.Intent
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.profile.ProfileActivity
import ani.dantotsu.profile.User
import ani.dantotsu.setAnimation
@@ -41,7 +40,7 @@ class UsersAdapter(private val user: ArrayList<User>) : RecyclerView.Adapter<Use
setAnimation(b.root.context, b.root)
val user = user[position]
b.profileUserAvatar.loadImage(user.pfp)
b.profileBannerImage.loadImage(user.banner)
blurImage(b.profileBannerImage, user.banner ?: user.pfp)
b.profileUserName.text = user.name
}

View File

@@ -7,8 +7,6 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.databinding.BottomSheetUsersBinding
import ani.dantotsu.profile.activity.UsersAdapter
import ani.dantotsu.settings.DevelopersAdapter
class UsersDialogFragment : BottomSheetDialogFragment() {

View File

@@ -6,63 +6,13 @@ import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.connections.github.Contributors
import ani.dantotsu.databinding.BottomSheetDevelopersBinding
class DevelopersDialogFragment : BottomSheetDialogFragment() {
private var _binding: BottomSheetDevelopersBinding? = null
private val binding get() = _binding!!
private val developers = arrayOf(
Developer(
"rebelonion",
"https://avatars.githubusercontent.com/u/87634197?v=4",
"Owner and Maintainer",
"https://github.com/rebelonion"
),
Developer(
"Aayush262",
"https://avatars.githubusercontent.com/u/99584765?v=4",
"Contributor",
"https://github.com/aayush2622"
),
Developer(
"AbandonedCart",
"https://avatars.githubusercontent.com/u/1173913?v=4",
"Contributor",
"https://github.com/AbandonedCart"
),
Developer(
"Sadwhy",
"https://avatars.githubusercontent.com/u/99601717?v=4",
"Contributor",
"https://github.com/Sadwhy"
),
Developer(
"Wai What",
"https://avatars.githubusercontent.com/u/149729762?v=4",
"Icon Designer",
"https://github.com/WaiWhat"
),
Developer(
"MarshMeadow",
"https://avatars.githubusercontent.com/u/88599122?v=4",
"Beta Icon Designer",
"https://github.com/MarshMeadow?tab=repositories"
),
Developer(
"Zaxx69",
"https://avatars.githubusercontent.com/u/138523882?v=4",
"Telegram Admin",
"https://github.com/Zaxx69"
),
Developer(
"Arif Alam",
"https://avatars.githubusercontent.com/u/70383209?v=4",
"Head Discord Moderator",
"https://youtube.com/watch?v=dQw4w9WgXcQ"
),
)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
@@ -74,7 +24,7 @@ class DevelopersDialogFragment : BottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.devsRecyclerView.adapter = DevelopersAdapter(developers)
binding.devsRecyclerView.adapter = DevelopersAdapter(Contributors().getContributors())
binding.devsRecyclerView.layoutManager = LinearLayoutManager(requireContext())
}

View File

@@ -1,22 +1,14 @@
package ani.dantotsu.settings
import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.RadioButton
import android.widget.RadioGroup
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.R
import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.databinding.BottomSheetDiscordRpcBinding
import ani.dantotsu.profile.activity.UsersAdapter
import ani.dantotsu.settings.saving.PrefManager
import ani.dantotsu.settings.saving.PrefName
import com.google.android.material.bottomsheet.BottomSheetDialog
class DiscordDialogFragment: BottomSheetDialogFragment() {
private var _binding: BottomSheetDiscordRpcBinding? = null

View File

@@ -7,21 +7,13 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.R
import ani.dantotsu.connections.github.Forks
import ani.dantotsu.databinding.BottomSheetDevelopersBinding
class ForksDialogFragment : BottomSheetDialogFragment() {
private var _binding: BottomSheetDevelopersBinding? = null
private val binding get() = _binding!!
private val developers = arrayOf(
Developer(
"Dantotsu",
"https://avatars.githubusercontent.com/u/87634197?v=4",
"rebelonion",
"https://github.com/rebelonion/Dantotsu"
),
)
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
@@ -34,7 +26,7 @@ class ForksDialogFragment : BottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.devsTitle.setText(R.string.forks)
binding.devsRecyclerView.adapter = DevelopersAdapter(developers)
binding.devsRecyclerView.adapter = DevelopersAdapter(Forks().getForks())
binding.devsRecyclerView.layoutManager = LinearLayoutManager(requireContext())
}

View File

@@ -29,6 +29,7 @@ import androidx.annotation.OptIn
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import android.view.HapticFeedbackConstants
import androidx.core.view.ViewCompat.performHapticFeedback
import androidx.core.view.updateLayoutParams
import androidx.documentfile.provider.DocumentFile
import androidx.lifecycle.lifecycleScope
@@ -219,6 +220,12 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
settingsAnilistUsername.visibility = View.VISIBLE
settingsAnilistUsername.text = Anilist.username
settingsAnilistAvatar.loadImage(Anilist.avatar)
settingsAnilistAvatar.setOnClickListener {
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
val anilistLink = getString(R.string.anilist_link, PrefManager.getVal<String>(PrefName.AnilistUserName))
openLinkInBrowser(anilistLink)
true
}
settingsMALLoginRequired.visibility = View.GONE
settingsMALLogin.visibility = View.VISIBLE
@@ -234,6 +241,12 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
settingsMALUsername.visibility = View.VISIBLE
settingsMALUsername.text = MAL.username
settingsMALAvatar.loadImage(MAL.avatar)
settingsMALAvatar.setOnClickListener {
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
val myanilistLink = getString(R.string.myanilist_link, MAL.username)
openLinkInBrowser(myanilistLink)
true
}
} else {
settingsMALAvatar.setImageResource(R.drawable.ic_round_person_24)
settingsMALUsername.visibility = View.GONE
@@ -260,6 +273,12 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
val username = PrefManager.getVal(PrefName.DiscordUserName, null as String?)
if (id != null && avatar != null) {
settingsDiscordAvatar.loadImage("https://cdn.discordapp.com/avatars/$id/$avatar.png")
settingsDiscordAvatar.setOnClickListener {
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
val discordLink = getString(R.string.discord_link, id)
openLinkInBrowser(discordLink)
true
}
}
settingsDiscordUsername.visibility = View.VISIBLE
settingsDiscordUsername.text =
@@ -651,18 +670,18 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
val filteredLocations = Location.entries.filter { it.exportable }
selectedArray.addAll(List(filteredLocations.size - 1) { false })
val dialog = AlertDialog.Builder(this@SettingsActivity, R.style.MyPopup)
.setTitle(R.string.import_export_settings)
.setTitle(R.string.backup_restore)
.setMultiChoiceItems(
filteredLocations.map { it.name }.toTypedArray(),
selectedArray.toBooleanArray()
) { _, which, isChecked ->
selectedArray[which] = isChecked
}
.setPositiveButton(R.string.button_import) { dialog, _ ->
.setPositiveButton(R.string.button_restore) { dialog, _ ->
openDocumentLauncher.launch(arrayOf("*/*"))
dialog.dismiss()
}
.setNegativeButton(R.string.button_export) { dialog, _ ->
.setNegativeButton(R.string.button_backup) { dialog, _ ->
if (!selectedArray.contains(true)) {
toast(R.string.no_location_selected)
return@setNegativeButton

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,600Q530,600 565,565Q600,530 600,480Q600,430 565,395Q530,360 480,360Q430,360 395,395Q360,430 360,480Q360,530 395,565Q430,600 480,600ZM480,880Q397,880 324,848.5Q251,817 197,763Q143,709 111.5,636Q80,563 80,480Q80,397 111.5,324Q143,251 197,197Q251,143 324,111.5Q397,80 480,80Q563,80 636,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,480Q880,563 848.5,636Q817,709 763,763Q709,817 636,848.5Q563,880 480,880ZM480,800Q614,800 707,707Q800,614 800,480Q800,346 707,253Q614,160 480,160Q346,160 253,253Q160,346 160,480Q160,614 253,707Q346,800 480,800ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M480,560Q447,560 423.5,536.5Q400,513 400,480Q400,447 423.5,423.5Q447,400 480,400Q513,400 536.5,423.5Q560,447 560,480Q560,513 536.5,536.5Q513,560 480,560ZM480,840Q341,840 239,748.5Q137,657 122,520L204,520Q218,624 296.5,692Q375,760 480,760Q597,760 678.5,678.5Q760,597 760,480Q760,363 678.5,281.5Q597,200 480,200Q411,200 351,232Q291,264 250,320L360,320L360,400L120,400L120,160L200,160L200,254Q251,190 324.5,155Q398,120 480,120Q555,120 620.5,148.5Q686,177 734.5,225.5Q783,274 811.5,339.5Q840,405 840,480Q840,555 811.5,620.5Q783,686 734.5,734.5Q686,783 620.5,811.5Q555,840 480,840Z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M120,580Q112,580 106,574Q100,568 100,560Q100,552 106,546Q112,540 120,540Q128,540 134,546Q140,552 140,560Q140,568 134,574Q128,580 120,580ZM120,420Q112,420 106,414Q100,408 100,400Q100,392 106,386Q112,380 120,380Q128,380 134,386Q140,392 140,400Q140,408 134,414Q128,420 120,420ZM240,760Q223,760 211.5,748.5Q200,737 200,720Q200,703 211.5,691.5Q223,680 240,680Q257,680 268.5,691.5Q280,703 280,720Q280,737 268.5,748.5Q257,760 240,760ZM240,600Q223,600 211.5,588.5Q200,577 200,560Q200,543 211.5,531.5Q223,520 240,520Q257,520 268.5,531.5Q280,543 280,560Q280,577 268.5,588.5Q257,600 240,600ZM240,440Q223,440 211.5,428.5Q200,417 200,400Q200,383 211.5,371.5Q223,360 240,360Q257,360 268.5,371.5Q280,383 280,400Q280,417 268.5,428.5Q257,440 240,440ZM240,280Q223,280 211.5,268.5Q200,257 200,240Q200,223 211.5,211.5Q223,200 240,200Q257,200 268.5,211.5Q280,223 280,240Q280,257 268.5,268.5Q257,280 240,280ZM400,620Q375,620 357.5,602.5Q340,585 340,560Q340,535 357.5,517.5Q375,500 400,500Q425,500 442.5,517.5Q460,535 460,560Q460,585 442.5,602.5Q425,620 400,620ZM400,460Q375,460 357.5,442.5Q340,425 340,400Q340,375 357.5,357.5Q375,340 400,340Q425,340 442.5,357.5Q460,375 460,400Q460,425 442.5,442.5Q425,460 400,460ZM400,760Q383,760 371.5,748.5Q360,737 360,720Q360,703 371.5,691.5Q383,680 400,680Q417,680 428.5,691.5Q440,703 440,720Q440,737 428.5,748.5Q417,760 400,760ZM400,280Q383,280 371.5,268.5Q360,257 360,240Q360,223 371.5,211.5Q383,200 400,200Q417,200 428.5,211.5Q440,223 440,240Q440,257 428.5,268.5Q417,280 400,280ZM400,860Q392,860 386,854Q380,848 380,840Q380,832 386,826Q392,820 400,820Q408,820 414,826Q420,832 420,840Q420,848 414,854Q408,860 400,860ZM400,140Q392,140 386,134Q380,128 380,120Q380,112 386,106Q392,100 400,100Q408,100 414,106Q420,112 420,120Q420,128 414,134Q408,140 400,140ZM560,620Q535,620 517.5,602.5Q500,585 500,560Q500,535 517.5,517.5Q535,500 560,500Q585,500 602.5,517.5Q620,535 620,560Q620,585 602.5,602.5Q585,620 560,620ZM560,460Q535,460 517.5,442.5Q500,425 500,400Q500,375 517.5,357.5Q535,340 560,340Q585,340 602.5,357.5Q620,375 620,400Q620,425 602.5,442.5Q585,460 560,460ZM560,760Q543,760 531.5,748.5Q520,737 520,720Q520,703 531.5,691.5Q543,680 560,680Q577,680 588.5,691.5Q600,703 600,720Q600,737 588.5,748.5Q577,760 560,760ZM560,280Q543,280 531.5,268.5Q520,257 520,240Q520,223 531.5,211.5Q543,200 560,200Q577,200 588.5,211.5Q600,223 600,240Q600,257 588.5,268.5Q577,280 560,280ZM560,860Q552,860 546,854Q540,848 540,840Q540,832 546,826Q552,820 560,820Q568,820 574,826Q580,832 580,840Q580,848 574,854Q568,860 560,860ZM560,140Q552,140 546,134Q540,128 540,120Q540,112 546,106Q552,100 560,100Q568,100 574,106Q580,112 580,120Q580,128 574,134Q568,140 560,140ZM720,760Q703,760 691.5,748.5Q680,737 680,720Q680,703 691.5,691.5Q703,680 720,680Q737,680 748.5,691.5Q760,703 760,720Q760,737 748.5,748.5Q737,760 720,760ZM720,600Q703,600 691.5,588.5Q680,577 680,560Q680,543 691.5,531.5Q703,520 720,520Q737,520 748.5,531.5Q760,543 760,560Q760,577 748.5,588.5Q737,600 720,600ZM720,440Q703,440 691.5,428.5Q680,417 680,400Q680,383 691.5,371.5Q703,360 720,360Q737,360 748.5,371.5Q760,383 760,400Q760,417 748.5,428.5Q737,440 720,440ZM720,280Q703,280 691.5,268.5Q680,257 680,240Q680,223 691.5,211.5Q703,200 720,200Q737,200 748.5,211.5Q760,223 760,240Q760,257 748.5,268.5Q737,280 720,280ZM840,580Q832,580 826,574Q820,568 820,560Q820,552 826,546Q832,540 840,540Q848,540 854,546Q860,552 860,560Q860,568 854,574Q848,580 840,580ZM840,420Q832,420 826,414Q820,408 820,400Q820,392 826,386Q832,380 840,380Q848,380 854,386Q860,392 860,400Q860,408 854,414Q848,420 840,420Z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480Q480,480 480,480Q480,480 480,480L480,480ZM80,680Q130,680 165,715Q200,750 200,800L80,800L80,680ZM80,520Q197,520 278.5,601.5Q360,683 360,800L280,800Q280,717 221.5,658.5Q163,600 80,600L80,520ZM80,360Q171,360 251,394.5Q331,429 391,489Q451,549 485.5,629Q520,709 520,800L440,800Q440,725 411.5,659.5Q383,594 334.5,545.5Q286,497 220.5,468.5Q155,440 80,440L80,360ZM800,800L600,800Q600,780 598.5,760Q597,740 594,720L800,720Q800,720 800,720Q800,720 800,720L800,508Q822,501 842,491.5Q862,482 880,469L880,720Q880,753 856.5,776.5Q833,800 800,800ZM80,280L80,240Q80,207 103.5,183.5Q127,160 160,160L452,160Q446,179 443,199Q440,219 440,240L160,240Q160,240 160,240Q160,240 160,240L160,286Q140,283 120,281.5Q100,280 80,280ZM720,440Q637,440 578.5,381.5Q520,323 520,240Q520,157 578.5,98.5Q637,40 720,40Q803,40 861.5,98.5Q920,157 920,240Q920,323 861.5,381.5Q803,440 720,440ZM720,360Q728,360 734,354Q740,348 740,340Q740,332 734,326Q728,320 720,320Q712,320 706,326Q700,332 700,340Q700,348 706,354Q712,360 720,360ZM700,280L740,280L740,120L700,120L700,280Z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M480,560L40,320L480,80L920,320L480,560ZM480,720L63,493L147,447L480,629L813,447L897,493L480,720ZM480,880L63,653L147,607L480,789L813,607L897,653L480,880ZM480,469L753,320L480,171L207,320L480,469ZM480,320L480,320L480,320L480,320L480,320Z"/>
</vector>

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M600,680Q527,680 472.5,634.5Q418,589 404,520L160,520L160,440L404,440Q409,417 417.5,397Q426,377 440,360L240,360L240,280L600,280Q683,280 741.5,338.5Q800,397 800,480Q800,563 741.5,621.5Q683,680 600,680ZM600,600Q650,600 685,565Q720,530 720,480Q720,430 685,395Q650,360 600,360Q550,360 515,395Q480,430 480,480Q480,530 515,565Q550,600 600,600ZM280,680L280,600L400,600L400,680L280,680ZM600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Q600,480 600,480Z"/>
</vector>

View File

@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M360,720L800,720Q800,720 800,720Q800,720 800,720L800,613L360,613L360,720ZM160,347L280,347L280,240L160,240Q160,240 160,240Q160,240 160,240L160,347ZM160,534L280,534L280,427L160,427L160,534ZM160,720L280,720L280,613L160,613L160,720Q160,720 160,720Q160,720 160,720ZM360,534L800,534L800,427L360,427L360,534ZM360,347L800,347L800,240Q800,240 800,240Q800,240 800,240L360,240L360,347ZM160,800Q127,800 103.5,776.5Q80,753 80,720L80,240Q80,207 103.5,183.5Q127,160 160,160L800,160Q833,160 856.5,183.5Q880,207 880,240L880,720Q880,753 856.5,776.5Q833,800 800,800L160,800Z"/>
</vector>

View File

@@ -1162,7 +1162,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="false"
android:drawableStart="@drawable/ic_round_cast_24"
android:drawableStart="@drawable/cast_warning"
android:drawablePadding="16dp"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
@@ -1215,4 +1215,4 @@
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>

View File

@@ -199,7 +199,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:drawableStart="@drawable/ic_round_movie_filter_24"
android:drawableStart="@drawable/view_list_24"
android:drawablePadding="16dp"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"

View File

@@ -173,12 +173,12 @@
android:insetBottom="0dp"
android:paddingStart="31dp"
android:paddingEnd="31dp"
android:text="@string/import_export_settings"
android:text="@string/backup_restore"
android:textAlignment="viewStart"
android:textAllCaps="false"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:icon="@drawable/ic_download_24"
app:icon="@drawable/backup_restore"
app:iconPadding="16dp"
app:iconSize="24dp"
app:iconTint="?attr/colorPrimary" />

View File

@@ -163,7 +163,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="false"
android:drawableStart="@drawable/ic_round_movie_filter_24"
android:drawableStart="@drawable/view_list_24"
android:drawablePadding="16dp"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"

View File

@@ -240,7 +240,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="true"
android:drawableStart="@drawable/ic_round_animation_24"
android:drawableStart="@drawable/trail_length_short"
android:drawablePadding="16dp"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
@@ -302,7 +302,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:drawableStart="@drawable/ic_round_photo_size_select_actual_24"
android:drawableStart="@drawable/blur_on"
android:drawablePadding="16dp"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
@@ -328,7 +328,7 @@
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/radius"
app:drawableStartCompat="@drawable/ic_internet"
app:drawableStartCompat="@drawable/adjust"
app:drawableTint="?attr/colorPrimary" />
<com.google.android.material.slider.Slider
@@ -357,7 +357,7 @@
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/sampling"
app:drawableStartCompat="@drawable/ic_globe_24"
app:drawableStartCompat="@drawable/stacks"
app:drawableTint="?attr/colorPrimary" />
<com.google.android.material.slider.Slider

View File

@@ -102,7 +102,7 @@
android:clickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/import_settings_underline"
android:text="@string/restore_settings_underline"
android:textSize="11sp"
android:textColor="?attr/colorOutline"
android:fontFamily="@font/poppins_bold"/>

View File

@@ -5,30 +5,39 @@
android:id="@+id/commentsCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginHorizontal="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="4dp">
<LinearLayout
android:id="@+id/linearLayout5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="0dp"
android:paddingEnd="8dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/commentUserAvatar"
style="@style/CircularImageView"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_gravity="center_horizontal"
<com.google.android.material.card.MaterialCardView
android:id="@+id/commentUserAvatarContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
android:backgroundTint="@color/transparent"
app:cardCornerRadius="64dp"
app:strokeColor="@color/transparent">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/commentUserAvatar"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_gravity="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck"
tools:tint="@color/bg_black_50" />
</com.google.android.material.card.MaterialCardView>
<LinearLayout
@@ -80,7 +89,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:ellipsize="end"
android:fontFamily="@font/poppins_semi_bold"
android:fontFamily="@font/poppins_bold"
android:paddingTop="1dp"
android:paddingBottom="0dp"
android:singleLine="true"
@@ -160,86 +169,116 @@
android:textSize="12sp"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/linearLayout7"
app:layout_constraintHeight_max="200dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/linearLayout5"
app:layout_constraintTop_toBottomOf="@+id/commentUserDetailsLayout" />
<TextView
android:id="@+id/commentReply"
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="1dp"
android:paddingEnd="12dp"
android:text="Reply"
android:textSize="12sp"
android:layout_marginStart="52dp"
android:orientation="horizontal"
app:layout_constraintStart_toEndOf="@+id/linearLayout5"
app:layout_constraintTop_toBottomOf="@+id/commentText"
tools:ignore="HardcodedText" />
app:layout_constraintTop_toBottomOf="@+id/commentText">
<TextView
android:id="@+id/commentEdit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="1dp"
android:paddingEnd="12dp"
android:text="Edit"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentReply"
app:layout_constraintStart_toEndOf="@+id/commentReply"
tools:ignore="HardcodedText" />
<View
android:id="@+id/commentRepliesDivider"
android:layout_width="24dp"
android:layout_height="3dp"
android:layout_gravity="center"
android:layout_marginStart="4dp"
android:background="@color/nav_tab" />
<TextView
android:id="@+id/commentDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="1dp"
android:paddingEnd="12dp"
android:text="Delete"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentEdit"
app:layout_constraintStart_toEndOf="@+id/commentEdit"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/commentTotalReplies"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:layout_marginStart="4dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:text="View replies"
android:textSize="12sp"
tools:ignore="HardcodedText" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<TextView
android:id="@+id/commentReport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="1dp"
android:paddingEnd="12dp"
android:text="Report"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentDelete"
app:layout_constraintStart_toEndOf="@+id/commentDelete"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentInfo"
android:layout_width="24dp"
android:layout_height="24dp"
android:alpha="0.6"
android:layout_marginEnd="16dp"
app:srcCompat="@drawable/ic_round_dots_vertical_24"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/commentBanUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="1dp"
android:text="Ban User"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentReport"
app:layout_constraintStart_toEndOf="@+id/commentReport"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/commentReply"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:gravity="center"
android:text="Reply"
android:textSize="12sp"
app:layout_constraintStart_toEndOf="@+id/commentDownVote"
app:layout_constraintTop_toBottomOf="@+id/commentText"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/commentEdit"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="12dp"
android:alpha="0.6"
android:gravity="center"
android:fontFamily="@font/poppins_semi_bold"
android:text="Edit"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentReply"
app:layout_constraintStart_toEndOf="@+id/commentReply"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentUpVote"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:alpha="0.6"
android:padding="2dp"
app:srcCompat="@drawable/ic_round_upvote_inactive_24"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/commentTotalVotes"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:gravity="center"
android:text="100"
android:textSize="12sp"
app:layout_constraintStart_toEndOf="@+id/commentUpVote"
app:layout_constraintTop_toBottomOf="@+id/commentText"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentDownVote"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="4dp"
android:alpha="0.6"
android:padding="2dp"
android:rotation="180"
app:layout_constraintStart_toEndOf="@+id/commentTotalVotes"
app:layout_constraintTop_toBottomOf="@+id/commentText"
app:srcCompat="@drawable/ic_round_upvote_inactive_24"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout7"
@@ -251,60 +290,10 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/commentUpVote"
android:layout_width="24dp"
android:layout_height="24dp"
android:alpha="0.4"
app:srcCompat="@drawable/ic_round_upvote_inactive_24"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/commentTotalVotes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:alpha="0.6"
android:fontFamily="@font/poppins_semi_bold"
android:text="100"
android:textSize="12sp"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentDownVote"
android:layout_width="24dp"
android:layout_height="24dp"
android:alpha="0.4"
android:rotation="180"
app:srcCompat="@drawable/ic_round_upvote_inactive_24"
tools:ignore="ContentDescription" />
</LinearLayout>
<View
android:id="@+id/commentRepliesDivider"
android:layout_width="32dp"
android:layout_height="3dp"
android:layout_gravity="center"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
android:background="@color/nav_tab"
app:layout_constraintStart_toEndOf="@+id/linearLayout5"
app:layout_constraintTop_toBottomOf="@+id/commentReply" />
<TextView
android:id="@+id/commentTotalReplies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:alpha="0.8"
android:fontFamily="@font/poppins_semi_bold"
android:text="View replies"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="@+id/commentRepliesDivider"
app:layout_constraintStart_toEndOf="@+id/commentRepliesDivider"
app:layout_constraintTop_toTopOf="@+id/commentRepliesDivider"
tools:ignore="HardcodedText" />
<androidx.recyclerview.widget.RecyclerView
@@ -314,8 +303,8 @@
android:nestedScrollingEnabled="false"
android:paddingStart="16dp"
android:visibility="visible"
app:layout_constraintTop_toBottomOf="@+id/commentRepliesDivider"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6"
tools:ignore="RtlSymmetry"
tools:visibility="visible" />
tools:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/commentDelete"
android:enabled="true"
android:icon="@drawable/ic_round_comment_24"
android:title="@string/delete" />
<item
android:id="@+id/commentReport"
android:enabled="true"
android:icon="@drawable/ic_round_info_24"
android:title="@string/report" />
<item
android:id="@+id/commentBanUser"
android:enabled="true"
android:icon="@drawable/ic_round_comment_24"
android:title="@string/ban" />
</menu>

View File

@@ -16,6 +16,7 @@
<string name="coffee" translatable="false">https://www.buymeacoffee.com/rebelonion</string>
<string name="anilist_link">https://anilist.co/user/%1$s/</string>
<string name="myanilist_link">https://myanimelist.net/profile/%1$s/</string>
<string name="discord_link">https://discord.com/users/%1$s/</string>
<string name="home">Home</string>
@@ -714,9 +715,9 @@
<string name="requires_android_12">Requires Android 12+</string>
<string name="share_username_in_crash_reports">Share username in crash reports</string>
<string name="pinned_sources">Pinned Sources</string>
<string name="import_export_settings">Import/Export Settings</string>
<string name="import_settings">Import Settings</string>
<string name="import_settings_underline"><u>Import Settings</u></string>
<string name="backup_restore">Backup and Restore</string>
<string name="restore_settings">Import Settings</string>
<string name="restore_settings_underline"><u>Restore Settings</u></string>
<string name="try_internal_cast_experimental">Try Internal Cast (Experimental)</string>
<string name="comments">Comments</string>
@@ -831,8 +832,8 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="video_quality">Quality: %1$dp</string>
<string name="size_unknown">Unknown Size</string>
<string name="mb_size">%1$s MB</string>
<string name="button_import">Import…</string>
<string name="button_export">Export…</string>
<string name="button_restore">Restore</string>
<string name="button_backup">Backup</string>
<string name="no_location_selected">No location selected</string>
<string name="enjoying_app">Enjoying the App?</string>
<string name="consider_donating">Consider donating!</string>
@@ -872,4 +873,6 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="dir_access_msg">Please choose a directory to save your downloads</string>
<string name="change_download_location">Change Download Location</string>
<string name="download_location_msg">Are you sure you want to change the download location?\nOld downloads may no longer be accessible.</string>
<string name="report">Report</string>
<string name="ban">Ban</string>
</resources>