mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-19 10:11:13 -05:00
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:
@@ -4,6 +4,6 @@ import com.google.gson.annotations.SerializedName
|
|||||||
|
|
||||||
class DetailedMovie(
|
class DetailedMovie(
|
||||||
@SerializedName("id") override val id: Int,
|
@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?
|
@SerializedName("poster_path") override val posterPath: String?
|
||||||
): DetailedItem(id, title, posterPath)
|
): DetailedItem(id, title, posterPath)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.owenlejeune.tvtime.api.tmdb.model
|
package com.owenlejeune.tvtime.api.tmdb.model
|
||||||
|
|
||||||
import com.owenlejeune.tvtime.api.tmdb.model.DetailedItem
|
import com.google.gson.annotations.SerializedName
|
||||||
|
|
||||||
class DetailedTv(
|
class DetailedTv(
|
||||||
id: Int,
|
@SerializedName("id") override val id: Int,
|
||||||
title: String,
|
@SerializedName("name") override val title: String,
|
||||||
posterPath: String?
|
@SerializedName("poster_path") override val posterPath: String?
|
||||||
): DetailedItem(id, title, posterPath)
|
): DetailedItem(id, title, posterPath)
|
||||||
@@ -6,6 +6,16 @@ sealed class BottomNavItem(val name: String, val icon: Int, val route: String) {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val Items = listOf(Movies, TV, Favourites, Settings)
|
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")
|
object Movies: BottomNavItem("Movies", R.drawable.ic_movie, "movies_route")
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ private fun BottomNavBar(navController: NavController, appBarTitle: MutableState
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
appBarTitle.value = BottomNavItem.getByRoute(currentRoute)?.name ?: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onBottomAppBarItemClicked(
|
private fun onBottomAppBarItemClicked(
|
||||||
|
|||||||
Reference in New Issue
Block a user