diff --git a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/streaming/Room.kt b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/streaming/Room.kt index 25614f8b..1fcfd910 100644 --- a/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/streaming/Room.kt +++ b/common/src/main/java/de/nicidienase/chaosflix/common/mediadata/entities/streaming/Room.kt @@ -13,7 +13,7 @@ data class Room(var slug: String, var link: String, var display: String, var talks: Map?, - var streams: MutableList) : Parcelable { + var streams: List) : Parcelable { protected constructor(input: Parcel) : this( @@ -23,7 +23,7 @@ data class Room(var slug: String, link = input.readString() ?: "", display = input.readString() ?: "", talks = readMap(input), - streams = input.createTypedArrayList(Stream.CREATOR) ?: emptyList().toMutableList()) + streams = input.createTypedArrayList(Stream.CREATOR).filterNotNull()) override fun describeContents(): Int { @@ -79,7 +79,7 @@ data class Room(var slug: String, "Dummy Room", HashMap(), ArrayList()) - dummy.streams.add(Stream.dummyObject) + dummy.streams = listOf(Stream.dummyObject) return dummy } diff --git a/leanback/src/main/java/de/nicidienase/chaosflix/leanback/EventDetailsDescriptionPresenter.kt b/leanback/src/main/java/de/nicidienase/chaosflix/leanback/EventDetailsDescriptionPresenter.kt index d1bb2ccb..5803845d 100644 --- a/leanback/src/main/java/de/nicidienase/chaosflix/leanback/EventDetailsDescriptionPresenter.kt +++ b/leanback/src/main/java/de/nicidienase/chaosflix/leanback/EventDetailsDescriptionPresenter.kt @@ -24,15 +24,14 @@ class EventDetailsDescriptionPresenter(private val context: Context) : Presenter } val dataHolder: DetailDataHolder if (item is PersistentEvent) { - val persistentEvent = item val sb = StringBuilder() - val speaker = TextUtils.join(", ", persistentEvent.persons) - sb.append(persistentEvent.description) + val speaker = TextUtils.join(", ", item.persons ?: emptyArray()) + sb.append(item.description) .append("\n") - .append("\nreleased at: ").append(persistentEvent.releaseDate) - .append("\nTags: ").append(android.text.TextUtils.join(", ", persistentEvent.tags!!)) - dataHolder = DetailDataHolder(persistentEvent.title, - persistentEvent.subtitle, + .append("\nreleased at: ").append(item.releaseDate) + .append("\nTags: ").append(android.text.TextUtils.join(", ", item.tags!!)) + dataHolder = DetailDataHolder(item.title, + item.subtitle, speaker, sb.toString()) } else if (item is Room) { diff --git a/leanback/src/main/java/de/nicidienase/chaosflix/leanback/fragments/EventDetailsFragment.kt b/leanback/src/main/java/de/nicidienase/chaosflix/leanback/fragments/EventDetailsFragment.kt index 211d1030..421b885f 100644 --- a/leanback/src/main/java/de/nicidienase/chaosflix/leanback/fragments/EventDetailsFragment.kt +++ b/leanback/src/main/java/de/nicidienase/chaosflix/leanback/fragments/EventDetailsFragment.kt @@ -181,10 +181,10 @@ class EventDetailsFragment : DetailsSupportFragment() { setThumb(room.thumb, detailsOverview) initializeBackgroundWithImage(room.thumb) - val dashStreams = room.streams.filter { it?.slug == "dash-native" } + val dashStreams = room.streams.filter { it.slug == "dash-native" } if (dashStreams.size > 0){ // && detailsViewModel.getAutoselectStream()) { - dashStreams.first()?.urls?.get("dash")?.url?.let { preparePlayer(it, "") } + dashStreams.first().urls.get("dash")?.url?.let { preparePlayer(it, "") } } val actionAdapter = ArrayObjectAdapter() @@ -349,13 +349,13 @@ class EventDetailsFragment : DetailsSupportFragment() { fun showWatchlistInfoDialog(preferences: SharedPreferences) { val builder = AlertDialog.Builder(activity) builder.setTitle(R.string.watchlist_message) - builder.setNegativeButton(R.string.return_to_homescreen) { dialog, which -> + builder.setNegativeButton(R.string.return_to_homescreen) { _, _ -> val i = Intent(activity, ConferencesActivity::class.java) i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK) startActivity(i) // getActivity().finish(); } - builder.setPositiveButton("OK") { dialog, which -> } + builder.setPositiveButton("OK") { _, _ -> } val edit = preferences.edit() edit.putBoolean(getString(R.string.watchlist_dialog_needed), false) edit.apply() diff --git a/touch/src/main/java/de/nicidienase/chaosflix/touch/browse/download/OfflineEventAdapter.kt b/touch/src/main/java/de/nicidienase/chaosflix/touch/browse/download/OfflineEventAdapter.kt index 42d570b1..5691de96 100644 --- a/touch/src/main/java/de/nicidienase/chaosflix/touch/browse/download/OfflineEventAdapter.kt +++ b/touch/src/main/java/de/nicidienase/chaosflix/touch/browse/download/OfflineEventAdapter.kt @@ -33,7 +33,7 @@ class OfflineEventAdapter(var items: List>, buttonDelete.setOnClickListener { viewModel.deleteOfflineItem(item.first) } - content?.setOnClickListener { view -> + content?.setOnClickListener { _ -> listener.onEventSelected(item.second) }