Minor cleanup
This commit is contained in:
@@ -33,6 +33,7 @@ import androidx.core.net.toUri
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.util.lang.truncateCenter
|
||||
import java.io.File
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
@@ -244,3 +245,12 @@ fun Context.openInBrowser(uri: Uri, @ColorInt toolbarColor: Int? = null) {
|
||||
toast(e.message)
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.createFileInCacheDir(name: String): File {
|
||||
val file = File(externalCacheDir, name)
|
||||
if (file.exists()) {
|
||||
file.delete()
|
||||
}
|
||||
file.createNewFile()
|
||||
return file
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user