diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..526b4c2 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..2842237 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3d6aeda --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..252587a --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,99 @@ +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'dagger.hilt.android.plugin' +} + +android { + compileSdk 30 + + defaultConfig { + applicationId "com.arvind.nikeshop" + minSdk 21 + targetSdk 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary true + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + useIR = true + } + buildFeatures { + compose true + } + composeOptions { + kotlinCompilerExtensionVersion compose_version + kotlinCompilerVersion '1.5.21' + } + packagingOptions { + resources { + excludes += '/META-INF/{AL2.0,LGPL2.1}' + } + } +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.6.0' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'com.google.android.material:material:1.4.0' + implementation "androidx.compose.ui:ui:$compose_version" + implementation "androidx.compose.material:material:$compose_version" + implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" + implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' + implementation 'androidx.activity:activity-compose:1.3.1' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' + androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" + debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" + + //lifecycle + implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07" + implementation "androidx.navigation:navigation-compose:2.4.0-alpha06" + implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-beta02" + + // Retrofit + implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.retrofit2:converter-gson:2.9.0' + implementation "com.squareup.okhttp3:okhttp:5.0.0-alpha.2" + implementation "com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2" + + // Paging Compose + implementation "androidx.paging:paging-compose:1.0.0-alpha12" + + // Coroutines + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1' + + // Coroutine Lifecycle Scopes + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1" + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' + + //Dagger - Hilt + implementation "com.google.dagger:hilt-android:2.38.1" + kapt "com.google.dagger:hilt-android-compiler:2.38.1" + implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03" + kapt "androidx.hilt:hilt-compiler:1.0.0" + implementation 'androidx.hilt:hilt-navigation-compose:1.0.0-alpha03' + + +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/arvind/nikeshop/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/arvind/nikeshop/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..4d14e76 --- /dev/null +++ b/app/src/androidTest/java/com/arvind/nikeshop/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.arvind.nikeshop + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.arvind.nikeshop", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..326734b --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png new file mode 100644 index 0000000..2ef535e Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ diff --git a/app/src/main/java/com/arvind/nikeshop/MainActivity.kt b/app/src/main/java/com/arvind/nikeshop/MainActivity.kt new file mode 100644 index 0000000..c5ac5f7 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/MainActivity.kt @@ -0,0 +1,31 @@ +package com.arvind.nikeshop + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Surface +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.tooling.preview.Preview +import com.arvind.nikeshop.navigation.Navigation +import com.arvind.nikeshop.ui.theme.NikeShopTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + JetNikeShopUIMain() + } + } + + @Composable + fun JetNikeShopUIMain() { + NikeShopTheme { + Surface(color = MaterialTheme.colors.background) { + Navigation() + } + } + } +} + diff --git a/app/src/main/java/com/arvind/nikeshop/app/NikeShopApp.kt b/app/src/main/java/com/arvind/nikeshop/app/NikeShopApp.kt new file mode 100644 index 0000000..2300a43 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/app/NikeShopApp.kt @@ -0,0 +1,8 @@ +package com.arvind.nikeshop.app + +import android.app.Application +import dagger.hilt.android.HiltAndroidApp + +@HiltAndroidApp +class NikeShopApp : Application() { +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/component/BottomBar.kt b/app/src/main/java/com/arvind/nikeshop/component/BottomBar.kt new file mode 100644 index 0000000..c8d0731 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/component/BottomBar.kt @@ -0,0 +1,81 @@ +package com.arvind.nikeshop.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material.BottomAppBar +import androidx.compose.material.Icon +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.arvind.nikeshop.R +import com.arvind.nikeshop.ui.theme.lightSilver +import com.arvind.nikeshop.ui.theme.orange +import com.arvind.nikeshop.ui.theme.white + +@Preview(showBackground = true) +@Composable +fun BottomBar() { + BottomAppBar( + backgroundColor = white, + elevation = 0.dp + ) { + Icon( + painter = painterResource(R.drawable.ic_baseline_home_24), + tint = lightSilver, + contentDescription = "", + modifier = Modifier + .weight(1f) + .size(20.dp, 20.dp) + ) + Icon( + painter = painterResource(R.drawable.ic_baseline_search_24), + tint = lightSilver, + contentDescription = "", + modifier = Modifier + .weight(1f) + .size(20.dp, 20.dp) + ) + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .weight(1f) + ) { + Box( + contentAlignment = Alignment.Center, + modifier = Modifier + .clip(CircleShape) + .background(orange) + .size(44.dp, 44.dp) + + + ) { + Icon( + painter = painterResource(R.drawable.ic_baseline_shopping_cart_24), + tint = white, + contentDescription = "", + modifier = Modifier + .size(20.dp, 20.dp) + ) + } + + } + + Icon( + painter = painterResource(R.drawable.ic_baseline_favorite_border_24), + tint = lightSilver, + contentDescription = "", + modifier = Modifier + .weight(1f) + .size(20.dp, 20.dp) + ) + + + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/component/TopAppBarWithBack.kt b/app/src/main/java/com/arvind/nikeshop/component/TopAppBarWithBack.kt new file mode 100644 index 0000000..9e73d18 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/component/TopAppBarWithBack.kt @@ -0,0 +1,63 @@ +package com.arvind.nikeshop.component + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.KeyboardArrowLeft +import androidx.compose.material.icons.outlined.List +import androidx.compose.material.icons.outlined.Menu +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.arvind.nikeshop.R +import com.arvind.nikeshop.ui.theme.orange + + +@Composable +fun TopAppBarWithBack(onBackClick: () -> Unit) { + Row( + modifier = Modifier.fillMaxWidth() + .padding(30.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.Top + ) { + Card( + modifier = Modifier.width(50.dp), + shape = RoundedCornerShape(12.dp), + elevation = 5.dp + ) { + IconButton(onClick = { onBackClick() }) { + Icon( + imageVector = Icons.Outlined.KeyboardArrowLeft, + contentDescription = "" + ) + } + + } + + Card( + modifier = Modifier.width(50.dp), + shape = RoundedCornerShape(12.dp), + elevation = 5.dp + ) { + IconButton(onClick = { }) { + Icon( + imageVector = Icons.Outlined.Favorite, + contentDescription = "", + tint = orange + ) + } + + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/model/DataDummy.kt b/app/src/main/java/com/arvind/nikeshop/model/DataDummy.kt new file mode 100644 index 0000000..e14d361 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/model/DataDummy.kt @@ -0,0 +1,36 @@ +package com.arvind.nikeshop.model + +import com.arvind.nikeshop.R + +object DataDummy { + val product = Product( + 1, + "Nike Air Max 200", + 240.00, + 100, + R.drawable.shooe_tilt_1, + "Trending Now" + + ) + + val productList = listOf( + product, + product.copy( + 2, + "Nike Air Max 97", + 240.00, + 100, + R.drawable.shoe_tilt_2, + "Trending Now" + ), + product.copy( + 3, + "Nike Air Max 97", + 220.00, + 100, + R.drawable.shoe_tilt_2, + "Trending Now" + ) + + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/model/Product.kt b/app/src/main/java/com/arvind/nikeshop/model/Product.kt new file mode 100644 index 0000000..f51227a --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/model/Product.kt @@ -0,0 +1,12 @@ +package com.arvind.nikeshop.model + +import java.io.Serializable + +data class Product( + val id: Int, + val name: String, + val price: Double, + val isliked: Int, + val imageID: Int, + val category: String, +) : Serializable diff --git a/app/src/main/java/com/arvind/nikeshop/navigation/Navigation.kt b/app/src/main/java/com/arvind/nikeshop/navigation/Navigation.kt new file mode 100644 index 0000000..d53857c --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/navigation/Navigation.kt @@ -0,0 +1,30 @@ +package com.arvind.nikeshop.navigation + +import androidx.compose.runtime.Composable +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController +import com.arvind.nikeshop.view.* + +@Composable +fun Navigation() { + val navController = rememberNavController() + NavHost( + navController = navController, + startDestination = Screen.SplashScreen.route + ) { + composable(Screen.SplashScreen.route) { + SplashScreen(navController = navController) + } + composable(Screen.HomeScreen.route) { + Dashboard() + } + composable(Screen.ProductDetailsScreen.route) { + ProductDetailsScreen() + } + composable(Screen.AddToCartScreen.route) { + AddToCartScren() + } + + } +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/navigation/Screen.kt b/app/src/main/java/com/arvind/nikeshop/navigation/Screen.kt new file mode 100644 index 0000000..2ed1185 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/navigation/Screen.kt @@ -0,0 +1,9 @@ +package com.arvind.nikeshop.navigation + +sealed class Screen(val route: String) { + object SplashScreen : Screen("splash_screen") + object HomeScreen : Screen("home_screen") + object ProductDetailsScreen : Screen("product_details_screen") + object AddToCartScreen : Screen("add_to_cart_screen") + +} diff --git a/app/src/main/java/com/arvind/nikeshop/ui/theme/Color.kt b/app/src/main/java/com/arvind/nikeshop/ui/theme/Color.kt new file mode 100644 index 0000000..d59d9d7 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/ui/theme/Color.kt @@ -0,0 +1,37 @@ +package com.arvind.nikeshop.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple200 = Color(0xFFBB86FC) +val Purple500 = Color(0xFF6200EE) +val Purple700 = Color(0xFF3700B3) +val Teal200 = Color(0xFF03DAC5) + +val white = Color(0XFFFFFFFF) +val background = Color(0XFFFFFFFF) +val lightbox = Color(0XFFF3F3F3) +val lightSilver = Color(209,215,224) + +val cottonBall = Color(241, 244, 253) +val titleTextColor = Color(0xff1d2635) +val subTitleTextColor = Color(0xff797878) + +val skyBlue = Color(0xff1790C7) +val lightBlue = Color(0xff5C3BFF) + + +val orange = Color(0xffE65829) +val red = Color(0xffFF3737) +val lightorange = Color(0xffFFE9DF) + +val lightGrey = Color(0xffE1E2E4) +val grey = Color(0xffA1A3A6) +val darkgrey = Color(0xff747F8F) +val lightgraybg=Color(0xffF8F8F8) +val lightsilverbox = Color(0xffF6F6F6) + +val iconColor = Color(0xffa8a09b) +val yellowColor = Color(0xfffbba01) + +val black = Color(0xff20262C) +val lightblack = Color(0xff5F5F60) \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/ui/theme/Shape.kt b/app/src/main/java/com/arvind/nikeshop/ui/theme/Shape.kt new file mode 100644 index 0000000..ef33926 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/ui/theme/Shape.kt @@ -0,0 +1,11 @@ +package com.arvind.nikeshop.ui.theme + +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Shapes +import androidx.compose.ui.unit.dp + +val Shapes = Shapes( + small = RoundedCornerShape(4.dp), + medium = RoundedCornerShape(4.dp), + large = RoundedCornerShape(0.dp) +) \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/ui/theme/Theme.kt b/app/src/main/java/com/arvind/nikeshop/ui/theme/Theme.kt new file mode 100644 index 0000000..6e4647b --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/ui/theme/Theme.kt @@ -0,0 +1,44 @@ +package com.arvind.nikeshop.ui.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material.MaterialTheme +import androidx.compose.material.darkColors +import androidx.compose.material.lightColors +import androidx.compose.runtime.Composable + +private val DarkColorPalette = darkColors( + primary = Purple200, + primaryVariant = Purple700, + secondary = Teal200 +) + +private val LightColorPalette = lightColors( + primary = Purple500, + primaryVariant = Purple700, + secondary = Teal200 + + /* Other default colors to override + background = Color.White, + surface = Color.White, + onPrimary = Color.White, + onSecondary = Color.Black, + onBackground = Color.Black, + onSurface = Color.Black, + */ +) + +@Composable +fun NikeShopTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable() () -> Unit) { + val colors = if (darkTheme) { + DarkColorPalette + } else { + LightColorPalette + } + + MaterialTheme( + colors = colors, + typography = Typography, + shapes = Shapes, + content = content + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/ui/theme/Type.kt b/app/src/main/java/com/arvind/nikeshop/ui/theme/Type.kt new file mode 100644 index 0000000..0a32643 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/ui/theme/Type.kt @@ -0,0 +1,28 @@ +package com.arvind.nikeshop.ui.theme + +import androidx.compose.material.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + body1 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp + ) + /* Other default text styles to override + button = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.W500, + fontSize = 14.sp + ), + caption = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 12.sp + ) + */ +) \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/utils/Constants.kt b/app/src/main/java/com/arvind/nikeshop/utils/Constants.kt new file mode 100644 index 0000000..b63d14a --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/utils/Constants.kt @@ -0,0 +1,5 @@ +package com.arvind.nikeshop.utils + +object Constants { + const val SPLASH_SCREEN_DURATION = 0L +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/view/AddToCartScren.kt b/app/src/main/java/com/arvind/nikeshop/view/AddToCartScren.kt new file mode 100644 index 0000000..0d7fb03 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/view/AddToCartScren.kt @@ -0,0 +1,272 @@ +package com.arvind.nikeshop.view + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.* +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Delete +import androidx.compose.material.icons.outlined.Delete +import androidx.compose.material.icons.sharp.Delete +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.painter.Painter +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.ParagraphStyle +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.arvind.nikeshop.R +import com.arvind.nikeshop.ui.theme.* + +@Preview(showBackground = true) +@Composable +fun AddToCartScren() { + Box( + modifier = Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()) + ) { + Column( + modifier = Modifier + .fillMaxSize() + .padding(30.dp) + ) { + TopAppBarHeader() + Spacer(modifier = Modifier.padding(5.dp)) + DeleteCart() + Spacer(modifier = Modifier.padding(20.dp)) + CartItemList() + Spacer(modifier = Modifier.padding(20.dp)) + NextButtonWithTotalItems() + } + } +} + + +@Composable +fun DeleteCart() { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + buildAnnotatedString { + withStyle(style = ParagraphStyle(lineHeight = 30.sp)) { + withStyle( + style = SpanStyle( + color = subTitleTextColor, + fontSize = 24.sp + ) + ) { + append("Shopping\n") + } + withStyle( + style = SpanStyle( + fontWeight = FontWeight.Bold, + color = titleTextColor, + fontSize = 24.sp + ) + ) { + append("Cart") + } + + } + } + ) + + IconButton(onClick = { }) { + Icon( + imageVector = Icons.Outlined.Delete, + contentDescription = "", + tint = orange + ) + + } + } +} + +@Composable +fun CartItemList() { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.spacedBy(40.dp) + ) { + ProductCartItems( + imagePainter = painterResource(id = R.drawable.shooe_tilt_1), + title = "NIKE AIR MAX 200", + price = "240.00", + pricetag = "$", + count = "x1", + backgroundColor = lightsilverbox + ) + ProductCartItems( + imagePainter = painterResource(id = R.drawable.small_tilt_shoe_3), + title = "NIKE AIR MAX 97", + price = "190.00", + pricetag = "$", + count = "x1", + backgroundColor = lightsilverbox + ) + ProductCartItems( + imagePainter = painterResource(id = R.drawable.small_tilt_shoe_2), + title = "NIKE AIR MAX 200", + price = "220.00", + pricetag = "$", + count = "x1", + backgroundColor = lightsilverbox + ) + + } +} + +@Composable +fun ProductCartItems( + imagePainter: Painter, + title: String = "", + price: String = "", + pricetag: String = "", + count: String = "", + backgroundColor: Color = Color.Transparent +) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Box( + modifier = Modifier + .width(100.dp) + .height(100.dp) + .fillMaxWidth(0.2f) + .clip(RoundedCornerShape(20.dp)) + .background(backgroundColor), + contentAlignment = Alignment.Center + ) { + Image( + painter = imagePainter, + contentDescription = "", + modifier = Modifier.padding(8.dp), + ) + } + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.SpaceEvenly + ) { + Text( + text = title, + fontSize = 18.sp, + color = titleTextColor, + fontWeight = FontWeight.Bold + ) + Spacer(modifier = Modifier.height(10.dp)) + + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = buildAnnotatedString { + withStyle( + style = SpanStyle( + orange, + fontWeight = FontWeight.Bold + ) + ) { + append(pricetag) + } + withStyle( + style = SpanStyle( + titleTextColor + ) + ) { + append(price) + } + }, + style = MaterialTheme.typography.subtitle1, + modifier = Modifier, + fontSize = 16.sp + + ) + Box( + modifier = Modifier + .size(35.dp, 35.dp) + .clip(CircleShape) + .background(backgroundColor), + contentAlignment = Alignment.Center + ) { + Text( + text = count, + fontSize = 14.sp, + color = titleTextColor + ) + } + } + + } + } +} + +@Composable +fun NextButtonWithTotalItems() { + Column(modifier = Modifier.fillMaxWidth()) { + Divider(color = lightGrey, thickness = 2.dp) + Spacer(modifier = Modifier.padding(8.dp)) + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = "3 Items", + fontSize = 14.sp, + color = lightGrey + ) + + Text( + text = "$650.00", + fontSize = 18.sp, + color = titleTextColor, + fontWeight = FontWeight.Bold + ) + } + + Button( + onClick = { + }, + colors = ButtonDefaults.buttonColors(backgroundColor = orange), + modifier = Modifier + .fillMaxWidth() + .padding( + top = 30.dp, + bottom = 34.dp + ) + .align(Alignment.CenterHorizontally), + shape = RoundedCornerShape(14.dp) + ) { + Text( + text = "Next", + color = white, + style = MaterialTheme.typography.button, + modifier = Modifier.padding(top = 8.dp, bottom = 8.dp) + ) + } + + } +} diff --git a/app/src/main/java/com/arvind/nikeshop/view/Dashboard.kt b/app/src/main/java/com/arvind/nikeshop/view/Dashboard.kt new file mode 100644 index 0000000..4b64000 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/view/Dashboard.kt @@ -0,0 +1,101 @@ +package com.arvind.nikeshop.view + +import androidx.compose.animation.Crossfade +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.* +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.arvind.nikeshop.R +import com.arvind.nikeshop.ui.theme.orange + +@Preview(showBackground = true) +@Composable +fun Dashboard( +) { + val sectionState = remember { mutableStateOf(DashboardSection.Home) } + val navItems = DashboardSection.values().toList() + + Scaffold( + bottomBar = { + BottomBar( + items = navItems, + currentSection = sectionState.value, + onSectionSelected = { sectionState.value = it }, + ) + }) { innerPadding -> + val modifier = Modifier.padding(innerPadding) + Crossfade( + modifier = modifier, + targetState = sectionState.value + ) + { section -> + when (section) { + DashboardSection.Home -> HomeScreen() + } + when (section) { + DashboardSection.ShoppingCart -> AddToCartScren() + } + when (section) { + DashboardSection.CartDetails -> ProductDetailsScreen() + } + + } + } +} + +@Composable +private fun BottomBar( + items: List, + currentSection: DashboardSection, + onSectionSelected: (DashboardSection) -> Unit, +) { + BottomNavigation( + modifier = Modifier.height(50.dp), + backgroundColor = MaterialTheme.colors.background, + contentColor = contentColorFor(MaterialTheme.colors.background) + ) { + items.forEach { section -> + + val selected = section == currentSection + + val iconRes = if (selected) section.selectedIcon else section.icon + + BottomNavigationItem( + icon = { + + Icon( + painter = painterResource(id = iconRes), + modifier = Modifier.size(24.dp), + contentDescription = "Bottom nav icons" + ) + }, + selected = selected, + unselectedContentColor = Color.Gray, + selectedContentColor = orange, + onClick = { onSectionSelected(section) }, + alwaysShowLabel = false + ) + } + } +} + +private enum class DashboardSection( + val icon: Int, + val selectedIcon: Int, +) { + Home(R.drawable.ic_baseline_home_24, R.drawable.ic_baseline_home_24), + List(R.drawable.ic_baseline_search_24, R.drawable.ic_baseline_search_24), + ShoppingCart(R.drawable.ic_baseline_shopping_cart_24, R.drawable.ic_baseline_shopping_cart_24), + CartDetails( + R.drawable.ic_baseline_favorite_border_24, + R.drawable.ic_baseline_favorite_border_24 + ), +} \ No newline at end of file diff --git a/app/src/main/java/com/arvind/nikeshop/view/HomeScreen.kt b/app/src/main/java/com/arvind/nikeshop/view/HomeScreen.kt new file mode 100644 index 0000000..8a2bdf7 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/view/HomeScreen.kt @@ -0,0 +1,332 @@ +package com.arvind.nikeshop.view + +import androidx.compose.foundation.* +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.lazy.LazyRow +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.foundation.text.KeyboardActions +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material.* +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Search +import androidx.compose.material.icons.outlined.Favorite +import androidx.compose.material.icons.outlined.FavoriteBorder +import androidx.compose.material.icons.outlined.Menu +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.shadow +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalSoftwareKeyboardController +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.* +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.arvind.nikeshop.R +import com.arvind.nikeshop.model.Product +import com.arvind.nikeshop.ui.theme.* +import java.util.* + +@Preview(showBackground = true) +@Composable +fun HomeScreen() { + Box(modifier = Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState())) { + Column(modifier = Modifier.padding(30.dp)) { + TopAppBarHeader() + Spacer(modifier = Modifier.padding(10.dp)) + OurProductsWithSearch() + Spacer(modifier = Modifier.padding(20.dp)) + ProductCategory() + Spacer(modifier = Modifier.padding(20.dp)) + ProductWidget() + } + } + + +} + +@Composable +fun TopAppBarHeader() { + Row( + modifier = Modifier + .fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.Top + ) { + Card( + modifier = Modifier + .width(50.dp), + elevation = 5.dp, + shape = RoundedCornerShape(12.dp) + ) { + IconButton(onClick = { }) { + Icon( + imageVector = Icons.Outlined.Menu, + contentDescription = "" + ) + + } + } + + Card( + modifier = Modifier + .size(50.dp), + elevation = 5.dp, + shape = RoundedCornerShape(12.dp) + ) { + Image(painter = painterResource(id = R.drawable.user), contentDescription = "User", + modifier = Modifier.size(50.dp)) + } + + } +} + +@Composable +fun OurProductsWithSearch() { + var search by remember { mutableStateOf("") } + + Column(modifier = Modifier + .fillMaxWidth(), + verticalArrangement = Arrangement.Top) { + + Text( + buildAnnotatedString { + withStyle(style = ParagraphStyle(lineHeight = 30.sp)) { + withStyle( + style = SpanStyle( + color = subTitleTextColor, + fontSize = 24.sp)) { + append("Our\n") + } + withStyle( + style = SpanStyle( + fontWeight = FontWeight.Bold, + color = titleTextColor, + fontSize = 24.sp + ) + ) { + append("Products") + } + + } + } + ) + + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start, + modifier = Modifier + .fillMaxWidth() + .height(78.dp) + .padding(top = 30.dp) + ) { + TextField( + modifier = Modifier + .weight(0.85f), + colors = TextFieldDefaults.textFieldColors( + backgroundColor = lightbox, + focusedIndicatorColor = Color.Transparent, + unfocusedIndicatorColor = Color.Transparent, + ), + value = search, + shape = RoundedCornerShape(12.dp), + singleLine = true, + onValueChange = { search = it }, + placeholder = { + Text( + text = "Search Products", + color = lightGrey + ) + }, + leadingIcon = { + Icon( + imageVector = Icons.Filled.Search, + contentDescription = "", + tint = lightblack + ) + }, + ) + Spacer(modifier = Modifier.width(5.dp)) + Card( + modifier = Modifier + .width(60.dp) + .padding(start = 16.dp) + .clickable { }, + elevation = 5.dp, + shape = RoundedCornerShape(12.dp) + ) { + IconButton(onClick = { }) { + Icon( + painter = painterResource(R.drawable.filter_list), + contentDescription = "Filter Icon", + modifier = Modifier.size(20.dp, 20.dp) + ) + + } + } + + } + + } +} + +@Composable +fun ProductCategory() { + val itemList = listOf("Sneakers", "Jacket", "Watch", "Watch") + val categoryImagesList = listOf( + R.drawable.shoe_thumb_2, + R.drawable.jacket, + R.drawable.watch, + R.drawable.watch + ) + LazyRow(modifier = Modifier + .fillMaxWidth()) { + items(itemList.size) { item -> + Box( + modifier = Modifier + .height(40.dp) + .border( + color = if (item == 0) orange else lightGrey, + width = 2.dp, + shape = RoundedCornerShape(10.dp) + ) + ) { + Row(modifier = Modifier + .fillMaxWidth() + .padding(top = 2.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center) { + Image(painter = painterResource(categoryImagesList[item]), contentDescription = "", + modifier = Modifier.size(30.dp, 30.dp)) + Text( + modifier = Modifier + .padding( + start = 5.dp, + end = 16.dp, + top = 8.dp, + bottom = 8.dp + ), + text = itemList[item], + color = if (item == 0) lightblack else Color.LightGray + ) + } + + } + Spacer(modifier = Modifier.width(10.dp)) + } + } +} + +@Composable +fun ProductWidget() { + val productImagesList = listOf( + R.drawable.shooe_tilt_1, + R.drawable.shoe_tilt_2, + ) + val productTitleitemList = listOf("Nike Air Max 200", "Nike Air Max 97") + val productTrendingitemList = listOf("Trending Now", "Best Selling") + val productPriceitemList = listOf("240.00", "220.00") + val productPriceTagitemList = listOf("$ ", "$ ") + + LazyRow(modifier = Modifier + .fillMaxWidth() + .wrapContentHeight(), + contentPadding = PaddingValues(horizontal = 5.dp), + horizontalArrangement = Arrangement.spacedBy(20.dp)) { + items(productImagesList.size) { item -> + Card(modifier = Modifier + .width(180.dp) + .wrapContentHeight(), + shape = RoundedCornerShape(24.dp), + elevation = 2.dp) { + + Column(modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .padding(12.dp)) { + IconButton(onClick = { }) { + Icon(imageVector = Icons.Outlined.FavoriteBorder, + contentDescription = "", + tint = lightGrey) + + } + + Box( + modifier = Modifier + .fillMaxWidth() + .wrapContentSize() + .clip(CircleShape) + .background(lightorange), + contentAlignment = Alignment.Center + ) { + Image( + modifier = Modifier + .size(100.dp), + painter = painterResource(productImagesList[item]), + contentDescription = "", + ) + } + + Column(modifier = Modifier + .fillMaxWidth() + .padding(top = 20.dp), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center) { + + Text(text = productTitleitemList[item], + fontWeight = FontWeight.Bold, + fontSize = 16.sp, + color = titleTextColor) + + Text(text = productTrendingitemList[item], + fontWeight = FontWeight.Bold, + fontSize = 16.sp, + color = orange, + modifier = Modifier.padding(bottom = 10.dp)) + + Text( + text = buildAnnotatedString { + withStyle( + style = SpanStyle( + orange, + fontWeight = FontWeight.Bold + ) + ) { + append(productPriceTagitemList[item]) + } + withStyle( + style = SpanStyle( + titleTextColor + ) + ) { + append(productPriceitemList[item]) + } + }, + style = MaterialTheme.typography.subtitle1, + modifier = Modifier, + fontSize = 16.sp + + ) + } + + + } + } + + } + } +} diff --git a/app/src/main/java/com/arvind/nikeshop/view/ProductDetailsScreen.kt b/app/src/main/java/com/arvind/nikeshop/view/ProductDetailsScreen.kt new file mode 100644 index 0000000..afc5cec --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/view/ProductDetailsScreen.kt @@ -0,0 +1,354 @@ +package com.arvind.nikeshop.view + +import android.widget.RatingBar +import androidx.compose.foundation.* +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.lazy.LazyRow +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.shape.ZeroCornerSize +import androidx.compose.material.* +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Add +import androidx.compose.material.icons.filled.ShoppingCart +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.saveable.rememberSaveable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.SpanStyle +import androidx.compose.ui.text.buildAnnotatedString +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.text.withStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.constraintlayout.compose.ConstraintLayout +import com.arvind.nikeshop.R +import com.arvind.nikeshop.component.TopAppBarWithBack +import com.arvind.nikeshop.ui.theme.* + +@Preview(showBackground = true) +@Composable +fun ProductDetailsScreen() { + Scaffold( + topBar = { + TopAppBarWithBack( + onBackClick = { + + }, + ) + }, backgroundColor = lightgraybg, + floatingActionButton = { + FloatingActionButton( + onClick = { }, + backgroundColor = orange + ) { + Icon( + imageVector = Icons.Default.ShoppingCart, + contentDescription = "Add To Cart", + tint = white + ) + } + }, + + content = { + Box( + modifier = Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()) + ) { + ConstraintLayout { + val (imagesliderref, addtocartref) = createRefs() + Box(modifier = Modifier + .height(280.dp) + .constrainAs(imagesliderref) { + top.linkTo(imagesliderref.top) + bottom.linkTo(imagesliderref.top) + start.linkTo(parent.start) + end.linkTo(parent.end) + }) { + HeaderImagesSlider() + } + Surface( + color = white, + shape = RoundedCornerShape(40.dp) + .copy( + bottomStart = ZeroCornerSize, + bottomEnd = ZeroCornerSize + ), + modifier = Modifier + .fillMaxSize() + .padding(top = 300.dp) + .constrainAs(addtocartref) { + bottom.linkTo(parent.bottom) + start.linkTo(parent.start) + end.linkTo(parent.end) + } + ) { + Column( + modifier = Modifier + .fillMaxSize() + .padding(30.dp) + ) { + ProductTitle() + Spacer(modifier = Modifier.padding(10.dp)) + ProductAvailableSize() + Spacer(modifier = Modifier.padding(10.dp)) + ProductItemColorWithDesc() + } + + + } + + } + + } + } + ) + +} + + +@Composable +fun HeaderImagesSlider() { + val showThumbImagesList = listOf( + R.drawable.show_1, + R.drawable.shoe_thumb_1, + R.drawable.shoe_thumb_4, + R.drawable.shoe_thumb_3 + ) + Column( + verticalArrangement = Arrangement.Top, + horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier + .fillMaxWidth() + .fillMaxHeight() + ) { + Image( + contentScale = ContentScale.Fit, + painter = painterResource(id = R.drawable.show_1), + contentDescription = "", + modifier = Modifier + .size(230.dp) + ) + + LazyRow( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp), + horizontalArrangement = Arrangement.spacedBy(10.dp) + ) { + items(showThumbImagesList.size) { item -> + Box( + modifier = Modifier + .height(60.dp) + .width(62.dp) + .border( + color = if (item == 0) orange else lightGrey, + width = 2.dp, + shape = RoundedCornerShape(16.dp) + ) + .clickable { }) { + Image( + painter = painterResource(showThumbImagesList[item]), + contentDescription = "", + modifier = Modifier + .size(50.dp, 50.dp) + .padding( + start = 10.dp, + end = 5.dp, + top = 5.dp, + bottom = 5.dp + ) + ) + + } + Spacer(modifier = Modifier.width(10.dp)) + } + } + } +} + +@Composable +fun ProductTitle() { + Column( + modifier = Modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Divider( + color = grey, + modifier = Modifier + .height(4.dp) + .width(40.dp) + ) + Spacer(modifier = Modifier.padding(5.dp)) + + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Text( + text = "NIKE AIR MAX 200", + color = titleTextColor, + fontSize = 24.sp, + fontWeight = FontWeight.Bold + ) + + Column(modifier = Modifier.wrapContentHeight()) { + Text( + text = buildAnnotatedString { + withStyle( + style = SpanStyle( + orange, + fontWeight = FontWeight.Bold + ) + ) { + append("$ ") + } + withStyle( + style = SpanStyle( + titleTextColor + ) + ) { + append("240") + } + }, + style = MaterialTheme.typography.subtitle1, + modifier = Modifier, + fontSize = 16.sp + + ) + + + } + } + } +} + +@Composable +fun ProductAvailableSize() { + val itemListavailablesize = listOf("US6", "US7", "US8", "US9") + Column(modifier = Modifier.fillMaxWidth()) { + + Text( + text = "Available Sizes", + color = titleTextColor, + fontSize = 18.sp + ) + Spacer(modifier = Modifier.padding(10.dp)) + + LazyRow( + modifier = Modifier + .fillMaxWidth() + ) { + items(itemListavailablesize.size) { item -> + Box( + modifier = Modifier + .height(40.dp) + .width(70.dp) + .border( + color = if (item == 1) orange else lightGrey, + width = 2.dp, + shape = RoundedCornerShape(10.dp) + ) + .clickable { }) { + Text( + modifier = Modifier + .padding( + start = 20.dp, + end = 16.dp, + top = 10.dp, + bottom = 8.dp + ), + text = itemListavailablesize[item], + fontWeight = FontWeight.Bold, + color = if (item == 1) titleTextColor else Color.LightGray + ) + + + } + Spacer(modifier = Modifier.width(10.dp)) + } + } + } +} + +@Composable +fun ProductItemColorWithDesc() { + Column(modifier = Modifier.fillMaxWidth()) { + Text( + text = "Color", + color = titleTextColor, + fontSize = 18.sp + ) + Spacer(modifier = Modifier.padding(10.dp)) + + Row( + modifier = Modifier + .fillMaxWidth(), + horizontalArrangement = Arrangement.spacedBy(16.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Box( + modifier = Modifier + .size(30.dp) + .clip(shape = CircleShape) + .background(orange) + .clickable { } + ) + Box( + modifier = Modifier + .size(30.dp) + .clip(shape = CircleShape) + .background(lightBlue) + .clickable { } + ) + Box( + modifier = Modifier + .size(30.dp) + .clip(shape = CircleShape) + .background(black) + .clickable { } + ) + Box( + modifier = Modifier + .size(30.dp) + .clip(shape = CircleShape) + .background(red) + .clickable { } + ) + Box( + modifier = Modifier + .size(30.dp) + .clip(shape = CircleShape) + .background(skyBlue) + .clickable { } + ) + } + Spacer(modifier = Modifier.padding(10.dp)) + Text( + text = "Description", + color = titleTextColor, + fontSize = 18.sp + ) + Spacer(modifier = Modifier.padding(5.dp)) + Text( + text = stringResource(id = R.string.product_text_description), + color = lightblack, + fontSize = 14.sp + ) + } + +} + + + + + diff --git a/app/src/main/java/com/arvind/nikeshop/view/SplashScreen.kt b/app/src/main/java/com/arvind/nikeshop/view/SplashScreen.kt new file mode 100644 index 0000000..93545d6 --- /dev/null +++ b/app/src/main/java/com/arvind/nikeshop/view/SplashScreen.kt @@ -0,0 +1,64 @@ +package com.arvind.nikeshop.view + +import android.view.animation.OvershootInterpolator +import androidx.compose.animation.core.Animatable +import androidx.compose.animation.core.tween +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.size +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp +import androidx.navigation.NavController +import com.arvind.nikeshop.R +import com.arvind.nikeshop.navigation.Screen +import com.arvind.nikeshop.utils.Constants +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.delay +import kotlinx.coroutines.withContext + +@Composable +fun SplashScreen( + navController: NavController, + dispatcher: CoroutineDispatcher = Dispatchers.Main +) { + val scale = remember { + Animatable(0f) + } + val overshootInterpolator = remember { + OvershootInterpolator(2f) + } + LaunchedEffect(key1 = true) { + withContext(dispatcher) { + scale.animateTo( + targetValue = 0.5f, + animationSpec = tween( + durationMillis = 500, + easing = { + overshootInterpolator.getInterpolation(it) + } + ) + ) + delay(Constants.SPLASH_SCREEN_DURATION) + navController.popBackStack() + navController.navigate(Screen.HomeScreen.route) + } + } + + Box( + modifier = Modifier.fillMaxSize(), + contentAlignment = Alignment.Center + ) { + Image( + painter = painterResource(id = R.drawable.app_logo), + contentDescription = "Logo", + modifier = Modifier.size(128.dp) + ) + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-nodpi/jacket.png b/app/src/main/res/drawable-nodpi/jacket.png new file mode 100644 index 0000000..d246750 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/jacket.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_thumb_1.png b/app/src/main/res/drawable-nodpi/shoe_thumb_1.png new file mode 100644 index 0000000..3d530cf Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_thumb_1.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_thumb_2.png b/app/src/main/res/drawable-nodpi/shoe_thumb_2.png new file mode 100644 index 0000000..578a71e Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_thumb_2.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_thumb_3.png b/app/src/main/res/drawable-nodpi/shoe_thumb_3.png new file mode 100644 index 0000000..4840d53 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_thumb_3.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_thumb_4.png b/app/src/main/res/drawable-nodpi/shoe_thumb_4.png new file mode 100644 index 0000000..39ae6c1 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_thumb_4.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_thumb_5.png b/app/src/main/res/drawable-nodpi/shoe_thumb_5.png new file mode 100644 index 0000000..2bb3a10 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_thumb_5.png differ diff --git a/app/src/main/res/drawable-nodpi/shoe_tilt_2.png b/app/src/main/res/drawable-nodpi/shoe_tilt_2.png new file mode 100644 index 0000000..cd75983 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shoe_tilt_2.png differ diff --git a/app/src/main/res/drawable-nodpi/shooe_tilt_1.png b/app/src/main/res/drawable-nodpi/shooe_tilt_1.png new file mode 100644 index 0000000..55f89ac Binary files /dev/null and b/app/src/main/res/drawable-nodpi/shooe_tilt_1.png differ diff --git a/app/src/main/res/drawable-nodpi/show_1.png b/app/src/main/res/drawable-nodpi/show_1.png new file mode 100644 index 0000000..a838fc6 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/show_1.png differ diff --git a/app/src/main/res/drawable-nodpi/small_tilt_shoe_1.png b/app/src/main/res/drawable-nodpi/small_tilt_shoe_1.png new file mode 100644 index 0000000..6bea664 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/small_tilt_shoe_1.png differ diff --git a/app/src/main/res/drawable-nodpi/small_tilt_shoe_2.png b/app/src/main/res/drawable-nodpi/small_tilt_shoe_2.png new file mode 100644 index 0000000..78207e7 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/small_tilt_shoe_2.png differ diff --git a/app/src/main/res/drawable-nodpi/small_tilt_shoe_3.png b/app/src/main/res/drawable-nodpi/small_tilt_shoe_3.png new file mode 100644 index 0000000..40a0eb3 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/small_tilt_shoe_3.png differ diff --git a/app/src/main/res/drawable-nodpi/user.png b/app/src/main/res/drawable-nodpi/user.png new file mode 100644 index 0000000..aa35fd7 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/user.png differ diff --git a/app/src/main/res/drawable-nodpi/watch.png b/app/src/main/res/drawable-nodpi/watch.png new file mode 100644 index 0000000..27d6f89 Binary files /dev/null and b/app/src/main/res/drawable-nodpi/watch.png differ diff --git a/app/src/main/res/drawable-v24/app_logo.png b/app/src/main/res/drawable-v24/app_logo.png new file mode 100644 index 0000000..eeeeca4 Binary files /dev/null and b/app/src/main/res/drawable-v24/app_logo.png differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/filter_list.png b/app/src/main/res/drawable/filter_list.png new file mode 100644 index 0000000..7fa22e2 Binary files /dev/null and b/app/src/main/res/drawable/filter_list.png differ diff --git a/app/src/main/res/drawable/ic_baseline_favorite_border_24.xml b/app/src/main/res/drawable/ic_baseline_favorite_border_24.xml new file mode 100644 index 0000000..3edfe1d --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_favorite_border_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_home_24.xml b/app/src/main/res/drawable/ic_baseline_home_24.xml new file mode 100644 index 0000000..3a4c7da --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_home_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_search_24.xml b/app/src/main/res/drawable/ic_baseline_search_24.xml new file mode 100644 index 0000000..07b76d6 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_search_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_shopping_cart_24.xml b/app/src/main/res/drawable/ic_baseline_shopping_cart_24.xml new file mode 100644 index 0000000..cf0dcc8 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_shopping_cart_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..7353dbd --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..0075ebe --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..341f6b5 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,13 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + + #E65829 + #E65829 + \ No newline at end of file diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..c0d89ce --- /dev/null +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #DC553D + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..6ddb101 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,18 @@ + + NikeShop + + + Clean lines, versatile and timeless—the people shoe + returns with the Nike Air Max 90. +Featuring the same iconic Waffle sole, +stitched overlays and classic TPU accents + you come to love, it lets you walk among + the pantheon of Air. ßNothing as fly, +nothing as comfortable, nothing as proven. +The Nike Air Max 90 stays true to its OG running + roots with the iconic Waffle sole, +stitched overlays and classic TPU details. +Classic colours celebrate your fresh look +while Max Air cushioning adds comfort to the journey. + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..0a489c8 --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,27 @@ + + + + + + +