Memory usage optimization

This commit is contained in:
tom5079
2020-09-10 19:16:42 +09:00
parent 297ce506b1
commit fd298529bf
6 changed files with 28 additions and 13 deletions

View File

@@ -22,6 +22,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Build
import androidx.core.content.ContextCompat
import okhttp3.OkHttpClient
import okhttp3.Request
import xyz.quaver.Code
@@ -101,13 +102,6 @@ fun GalleryBlock.formatDownloadFolderTest(format: String): String =
}
}
fun Context.startForegroundServiceCompat(service: Intent) {
if (Build.VERSION.SDK_INT >= 26)
startForegroundService(service)
else
startService(service)
}
val Reader.requestBuilders: List<Request.Builder>
get() {
val galleryID = this.galleryInfo.id ?: 0