diff --git a/app/build.gradle b/app/build.gradle index 7486c4c..3111da0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,19 +1,20 @@ plugins { id "com.android.application" id "kotlin-android" - id "kotlin-kapt" + id "com.google.devtools.ksp" + id "org.jetbrains.kotlin.plugin.compose" version "$kotlin_version" id "dagger.hilt.android.plugin" id "kotlin-parcelize" } android { - compileSdkVersion 32 - buildToolsVersion "30.0.3" + namespace "com.mohitb117.demo_omdb_api" + compileSdk 36 defaultConfig { applicationId "com.mohitb117.demo_omdb_api" - minSdkVersion 23 - targetSdkVersion 32 + minSdk 30 + targetSdk 35 versionCode 1 versionName "1.0" @@ -33,65 +34,96 @@ android { buildFeatures { viewBinding true + compose true } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = "11" + jvmTarget = "17" + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF" + } } } dependencies { // Android UI/Boilerplate - implementation "com.google.android.material:material:1.5.0" - implementation "androidx.core:core-ktx:1.7.0" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.constraintlayout:constraintlayout:2.1.3" - implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1" - implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1" + implementation "com.google.android.material:material:1.13.0" + implementation "androidx.core:core-ktx:1.17.0" + implementation "androidx.appcompat:appcompat:1.7.1" + implementation "androidx.constraintlayout:constraintlayout:2.2.1" + implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.7" + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.8.7" + implementation "androidx.activity:activity-compose:1.10.0" + + implementation 'androidx.compose.material3:material3-adaptive-navigation-suite' + implementation 'androidx.compose.material3.adaptive:adaptive' + implementation 'androidx.compose.material3.adaptive:adaptive-layout' + implementation 'androidx.compose.material3.adaptive:adaptive-navigation' + + // Jetpack Compose BOM + implementation platform("androidx.compose:compose-bom:$compose_bom_version") + implementation "androidx.compose.ui:ui" + implementation "androidx.compose.ui:ui-graphics" + implementation "androidx.compose.ui:ui-tooling-preview" + implementation "androidx.compose.material3:material3" + implementation "androidx.compose.material:material-icons-extended" + implementation "androidx.compose.runtime:runtime-livedata" + debugImplementation "androidx.compose.ui:ui-tooling" + debugImplementation "androidx.compose.ui:ui-test-manifest" // Networking - implementation "com.squareup.retrofit2:retrofit:2.9.0" - implementation "com.google.code.gson:gson:2.8.9" - implementation "com.squareup.retrofit2:converter-gson:2.9.0" - implementation "com.squareup.okhttp3:logging-interceptor:4.9.3" - - implementation "androidx.legacy:legacy-support-v4:1.0.0" + implementation "com.squareup.retrofit2:retrofit:3.0.0" + implementation "com.google.code.gson:gson:2.13.2" + implementation "com.squareup.retrofit2:converter-gson:3.0.0" + implementation "com.squareup.okhttp3:logging-interceptor:5.3.2" - // Navigation + // Navigation (including Compose) implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" + implementation "androidx.navigation:navigation-compose:$nav_version" - // Dagger + // Dagger Hilt implementation "com.google.dagger:hilt-android:$hilt_version" - kapt "com.google.dagger:hilt-android-compiler:$hilt_version" + ksp "com.google.dagger:hilt-android-compiler:$hilt_version" + implementation "androidx.hilt:hilt-navigation-compose:1.3.0" - implementation "com.github.bumptech.glide:glide:4.13.0" - kapt "com.github.bumptech.glide:compiler:4.12.0" + // Image loading + implementation "com.github.bumptech.glide:glide:5.0.5" + ksp "com.github.bumptech.glide:ksp:5.0.5" + implementation "io.coil-kt:coil-compose:2.7.0" // Room - implementation "androidx.room:room-ktx:2.4.2" - kapt "androidx.room:room-compiler:2.4.2" + implementation "androidx.room:room-runtime:$room_version" + implementation "androidx.room:room-ktx:$room_version" + ksp "androidx.room:room-compiler:$room_version" // EitherNet - implementation "com.slack.eithernet:eithernet:1.1.0" + implementation "com.slack.eithernet:eithernet:1.8.1" // Testing testImplementation "junit:junit:4.13.2" - - testImplementation "androidx.test:core:1.4.0" // Optional -- Robolectric environment - testImplementation "org.mockito:mockito-core:3.11.2" // Optional -- Mockito framework - + testImplementation "androidx.test:core:1.7.0" + testImplementation "org.mockito:mockito-core:5.21.0" testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version" testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" // Espresso - androidTestImplementation "androidx.test.ext:junit:1.1.3" - androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0" + androidTestImplementation "androidx.test.ext:junit:1.3.0" + androidTestImplementation "androidx.test.espresso:espresso-core:3.7.0" + + // Compose Testing + androidTestImplementation platform("androidx.compose:compose-bom:$compose_bom_version") + androidTestImplementation "androidx.compose.ui:ui-test-junit4" - testImplementation "com.slack.eithernet:eithernet:1.1.0" + testImplementation "com.slack.eithernet:eithernet:1.8.1" } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ea437cb..c3380e8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + diff --git a/app/src/main/java/com/mohitb117/demo_omdb_api/activities/AppDestinations.kt b/app/src/main/java/com/mohitb117/demo_omdb_api/activities/AppDestinations.kt new file mode 100644 index 0000000..d0091f6 --- /dev/null +++ b/app/src/main/java/com/mohitb117/demo_omdb_api/activities/AppDestinations.kt @@ -0,0 +1,21 @@ +package com.mohitb117.demo_omdb_api.activities + +import androidx.annotation.StringRes +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.AccountBox +import androidx.compose.material.icons.filled.Favorite +import androidx.compose.material.icons.filled.Home +import androidx.compose.material.icons.filled.ShoppingCart +import androidx.compose.ui.graphics.vector.ImageVector +import com.mohitb117.demo_omdb_api.R + +enum class AppDestinations( + @StringRes val label: Int, + val icon: ImageVector, + @StringRes val contentDescription: Int +) { + HOME(R.string.home, Icons.Default.Home, R.string.home), + FAVORITES(R.string.favorites, Icons.Default.Favorite, R.string.favorites), + SHOPPING(R.string.shopping, Icons.Default.ShoppingCart, R.string.shopping), + PROFILE(R.string.profile, Icons.Default.AccountBox, R.string.profile), +} \ No newline at end of file diff --git a/app/src/main/java/com/mohitb117/demo_omdb_api/activities/LaunchingActivity.kt b/app/src/main/java/com/mohitb117/demo_omdb_api/activities/LaunchingActivity.kt index a4308da..f0c1629 100644 --- a/app/src/main/java/com/mohitb117/demo_omdb_api/activities/LaunchingActivity.kt +++ b/app/src/main/java/com/mohitb117/demo_omdb_api/activities/LaunchingActivity.kt @@ -1,8 +1,16 @@ package com.mohitb117.demo_omdb_api.activities +import android.graphics.Color import android.os.Bundle +import android.view.View +import androidx.activity.enableEdgeToEdge import com.google.android.material.bottomnavigation.BottomNavigationView import androidx.appcompat.app.AppCompatActivity +import androidx.core.view.ViewCompat +import androidx.core.view.WindowCompat +import androidx.core.view.WindowInsetsCompat +import androidx.core.view.insets.GradientProtection +import androidx.core.view.insets.ProtectionLayout import androidx.navigation.NavController import androidx.navigation.findNavController import androidx.navigation.ui.navigateUp @@ -24,6 +32,8 @@ class LaunchingActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + enableEdgeToEdge() + binding = ActivityLaunchingBinding.inflate(layoutInflater) setContentView(binding.root) @@ -40,6 +50,20 @@ class LaunchingActivity : AppCompatActivity() { setupActionBarWithNavController(navController, appBarConfiguration) bottomNavigationView.setupWithNavController(navController) + + ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v: View, insets: WindowInsetsCompat -> + val innerPadding = insets.getInsets( + WindowInsetsCompat.Type.systemBars() or WindowInsetsCompat.Type.displayCutout() + ) + + v.setPadding( + innerPadding.left, + innerPadding.top, + innerPadding.right, + innerPadding.bottom + ) + insets + } } fun gotoDetails(imdbId: String) { diff --git a/app/src/main/res/layout/activity_launching.xml b/app/src/main/res/layout/activity_launching.xml index 21ffffe..841fedd 100644 --- a/app/src/main/res/layout/activity_launching.xml +++ b/app/src/main/res/layout/activity_launching.xml @@ -3,16 +3,16 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/container" - android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:layout_width="match_parent"> OMDB Test Search Favourites + Home + Favorites + Shopping + Profile \ No newline at end of file diff --git a/build.gradle b/build.gradle index 80c562c..7fa2440 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,12 @@ buildscript { - ext.kotlin_plugin_version = "1.6.20-M1" - ext.kotlin_version = "1.6.20" - ext.hilt_version = "2.41" - ext.gradle_plugin = "7.0.1" - ext.nav_version_plugin = "2.4.2" - ext.nav_version = "2.5.0-alpha04" + ext.kotlin_version = "2.1.10" + ext.ksp_version = "2.1.10-1.0.29" + ext.hilt_version = "2.54" + ext.gradle_plugin = "8.9.1" + ext.nav_version = "2.8.5" + ext.compose_bom_version = "2024.12.01" + ext.room_version = "2.7.0" repositories { google() @@ -14,9 +15,10 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:$gradle_plugin" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_plugin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$ksp_version" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version" - classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version_plugin" + classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cb735eb..20e68a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue May 11 13:54:20 PDT 2021 +#Mon Jan 26 10:19:43 CST 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip diff --git a/settings.gradle b/settings.gradle index 8d84e1e..a976fbc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,5 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +} include ':app' rootProject.name = "DEMO_OMDB_API" \ No newline at end of file