chore: code cleanup

This commit is contained in:
rebelonion 2024-04-19 06:03:40 -05:00
parent 386e02a564
commit 24147e746a
198 changed files with 1367 additions and 965 deletions

View file

@ -5,7 +5,10 @@ import android.graphics.Rect
import android.view.View
import android.widget.FrameLayout
class AndroidBug5497Workaround private constructor(activity: Activity, private val callback: (Boolean) -> Unit) {
class AndroidBug5497Workaround private constructor(
activity: Activity,
private val callback: (Boolean) -> Unit
) {
private val mChildOfContent: View
private var usableHeightPrevious = 0
private val frameLayoutParams: FrameLayout.LayoutParams

View file

@ -1,6 +1,5 @@
package ani.dantotsu.others
import android.app.DownloadManager
import android.content.ComponentName
import android.content.Context
import android.content.Intent
@ -8,7 +7,6 @@ import android.content.pm.PackageManager
import android.net.Uri
import android.os.Bundle
import android.os.Environment
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import ani.dantotsu.FileUrl
import ani.dantotsu.R
@ -19,9 +17,6 @@ import ani.dantotsu.parsers.Book
import ani.dantotsu.settings.saving.PrefManager
import ani.dantotsu.settings.saving.PrefName
import ani.dantotsu.toast
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.io.File
object Download {

View file

@ -2,10 +2,10 @@ package ani.dantotsu.others
import ani.dantotsu.FileUrl
import ani.dantotsu.client
import ani.dantotsu.util.Logger
import ani.dantotsu.media.Media
import ani.dantotsu.media.anime.Episode
import ani.dantotsu.tryWithSuspend
import ani.dantotsu.util.Logger
import com.google.gson.Gson
import com.lagradost.nicehttp.NiceResponse
import kotlinx.serialization.SerialName

View file

@ -56,9 +56,10 @@ class OutlineTextView : AppCompatTextView {
setStrokeWidth(strokeWidth)
}
private val Float.toPx get() = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, this, Resources.getSystem().displayMetrics
)
private val Float.toPx
get() = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, this, Resources.getSystem().displayMetrics
)
private fun setStrokeWidth(width: Float) {
strokeWidth = width.toPx

View file

@ -50,7 +50,7 @@ class Xpandable @JvmOverloads constructor(
}
}
postDelayed({
listeners.forEach{
listeners.forEach {
it.onRetract()
}
}, 300)
@ -66,7 +66,7 @@ class Xpandable @JvmOverloads constructor(
}
}
postDelayed({
listeners.forEach{
listeners.forEach {
it.onExpand()
}
}, 300)

View file

@ -24,7 +24,8 @@ class CookieCatcher : AppCompatActivity() {
//get url from intent
val url = intent.getStringExtra("url") ?: getString(R.string.cursed_yt)
val headers: Map<String, String> = intent.getSerializableExtraCompat("headers") as? Map<String, String> ?: emptyMap()
val headers: Map<String, String> =
intent.getSerializableExtraCompat("headers") as? Map<String, String> ?: emptyMap()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
val process = Application.getProcessName()