From 59a95385599ec48a637f0fa6398a4d170e5670cd Mon Sep 17 00:00:00 2001 From: Felix Date: Thu, 11 Jun 2020 15:39:17 +0200 Subject: [PATCH] ktlint format --- .../common/viewmodel/DetailsViewModel.kt | 4 ++-- .../chaosflix/touch/browse/cast/CastService.kt | 16 ++++++++-------- .../chaosflix/touch/NavigationActivity.kt | 1 - 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/viewmodel/DetailsViewModel.kt b/common/src/main/java/de/nicidienase/chaosflix/common/viewmodel/DetailsViewModel.kt index 6e89ccd8..e8ce66b6 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/viewmodel/DetailsViewModel.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/viewmodel/DetailsViewModel.kt @@ -19,11 +19,11 @@ import de.nicidienase.chaosflix.common.userdata.entities.watchlist.WatchlistItem import de.nicidienase.chaosflix.common.util.LiveEvent import de.nicidienase.chaosflix.common.util.SingleLiveEvent import de.nicidienase.chaosflix.touch.browse.cast.CastService +import java.io.File +import java.util.ArrayList import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext -import java.io.File -import java.util.ArrayList class DetailsViewModel( private val database: ChaosflixDatabase, diff --git a/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt b/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt index aef0fb52..6b52f3f1 100644 --- a/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt +++ b/common/src/noFree/java/de/nicidienase/chaosflix/touch/browse/cast/CastService.kt @@ -17,15 +17,17 @@ import de.nicidienase.chaosflix.common.mediadata.entities.streaming.StreamUrl import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgressDao import de.nicidienase.chaosflix.touch.browse.streaming.StreamingItem +import java.util.Date import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import pl.droidsonroids.casty.Casty import pl.droidsonroids.casty.MediaData -import java.util.Date -class CastService(private val playbackProgressDao: PlaybackProgressDao, - private val scope: CoroutineScope) : LifecycleObserver { +class CastService( + private val playbackProgressDao: PlaybackProgressDao, + private val scope: CoroutineScope +) : LifecycleObserver { private var currentEvent: Event? = null @@ -107,8 +109,9 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao, } private inner class SessionListener( - private val guid: String, - progress: PlaybackProgress?): SessionManagerListener { + private val guid: String, + progress: PlaybackProgress? + ) : SessionManagerListener { private lateinit var playbackProgress: PlaybackProgress init { @@ -123,7 +126,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao, progress.apply { this.id = id } } } - } } @@ -145,7 +147,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao, castSession.remoteMediaClient?.addProgressListener(progressListener, 5000) } - override fun onSessionStarted(p0: CastSession?, p1: String?) { Log.d(TAG, "onSessionStarted") p0?.let { attachProgressListener(it) } @@ -176,7 +177,6 @@ class CastService(private val playbackProgressDao: PlaybackProgressDao, override fun onSessionStartFailed(p0: CastSession?, p1: Int) { } - } companion object { diff --git a/touch/src/main/java/de/nicidienase/chaosflix/touch/NavigationActivity.kt b/touch/src/main/java/de/nicidienase/chaosflix/touch/NavigationActivity.kt index a2bd5f12..389a1d94 100644 --- a/touch/src/main/java/de/nicidienase/chaosflix/touch/NavigationActivity.kt +++ b/touch/src/main/java/de/nicidienase/chaosflix/touch/NavigationActivity.kt @@ -71,7 +71,6 @@ class NavigationActivity : AppCompatActivity() { override fun onStart() { super.onStart() viewModel.attachActivityToCastService(this) - } override fun onNewIntent(intent: Intent?) {