├── .gitignore ├── .idea ├── .gitignore ├── compiler.xml ├── deploymentTargetDropDown.xml ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml └── misc.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── arvind │ │ └── furnitureshop │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── arvind │ │ │ └── furnitureshop │ │ │ ├── MainActivity.kt │ │ │ ├── app │ │ │ └── FurnitureShopApp.kt │ │ │ ├── component │ │ │ ├── TopBarWithBack.kt │ │ │ └── TopBarWithBackProductList.kt │ │ │ ├── navigation │ │ │ ├── Navigation.kt │ │ │ └── Screen.kt │ │ │ ├── ui │ │ │ └── theme │ │ │ │ ├── Color.kt │ │ │ │ ├── Shape.kt │ │ │ │ ├── Theme.kt │ │ │ │ └── Type.kt │ │ │ ├── utils │ │ │ └── Constants.kt │ │ │ └── view │ │ │ ├── DashboardScreen.kt │ │ │ ├── ProductDetailsScreen.kt │ │ │ ├── ProductListScreen.kt │ │ │ └── SplashScreen.kt │ └── res │ │ ├── drawable-v24 │ │ ├── furniture_1.png │ │ ├── furniture_2.png │ │ ├── furniture_3.png │ │ ├── furniture_4.png │ │ ├── furniture_5.png │ │ ├── furniture_6.png │ │ ├── furniture_logo.jpg │ │ ├── ic_launcher_foreground.xml │ │ ├── sofa_1.png │ │ ├── sofa_2.png │ │ └── sofa_3.png │ │ ├── drawable │ │ ├── ic_baseline_arrow_forward_ios_24.xml │ │ ├── ic_baseline_shopping_cart_24.xml │ │ └── ic_launcher_background.xml │ │ ├── font │ │ ├── dmsansbold.ttf │ │ ├── dmsansmedium.ttf │ │ └── dmsansregular.ttf │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── 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-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── arvind │ └── furnitureshop │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.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 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JetComposeFurnitureShopUI-Android 2 | Online Furniture Shop App UI made in Jetpack Compose with clean architecture...😉😎 3 | 4 | (Navigation Components, 5 | Dagger-Hilt, 6 | Material Components) 7 | 8 | # Screenshot 9 | 10 | ![7433392f8f86fa2a796ead2207508b5e](https://user-images.githubusercontent.com/25154589/128817681-ba43a40b-c659-4773-aab8-c717ea707616.png) 11 | 12 | ►Design Credit: https://dribbble.com/shots/10066740-Furniture-e-commerce-ios-mobile-app-screens 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'kotlin-android' 4 | id 'kotlin-kapt' 5 | id 'dagger.hilt.android.plugin' 6 | id 'androidx.navigation.safeargs.kotlin' 7 | } 8 | 9 | android { 10 | compileSdk 30 11 | 12 | defaultConfig { 13 | applicationId "com.arvind.furnitureshop" 14 | minSdk 21 15 | targetSdk 30 16 | versionCode 1 17 | versionName "1.0" 18 | 19 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 20 | vectorDrawables { 21 | useSupportLibrary true 22 | } 23 | } 24 | 25 | buildTypes { 26 | release { 27 | minifyEnabled false 28 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 29 | } 30 | } 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | useIR = true 38 | } 39 | buildFeatures { 40 | compose true 41 | } 42 | composeOptions { 43 | kotlinCompilerExtensionVersion compose_version 44 | kotlinCompilerVersion '1.5.10' 45 | } 46 | packagingOptions { 47 | resources { 48 | excludes += '/META-INF/{AL2.0,LGPL2.1}' 49 | } 50 | } 51 | } 52 | 53 | dependencies { 54 | 55 | implementation 'androidx.core:core-ktx:1.6.0' 56 | implementation 'androidx.appcompat:appcompat:1.3.1' 57 | implementation 'com.google.android.material:material:1.4.0' 58 | implementation "androidx.compose.ui:ui:$compose_version" 59 | implementation "androidx.compose.material:material:$compose_version" 60 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" 61 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' 62 | implementation 'androidx.activity:activity-compose:1.3.1' 63 | testImplementation 'junit:junit:4.13.2' 64 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 65 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 66 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" 67 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" 68 | 69 | //lifecycle 70 | implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07" 71 | implementation "androidx.navigation:navigation-compose:2.4.0-alpha06" 72 | implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02" 73 | 74 | // Coroutines 75 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1' 76 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1' 77 | 78 | // Coroutine Lifecycle Scopes 79 | implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1" 80 | implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1" 81 | 82 | //Dagger - Hilt 83 | implementation "com.google.dagger:hilt-android:2.37" 84 | kapt "com.google.dagger:hilt-android-compiler:2.37" 85 | implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03" 86 | kapt "androidx.hilt:hilt-compiler:1.0.0" 87 | implementation 'androidx.hilt:hilt-navigation-compose:1.0.0-alpha03' 88 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/arvind/furnitureshop/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.arvind.furnitureshop", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.compose.material.MaterialTheme 7 | import androidx.compose.material.Surface 8 | import androidx.compose.material.Text 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.ui.tooling.preview.Preview 11 | import com.arvind.furnitureshop.app.FurnitureShopApp 12 | import com.arvind.furnitureshop.navigation.Navigation 13 | import com.arvind.furnitureshop.ui.theme.FurnitureShopTheme 14 | import dagger.hilt.android.AndroidEntryPoint 15 | 16 | class MainActivity : ComponentActivity() { 17 | override fun onCreate(savedInstanceState: Bundle?) { 18 | super.onCreate(savedInstanceState) 19 | setContent { 20 | FurnitureShopAppUiMain() 21 | } 22 | } 23 | 24 | @Composable 25 | fun FurnitureShopAppUiMain() { 26 | FurnitureShopTheme { 27 | Surface(color = MaterialTheme.colors.background) { 28 | Navigation() 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/app/FurnitureShopApp.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.app 2 | 3 | import android.app.Application 4 | import dagger.hilt.android.HiltAndroidApp 5 | 6 | @HiltAndroidApp 7 | class FurnitureShopApp : Application() { 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/component/TopBarWithBack.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.component 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.foundation.shape.RoundedCornerShape 5 | import androidx.compose.material.Card 6 | import androidx.compose.material.Icon 7 | import androidx.compose.material.IconButton 8 | import androidx.compose.material.Text 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.filled.ArrowBack 11 | import androidx.compose.material.icons.outlined.Favorite 12 | import androidx.compose.runtime.Composable 13 | import androidx.compose.ui.Alignment 14 | import androidx.compose.ui.Modifier 15 | import androidx.compose.ui.text.font.FontWeight 16 | import androidx.compose.ui.text.style.TextAlign 17 | import androidx.compose.ui.unit.dp 18 | import androidx.compose.ui.unit.sp 19 | import com.arvind.furnitureshop.ui.theme.black 20 | import com.arvind.furnitureshop.ui.theme.paledark 21 | 22 | @Composable 23 | fun TopBarWithBack(title: String, onBackClick: () -> Unit) { 24 | Row( 25 | modifier = Modifier 26 | .fillMaxWidth() 27 | .padding(top = 16.dp), 28 | horizontalArrangement = Arrangement.SpaceBetween, 29 | verticalAlignment = Alignment.CenterVertically 30 | ) { 31 | IconButton(onClick = { onBackClick() }) { 32 | Icon( 33 | modifier = Modifier.size(32.dp, 32.dp), 34 | imageVector = Icons.Default.ArrowBack, 35 | contentDescription = "", 36 | tint = black 37 | ) 38 | } 39 | 40 | Text( 41 | text = title, 42 | color = paledark, 43 | modifier = Modifier.padding(start = 16.dp), 44 | fontWeight = FontWeight.Bold, 45 | textAlign = TextAlign.Center, 46 | fontSize = 16.sp, 47 | ) 48 | 49 | Card( 50 | modifier = Modifier 51 | .padding(end = 20.dp) 52 | .width(50.dp), 53 | elevation = 4.dp, 54 | shape = RoundedCornerShape(8.dp) 55 | ) { 56 | IconButton(onClick = { }) { 57 | Icon( 58 | imageVector = Icons.Outlined.Favorite, 59 | contentDescription = "" 60 | ) 61 | 62 | } 63 | } 64 | 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/component/TopBarWithBackProductList.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.component 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.foundation.shape.RoundedCornerShape 5 | import androidx.compose.material.Card 6 | import androidx.compose.material.Icon 7 | import androidx.compose.material.IconButton 8 | import androidx.compose.material.Text 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.filled.ArrowBack 11 | import androidx.compose.material.icons.filled.ShoppingCart 12 | import androidx.compose.runtime.Composable 13 | import androidx.compose.ui.Alignment 14 | import androidx.compose.ui.Modifier 15 | import androidx.compose.ui.text.font.FontWeight 16 | import androidx.compose.ui.text.style.TextAlign 17 | import androidx.compose.ui.unit.dp 18 | import androidx.compose.ui.unit.sp 19 | import com.arvind.furnitureshop.ui.theme.black 20 | import com.arvind.furnitureshop.ui.theme.paledark 21 | 22 | @Composable 23 | fun TopBarWithBackProductList(title: String, onBackClick: () -> Unit) { 24 | Row( 25 | modifier = Modifier 26 | .fillMaxWidth() 27 | .padding(top = 16.dp), 28 | horizontalArrangement = Arrangement.SpaceBetween, 29 | verticalAlignment = Alignment.CenterVertically 30 | ) { 31 | IconButton(onClick = { onBackClick() }) { 32 | Icon( 33 | modifier = Modifier.size(32.dp, 32.dp), 34 | imageVector = Icons.Default.ArrowBack, 35 | contentDescription = "", 36 | tint = black 37 | ) 38 | } 39 | Text( 40 | text = title, 41 | color = paledark, 42 | modifier = Modifier.padding(start = 16.dp), 43 | fontWeight = FontWeight.Bold, 44 | textAlign = TextAlign.Center, 45 | fontSize = 16.sp, 46 | ) 47 | Card( 48 | modifier = Modifier 49 | .padding(end = 20.dp) 50 | .width(50.dp), 51 | shape = RoundedCornerShape(8.dp), 52 | elevation = 4.dp 53 | ) { 54 | IconButton(onClick = { }) { 55 | Icon( 56 | imageVector = Icons.Default.ShoppingCart, 57 | contentDescription = "" 58 | ) 59 | 60 | } 61 | 62 | } 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/navigation/Navigation.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.navigation 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.navigation.NavController 5 | import androidx.navigation.compose.NavHost 6 | import androidx.navigation.compose.composable 7 | import androidx.navigation.compose.rememberNavController 8 | import com.arvind.furnitureshop.view.DashboardScreen 9 | import com.arvind.furnitureshop.view.ProductDetailsScreen 10 | import com.arvind.furnitureshop.view.ProductListScreen 11 | import com.arvind.furnitureshop.view.SplashScreen 12 | 13 | @Composable 14 | fun Navigation() { 15 | val navController = rememberNavController() 16 | NavHost( 17 | navController = navController, 18 | startDestination = Screen.SplashScreen.route 19 | ) { 20 | composable(Screen.SplashScreen.route) { 21 | SplashScreen(navController = navController) 22 | } 23 | composable(Screen.DashboardScreen.route) { 24 | DashboardScreen() 25 | } 26 | composable(Screen.ProductListScreen.route) { 27 | ProductListScreen() 28 | } 29 | 30 | composable(Screen.ProductDetailScreen.route) { 31 | ProductDetailsScreen() 32 | } 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/navigation/Screen.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.navigation 2 | 3 | sealed class Screen(val route: String) { 4 | object SplashScreen : Screen("splash_screen") 5 | object DashboardScreen : Screen("dashboard_screen") 6 | object ProductListScreen : Screen("product_list_screen") 7 | object ProductDetailScreen : Screen("product_detail_screen") 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | val Purple200 = Color(0xFFBB86FC) 6 | val Purple500 = Color(0xFF6200EE) 7 | val Purple700 = Color(0xFF3700B3) 8 | val Teal200 = Color(0xFF03DAC5) 9 | val primarycolor = Color(0xff2A2D31) 10 | 11 | val white = Color(0xffffffff) 12 | val black = Color(0xff000000) 13 | val texttitlewhite = Color(0xffDCDDE9) 14 | val paledark = Color(0xff34344B) 15 | val orangedark = Color(0xffE35C2A) 16 | val greendark = Color(0xffBBBA5D) 17 | val orangelight= Color(0xffF4AE83) 18 | val addtocart= Color(0xffF5F6FD) 19 | val cottonBall = Color(241, 244, 253) 20 | val paleWhite = Color(0xfff3f7f9) 21 | val paleBlack = Color(0xff222325) 22 | val blue = Color(89, 155, 254) 23 | val ghostWhite = Color(245, 246, 248) 24 | val platinum = Color(200, 202, 204) 25 | val lightSilver = Color(171, 172, 173) 26 | val gold = Color(238, 141, 60, 255) 27 | val navajoWhite = Color(254, 228, 162) 28 | val water = Color(220, 237, 255) 29 | val lightBlue = Color(229, 240, 252, 255) -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.ui.theme 2 | 3 | import androidx.compose.foundation.isSystemInDarkTheme 4 | import androidx.compose.material.MaterialTheme 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.runtime.Composable 8 | 9 | private val DarkColorPalette = darkColors( 10 | primary = Purple200, 11 | primaryVariant = Purple700, 12 | secondary = Teal200 13 | ) 14 | 15 | private val LightColorPalette = lightColors( 16 | primary = Purple500, 17 | primaryVariant = Purple700, 18 | secondary = Teal200 19 | 20 | /* Other default colors to override 21 | background = Color.White, 22 | surface = Color.White, 23 | onPrimary = Color.White, 24 | onSecondary = Color.Black, 25 | onBackground = Color.Black, 26 | onSurface = Color.Black, 27 | */ 28 | ) 29 | 30 | @Composable 31 | fun FurnitureShopTheme( 32 | darkTheme: Boolean = isSystemInDarkTheme(), 33 | content: @Composable() () -> Unit 34 | ) { 35 | val colors = if (darkTheme) { 36 | DarkColorPalette 37 | } else { 38 | LightColorPalette 39 | } 40 | 41 | MaterialTheme( 42 | colors = colors, 43 | typography = Typography, 44 | shapes = Shapes, 45 | content = content 46 | ) 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ) 16 | /* Other default text styles to override 17 | button = TextStyle( 18 | fontFamily = FontFamily.Default, 19 | fontWeight = FontWeight.W500, 20 | fontSize = 14.sp 21 | ), 22 | caption = TextStyle( 23 | fontFamily = FontFamily.Default, 24 | fontWeight = FontWeight.Normal, 25 | fontSize = 12.sp 26 | ) 27 | */ 28 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/utils/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.utils 2 | 3 | object Constants { 4 | const val SPLASH_SCREEN_DURATION = 0L 5 | } -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/view/DashboardScreen.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.view 2 | 3 | import androidx.compose.foundation.* 4 | import androidx.compose.foundation.layout.* 5 | import androidx.compose.foundation.lazy.LazyRow 6 | import androidx.compose.foundation.shape.RoundedCornerShape 7 | import androidx.compose.material.* 8 | import androidx.compose.material.icons.Icons 9 | import androidx.compose.material.icons.filled.KeyboardArrowRight 10 | import androidx.compose.material.icons.outlined.Search 11 | import androidx.compose.runtime.* 12 | import androidx.compose.ui.Alignment 13 | import androidx.compose.ui.Modifier 14 | import androidx.compose.ui.draw.clip 15 | import androidx.compose.ui.graphics.Color 16 | import androidx.compose.ui.graphics.painter.Painter 17 | import androidx.compose.ui.layout.ContentScale 18 | import androidx.compose.ui.res.painterResource 19 | import androidx.compose.ui.text.SpanStyle 20 | import androidx.compose.ui.text.buildAnnotatedString 21 | import androidx.compose.ui.text.font.FontWeight 22 | import androidx.compose.ui.text.style.TextAlign 23 | import androidx.compose.ui.text.withStyle 24 | import androidx.compose.ui.tooling.preview.Preview 25 | import androidx.compose.ui.unit.dp 26 | import androidx.compose.ui.unit.sp 27 | import androidx.navigation.NavController 28 | import com.arvind.furnitureshop.R 29 | import com.arvind.furnitureshop.navigation.Screen 30 | import com.arvind.furnitureshop.ui.theme.* 31 | 32 | @Preview(showBackground = true) 33 | @Composable 34 | fun DashboardScreen() { 35 | val itemList = listOf("Chairs", "Sofas", "Beds", "Tables") 36 | 37 | Surface( 38 | modifier = Modifier 39 | .fillMaxSize() 40 | .background(cottonBall) 41 | ) { 42 | Column(modifier = Modifier.verticalScroll(rememberScrollState())) { 43 | Spacer(modifier = Modifier.padding(5.dp)) 44 | Header() 45 | Spacer(modifier = Modifier.padding(24.dp)) 46 | CategoryChairs(itemList) 47 | Spacer(modifier = Modifier.padding(24.dp)) 48 | CategoryBestOffers() 49 | Spacer(modifier = Modifier.padding(24.dp)) 50 | CategoryMore() 51 | 52 | } 53 | } 54 | } 55 | 56 | @Composable 57 | fun Header() { 58 | Row( 59 | verticalAlignment = Alignment.Top, 60 | horizontalArrangement = Arrangement.SpaceBetween, 61 | modifier = Modifier 62 | .fillMaxWidth() 63 | .padding(horizontal = 16.dp) 64 | ) { 65 | Text( 66 | text = buildAnnotatedString { 67 | withStyle( 68 | style = SpanStyle( 69 | paledark, 70 | fontWeight = FontWeight.Bold 71 | ) 72 | ) { 73 | append("Our ") 74 | } 75 | withStyle( 76 | style = SpanStyle( 77 | paledark 78 | ) 79 | ) { 80 | append("Products") 81 | } 82 | }, 83 | style = MaterialTheme.typography.subtitle1, 84 | modifier = Modifier, 85 | fontSize = 24.sp 86 | 87 | ) 88 | 89 | Card( 90 | modifier = Modifier.width(50.dp), 91 | elevation = 4.dp, 92 | shape = RoundedCornerShape(8.dp) 93 | ) { 94 | IconButton(onClick = { }) { 95 | Icon( 96 | imageVector = Icons.Outlined.Search, 97 | contentDescription = "" 98 | ) 99 | 100 | } 101 | } 102 | } 103 | } 104 | 105 | @Composable 106 | fun CategoryChairs(itemList: List) { 107 | LazyRow( 108 | modifier = Modifier 109 | .fillMaxWidth() 110 | .padding(horizontal = 16.dp) 111 | ) { 112 | items(itemList.size) { item -> 113 | Box( 114 | modifier = Modifier.border( 115 | color = if (item == 0) paledark else Color.Transparent, 116 | width = 2.dp, 117 | shape = RoundedCornerShape(24.dp) 118 | ) 119 | ) { 120 | Text( 121 | modifier = Modifier.padding( 122 | start = 16.dp, 123 | end = 16.dp, 124 | top = 8.dp, 125 | bottom = 8.dp 126 | ), 127 | text = itemList[item], 128 | color = if (item == 0) paledark else Color.LightGray 129 | ) 130 | 131 | Spacer(modifier = Modifier.padding(8.dp)) 132 | } 133 | } 134 | } 135 | 136 | Spacer(modifier = Modifier.padding(10.dp)) 137 | 138 | LazyRow( 139 | modifier = Modifier 140 | .fillMaxWidth() 141 | .wrapContentHeight(), 142 | contentPadding = PaddingValues(horizontal = 16.dp), 143 | horizontalArrangement = Arrangement.spacedBy(16.dp) 144 | ) { 145 | item { 146 | ChairsItem( 147 | imagePainter = painterResource(id = R.drawable.furniture_1), 148 | title = "Matteo\n" + 149 | "Armchair", 150 | price = "$240" 151 | ) 152 | } 153 | 154 | item { 155 | ChairsItem( 156 | imagePainter = painterResource(id = R.drawable.furniture_2), 157 | title = "Araceli\n" + 158 | "Armchair", 159 | price = "$240" 160 | ) 161 | } 162 | 163 | item { 164 | ChairsItem( 165 | imagePainter = painterResource(id = R.drawable.furniture_3), 166 | title = "Primose\n" + 167 | "Armchair", 168 | price = "$240" 169 | ) 170 | } 171 | 172 | } 173 | } 174 | 175 | 176 | @Composable 177 | fun ChairsItem( 178 | imagePainter: Painter, 179 | title: String = "", 180 | price: String = "" 181 | ) { 182 | Card( 183 | modifier = Modifier 184 | .width(200.dp) 185 | .clickable { 186 | }, 187 | elevation = 10.dp, 188 | shape = RoundedCornerShape(20.dp) 189 | ) { 190 | Column( 191 | modifier = Modifier 192 | .fillMaxWidth() 193 | .padding(16.dp) 194 | ) { 195 | Image( 196 | painter = imagePainter, contentDescription = "", 197 | modifier = Modifier 198 | .fillMaxWidth() 199 | .aspectRatio(1f), 200 | contentScale = ContentScale.Fit 201 | ) 202 | Text(text = title, color = texttitlewhite) 203 | Text(text = price, fontWeight = FontWeight.Bold) 204 | } 205 | } 206 | } 207 | 208 | @Composable 209 | fun CategoryBestOffers() { 210 | Column( 211 | modifier = Modifier 212 | .fillMaxSize() 213 | .padding(horizontal = 16.dp) 214 | ) { 215 | Text( 216 | text = buildAnnotatedString { 217 | withStyle( 218 | style = SpanStyle( 219 | paledark, 220 | fontWeight = FontWeight.Bold 221 | ) 222 | ) { 223 | append("Best ") 224 | } 225 | withStyle( 226 | style = SpanStyle( 227 | paledark 228 | ) 229 | ) { 230 | append("Offers") 231 | } 232 | }, 233 | style = MaterialTheme.typography.subtitle1, 234 | modifier = Modifier, 235 | fontSize = 24.sp 236 | ) 237 | 238 | CategoryBestOffersItems( 239 | imagePainter = painterResource(id = R.drawable.sofa_1), 240 | title = "Ingrit MV", 241 | subtitle = "Sofa", 242 | price = "$2689", 243 | backgroundColor = lightBlue 244 | ) 245 | 246 | CategoryBestOffersItems( 247 | imagePainter = painterResource(id = R.drawable.sofa_2), 248 | title = "Montesque", 249 | subtitle = "Bed", 250 | price = "$1240", 251 | backgroundColor = lightBlue 252 | ) 253 | 254 | CategoryBestOffersItems( 255 | imagePainter = painterResource(id = R.drawable.sofa_3), 256 | title = "Nolin Sofa", 257 | subtitle = "Sofa", 258 | price = "$240", 259 | backgroundColor = lightBlue 260 | ) 261 | } 262 | 263 | } 264 | 265 | 266 | @Composable 267 | fun CategoryBestOffersItems( 268 | imagePainter: Painter, 269 | title: String = "", 270 | subtitle: String = "", 271 | price: String = "", 272 | backgroundColor: Color = Color.Transparent, 273 | ) { 274 | Row( 275 | horizontalArrangement = Arrangement.SpaceBetween, 276 | verticalAlignment = Alignment.CenterVertically, 277 | modifier = Modifier 278 | .fillMaxWidth() 279 | .wrapContentHeight() 280 | .padding(top = 24.dp) 281 | ) { 282 | Box( 283 | modifier = Modifier 284 | .height(90.dp) 285 | .fillMaxWidth(0.2f) 286 | .clip(RoundedCornerShape(12.dp)) 287 | .background(backgroundColor), 288 | contentAlignment = Alignment.Center 289 | ) { 290 | Image( 291 | modifier = Modifier 292 | .padding(8.dp), 293 | painter = imagePainter, 294 | contentDescription = "", 295 | ) 296 | } 297 | 298 | Column( 299 | verticalArrangement = Arrangement.SpaceEvenly, 300 | horizontalAlignment = Alignment.Start, 301 | modifier = Modifier 302 | .offset((-60).dp) 303 | .wrapContentHeight() 304 | ) { 305 | Text( 306 | text = title, 307 | fontWeight = FontWeight.Bold, 308 | fontSize = 14.sp, 309 | color = black, 310 | ) 311 | Spacer(modifier = Modifier.height(4.dp)) 312 | Text( 313 | text = subtitle, 314 | fontSize = 12.sp, 315 | color = Color.Gray, 316 | ) 317 | } 318 | Column( 319 | verticalArrangement = Arrangement.Center, 320 | horizontalAlignment = Alignment.CenterHorizontally, 321 | modifier = Modifier 322 | .fillMaxHeight(0.75f) 323 | .wrapContentHeight() 324 | ) { 325 | Text( 326 | text = price, 327 | fontWeight = FontWeight.Bold, 328 | fontSize = 16.sp, 329 | color = black, 330 | textAlign = TextAlign.Right 331 | ) 332 | 333 | } 334 | } 335 | 336 | } 337 | 338 | @Composable 339 | fun CategoryMore() { 340 | Row( 341 | modifier = Modifier 342 | .fillMaxWidth() 343 | .padding(horizontal = 16.dp), 344 | verticalAlignment = Alignment.CenterVertically, 345 | horizontalArrangement = Arrangement.SpaceBetween 346 | ) { 347 | Text( 348 | text = "New", 349 | color = paledark, 350 | fontSize = 14.sp, 351 | fontWeight = FontWeight.Bold 352 | ) 353 | 354 | Text( 355 | text = "Soon", 356 | color = texttitlewhite, 357 | fontSize = 14.sp, 358 | modifier = Modifier.offset((-60).dp) 359 | ) 360 | 361 | Button( 362 | onClick = { 363 | 364 | }, 365 | modifier = Modifier 366 | .height(70.dp) 367 | .width(110.dp) 368 | .offset((20).dp), 369 | elevation = null, 370 | shape = RoundedCornerShape( 371 | topStartPercent = 50, 372 | ), 373 | colors = ButtonDefaults.buttonColors( 374 | backgroundColor = paledark 375 | ), 376 | ) { 377 | Text( 378 | text = "more", 379 | color = white, 380 | fontSize = 12.sp 381 | ) 382 | Icon( 383 | imageVector = Icons.Default.KeyboardArrowRight, 384 | contentDescription = "", 385 | modifier = Modifier.padding(start = 5.dp), 386 | tint = white 387 | ) 388 | 389 | } 390 | } 391 | } 392 | 393 | 394 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/view/ProductDetailsScreen.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.view 2 | 3 | import androidx.compose.foundation.* 4 | import androidx.compose.foundation.layout.* 5 | import androidx.compose.foundation.shape.CircleShape 6 | import androidx.compose.foundation.shape.RoundedCornerShape 7 | import androidx.compose.foundation.text.ClickableText 8 | import androidx.compose.material.* 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.filled.Add 11 | import androidx.compose.material.icons.filled.ShoppingCart 12 | import androidx.compose.material.icons.outlined.Add 13 | import androidx.compose.material.icons.outlined.Favorite 14 | import androidx.compose.material.icons.outlined.ShoppingCart 15 | import androidx.compose.runtime.Composable 16 | import androidx.compose.ui.Alignment 17 | import androidx.compose.ui.Modifier 18 | import androidx.compose.ui.draw.clip 19 | import androidx.compose.ui.layout.ContentScale 20 | import androidx.compose.ui.res.painterResource 21 | import androidx.compose.ui.res.stringResource 22 | import androidx.compose.ui.text.AnnotatedString 23 | import androidx.compose.ui.text.font.FontWeight 24 | import androidx.compose.ui.text.style.TextAlign 25 | import androidx.compose.ui.tooling.preview.Preview 26 | import androidx.compose.ui.unit.dp 27 | import androidx.compose.ui.unit.sp 28 | import com.arvind.furnitureshop.R 29 | import com.arvind.furnitureshop.component.TopBarWithBack 30 | import com.arvind.furnitureshop.ui.theme.* 31 | 32 | @Preview(showBackground = true) 33 | @Composable 34 | fun ProductDetailsScreen() { 35 | Box(Modifier.verticalScroll(rememberScrollState())) { 36 | Column { 37 | TopBarWithBack( 38 | title = "Product", 39 | onBackClick = { 40 | 41 | }, 42 | ) 43 | Column { 44 | Content() 45 | } 46 | } 47 | } 48 | } 49 | 50 | @Composable 51 | fun Content() { 52 | Column() { 53 | ProductItemsImage() 54 | ProductContent() 55 | ProductAbout() 56 | Spacer(modifier = Modifier.padding(24.dp)) 57 | ProductAddtoCart() 58 | 59 | } 60 | } 61 | 62 | @Composable 63 | fun ProductContent() { 64 | Row( 65 | horizontalArrangement = Arrangement.SpaceBetween, 66 | verticalAlignment = Alignment.CenterVertically, 67 | modifier = Modifier 68 | .fillMaxWidth() 69 | .padding(start = 16.dp) 70 | ) { 71 | Column() { 72 | Text( 73 | text = "Osmond Armchair", 74 | fontWeight = FontWeight.Bold, 75 | fontSize = 16.sp, 76 | color = paledark, 77 | ) 78 | Text( 79 | text = "Chair", 80 | fontSize = 14.sp, 81 | color = texttitlewhite, 82 | ) 83 | } 84 | 85 | Card( 86 | modifier = Modifier 87 | .width(130.dp) 88 | .height(100.dp), 89 | elevation = 10.dp 90 | ) { 91 | Column( 92 | verticalArrangement = Arrangement.Center, 93 | horizontalAlignment = Alignment.CenterHorizontally 94 | ) { 95 | Text( 96 | text = "$240", 97 | fontSize = 18.sp, 98 | color = paledark, 99 | textAlign = TextAlign.Center, 100 | fontWeight = FontWeight.Bold 101 | ) 102 | } 103 | } 104 | 105 | } 106 | } 107 | 108 | 109 | @Composable 110 | fun ProductItemsImage() { 111 | Column( 112 | modifier = Modifier.fillMaxSize(), 113 | verticalArrangement = Arrangement.Center, 114 | horizontalAlignment = Alignment.CenterHorizontally 115 | ) { 116 | Box( 117 | modifier = Modifier 118 | .fillMaxWidth(0.8f) 119 | .fillMaxHeight() 120 | ) { 121 | Image( 122 | painter = painterResource(id = R.drawable.furniture_3), 123 | contentDescription = "Product Image", 124 | modifier = Modifier 125 | .fillMaxWidth() 126 | .height(300.dp) 127 | ) 128 | } 129 | } 130 | } 131 | 132 | @Composable 133 | fun ProductAbout() { 134 | Row( 135 | modifier = Modifier 136 | .fillMaxWidth() 137 | .padding(16.dp), 138 | verticalAlignment = Alignment.CenterVertically, 139 | horizontalArrangement = Arrangement.spacedBy(16.dp) 140 | 141 | ) { 142 | 143 | Box( 144 | modifier = Modifier 145 | .size(30.dp) 146 | .clip(shape = CircleShape) 147 | .background(orangedark) 148 | ) 149 | Box( 150 | modifier = Modifier 151 | .size(30.dp) 152 | .clip(shape = CircleShape) 153 | .background(greendark) 154 | ) 155 | Box( 156 | modifier = Modifier 157 | .size(30.dp) 158 | .clip(shape = CircleShape) 159 | .background(orangelight) 160 | ) 161 | } 162 | Spacer(modifier = Modifier.padding(5.dp)) 163 | Column( 164 | horizontalAlignment = Alignment.CenterHorizontally, 165 | verticalArrangement = Arrangement.Center, 166 | modifier = Modifier.padding(16.dp) 167 | ) { 168 | Text( 169 | text = "In a best traditions, constructed of hardwood\n" + 170 | "with padding of high-resilient foam.Created\n" + 171 | "by awarded winning duo of Manchesti\n" + 172 | "Bermadi and Fresco Duli brothers.", 173 | fontSize = 18.sp, 174 | color = texttitlewhite, 175 | fontWeight = FontWeight.Bold 176 | ) 177 | } 178 | } 179 | 180 | @Composable 181 | fun ProductAddtoCart() { 182 | Box( 183 | modifier = Modifier 184 | .fillMaxWidth() 185 | .height(100.dp) 186 | .background(addtocart), 187 | contentAlignment = Alignment.BottomCenter 188 | ) { 189 | Column( 190 | modifier = Modifier 191 | .fillMaxSize(), 192 | verticalArrangement = Arrangement.Center, 193 | horizontalAlignment = Alignment.CenterHorizontally 194 | ) { 195 | 196 | Card( 197 | modifier = Modifier 198 | .offset(16.dp, (-40).dp) 199 | .fillMaxWidth(0.2f) 200 | .height(70.dp), 201 | shape = RoundedCornerShape(20.dp) 202 | ) { 203 | IconButton( 204 | onClick = { }, 205 | Modifier.background(paleBlack) 206 | ) { 207 | Icon( 208 | imageVector = Icons.Outlined.ShoppingCart, 209 | contentDescription = "", 210 | tint = white 211 | ) 212 | 213 | } 214 | } 215 | ClickableText( 216 | text = AnnotatedString("+ Add to Cart"), 217 | Modifier.offset(16.dp, (-30).dp), 218 | onClick = { offset -> 219 | } 220 | ) 221 | 222 | 223 | } 224 | } 225 | } 226 | 227 | 228 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/view/ProductListScreen.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.view 2 | 3 | import androidx.compose.foundation.* 4 | import androidx.compose.foundation.layout.* 5 | import androidx.compose.foundation.lazy.LazyRow 6 | import androidx.compose.foundation.shape.RoundedCornerShape 7 | import androidx.compose.material.* 8 | import androidx.compose.material.icons.Icons 9 | import androidx.compose.material.icons.filled.List 10 | import androidx.compose.runtime.Composable 11 | import androidx.compose.ui.Alignment 12 | import androidx.compose.ui.Modifier 13 | import androidx.compose.ui.graphics.Color 14 | import androidx.compose.ui.graphics.painter.Painter 15 | import androidx.compose.ui.layout.ContentScale 16 | import androidx.compose.ui.res.painterResource 17 | import androidx.compose.ui.res.stringResource 18 | import androidx.compose.ui.text.font.FontWeight 19 | import androidx.compose.ui.tooling.preview.Preview 20 | import androidx.compose.ui.unit.dp 21 | import androidx.navigation.NavController 22 | import com.arvind.furnitureshop.R 23 | import com.arvind.furnitureshop.component.TopBarWithBackProductList 24 | import com.arvind.furnitureshop.navigation.Screen 25 | import com.arvind.furnitureshop.ui.theme.* 26 | 27 | @Preview(showBackground = true) 28 | @Composable 29 | fun ProductListScreen() { 30 | Box(Modifier.verticalScroll(rememberScrollState())) { 31 | 32 | Column() { 33 | TopBarWithBackProductList( 34 | title = "Armchairs", 35 | onBackClick = { 36 | 37 | }, 38 | ) 39 | Column() { 40 | ContentList() 41 | 42 | } 43 | } 44 | 45 | } 46 | } 47 | 48 | @Composable 49 | fun ContentList() { 50 | Column() { 51 | SortFilter() 52 | Spacer(modifier = Modifier.padding(24.dp)) 53 | Products() 54 | 55 | } 56 | } 57 | 58 | @Composable 59 | fun SortFilter() { 60 | Row( 61 | modifier = Modifier.fillMaxWidth(), 62 | horizontalArrangement = Arrangement.Center, 63 | verticalAlignment = Alignment.CenterVertically 64 | ) { 65 | Button( 66 | onClick = { }, 67 | border = BorderStroke(1.dp, platinum), 68 | colors = ButtonDefaults.buttonColors(backgroundColor = white), 69 | modifier = Modifier 70 | .padding(8.dp) 71 | ) { 72 | Icon( 73 | imageVector = Icons.Default.List, 74 | contentDescription = "", 75 | tint = Color.Black, 76 | modifier = Modifier.padding(end = 4.dp) 77 | ) 78 | Text( 79 | text = "Sort", 80 | color = black 81 | ) 82 | 83 | 84 | } 85 | 86 | Button( 87 | onClick = { }, 88 | colors = ButtonDefaults.buttonColors(backgroundColor = white), 89 | shape = RoundedCornerShape(8.dp), 90 | elevation = ButtonDefaults.elevation(8.dp), 91 | modifier = Modifier 92 | .padding(8.dp) 93 | ) { 94 | Icon( 95 | imageVector = Icons.Default.List, 96 | contentDescription = "", 97 | tint = black, 98 | modifier = Modifier.padding(end = 4.dp) 99 | ) 100 | Text( 101 | text = "Filter", 102 | color = black 103 | ) 104 | 105 | 106 | } 107 | } 108 | } 109 | 110 | 111 | @Composable 112 | fun Products() { 113 | LazyRow( 114 | modifier = Modifier 115 | .fillMaxSize() 116 | .padding(10.dp) 117 | ) { 118 | item { 119 | LeftSide() 120 | RightSide() 121 | } 122 | } 123 | 124 | } 125 | 126 | 127 | @Composable 128 | fun LeftSide() { 129 | Column( 130 | modifier = Modifier 131 | .fillMaxSize() 132 | .padding(horizontal = 16.dp) 133 | ) { 134 | LeftItem( 135 | imagePainter = painterResource(id = R.drawable.furniture_4), 136 | title = "Matteo Armchair", 137 | price = "$240" 138 | ) 139 | LeftItem( 140 | imagePainter = painterResource(id = R.drawable.furniture_5), 141 | title = "Primorse Accent", 142 | price = "$761" 143 | ) 144 | LeftItem( 145 | imagePainter = painterResource(id = R.drawable.furniture_6), 146 | title = "Crandall 21", 147 | price = "$761" 148 | ) 149 | } 150 | } 151 | 152 | @Composable 153 | fun LeftItem( 154 | imagePainter: Painter, 155 | title: String = "", 156 | price: String = "" 157 | ) { 158 | 159 | Card( 160 | modifier = Modifier 161 | .width(150.dp) 162 | .height(150.dp) 163 | .clickable { 164 | }, 165 | elevation = 10.dp, 166 | shape = RoundedCornerShape(20.dp) 167 | ) { 168 | Column( 169 | modifier = Modifier 170 | .fillMaxWidth() 171 | .padding(16.dp), 172 | verticalArrangement = Arrangement.Bottom 173 | ) { 174 | Text(text = title, color = texttitlewhite) 175 | Text(text = price, fontWeight = FontWeight.Bold) 176 | } 177 | } 178 | 179 | Box( 180 | modifier = Modifier 181 | .offset 182 | (20.dp, (-190).dp) 183 | .height(120.dp) 184 | ) { 185 | Image( 186 | contentScale = ContentScale.Fit, 187 | painter = imagePainter, 188 | contentDescription = "", 189 | modifier = Modifier.aspectRatio(1f) 190 | ) 191 | } 192 | 193 | 194 | } 195 | 196 | @Composable 197 | fun RightSide() { 198 | Column( 199 | modifier = Modifier 200 | .fillMaxSize() 201 | .padding(top = 40.dp, start = 16.dp), 202 | verticalArrangement = Arrangement.spacedBy(15.dp) 203 | ) { 204 | RightItem( 205 | imagePainter = painterResource(id = R.drawable.furniture_1), 206 | title = "Araceli Armchair", 207 | price = "$240" 208 | ) 209 | RightItem( 210 | imagePainter = painterResource(id = R.drawable.furniture_2), 211 | title = "Nolin Armchair", 212 | price = "$332.0" 213 | ) 214 | RightItem( 215 | imagePainter = painterResource(id = R.drawable.furniture_3), 216 | title = "Donham Armchair", 217 | price = "$555.0" 218 | ) 219 | } 220 | } 221 | 222 | @Composable 223 | fun RightItem( 224 | imagePainter: Painter, 225 | title: String = "", 226 | price: String = "" 227 | ) { 228 | Card( 229 | modifier = Modifier 230 | .width(150.dp) 231 | .height(150.dp) 232 | .clickable { 233 | }, 234 | elevation = 10.dp, 235 | shape = RoundedCornerShape(20.dp) 236 | ) { 237 | Column( 238 | modifier = Modifier 239 | .fillMaxWidth() 240 | .padding(16.dp), 241 | verticalArrangement = Arrangement.Bottom 242 | ) { 243 | Text(text = title, color = texttitlewhite) 244 | Text(text = price, fontWeight = FontWeight.Bold) 245 | } 246 | } 247 | 248 | Box( 249 | modifier = Modifier 250 | .offset 251 | (20.dp, (-210).dp) 252 | .height(120.dp) 253 | ) { 254 | Image( 255 | contentScale = ContentScale.Fit, 256 | painter = imagePainter, 257 | contentDescription = "", 258 | modifier = Modifier.aspectRatio(1f) 259 | ) 260 | } 261 | } 262 | -------------------------------------------------------------------------------- /app/src/main/java/com/arvind/furnitureshop/view/SplashScreen.kt: -------------------------------------------------------------------------------- 1 | package com.arvind.furnitureshop.view 2 | 3 | import android.view.animation.OvershootInterpolator 4 | import androidx.compose.animation.core.Animatable 5 | import androidx.compose.animation.core.tween 6 | import androidx.compose.foundation.Image 7 | import androidx.compose.foundation.layout.Box 8 | import androidx.compose.foundation.layout.fillMaxSize 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.runtime.LaunchedEffect 11 | import androidx.compose.runtime.remember 12 | import androidx.compose.ui.Alignment 13 | import androidx.compose.ui.Modifier 14 | import androidx.compose.ui.draw.scale 15 | import androidx.compose.ui.res.painterResource 16 | import androidx.compose.ui.tooling.preview.Preview 17 | import androidx.navigation.NavController 18 | import com.arvind.furnitureshop.R 19 | import com.arvind.furnitureshop.navigation.Screen 20 | import com.arvind.furnitureshop.utils.Constants 21 | import kotlinx.coroutines.delay 22 | 23 | @Composable 24 | fun SplashScreen(navController: NavController) { 25 | val scale = remember { 26 | Animatable(0f) 27 | } 28 | val overshootInterpolator = remember { 29 | OvershootInterpolator(2f) 30 | } 31 | LaunchedEffect(key1 = true) { 32 | scale.animateTo( 33 | targetValue = 0.5f, 34 | animationSpec = tween( 35 | durationMillis = 500, 36 | easing = { 37 | overshootInterpolator.getInterpolation(it) 38 | } 39 | ) 40 | ) 41 | delay(Constants.SPLASH_SCREEN_DURATION) 42 | navController.popBackStack() 43 | navController.navigate(Screen.DashboardScreen.route) 44 | 45 | } 46 | Box( 47 | modifier = Modifier.fillMaxSize(), 48 | contentAlignment = Alignment.Center 49 | ) { 50 | Image( 51 | painter = painterResource(id = R.drawable.furniture_logo), 52 | contentDescription = "Logo", 53 | modifier = Modifier.scale(scale.value) 54 | ) 55 | } 56 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_6.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/furniture_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/furniture_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/sofa_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/sofa_1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/sofa_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/sofa_2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/sofa_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/drawable-v24/sofa_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_arrow_forward_ios_24.xml: -------------------------------------------------------------------------------- 1 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_shopping_cart_24.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/font/dmsansbold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/font/dmsansbold.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/dmsansmedium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/font/dmsansmedium.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/dmsansregular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/font/dmsansregular.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/meshramaravind/FurnitureShopUI-Android/9bd3e85459f26972a6d5406490abf487ee645e6a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | #000000 11 | 12 | #ffffff 13 | #000000 14 | 15 | #f3f7f9 16 | #1E2132 17 | 18 | #1E2132 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FurnitureShop 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 21 | 22 |