Skip to content

Update project to latest dependencies #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ plugins {
}

android {
compileSdk 32
compileSdk 33

defaultConfig {
applicationId "com.farhan.tanvir.androidcleanarchitecture"
minSdk 21
targetSdk 32
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -20,6 +20,7 @@ android {
useSupportLibrary true
}
buildConfigField("String","BASE_URL",BASE_URL)
buildConfigField("String","API_KEY",API_KEY)
buildConfigField("String","POSTER_URL",POSTER_URL)

}
Expand Down Expand Up @@ -52,41 +53,42 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
implementation 'androidx.activity:activity-compose:1.7.2'
implementation project(path: ':data')
implementation project(path: ':domain')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"

//hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
implementation 'androidx.navigation:navigation-compose:2.6.0'

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.8.0")

//GSON
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.google.code.gson:gson:2.10.1'

// Coil
implementation("io.coil-kt:coil-compose:1.4.0")
implementation("io.coil-kt:coil-compose:2.3.0")

// System UI Controller - Accompanist
implementation "com.google.accompanist:accompanist-systemuicontroller:0.17.0"
implementation "com.google.accompanist:accompanist-systemuicontroller:0.30.1"

//ROOM DB
implementation "androidx.room:room-runtime:$room_version"
Expand All @@ -95,7 +97,7 @@ dependencies {
implementation "androidx.room:room-paging:$room_version"

// Paging 3.0
implementation 'androidx.paging:paging-compose:1.0.0-alpha14'
implementation 'androidx.paging:paging-compose:3.2.0-rc01'

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import coil.compose.rememberImagePainter
import coil.request.ImageRequest
import coil.size.Scale
import com.farhan.tanvir.androidcleanarchitecture.BuildConfig
import com.farhan.tanvir.androidcleanarchitecture.presentation.components.RatingComponent
Expand All @@ -32,12 +35,13 @@ fun MovieDetailsContent(movie: Movie) {
.fillMaxWidth()
.verticalScroll(scrollState)
) {
Image(
painter = rememberImagePainter(
data = BuildConfig.POSTER_URL + movie.posterPath, builder = {
crossfade(true)
scale(Scale.FIT)
}),
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(
BuildConfig.POSTER_URL + movie.posterPath
)
.crossfade(true)
.build(),
contentDescription = null,
modifier = Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun HomeScreen(navController: NavHostController, viewModel: HomeViewModel = hilt
topBar = {
HomeTopBar()
},
content = {
content = { it
MovieListContent(allMovies = allMovies, navController = navController)
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.farhan.tanvir.androidcleanarchitecture.presentation.screen.home

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
Expand All @@ -11,13 +10,15 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.items
import coil.compose.rememberImagePainter
import coil.size.Scale
import androidx.paging.compose.itemContentType
import androidx.paging.compose.itemKey
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.farhan.tanvir.androidcleanarchitecture.BuildConfig
import com.farhan.tanvir.androidcleanarchitecture.presentation.components.RatingComponent
import com.farhan.tanvir.androidcleanarchitecture.presentation.navigation.Screen
Expand All @@ -26,15 +27,16 @@ import com.farhan.tanvir.domain.model.Movie

@Composable
fun MovieListContent(allMovies: LazyPagingItems<Movie>, navController: NavHostController) {

LazyColumn(
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp)
) {
items(
items = allMovies,
key = { movie ->
movie.pk
}
) { movie ->
contentType = allMovies.itemContentType { "MyPagingItems" },
key = allMovies.itemKey { it },
count = allMovies.itemCount,
) { index ->
val movie = allMovies[index]
if (movie != null) {
MovieListItem(movie = movie, navController = navController)
}
Expand Down Expand Up @@ -62,26 +64,29 @@ fun MovieListItem(movie: Movie, navController: NavHostController) {
verticalAlignment = Alignment.CenterVertically
) {
movie.posterPath?.let {
Image(
AsyncImage(
modifier = Modifier
.padding(
end = 4.dp,
)
.width(120.dp),
painter = rememberImagePainter(
data = BuildConfig.POSTER_URL + movie.posterPath, builder = {
crossfade(true)
scale(Scale.FILL)
}),
model = ImageRequest.Builder(LocalContext.current)
.data(
BuildConfig.POSTER_URL + movie.posterPath
)
.crossfade(true)
.build(),
contentDescription = null,
contentScale = ContentScale.Fit
)
}
Column(Modifier
.height(IntrinsicSize.Max)
.padding(
end = 2.dp,
)) {
Column(
Modifier
.height(IntrinsicSize.Max)
.padding(
end = 2.dp,
)
) {
movie.title?.let { Text(text = it, style = MaterialTheme.typography.body1) }
Spacer(modifier = Modifier.height(4.dp))
movie.overview?.let {
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
buildscript {
ext {
compose_version = '1.1.0'
hilt_version = "2.40.5"
compose_version = '1.4.3'
hilt_version = "2.46"
coroutine_version="1.6.0"
room_version="2.4.1"
room_version="2.5.2"
}

dependencies {
Expand All @@ -13,7 +13,7 @@ buildscript {
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
}

task clean(type: Delete) {
Expand Down
21 changes: 11 additions & 10 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ plugins {
}

android {
compileSdk 32
compileSdk 33

defaultConfig {
minSdk 21
targetSdk 32
targetSdk 34

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
buildConfigField("String","API_KEY",API_KEY)
buildConfigField("String","POSTER_URL",POSTER_URL)
}

buildTypes {
Expand All @@ -33,21 +34,21 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation project(path: ':domain')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

//Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

//ROOM DB
implementation "androidx.room:room-runtime:$room_version"
Expand All @@ -56,7 +57,7 @@ dependencies {
implementation "androidx.room:room-paging:$room_version"

// Paging 3.0
implementation 'androidx.paging:paging-compose:1.0.0-alpha14'
implementation 'androidx.paging:paging-compose:3.2.0-rc01'


}
Loading