chore: code cleanup
This commit is contained in:
parent
386e02a564
commit
24147e746a
198 changed files with 1367 additions and 965 deletions
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue