commit
1d4257b1b3
33 changed files with 467 additions and 112 deletions
|
@ -13,27 +13,33 @@ import kotlinx.coroutines.launch
|
|||
import kotlin.math.roundToInt
|
||||
|
||||
fun updateProgress(media: Media, number: String) {
|
||||
if (Anilist.userid != null) {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val a = number.toFloatOrNull()?.roundToInt()
|
||||
if ((a ?: 0) > (media.userProgress ?: 0)) {
|
||||
Anilist.mutation.editList(
|
||||
media.id,
|
||||
a,
|
||||
status = if (media.userStatus == "REPEATING") media.userStatus else "CURRENT"
|
||||
)
|
||||
MAL.query.editList(
|
||||
media.idMAL,
|
||||
media.anime != null,
|
||||
a, null,
|
||||
if (media.userStatus == "REPEATING") media.userStatus!! else "CURRENT"
|
||||
)
|
||||
toast(currContext()?.getString(R.string.setting_progress, a))
|
||||
val incognito = currContext()?.getSharedPreferences("Dantotsu", 0)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
if (!incognito) {
|
||||
if (Anilist.userid != null) {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
val a = number.toFloatOrNull()?.toInt()
|
||||
if ((a ?: 0) > (media.userProgress ?: 0)) {
|
||||
Anilist.mutation.editList(
|
||||
media.id,
|
||||
a,
|
||||
status = if (media.userStatus == "REPEATING") media.userStatus else "CURRENT"
|
||||
)
|
||||
MAL.query.editList(
|
||||
media.idMAL,
|
||||
media.anime != null,
|
||||
a, null,
|
||||
if (media.userStatus == "REPEATING") media.userStatus!! else "CURRENT"
|
||||
)
|
||||
toast(currContext()?.getString(R.string.setting_progress, a))
|
||||
}
|
||||
media.userProgress = a
|
||||
Refresh.all()
|
||||
}
|
||||
media.userProgress = a
|
||||
Refresh.all()
|
||||
} else {
|
||||
toast(currContext()?.getString(R.string.login_anilist_account))
|
||||
}
|
||||
} else {
|
||||
toast(currContext()?.getString(R.string.login_anilist_account))
|
||||
toast("Sneaky sneaky :3")
|
||||
}
|
||||
}
|
|
@ -69,11 +69,75 @@ class DownloadsManager(private val context: Context) {
|
|||
}
|
||||
} else {
|
||||
Toast.makeText(context, "Directory does not exist", Toast.LENGTH_SHORT).show()
|
||||
cleanDownloads()
|
||||
}
|
||||
downloadsList.removeAll { it.title == title }
|
||||
saveDownloads()
|
||||
}
|
||||
|
||||
private fun cleanDownloads() {
|
||||
cleanDownload(Download.Type.MANGA)
|
||||
cleanDownload(Download.Type.ANIME)
|
||||
cleanDownload(Download.Type.NOVEL)
|
||||
}
|
||||
|
||||
private fun cleanDownload(type: Download.Type) {
|
||||
// remove all folders that are not in the downloads list
|
||||
val subDirectory = if (type == Download.Type.MANGA) {
|
||||
"Manga"
|
||||
} else if (type == Download.Type.ANIME) {
|
||||
"Anime"
|
||||
} else {
|
||||
"Novel"
|
||||
}
|
||||
val directory = File(
|
||||
context.getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS),
|
||||
"Dantotsu/$subDirectory"
|
||||
)
|
||||
val downloadsSubList = if (type == Download.Type.MANGA) {
|
||||
mangaDownloads
|
||||
} else if (type == Download.Type.ANIME) {
|
||||
animeDownloads
|
||||
} else {
|
||||
novelDownloads
|
||||
}
|
||||
if (directory.exists()) {
|
||||
val files = directory.listFiles()
|
||||
if (files != null) {
|
||||
for (file in files) {
|
||||
if (!downloadsSubList.any { it.title == file.name }) {
|
||||
val deleted = file.deleteRecursively()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//now remove all downloads that do not have a folder
|
||||
val iterator = downloadsList.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val download = iterator.next()
|
||||
val downloadDir = File(directory, download.title)
|
||||
if ((!downloadDir.exists() && download.type == type) || download.title.isBlank()) {
|
||||
iterator.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun saveDownloadsListToJSONFileInDownloadsFolder(downloadsList: List<Download>) //for debugging
|
||||
{
|
||||
val jsonString = gson.toJson(downloadsList)
|
||||
val file = File(
|
||||
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),
|
||||
"Dantotsu/downloads.json"
|
||||
)
|
||||
if (file.parentFile?.exists() == false) {
|
||||
file.parentFile?.mkdirs()
|
||||
}
|
||||
if (!file.exists()) {
|
||||
file.createNewFile()
|
||||
}
|
||||
file.writeText(jsonString)
|
||||
}
|
||||
|
||||
fun queryDownload(download: Download): Boolean {
|
||||
return downloadsList.contains(download)
|
||||
}
|
||||
|
|
|
@ -136,7 +136,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
builder.setNegativeButton("No") { _, _ ->
|
||||
// Do nothing
|
||||
}
|
||||
builder.show()
|
||||
val dialog = builder.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
true
|
||||
}
|
||||
|
||||
|
@ -284,7 +285,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
} else {
|
||||
null
|
||||
}
|
||||
val title = mediaModel.nameMAL ?: "unknown"
|
||||
val title = mediaModel.nameMAL ?: mediaModel.nameRomaji
|
||||
val score = ((if (mediaModel.userScore == 0) (mediaModel.meanScore
|
||||
?: 0) else mediaModel.userScore) / 10.0).toString()
|
||||
val isOngoing = false
|
||||
|
|
|
@ -300,6 +300,19 @@ class MediaAdaptor(
|
|||
return type
|
||||
}
|
||||
|
||||
fun randomOptionClick() { //used for user list
|
||||
val media = mediaList?.random()
|
||||
if (media != null) {
|
||||
mediaList?.let {
|
||||
clicked(
|
||||
it.indexOf(media),
|
||||
null
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inner class MediaViewHolder(val binding: ItemMediaCompactBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
init {
|
||||
|
|
|
@ -204,6 +204,7 @@ class AnimeWatchAdapter(
|
|||
fragment.onIconPressed(style, reversed)
|
||||
}
|
||||
binding.animeScanlatorTop.visibility = View.GONE
|
||||
binding.animeDownloadTop.visibility = View.GONE
|
||||
//Episode Handling
|
||||
handleEpisodes()
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ class AnimeWatchFragment : Fragment() {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext())
|
||||
val dialog = AlertDialog.Builder(requireContext())
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { _, which ->
|
||||
selectedIndex = which
|
||||
|
@ -347,6 +347,7 @@ class AnimeWatchFragment : Fragment() {
|
|||
return@setNegativeButton
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
requireActivity().runOnUiThread {
|
||||
|
|
|
@ -14,6 +14,7 @@ import android.content.pm.PackageManager
|
|||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Animatable
|
||||
import android.hardware.Sensor
|
||||
import android.hardware.SensorManager
|
||||
import android.media.AudioManager
|
||||
import android.media.AudioManager.*
|
||||
|
@ -186,8 +187,6 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
|
||||
var rotation = 0
|
||||
|
||||
private var rpc: RPC? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
val displayCutout = window.decorView.rootWindowInsets.displayCutout
|
||||
|
@ -385,14 +384,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
}, AUDIO_CONTENT_TYPE_MOVIE, AUDIOFOCUS_GAIN)
|
||||
|
||||
if (System.getInt(contentResolver, System.ACCELEROMETER_ROTATION, 0) != 1) {
|
||||
requestedOrientation = rotation
|
||||
exoRotate.setOnClickListener {
|
||||
requestedOrientation = rotation
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
orientationListener =
|
||||
object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_UI) {
|
||||
override fun onOrientationChanged(orientation: Int) {
|
||||
println(orientation)
|
||||
if (orientation in 45..135) {
|
||||
if (rotation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) exoRotate.visibility =
|
||||
View.VISIBLE
|
||||
|
@ -405,6 +400,12 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
}
|
||||
}
|
||||
orientationListener?.enable()
|
||||
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
exoRotate.setOnClickListener {
|
||||
requestedOrientation = rotation
|
||||
it.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
setupSubFormatting(playerView, settings)
|
||||
|
@ -998,36 +999,45 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
preloading = false
|
||||
val context = this
|
||||
|
||||
lifecycleScope.launch {
|
||||
val presence = RPC.createPresence(RPC.Companion.RPCData(
|
||||
applicationId = Discord.application_Id,
|
||||
type = RPC.Type.WATCHING,
|
||||
activityName = media.userPreferredName,
|
||||
details = ep.title?.takeIf { it.isNotEmpty() } ?: getString(
|
||||
R.string.episode_num,
|
||||
ep.number
|
||||
),
|
||||
state = "Episode : ${ep.number}/${media.anime?.totalEpisodes ?: "??"}",
|
||||
largeImage = media.cover?.let { RPC.Link(media.userPreferredName, it) },
|
||||
smallImage = RPC.Link(
|
||||
"Dantotsu",
|
||||
Discord.small_Image
|
||||
),
|
||||
buttons = mutableListOf(
|
||||
RPC.Link(getString(R.string.view_anime), media.shareLink ?: ""),
|
||||
RPC.Link(
|
||||
"Stream on Dantotsu",
|
||||
"https://github.com/rebelonion/Dantotsu/"
|
||||
val incognito = baseContext.getSharedPreferences("Dantotsu", MODE_PRIVATE)
|
||||
.getBoolean("incognito", false)
|
||||
if (isOnline(context) && Discord.token != null && !incognito) {
|
||||
lifecycleScope.launch {
|
||||
val presence = RPC.createPresence(RPC.Companion.RPCData(
|
||||
applicationId = Discord.application_Id,
|
||||
type = RPC.Type.WATCHING,
|
||||
activityName = media.userPreferredName,
|
||||
details = ep.title?.takeIf { it.isNotEmpty() } ?: getString(
|
||||
R.string.episode_num,
|
||||
ep.number
|
||||
),
|
||||
state = "Episode : ${ep.number}/${media.anime?.totalEpisodes ?: "??"}",
|
||||
largeImage = media.cover?.let {
|
||||
RPC.Link(
|
||||
media.userPreferredName,
|
||||
it
|
||||
)
|
||||
},
|
||||
smallImage = RPC.Link(
|
||||
"Dantotsu",
|
||||
Discord.small_Image
|
||||
),
|
||||
buttons = mutableListOf(
|
||||
RPC.Link(getString(R.string.view_anime), media.shareLink ?: ""),
|
||||
RPC.Link(
|
||||
"Stream on Dantotsu",
|
||||
"https://github.com/rebelonion/Dantotsu/"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
val intent = Intent(context, DiscordService::class.java).apply {
|
||||
putExtra("presence", presence)
|
||||
val intent = Intent(context, DiscordService::class.java).apply {
|
||||
putExtra("presence", presence)
|
||||
}
|
||||
DiscordServiceRunningSingleton.running = true
|
||||
startService(intent)
|
||||
}
|
||||
DiscordServiceRunningSingleton.running = true
|
||||
startService(intent)
|
||||
}
|
||||
|
||||
updateProgress()
|
||||
|
@ -1101,7 +1111,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
val speedDialog =
|
||||
AlertDialog.Builder(this, R.style.DialogTheme).setTitle(getString(R.string.speed))
|
||||
exoSpeed.setOnClickListener {
|
||||
speedDialog.setSingleChoiceItems(speedsName, curSpeed) { dialog, i ->
|
||||
val dialog = speedDialog.setSingleChoiceItems(speedsName, curSpeed) { dialog, i ->
|
||||
if (isInitialized) {
|
||||
saveData("${media.id}_speed", i, this)
|
||||
speed = speeds[i]
|
||||
|
@ -1112,6 +1122,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
hideSystemBars()
|
||||
}
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
speedDialog.setOnCancelListener { hideSystemBars() }
|
||||
|
||||
|
@ -1151,6 +1162,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.auto_update, media.userPreferredName))
|
||||
.setMessage(getString(R.string.incognito_will_not_update))
|
||||
.apply {
|
||||
setOnCancelListener { hideSystemBars() }
|
||||
setCancelable(false)
|
||||
|
@ -1349,7 +1361,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
)
|
||||
)
|
||||
)
|
||||
AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val dialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.continue_from, time)).apply {
|
||||
setCancelable(false)
|
||||
setPositiveButton(getString(R.string.yes)) { d, _ ->
|
||||
|
@ -1362,6 +1374,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
d.dismiss()
|
||||
}
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else buildExoplayer()
|
||||
}
|
||||
|
||||
|
@ -1394,7 +1407,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
exoPlayer.addAnalyticsListener(EventLogger())
|
||||
isInitialized = true
|
||||
}
|
||||
/*private fun selectSubtitleTrack() {
|
||||
/*private fun selectSubtitleTrack() { saving this for later
|
||||
// Get the current track groups
|
||||
val trackGroups = exoPlayer.currentTrackGroups
|
||||
|
||||
|
@ -1426,9 +1439,11 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
exoPlayer.release()
|
||||
VideoCache.release()
|
||||
mediaSession?.release()
|
||||
val stopIntent = Intent(this, DiscordService::class.java)
|
||||
DiscordServiceRunningSingleton.running = false
|
||||
stopService(stopIntent)
|
||||
if(DiscordServiceRunningSingleton.running) {
|
||||
val stopIntent = Intent(this, DiscordService::class.java)
|
||||
DiscordServiceRunningSingleton.running = false
|
||||
stopService(stopIntent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1532,6 +1547,12 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
|||
if (exoPlayer.duration < playbackPosition)
|
||||
exoPlayer.seekTo(0)
|
||||
|
||||
//if playbackPosition is within 92% of the episode length, reset it to 0
|
||||
if (playbackPosition > exoPlayer.duration.toFloat() * 0.92) {
|
||||
playbackPosition = 0
|
||||
exoPlayer.seekTo(0)
|
||||
}
|
||||
|
||||
if (!isTimeStampsLoaded && settings.timeStampsEnabled) {
|
||||
val dur = exoPlayer.duration
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package ani.dantotsu.media.manga
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.widget.NumberPicker
|
||||
import androidx.lifecycle.coroutineScope
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ani.dantotsu.R
|
||||
|
@ -114,6 +116,49 @@ class MangaChapterAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
fun downloadNextNChapters(n: Int) {
|
||||
//find last viewed chapter
|
||||
var lastViewedChapter = arr.indexOfFirst { MangaNameAdapter.findChapterNumber(it.number)?.toInt() == media.userProgress }
|
||||
if (lastViewedChapter == -1) {
|
||||
lastViewedChapter = 0
|
||||
}
|
||||
//download next n chapters
|
||||
for (i in 1..n) {
|
||||
if (lastViewedChapter + i < arr.size) {
|
||||
val chapterNumber = arr[lastViewedChapter + i].number
|
||||
if (activeDownloads.contains(chapterNumber)) {
|
||||
//do nothing
|
||||
continue
|
||||
} else if (downloadedChapters.contains(chapterNumber)) {
|
||||
//do nothing
|
||||
continue
|
||||
} else {
|
||||
fragment.onMangaChapterDownloadClick(chapterNumber)
|
||||
startDownload(chapterNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun downloadNChaptersFrom(position: Int, n: Int) {
|
||||
//download next n chapters
|
||||
for (i in 0..<n) {
|
||||
if (position + i < arr.size) {
|
||||
val chapterNumber = arr[position + i].number
|
||||
if (activeDownloads.contains(chapterNumber)) {
|
||||
//do nothing
|
||||
continue
|
||||
} else if (downloadedChapters.contains(chapterNumber)) {
|
||||
//do nothing
|
||||
continue
|
||||
} else {
|
||||
fragment.onMangaChapterDownloadClick(chapterNumber)
|
||||
startDownload(chapterNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class ChapterListViewHolder(val binding: ItemChapterListBinding) :
|
||||
RecyclerView.ViewHolder(binding.root) {
|
||||
private val activeCoroutines = mutableSetOf<String>()
|
||||
|
@ -200,6 +245,24 @@ class MangaChapterAdapter(
|
|||
}
|
||||
}
|
||||
}
|
||||
binding.itemDownload.setOnLongClickListener {
|
||||
//Alert dialog asking for the number of chapters to download
|
||||
val alertDialog = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
alertDialog.setTitle("Multi Chapter Downloader")
|
||||
alertDialog.setMessage("Enter the number of chapters to download")
|
||||
val input = NumberPicker(currContext())
|
||||
input.minValue = 1
|
||||
input.maxValue = itemCount - bindingAdapterPosition
|
||||
input.value = 1
|
||||
alertDialog.setView(input)
|
||||
alertDialog.setPositiveButton("OK") { dialog, which ->
|
||||
downloadNChaptersFrom(bindingAdapterPosition, input.value)
|
||||
}
|
||||
alertDialog.setNegativeButton("Cancel") { dialog, _ -> dialog.cancel() }
|
||||
val dialog = alertDialog.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,10 +5,12 @@ import android.app.AlertDialog
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.CheckBox
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.NumberPicker
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
@ -167,7 +169,7 @@ class MangaReadAdapter(
|
|||
}
|
||||
|
||||
// Create AlertDialog
|
||||
AlertDialog.Builder(currContext())
|
||||
val dialog = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
.setView(dialogView)
|
||||
.setPositiveButton("OK") { dialog, which ->
|
||||
//add unchecked to hidden
|
||||
|
@ -183,6 +185,25 @@ class MangaReadAdapter(
|
|||
}
|
||||
.setNegativeButton("Cancel", null)
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.animeDownloadTop.setOnClickListener {
|
||||
//Alert dialog asking for the number of chapters to download
|
||||
val alertDialog = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
alertDialog.setTitle("Multi Chapter Downloader")
|
||||
alertDialog.setMessage("Enter the number of chapters to download")
|
||||
val input = NumberPicker(currContext())
|
||||
input.minValue = 1
|
||||
input.maxValue = 20
|
||||
input.value = 1
|
||||
alertDialog.setView(input)
|
||||
alertDialog.setPositiveButton("OK") { dialog, which ->
|
||||
fragment.multiDownload(input.value)
|
||||
}
|
||||
alertDialog.setNegativeButton("Cancel") { dialog, _ -> dialog.cancel() }
|
||||
val dialog = alertDialog.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
var selected = when (style) {
|
||||
|
@ -238,7 +259,20 @@ class MangaReadAdapter(
|
|||
0
|
||||
)
|
||||
}
|
||||
chip.text = "${names[limit * (position)]} - ${names[last - 1]}"
|
||||
val startChapter = MangaNameAdapter.findChapterNumber(names[limit * (position)])
|
||||
val endChapter = MangaNameAdapter.findChapterNumber(names[last - 1])
|
||||
val startChapterString = if (startChapter != null) {
|
||||
"Ch.$startChapter"
|
||||
} else {
|
||||
names[limit * (position)]
|
||||
}
|
||||
val endChapterString = if (endChapter != null) {
|
||||
"Ch.$endChapter"
|
||||
} else {
|
||||
names[last - 1]
|
||||
}
|
||||
//chip.text = "${names[limit * (position)]} - ${names[last - 1]}"
|
||||
chip.text = "$startChapterString - $endChapterString"
|
||||
chip.setTextColor(
|
||||
ContextCompat.getColorStateList(
|
||||
fragment.requireContext(),
|
||||
|
|
|
@ -197,6 +197,10 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
updateChapters()
|
||||
}
|
||||
|
||||
fun multiDownload(n: Int) {
|
||||
chapterAdapter.downloadNextNChapters(n)
|
||||
}
|
||||
|
||||
private fun updateChapters() {
|
||||
val loadedChapters = model.getMangaChapters().value
|
||||
if (loadedChapters != null) {
|
||||
|
@ -334,7 +338,7 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext())
|
||||
val dialog = AlertDialog.Builder(requireContext())
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { _, which ->
|
||||
selectedIndex = which
|
||||
|
@ -361,6 +365,7 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
return@setNegativeButton
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
val fragment = MangaSourcePreferencesFragment().getInstance(selectedSetting.id) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import android.view.*
|
|||
import android.view.KeyEvent.*
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import android.widget.AdapterView
|
||||
import android.widget.CheckBox
|
||||
import androidx.activity.addCallback
|
||||
import androidx.activity.viewModels
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
@ -124,7 +125,7 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
|
||||
override fun onDestroy() {
|
||||
mangaCache.clear()
|
||||
if (isOnline(baseContext)) { //TODO:
|
||||
if (DiscordServiceRunningSingleton.running) {
|
||||
DiscordServiceRunningSingleton.running = false
|
||||
val stopIntent = Intent(this, DiscordService::class.java)
|
||||
stopService(stopIntent)
|
||||
|
@ -253,20 +254,22 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog") != true else false
|
||||
progressDialog =
|
||||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true)
|
||||
if (showProgressDialog && Anilist.userid != null && if (media.isAdult) settings.updateForH else true) {
|
||||
val dialogView = layoutInflater.inflate(R.layout.item_custom_dialog, null)
|
||||
val checkbox = dialogView.findViewById<CheckBox>(R.id.dialog_checkbox)
|
||||
checkbox.text = getString(R.string.dont_ask_again, media.userPreferredName)
|
||||
checkbox.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) progressDialog = null
|
||||
saveData("${media.id}_progressDialog", isChecked)
|
||||
showProgressDialog = isChecked
|
||||
}
|
||||
AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.title_update_progress)).apply {
|
||||
setMultiChoiceItems(
|
||||
arrayOf(getString(R.string.dont_ask_again, media.userPreferredName)),
|
||||
booleanArrayOf(false)
|
||||
) { _, _, isChecked ->
|
||||
if (isChecked) progressDialog = null
|
||||
saveData("${media.id}_progressDialog", isChecked)
|
||||
showProgressDialog = isChecked
|
||||
}
|
||||
.setTitle(getString(R.string.title_update_progress))
|
||||
.setView(dialogView)
|
||||
.apply {
|
||||
setOnCancelListener { hideBars() }
|
||||
}
|
||||
else null
|
||||
} else null
|
||||
|
||||
//Chapter Change
|
||||
fun change(index: Int) {
|
||||
|
@ -329,7 +332,9 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
chaptersTitleArr.getOrNull(currentChapterIndex - 1) ?: ""
|
||||
applySettings()
|
||||
val context = this
|
||||
if (isOnline(context)) {
|
||||
val incognito = context.getSharedPreferences("Dantotsu", 0)
|
||||
?.getBoolean("incognito", false) ?: false
|
||||
if (isOnline(context) && Discord.token != null && !incognito) {
|
||||
lifecycleScope.launch {
|
||||
val presence = RPC.createPresence(
|
||||
RPC.Companion.RPCData(
|
||||
|
|
|
@ -167,9 +167,9 @@ class Swipy @JvmOverloads constructor(
|
|||
val totalDragDistance =
|
||||
Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||
if (verticalPos == VerticalPosition.Top)
|
||||
topBeingSwiped.invoke(overscroll / totalDragDistance)
|
||||
topBeingSwiped.invoke(overscroll * 2 / totalDragDistance)
|
||||
else
|
||||
bottomBeingSwiped.invoke(overscroll / totalDragDistance)
|
||||
bottomBeingSwiped.invoke(overscroll * 2 / totalDragDistance)
|
||||
} else {
|
||||
val totalDragDistance =
|
||||
Resources.getSystem().displayMetrics.widthPixels / dragDivider
|
||||
|
@ -243,7 +243,7 @@ class Swipy @JvmOverloads constructor(
|
|||
|
||||
if (vertical) {
|
||||
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||
if (overscrollDistance > totalDragDistance)
|
||||
if (overscrollDistance * 2 > totalDragDistance)
|
||||
if (verticalPos == VerticalPosition.Top)
|
||||
onTopSwiped.invoke()
|
||||
else
|
||||
|
|
|
@ -112,7 +112,8 @@ class NovelResponseAdapter(
|
|||
builder.setNegativeButton("No") { _, _ ->
|
||||
// Do nothing
|
||||
}
|
||||
builder.show()
|
||||
val dialog = builder.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,5 +162,15 @@ class ListActivity : AppCompatActivity() {
|
|||
popup.inflate(R.menu.list_sort_menu)
|
||||
popup.show()
|
||||
}
|
||||
|
||||
binding.random.setOnClickListener {
|
||||
//get the current tab
|
||||
val currentTab =
|
||||
binding.listTabLayout.getTabAt(binding.listTabLayout.selectedTabPosition)
|
||||
val currentViewePager = binding.listViewPager.getChildAt(0)
|
||||
val currentFragment =
|
||||
supportFragmentManager.findFragmentByTag("f" + currentTab?.position.toString()) as? ListFragment
|
||||
currentFragment?.randomOptionClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,11 @@ class ListFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
|
||||
fun randomOptionClick() {
|
||||
val adapter = binding.listRecyclerView.adapter as MediaAdaptor
|
||||
adapter.randomOptionClick()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(pos: Int, calendar: Boolean = false): ListFragment =
|
||||
ListFragment().apply {
|
||||
|
|
|
@ -55,7 +55,7 @@ class InstalledAnimeExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
selectedIndex = which
|
||||
|
@ -85,6 +85,7 @@ class InstalledAnimeExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
}
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
val eActivity = requireActivity() as ExtensionsActivity
|
||||
|
|
|
@ -62,7 +62,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
selectedIndex = which
|
||||
|
@ -81,6 +81,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
.commit()
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
val fragment = MangaSourcePreferencesFragment().getInstance(selectedSetting.id) {
|
||||
|
|
|
@ -106,13 +106,14 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.default_speed))
|
||||
binding.playerSettingsSpeed.setOnClickListener {
|
||||
speedDialog.setSingleChoiceItems(speedsName, settings.defaultSpeed) { dialog, i ->
|
||||
val dialog = speedDialog.setSingleChoiceItems(speedsName, settings.defaultSpeed) { dialog, i ->
|
||||
settings.defaultSpeed = i
|
||||
binding.playerSettingsSpeed.text =
|
||||
getString(R.string.default_playback_speed, speedsName[i])
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.playerSettingsCursedSpeeds.isChecked = settings.cursedSpeeds
|
||||
|
@ -255,11 +256,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val resizeDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.default_resize_mode))
|
||||
binding.playerResizeMode.setOnClickListener {
|
||||
resizeDialog.setSingleChoiceItems(resizeModes, settings.resize) { dialog, count ->
|
||||
val dialog = resizeDialog.setSingleChoiceItems(resizeModes, settings.resize) { dialog, count ->
|
||||
settings.resize = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
fun restartApp() {
|
||||
Snackbar.make(
|
||||
|
@ -339,7 +341,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val primaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.primary_sub_color))
|
||||
binding.videoSubColorPrimary.setOnClickListener {
|
||||
primaryColorDialog.setSingleChoiceItems(
|
||||
val dialog = primaryColorDialog.setSingleChoiceItems(
|
||||
colorsPrimary,
|
||||
settings.primaryColor
|
||||
) { dialog, count ->
|
||||
|
@ -347,6 +349,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val colorsSecondary = arrayOf(
|
||||
"Black",
|
||||
|
@ -365,7 +368,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val secondaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorSecondary.setOnClickListener {
|
||||
secondaryColorDialog.setSingleChoiceItems(
|
||||
val dialog = secondaryColorDialog.setSingleChoiceItems(
|
||||
colorsSecondary,
|
||||
settings.secondaryColor
|
||||
) { dialog, count ->
|
||||
|
@ -373,16 +376,18 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val typesOutline = arrayOf("Outline", "Shine", "Drop Shadow", "None")
|
||||
val outlineDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_type))
|
||||
binding.videoSubOutline.setOnClickListener {
|
||||
outlineDialog.setSingleChoiceItems(typesOutline, settings.outline) { dialog, count ->
|
||||
val dialog = outlineDialog.setSingleChoiceItems(typesOutline, settings.outline) { dialog, count ->
|
||||
settings.outline = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val colorsSubBackground = arrayOf(
|
||||
"Transparent",
|
||||
|
@ -401,7 +406,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val subBackgroundDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorBackground.setOnClickListener {
|
||||
subBackgroundDialog.setSingleChoiceItems(
|
||||
val dialog = subBackgroundDialog.setSingleChoiceItems(
|
||||
colorsSubBackground,
|
||||
settings.subBackground
|
||||
) { dialog, count ->
|
||||
|
@ -409,6 +414,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
val colorsSubWindow = arrayOf(
|
||||
|
@ -428,7 +434,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val subWindowDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorWindow.setOnClickListener {
|
||||
subWindowDialog.setSingleChoiceItems(
|
||||
val dialog = subWindowDialog.setSingleChoiceItems(
|
||||
colorsSubWindow,
|
||||
settings.subWindow
|
||||
) { dialog, count ->
|
||||
|
@ -436,6 +442,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val fonts = arrayOf(
|
||||
"Poppins Semi Bold",
|
||||
|
@ -448,11 +455,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val fontDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.subtitle_font))
|
||||
binding.videoSubFont.setOnClickListener {
|
||||
fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->
|
||||
val dialog = fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->
|
||||
settings.font = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
binding.subtitleFontSize.setText(settings.fontSize.toString())
|
||||
binding.subtitleFontSize.setOnEditorActionListener { _, actionId, _ ->
|
||||
|
|
|
@ -199,8 +199,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
passedColor = color
|
||||
linearLayout.setBackgroundColor(color)
|
||||
})
|
||||
|
||||
alertDialog.show()
|
||||
alertDialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
//val animeSource = loadData<Int>("settings_def_anime_source_s")?.let { if (it >= AnimeSources.names.size) 0 else it } ?: 0
|
||||
|
@ -237,11 +236,12 @@ class SettingsActivity : AppCompatActivity() {
|
|||
AlertDialog.Builder(this, R.style.DialogTheme).setTitle("Download Manager")
|
||||
var downloadManager = loadData<Int>("settings_download_manager") ?: 0
|
||||
binding.settingsDownloadManager.setOnClickListener {
|
||||
downloadManagerDialog.setSingleChoiceItems(managers, downloadManager) { dialog, count ->
|
||||
val dialog = downloadManagerDialog.setSingleChoiceItems(managers, downloadManager) { dialog, count ->
|
||||
downloadManager = count
|
||||
saveData("settings_download_manager", downloadManager)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.settingsForceLegacyInstall.isChecked =
|
||||
|
@ -287,6 +287,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
.create()
|
||||
|
||||
alertDialog.show()
|
||||
alertDialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
|
||||
|
@ -416,6 +417,16 @@ class SettingsActivity : AppCompatActivity() {
|
|||
uiTheme(true, it)
|
||||
}
|
||||
|
||||
binding.settingsIncognito.isChecked =
|
||||
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean(
|
||||
"incognito",
|
||||
false
|
||||
)
|
||||
binding.settingsIncognito.setOnCheckedChangeListener { _, isChecked ->
|
||||
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit()
|
||||
.putBoolean("incognito", isChecked).apply()
|
||||
}
|
||||
|
||||
var previousStart: View = when (uiSettings.defaultStartUpTab) {
|
||||
0 -> binding.uiSettingsAnime
|
||||
1 -> binding.uiSettingsHome
|
||||
|
@ -582,7 +593,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(R.string.subscriptions_checking_time)
|
||||
binding.settingsSubscriptionsTime.setOnClickListener {
|
||||
speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||
val dialog = speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||
curTime = i
|
||||
binding.settingsSubscriptionsTime.text =
|
||||
getString(R.string.subscriptions_checking_time_s, timeNames[i])
|
||||
|
@ -590,6 +601,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
dialog.dismiss()
|
||||
startSubscription(true)
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.settingsSubscriptionsTime.setOnLongClickListener {
|
||||
|
|
|
@ -42,7 +42,7 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
|
||||
val views = resources.getStringArray(R.array.home_layouts)
|
||||
binding.uiSettingsHomeLayout.setOnClickListener {
|
||||
AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val dialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.home_layout_show)).apply {
|
||||
setMultiChoiceItems(
|
||||
views,
|
||||
|
@ -52,6 +52,7 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
saveData(ui, settings)
|
||||
}
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.uiSettingsSmallView.isChecked = settings.smallView
|
||||
|
|
8
app/src/main/res/color/chip_background_color.xml
Normal file
8
app/src/main/res/color/chip_background_color.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Color when the chip is selected -->
|
||||
<item android:color="@color/chip" android:state_selected="true"/>
|
||||
|
||||
<!-- Color when the chip is not selected -->
|
||||
<item android:color="?attr/colorSurface"/>
|
||||
</selector>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- Color when the chip is selected -->
|
||||
<item android:color="#ffffff" android:state_selected="true"/>
|
||||
<item android:color="?attr/colorSurface" android:state_selected="true"/>
|
||||
<!-- Color when the chip is not selected -->
|
||||
<item android:color="#aaadab"/>
|
||||
<item android:color="#858585"/>
|
||||
</selector>
|
||||
|
|
6
app/src/main/res/drawable/ic_incognito_24.xml
Normal file
6
app/src/main/res/drawable/ic_incognito_24.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<vector android:height="24dp" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#212121" android:fillType="nonZero"
|
||||
android:pathData="M17.5,12C19.985,12 22,14.015 22,16.5C22,18.985 19.985,21 17.5,21C15.359,21 13.567,19.505 13.112,17.502L10.888,17.502C10.433,19.505 8.641,21 6.5,21C4.015,21 2,18.985 2,16.5C2,14.015 4.015,12 6.5,12C8.816,12 10.724,13.75 10.973,16L13.027,16C13.276,13.75 15.184,12 17.5,12ZM6.5,13.5C4.843,13.5 3.5,14.843 3.5,16.5C3.5,18.157 4.843,19.5 6.5,19.5C8.157,19.5 9.5,18.157 9.5,16.5C9.5,14.843 8.157,13.5 6.5,13.5ZM17.5,13.5C15.843,13.5 14.5,14.843 14.5,16.5C14.5,18.157 15.843,19.5 17.5,19.5C19.157,19.5 20.5,18.157 20.5,16.5C20.5,14.843 19.157,13.5 17.5,13.5ZM12,9.25C15.389,9.25 18.53,9.59 21.422,10.27C21.825,10.365 22.075,10.769 21.98,11.172C21.885,11.575 21.481,11.825 21.078,11.73C18.303,11.077 15.277,10.75 12,10.75C8.723,10.75 5.697,11.077 2.922,11.73C2.519,11.825 2.115,11.575 2.02,11.172C1.925,10.769 2.175,10.365 2.578,10.27C5.47,9.59 8.611,9.25 12,9.25ZM15.7,3.25C16.723,3.25 17.656,3.817 18.13,4.712L18.213,4.883L19.685,8.195C19.854,8.574 19.683,9.017 19.305,9.185C18.958,9.34 18.556,9.209 18.362,8.895L18.315,8.805L16.843,5.492C16.66,5.082 16.274,4.804 15.834,4.757L15.7,4.75L8.3,4.75C7.851,4.75 7.44,4.99 7.218,5.373L7.157,5.492L5.685,8.805C5.517,9.183 5.074,9.354 4.695,9.185C4.348,9.031 4.176,8.646 4.28,8.291L4.315,8.195L5.787,4.883C6.202,3.948 7.099,3.327 8.109,3.257L8.3,3.25L15.7,3.25Z"
|
||||
android:strokeColor="#00000000" android:strokeWidth="1"/>
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_shuffle_24.xml
Normal file
10
app/src/main/res/drawable/ic_shuffle_24.xml
Normal 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="M560,800v-80h104L537,593l57,-57 126,126v-102h80v240L560,800ZM216,800 L160,744 664,240L560,240v-80h240v240h-80v-104L216,800ZM367,423L160,216l56,-56 207,207 -56,56Z"/>
|
||||
</vector>
|
|
@ -44,12 +44,21 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/random"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/random_selection"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
app:srcCompat="@drawable/ic_shuffle_24" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/listSort"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/sort_by"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
|
|
|
@ -341,6 +341,25 @@
|
|||
app:drawableEndCompat="@drawable/ic_round_arrow_drop_down_24"
|
||||
tools:ignore="TextContrastCheck" />
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
android:id="@+id/settingsIncognito"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:drawableStart="@drawable/ic_incognito_24"
|
||||
android:drawablePadding="16dp"
|
||||
android:elegantTextHeight="true"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:minHeight="64dp"
|
||||
android:text="@string/incognito_mode"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="?attr/colorOnBackground"
|
||||
android:layout_marginStart="4dp"
|
||||
app:cornerRadius="0dp"
|
||||
app:drawableTint="?attr/colorPrimary"
|
||||
app:showText="false"
|
||||
app:thumbTint="@color/button_switch_track" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settingsAnilistLoginContainer"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -353,6 +372,7 @@
|
|||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:contentDescription="@string/anilist"
|
||||
app:tint="?attr/colorPrimary"
|
||||
app:srcCompat="@drawable/ic_anilist" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -371,7 +391,8 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center"
|
||||
android:text="@string/username"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/colorSecondary"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsAnilistLogin"
|
||||
|
@ -383,7 +404,6 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:padding="16dp"
|
||||
android:text="@string/logout"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -419,6 +439,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:contentDescription="@string/myanimelist"
|
||||
app:tint="?attr/colorPrimary"
|
||||
app:srcCompat="@drawable/ic_myanimelist" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -447,7 +468,8 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:gravity="center"
|
||||
android:text="@string/username"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/colorSecondary"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsMALLogin"
|
||||
|
@ -459,7 +481,6 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:padding="16dp"
|
||||
android:text="@string/logout"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -495,7 +516,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_discord"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
app:tint="?attr/colorPrimary"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -515,7 +536,8 @@
|
|||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/username"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/colorSecondary"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settingsDiscordLogin"
|
||||
|
@ -527,7 +549,6 @@
|
|||
android:fontFamily="@font/poppins_bold"
|
||||
android:padding="16dp"
|
||||
android:text="@string/logout"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -573,7 +594,6 @@
|
|||
app:drawableStartCompat="@drawable/ic_round_help_24"
|
||||
app:drawableTint="?attr/colorPrimary" />
|
||||
|
||||
|
||||
</ani.dantotsu.others.Xpandable>
|
||||
|
||||
<ani.dantotsu.others.Xpandable
|
||||
|
|
|
@ -246,6 +246,16 @@
|
|||
app:tint="?attr/colorOnBackground"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/animeDownloadTop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="1"
|
||||
android:padding="8dp"
|
||||
app:srcCompat="@drawable/ic_round_download_24"
|
||||
app:tint="?attr/colorOnBackground"
|
||||
tools:ignore="ContentDescription,ImageContrastCheck" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/animeScanlatorTop"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="-4dp"
|
||||
app:chipBackgroundColor="@color/bg_black"
|
||||
app:chipBackgroundColor="@color/chip_background_color"
|
||||
android:elegantTextHeight="true"
|
||||
android:textAppearance="@style/Suffix"
|
||||
app:chipStrokeColor="?attr/colorPrimaryContainer"
|
||||
|
|
25
app/src/main/res/layout/item_custom_dialog.xml
Normal file
25
app/src/main/res/layout/item_custom_dialog.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_message"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/incognito_will_not_update"
|
||||
android:paddingBottom="16dp"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/poppins_bold"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/dialog_checkbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/dont_ask_again"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/poppins_bold"/>
|
||||
</LinearLayout>
|
|
@ -493,6 +493,7 @@
|
|||
<string name="auto_update">Auto Update progress for %1$s?</string>
|
||||
<string name="continue_from">Continue from %1$s?</string>
|
||||
<string name="title_update_progress">Update progress on anilist?</string>
|
||||
<string name="incognito_will_not_update">Incognito mode will still ignore progress.</string>
|
||||
<string name="dont_ask_again">"Don\'t ask again for %1$s"</string>
|
||||
<string name="default_speed">Default Speed</string>
|
||||
<string name="default_resize_mode">Default Resize Mode</string>
|
||||
|
@ -628,9 +629,19 @@
|
|||
<string name="extensions_settings">Extensions</string>
|
||||
<string name="NSFWExtention">NSFW Extensions</string>
|
||||
<string name="skip_loading_extension_icons">Skip loading extension icons</string>
|
||||
<string name="use_material_you">Use Material You</string>
|
||||
<string name="use_material_you">Material You</string>
|
||||
<string name="extension_specific_dns">Extension-specific DNS</string>
|
||||
<string name="theme_">Theme:</string>
|
||||
<string name="user_agent">User Agent</string>
|
||||
<string name="custom_theme">Custom Theme</string>
|
||||
<string name="use_custom_theme">Custom theme</string>
|
||||
<string name="use_unique_theme_for_each_item">Color same as Anime/Manga cover</string>
|
||||
<string name="oled_theme_variant">OLED theme variant</string>
|
||||
<string name="installed_anime">Installed Anime</string>
|
||||
<string name="available_anime">Available Anime</string>
|
||||
<string name="installed_manga">Installed Manga</string>
|
||||
<string name="color_picker">Color Picker</string>
|
||||
<string name="random_selection">Random Selection</string>
|
||||
<string name="incognito_mode">Incognito Mode</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
<color name="status">#54000000</color>
|
||||
<color name="nav_status">#80000000</color>
|
||||
<color name="filler">#29FF6B08</color>
|
||||
|
||||
<color name="chip">#b3aead</color>
|
||||
<color name="grey_nav">#E8222222</color>
|
||||
</resources>
|
|
@ -22,7 +22,7 @@
|
|||
<color name="grey_60">#999999</color>
|
||||
<color name="darkest_Black">#000000</color>
|
||||
<color name="yt_red">#CD201F</color>
|
||||
|
||||
<color name="chip">#a3a2a2</color>
|
||||
<color name="grey_nav">#E8EDEDED</color>
|
||||
|
||||
<!-- theme 1 -->
|
||||
|
|
|
@ -493,6 +493,7 @@
|
|||
<string name="auto_update">Auto Update progress for %1$s?</string>
|
||||
<string name="continue_from">Continue from %1$s?</string>
|
||||
<string name="title_update_progress">Update progress on anilist?</string>
|
||||
<string name="incognito_will_not_update">Incognito mode will still ignore progress.</string>
|
||||
<string name="dont_ask_again">"Don\'t ask again for %1$s"</string>
|
||||
<string name="default_speed">Default Speed</string>
|
||||
<string name="default_resize_mode">Default Resize Mode</string>
|
||||
|
@ -640,5 +641,7 @@
|
|||
<string name="available_anime">Available Anime</string>
|
||||
<string name="installed_manga">Installed Manga</string>
|
||||
<string name="color_picker">Color Picker</string>
|
||||
<string name="random_selection">Random Selection</string>
|
||||
<string name="incognito_mode">Incognito Mode</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue