Skip to content
Merged
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
102 changes: 67 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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"
}
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mohitb117.demo_omdb_api">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
Original file line number Diff line number Diff line change
@@ -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),
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,6 +32,8 @@ class LaunchingActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

enableEdgeToEdge()

binding = ActivityLaunchingBinding.inflate(layoutInflater)
setContentView(binding.root)

Expand All @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_launching.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
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">

<com.google.android.material.bottomnavigation.BottomNavigationView
android:background="?android:attr/windowBackground"
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
android:layout_marginStart="0dp"
android:layout_width="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />

<fragment
android:id="@+id/nav_host_fragment_activity_launching"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_width="0dp"
android:name="androidx.navigation.fragment.NavHostFragment"
app:defaultNavHost="true"
app:layout_constraintBottom_toTopOf="@id/nav_view"
app:layout_constraintLeft_toLeftOf="parent"
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<string name="title_activity_launching">OMDB Test</string>
<string name="title_search_home">Search</string>
<string name="title_favourites">Favourites</string>
<string name="home">Home</string>
<string name="favorites">Favorites</string>
<string name="shopping">Shopping</string>
<string name="profile">Profile</string>
</resources>
18 changes: 10 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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"
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}
include ':app'
rootProject.name = "DEMO_OMDB_API"
Loading