mirror of
https://github.com/owenlejeune/TVTime.git
synced 2025-11-10 22:02:46 -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(
|
||||
@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)
|
||||
|
||||
@@ -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)
|
||||
@@ -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")
|
||||
|
||||
@@ -85,6 +85,8 @@ private fun BottomNavBar(navController: NavController, appBarTitle: MutableState
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
appBarTitle.value = BottomNavItem.getByRoute(currentRoute)?.name ?: ""
|
||||
}
|
||||
|
||||
private fun onBottomAppBarItemClicked(
|
||||
|
||||
Reference in New Issue
Block a user