fix title not being set properly when returning from tv detail view and fix tv details not returning from server

This commit is contained in:
Owen LeJeune
2022-02-14 12:02:19 -05:00
parent b69cfff94b
commit 0f3fe7ea7c
4 changed files with 17 additions and 5 deletions

View File

@@ -4,6 +4,6 @@ import com.google.gson.annotations.SerializedName
class DetailedMovie(
@SerializedName("id") override val id: Int,
@SerializedName("origina_title") override val title: String,
@SerializedName("original_title") override val title: String,
@SerializedName("poster_path") override val posterPath: String?
): DetailedItem(id, title, posterPath)

View File

@@ -1,9 +1,9 @@
package com.owenlejeune.tvtime.api.tmdb.model
import com.owenlejeune.tvtime.api.tmdb.model.DetailedItem
import com.google.gson.annotations.SerializedName
class DetailedTv(
id: Int,
title: String,
posterPath: String?
@SerializedName("id") override val id: Int,
@SerializedName("name") override val title: String,
@SerializedName("poster_path") override val posterPath: String?
): DetailedItem(id, title, posterPath)

View File

@@ -6,6 +6,16 @@ sealed class BottomNavItem(val name: String, val icon: Int, val route: String) {
companion object {
val Items = listOf(Movies, TV, Favourites, Settings)
fun getByRoute(route: String?): BottomNavItem? {
return when (route) {
Movies.route -> Movies
TV.route -> TV
Favourites.route -> Favourites
Settings.route -> Settings
else -> null
}
}
}
object Movies: BottomNavItem("Movies", R.drawable.ic_movie, "movies_route")

View File

@@ -85,6 +85,8 @@ private fun BottomNavBar(navController: NavController, appBarTitle: MutableState
)
}
}
appBarTitle.value = BottomNavItem.getByRoute(currentRoute)?.name ?: ""
}
private fun onBottomAppBarItemClicked(