Automatic Lint

This commit is contained in:
Syer10
2024-03-29 00:16:52 +00:00
parent 253095fab1
commit b93c96a85b
48 changed files with 204 additions and 145 deletions

View File

@@ -21,13 +21,12 @@ class ReaderActivity : AppCompatActivity() {
context: Context,
mangaId: Long,
chapterIndex: Int,
): Intent {
return Intent(context, ReaderActivity::class.java).apply {
): Intent =
Intent(context, ReaderActivity::class.java).apply {
putExtra("manga", mangaId)
putExtra("chapter", chapterIndex)
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {

View File

@@ -74,9 +74,7 @@ class AndroidDownloadService : Service() {
context.stopService(Intent(context, AndroidDownloadService::class.java))
}
fun isRunning(): Boolean {
return instance != null
}
fun isRunning(): Boolean = instance != null
private val json = Json {
ignoreUnknownKeys = true
@@ -87,9 +85,7 @@ class AndroidDownloadService : Service() {
private lateinit var ioScope: CoroutineScope
override fun onBind(intent: Intent): IBinder? {
return null
}
override fun onBind(intent: Intent): IBinder? = null
override fun onCreate() {
super.onCreate()
@@ -123,7 +119,9 @@ class AndroidDownloadService : Service() {
Actions.START.name,
Actions.RESTART.name,
-> startWebsocket()
Actions.STOP.name -> stopSelf()
else -> log.info { "This should never happen. No action in the received intent" }
}
} else {

View File

@@ -73,9 +73,7 @@ class AndroidLibraryService : Service() {
context.stopService(Intent(context, AndroidLibraryService::class.java))
}
fun isRunning(): Boolean {
return instance != null
}
fun isRunning(): Boolean = instance != null
private val json = Json {
ignoreUnknownKeys = true
@@ -86,9 +84,7 @@ class AndroidLibraryService : Service() {
private lateinit var ioScope: CoroutineScope
override fun onBind(intent: Intent): IBinder? {
return null
}
override fun onBind(intent: Intent): IBinder? = null
override fun onCreate() {
super.onCreate()
@@ -122,7 +118,9 @@ class AndroidLibraryService : Service() {
Actions.START.name,
Actions.RESTART.name,
-> startWebsocket()
Actions.STOP.name -> stopSelf()
else -> log.info { "This should never happen. No action in the received intent" }
}
} else {