diff --git a/app/build.gradle b/app/build.gradle index 2653a19..6b6e16b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -50,56 +50,53 @@ dependencies { implementation 'com.google.android.material:material:1.2.0-alpha06' // Android KTX - implementation 'androidx.core:core-ktx:1.2.0' + implementation 'androidx.core:core-ktx:1.3.0' // UI - implementation "androidx.viewpager2:viewpager2:1.0.0" implementation 'com.yarolegovich:discrete-scrollview:1.4.9' implementation "androidx.fragment:fragment-ktx:1.3.0-alpha05" implementation 'androidx.constraintlayout:constraintlayout:1.1.3' // Navigation - implementation "androidx.navigation:navigation-fragment-ktx:2.3.0-beta01" - implementation "androidx.navigation:navigation-ui-ktx:2.3.0-beta01" + def navigation_version = '2.3.0-beta01' + implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version" + implementation "androidx.navigation:navigation-ui-ktx:$navigation_version" // Coroutines for getting off the UI thread - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5" + def coroutines_version = '1.3.5' + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" // Retrofit for networking - implementation 'com.squareup.retrofit2:retrofit:2.7.1' + def retrofit2_version = '2.7.1' + implementation "com.squareup.retrofit2:retrofit:$retrofit2_version" + implementation "com.squareup.retrofit2:converter-gson:$retrofit2_version" implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2' - implementation 'com.squareup.retrofit2:converter-gson:2.7.1' - implementation 'com.squareup.retrofit2:converter-scalars:2.7.1' - implementation 'com.squareup.retrofit2:converter-moshi:2.7.1' - - //OkHTTP - implementation "com.squareup.okhttp3:okhttp:4.4.0" - implementation "com.squareup.okhttp3:logging-interceptor:4.4.0" //Parsing the JSON format - implementation 'com.squareup.moshi:moshi:1.9.2' - implementation 'com.squareup.moshi:moshi-kotlin:1.9.2' implementation 'com.google.code.gson:gson:2.8.6' - kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.2' + + //OkHTTP + def okhttp3_version = '4.4.0' + implementation "com.squareup.okhttp3:okhttp:$okhttp3_version" + implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" + //Firebase implementation 'com.google.firebase:firebase-auth:19.3.1' implementation 'com.google.android.gms:play-services-auth:18.0.0' implementation 'com.google.firebase:firebase-firestore-ktx:21.4.3' - // arch components + // Arch components // ViewModel and LiveData - implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha03' + def lifecycle_version = '2.2.0' + implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" // glide for images - implementation 'com.github.bumptech.glide:glide:4.11.0' - kapt 'com.github.bumptech.glide:compiler:4.11.0' - -// //Database -// implementation "androidx.room:room-runtime:2.2.4" -// kapt "androidx.room:room-compiler:2.2.4" + def glide_version = '4.11.0' + implementation "com.github.bumptech.glide:glide:$glide_version" + kapt "com.github.bumptech.glide:compiler:$glide_version" //Dagger 2 def dagger_version = '2.26' diff --git a/app/src/main/java/com/example/movieapp/dagger/App.kt b/app/src/main/java/com/example/movieapp/dagger/App.kt index 0dbfeca..1eb4a61 100644 --- a/app/src/main/java/com/example/movieapp/dagger/App.kt +++ b/app/src/main/java/com/example/movieapp/dagger/App.kt @@ -6,9 +6,8 @@ import com.example.movieapp.dagger.component.DaggerAppComponent import com.example.movieapp.dagger.module.NetworkModule class App : Application(){ - companion object{ - lateinit var appComponent: AppComponent - } + + companion object{ lateinit var appComponent: AppComponent } override fun onCreate() { super.onCreate() diff --git a/app/src/main/java/com/example/movieapp/dagger/module/NetworkModule.kt b/app/src/main/java/com/example/movieapp/dagger/module/NetworkModule.kt index 76b7250..b26b0d6 100644 --- a/app/src/main/java/com/example/movieapp/dagger/module/NetworkModule.kt +++ b/app/src/main/java/com/example/movieapp/dagger/module/NetworkModule.kt @@ -6,8 +6,6 @@ import com.example.movieapp.model.network.news.NewsApi import com.example.movieapp.model.network.news.NewsSource import com.example.movieapp.model.network.MovieListSource import com.jakewharton.retrofit2.adapter.kotlin.coroutines.CoroutineCallAdapterFactory -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory import dagger.Module import dagger.Provides import dagger.Reusable @@ -16,8 +14,6 @@ import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory -import retrofit2.converter.moshi.MoshiConverterFactory -import retrofit2.converter.scalars.ScalarsConverterFactory import java.io.File import java.util.* import java.util.concurrent.TimeUnit @@ -41,8 +37,7 @@ class NetworkModule (private val application: Application) { .readTimeout(60, TimeUnit.SECONDS) .writeTimeout(60, TimeUnit.SECONDS) .addInterceptor(interceptor) - .build() - } + .build() } @Provides @Reusable diff --git a/app/src/main/java/com/example/movieapp/dagger/module/viewModule/ViewModelFactory.kt b/app/src/main/java/com/example/movieapp/dagger/module/viewModule/ViewModelFactory.kt index baa96a7..4db38b4 100644 --- a/app/src/main/java/com/example/movieapp/dagger/module/viewModule/ViewModelFactory.kt +++ b/app/src/main/java/com/example/movieapp/dagger/module/viewModule/ViewModelFactory.kt @@ -13,9 +13,7 @@ class ViewModelFactory @Inject constructor(private val viewModels: MutableMap - - diff --git a/app/src/main/res/drawable/ic_local_phone_black_24dp.xml b/app/src/main/res/drawable/ic_local_phone_black_24dp.xml deleted file mode 100644 index ccdb67c..0000000 --- a/app/src/main/res/drawable/ic_local_phone_black_24dp.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/layout/detail_fragment.xml b/app/src/main/res/layout/detail_fragment.xml index 278f15a..7de014a 100644 --- a/app/src/main/res/layout/detail_fragment.xml +++ b/app/src/main/res/layout/detail_fragment.xml @@ -22,6 +22,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> + - + android:id="@+id/year_ditale" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/title_detail" + app:layout_constraintTop_toBottomOf="@+id/title_detail" + tools:text="2019" + android:text="@{viewModel.selectProperty.release_date}" /> - + - + + + +