├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── themes.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable │ │ │ │ ├── ic_baseline_error_24.xml │ │ │ │ ├── ic_favourite_enabled.xml │ │ │ │ ├── ic_favourite_disabled.xml │ │ │ │ ├── ic_add_shopping_cart.xml │ │ │ │ ├── add_shopping_cart_24.xml │ │ │ │ ├── ic_remove_shopping_cart.xml │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ ├── navigation │ │ │ │ └── nav_graph.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── fragment_product_list.xml │ │ │ │ ├── fragment_product_details.xml │ │ │ │ └── product_card.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── rimapps │ │ │ │ └── shoppingapp │ │ │ │ ├── di │ │ │ │ ├── ShoppingApplication.kt │ │ │ │ └── module │ │ │ │ │ └── RepositoryModule.kt │ │ │ │ ├── features │ │ │ │ ├── productList │ │ │ │ │ ├── business │ │ │ │ │ │ └── Product.kt │ │ │ │ │ ├── data │ │ │ │ │ │ └── ProductEntity.kt │ │ │ │ │ └── presentation │ │ │ │ │ │ ├── ProductCardViewState.kt │ │ │ │ │ │ ├── ProductListViewState.kt │ │ │ │ │ │ ├── ProductListViewModel.kt │ │ │ │ │ │ ├── ProductCardListAdapter.kt │ │ │ │ │ │ └── ProductListFragment.kt │ │ │ │ ├── productDetails │ │ │ │ │ ├── data │ │ │ │ │ │ ├── AsyncResult.kt │ │ │ │ │ │ └── ProductDetailsEntity.kt │ │ │ │ │ ├── business │ │ │ │ │ │ └── ProductDetail.kt │ │ │ │ │ └── presentation │ │ │ │ │ │ ├── ProductDetailsViewState.kt │ │ │ │ │ │ ├── ProductDetailsViewModel.kt │ │ │ │ │ │ └── ProductDetailsFragment.kt │ │ │ │ └── wishList │ │ │ │ │ ├── repository │ │ │ │ │ ├── WishListRepository.kt │ │ │ │ │ └── WishListDatabaseRepository.kt │ │ │ │ │ ├── data │ │ │ │ │ └── FavouriteProductEntity.kt │ │ │ │ │ ├── dataBase │ │ │ │ │ ├── WishListDatabase.kt │ │ │ │ │ └── WishListDao.kt │ │ │ │ │ └── usecase │ │ │ │ │ ├── IsProductInWishListUseCase.kt │ │ │ │ │ └── AddOrRemoveFromWishListUseCase.kt │ │ │ │ └── shared │ │ │ │ ├── data │ │ │ │ └── repository │ │ │ │ │ ├── ProductRepository.kt │ │ │ │ │ └── api │ │ │ │ │ ├── ApiClient.kt │ │ │ │ │ ├── ProductService.kt │ │ │ │ │ └── ProductRepositoryApi.kt │ │ │ │ └── presentation │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── rimapps │ │ │ └── shoppingapp │ │ │ ├── ExampleUnitTest.kt │ │ │ ├── TestCoroutineRule.kt │ │ │ ├── features │ │ │ ├── productList │ │ │ │ └── presentation │ │ │ │ │ ├── ProductListViewStateTest.kt │ │ │ │ │ └── ProductListViewModelTest.kt │ │ │ └── wishList │ │ │ │ ├── repository │ │ │ │ └── WishListDatabaseRepositoryTest.kt │ │ │ │ └── usecase │ │ │ │ └── AddOrRemoveFromWishListUseCaseTest.kt │ │ │ └── shared │ │ │ └── data │ │ │ └── repository │ │ │ └── api │ │ │ └── ProductRepositoryApiTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── rimapps │ │ └── shoppingapp │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── .idea ├── .gitignore ├── compiler.xml ├── kotlinc.xml ├── vcs.xml ├── misc.xml └── gradle.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── local.properties ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rimshadpcs/ShoppingApp/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FFFFFFFF 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ShoppingApp 3 | 4 | Hello blank fragment 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/di/ShoppingApplication.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.di 2 | 3 | import android.app.Application 4 | import dagger.hilt.android.HiltAndroidApp 5 | 6 | @HiltAndroidApp 7 | class ShoppingApplication: Application() { 8 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 25 13:37:34 BST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productList/business/Product.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productList.business 2 | 3 | data class Product( 4 | val title: String, 5 | val description: String, 6 | val price: Double, 7 | val imageUrl : String, 8 | val productId: String 9 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productDetails/data/AsyncResult.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productDetails.data 2 | 3 | sealed class AsyncResult { 4 | data class Error(val exception: Exception): AsyncResult() 5 | data class Success(val data:T): AsyncResult() 6 | } -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productList/data/ProductEntity.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productList.data 2 | 3 | data class ProductEntity( 4 | val id : String, 5 | val title: String, 6 | val description: String, 7 | val price: Double, 8 | val imageUrl : String 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/wishList/repository/WishListRepository.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.wishList.repository 2 | 3 | interface WishListRepository { 4 | suspend fun isFavourite(productId: String): Boolean 5 | 6 | suspend fun addToWishList(productId: String) 7 | 8 | suspend fun removeFromWishList(productId: String) 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productList/presentation/ProductCardViewState.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productList.presentation 2 | 3 | data class ProductCardViewState( 4 | val id:String, 5 | val title: String, 6 | val description: String, 7 | val price: String, 8 | val imageUrl : String, 9 | val isFavourite: Boolean 10 | ) -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "ShoppingApp" 16 | include ':app' 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productDetails/business/ProductDetail.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productDetails.business 2 | 3 | data class ProductDetail( 4 | val title: String, 5 | val description: String, 6 | val fullDescription: String, 7 | val price: String, 8 | val imageUrl : String, 9 | val pros : List, 10 | val cons : List 11 | ) { 12 | } -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/wishList/data/FavouriteProductEntity.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.wishList.data 2 | 3 | import androidx.room.ColumnInfo 4 | import androidx.room.Entity 5 | import androidx.room.PrimaryKey 6 | 7 | @Entity 8 | data class FavouriteProductEntity( 9 | @PrimaryKey val id: String, 10 | @ColumnInfo(name = "product_name") val productName: String 11 | ) { 12 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/rimapps/shoppingapp/features/productDetails/data/ProductDetailsEntity.kt: -------------------------------------------------------------------------------- 1 | package com.rimapps.shoppingapp.features.productDetails.data 2 | 3 | data class ProductDetailsEntity( 4 | val title: String, 5 | val description: String, 6 | val full_description: String, 7 | val price: Double, 8 | val imageUrl : String, 9 | val pros : List, 10 | val cons : List 11 | 12 | ){ 13 | 14 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_error_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |