Skip to content

Commit 236e108

Browse files
committed
Update libs
1 parent 0e2b4f6 commit 236e108

25 files changed

+162
-156
lines changed

app/build.gradle.kts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -146,30 +146,30 @@ dependencies {
146146

147147
// List of KTX extensions
148148
// https://developer.android.com/kotlin/ktx/extensions-list
149-
implementation("androidx.core:core-ktx:1.8.0-alpha03")
149+
implementation("androidx.core:core-ktx:1.9.0-alpha02")
150150
implementation("androidx.activity:activity-ktx:1.4.0")
151151
implementation("androidx.fragment:fragment-ktx:1.4.1")
152152

153153
// Lifecycle
154154
// https://developer.android.com/jetpack/androidx/releases/lifecycle
155-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0")
156-
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.4.0")
157-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0")
158-
implementation("androidx.lifecycle:lifecycle-common-java8:2.4.0")
155+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1")
156+
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.4.1")
157+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.1")
158+
implementation("androidx.lifecycle:lifecycle-common-java8:2.4.1")
159159

160160
// Preferences DataStore
161161
// https://android-developers.googleblog.com/2020/09/prefer-storing-data-with-jetpack.html
162162
implementation("androidx.datastore:datastore-preferences:1.0.0")
163163

164164
// room
165165
// https://developer.android.com/topic/libraries/architecture/room
166-
implementation("androidx.room:room-runtime:2.4.1")
167-
kapt("androidx.room:room-compiler:2.4.1")
168-
implementation("androidx.room:room-ktx:2.4.1")
166+
implementation("androidx.room:room-runtime:2.4.2")
167+
kapt("androidx.room:room-compiler:2.4.2")
168+
implementation("androidx.room:room-ktx:2.4.2")
169169

170170
// paging
171171
// https://developer.android.com/topic/libraries/architecture/paging
172-
implementation("androidx.paging:paging-runtime-ktx:3.1.0")
172+
implementation("androidx.paging:paging-runtime-ktx:3.1.1")
173173

174174
// navigation
175175
// https://developer.android.com/jetpack/androidx/releases/navigation
@@ -219,8 +219,8 @@ dependencies {
219219

220220
// firebase
221221
// https://firebase.google.com/docs/android/setup
222-
implementation("com.google.firebase:firebase-analytics:20.0.2")
223-
implementation("com.google.firebase:firebase-crashlytics:18.2.7")
222+
implementation("com.google.firebase:firebase-analytics:20.1.2")
223+
implementation("com.google.firebase:firebase-crashlytics:18.2.9")
224224

225225
// lottie
226226
// https://github.com/airbnb/lottie-android

app/src/main/java/com/example/moviedb/MainApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class MainApplication : Application() {
6363
)
6464
startActivity(intent)
6565
try {
66-
exitProcess(2);
66+
exitProcess(2)
6767
} catch (e: Exception) {
6868
startActivity(intent)
6969
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package com.example.moviedb.data.model
22

33
import android.os.Parcelable
4+
import com.squareup.moshi.Json
45
import com.squareup.moshi.JsonClass
56
import kotlinx.parcelize.Parcelize
67

78
@Parcelize
89
@JsonClass(generateAdapter = true)
910
data class Backdrop(
10-
val aspect_ratio: Double? = null,
11-
val file_path: String? = null,
12-
val height: Int? = null,
13-
val iso_639_1: String? = null,
14-
val vote_average: Int? = null,
15-
val vote_count: Int? = null,
16-
val width: Int? = null
11+
@Json(name = "aspect_ratio") val aspectRatio: Double? = null,
12+
@Json(name = "file_path") val filePath: String? = null,
13+
@Json(name = "height") val height: Int? = null,
14+
@Json(name = "iso_639_1") val iso6391: String? = null,
15+
@Json(name = "vote_average") val voteAverage: Int? = null,
16+
@Json(name = "vote_count") val voteCount: Int? = null,
17+
@Json(name = "width") val width: Int? = null
1718
) : Parcelable

app/src/main/java/com/example/moviedb/data/model/Cast.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@ package com.example.moviedb.data.model
22

33
import android.os.Parcelable
44
import com.example.moviedb.BuildConfig
5+
import com.squareup.moshi.Json
56
import com.squareup.moshi.JsonClass
67
import kotlinx.parcelize.Parcelize
78

89
@Parcelize
910
@JsonClass(generateAdapter = true)
1011
data class Cast(
11-
val cast_id: String? = null,
12-
val character: String? = null,
13-
val credit_id: String? = null,
14-
val gender: Int? = null,
15-
val id: String? = null,
16-
val name: String? = null,
17-
val order: Int? = null,
18-
val profile_path: String? = null
12+
@Json(name = "cast_id") val castId: String? = null,
13+
@Json(name = "character") val character: String? = null,
14+
@Json(name = "credit_id") val creditId: String? = null,
15+
@Json(name = "gender") val gender: Int? = null,
16+
@Json(name = "id") val id: String? = null,
17+
@Json(name = "name") val name: String? = null,
18+
@Json(name = "order") val order: Int? = null,
19+
@Json(name = "profile_path") val profilePath: String? = null
1920
) : Parcelable {
2021

2122
fun getFullProfilePath() =
22-
if (profile_path.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + profile_path
23+
if (profilePath.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + profilePath
2324

2425
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package com.example.moviedb.data.model
22

33
import android.os.Parcelable
4+
import com.squareup.moshi.Json
45
import com.squareup.moshi.JsonClass
56
import kotlinx.parcelize.Parcelize
67

78
@Parcelize
89
@JsonClass(generateAdapter = true)
910
data class Crew(
10-
val credit_id: String? = null,
11-
val department: String? = null,
12-
val gender: Int? = null,
13-
val id: String? = null,
14-
val job: String? = null,
15-
val name: String? = null,
16-
val profile_path: String? = null
11+
@Json(name = "credit_id") val creditId: String? = null,
12+
@Json(name = "department") val department: String? = null,
13+
@Json(name = "gender") val gender: Int? = null,
14+
@Json(name = "id") val id: String? = null,
15+
@Json(name = "job") val job: String? = null,
16+
@Json(name = "name") val name: String? = null,
17+
@Json(name = "profile_path") val profilePath: String? = null
1718
) : Parcelable

app/src/main/java/com/example/moviedb/data/model/Movie.kt

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.os.Parcelable
44
import androidx.room.Entity
55
import androidx.room.PrimaryKey
66
import com.example.moviedb.BuildConfig
7+
import com.squareup.moshi.Json
78
import com.squareup.moshi.JsonClass
89
import kotlinx.parcelize.Parcelize
910

@@ -12,32 +13,32 @@ import kotlinx.parcelize.Parcelize
1213
@Entity(tableName = "movie")
1314
data class Movie(
1415
@PrimaryKey(autoGenerate = false)
15-
val id: String,
16-
val adult: Boolean? = false,
17-
val backdrop_path: String? = null,
18-
val budget: Int? = null,
19-
val homepage: String? = null,
20-
val imdb_id: String? = null,
21-
val original_language: String? = null,
22-
val original_title: String? = null,
23-
val overview: String? = null,
24-
val popularity: Double? = null,
25-
val poster_path: String? = null,
26-
val release_date: String? = null,
27-
val revenue: Int? = null,
28-
val runtime: Int? = null,
29-
val status: String? = null,
30-
val tagline: String? = null,
31-
val title: String? = null,
32-
val video: Boolean? = false,
33-
val vote_average: Double? = null,
34-
val vote_count: Int? = null,
16+
@Json(name = "id") val id: String,
17+
@Json(name = "adult") val adult: Boolean? = false,
18+
@Json(name = "backdrop_path") val backdropPath: String? = null,
19+
@Json(name = "budget") val budget: Int? = null,
20+
@Json(name = "homepage") val homepage: String? = null,
21+
@Json(name = "imdb_id") val imdbId: String? = null,
22+
@Json(name = "original_language") val originalLanguage: String? = null,
23+
@Json(name = "original_title") val originalTitle: String? = null,
24+
@Json(name = "overview") val overview: String? = null,
25+
@Json(name = "popularity") val popularity: Double? = null,
26+
@Json(name = "poster_path") val posterPath: String? = null,
27+
@Json(name = "release_date") val releaseDate: String? = null,
28+
@Json(name = "revenue") val revenue: Int? = null,
29+
@Json(name = "runtime") val runtime: Int? = null,
30+
@Json(name = "status") val status: String? = null,
31+
@Json(name = "tagline") val tagline: String? = null,
32+
@Json(name = "title") val title: String? = null,
33+
@Json(name = "video") val video: Boolean? = false,
34+
@Json(name = "vote_average") val voteAverage: Double? = null,
35+
@Json(name = "vote_count") val voteCount: Int? = null,
3536
var isFavorite: Boolean? = false
3637
) : Parcelable {
3738

3839
fun getFullBackdropPath() =
39-
if (backdrop_path.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + backdrop_path
40+
if (backdropPath.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + backdropPath
4041

4142
fun getFullPosterPath() =
42-
if (poster_path.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + poster_path
43+
if (posterPath.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + posterPath
4344
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
package com.example.moviedb.data.model
22

33
import android.os.Parcelable
4+
import com.squareup.moshi.Json
45
import com.squareup.moshi.JsonClass
56
import kotlinx.parcelize.Parcelize
67

78
@Parcelize
89
@JsonClass(generateAdapter = true)
910
data class Poster(
10-
val aspect_ratio: Double? = null,
11-
val file_path: String? = null,
12-
val height: Int? = null,
13-
val iso_639_1: String? = null,
14-
val vote_average: Int? = null,
15-
val vote_count: Int? = null,
16-
val width: Int? = null
11+
@Json(name = "aspect_ratio") val aspectRatio: Double? = null,
12+
@Json(name = "file_path") val filePath: String? = null,
13+
@Json(name = "height") val height: Int? = null,
14+
@Json(name = "iso_639_1") val iso6391: String? = null,
15+
@Json(name = "vote_average") val voteAverage: Int? = null,
16+
@Json(name = "vote_count") val voteCount: Int? = null,
17+
@Json(name = "width") val width: Int? = null
1718
) : Parcelable

app/src/main/java/com/example/moviedb/data/model/Tv.kt

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@ package com.example.moviedb.data.model
22

33
import android.os.Parcelable
44
import com.example.moviedb.BuildConfig
5+
import com.squareup.moshi.Json
56
import com.squareup.moshi.JsonClass
67
import kotlinx.parcelize.Parcelize
78

89
@Parcelize
910
@JsonClass(generateAdapter = true)
1011
data class Tv(
11-
val id: String,
12-
val original_name: String? = null,
13-
val name: String? = null,
14-
val popularity: Double? = null,
15-
val vote_count: Int? = null,
16-
val first_air_date: String? = null,
17-
val backdrop_path: String? = null,
18-
val original_language: String? = null,
19-
val vote_average: Double? = null,
20-
val overview: String? = null,
21-
val poster_path: String? = null
12+
@Json(name = "id") val id: String,
13+
@Json(name = "original_name") val originalName: String? = null,
14+
@Json(name = "name") val name: String? = null,
15+
@Json(name = "popularity") val popularity: Double? = null,
16+
@Json(name = "vote_count") val voteCount: Int? = null,
17+
@Json(name = "first_air_date") val firstAirDate: String? = null,
18+
@Json(name = "backdrop_path") val backdropPath: String? = null,
19+
@Json(name = "original_language") val originalLanguage: String? = null,
20+
@Json(name = "vote_average") val voteAverage: Double? = null,
21+
@Json(name = "overview") val overview: String? = null,
22+
@Json(name = "poster_path") val posterPath: String? = null
2223
) : Parcelable {
2324
fun getFullPosterPath() =
24-
if (poster_path.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + poster_path
25+
if (posterPath.isNullOrBlank()) null else BuildConfig.SMALL_IMAGE_URL + posterPath
2526
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.example.moviedb.data.remote.response
22

3+
import com.squareup.moshi.Json
4+
35
class BaseItemResponse<Item>(
4-
val item: Item? = null
6+
@Json(name = "item") val item: Item? = null
57
) : BaseResponse()

app/src/main/java/com/example/moviedb/data/remote/response/GetCastAndCrewResponse.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package com.example.moviedb.data.remote.response
22

33
import com.example.moviedb.data.model.Cast
44
import com.example.moviedb.data.model.Crew
5+
import com.squareup.moshi.Json
56

67
class GetCastAndCrewResponse(
7-
val id: Int? = null,
8-
val cast: List<Cast>? = null,
9-
val crew: List<Crew>? = null
8+
@Json(name = "id") val id: Int? = null,
9+
@Json(name = "cast") val cast: List<Cast>? = null,
10+
@Json(name = "crew") val crew: List<Crew>? = null
1011
) : BaseResponse()

0 commit comments

Comments
 (0)