forked from meshramaravind/E-commerceShopAppUI-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Arvind Meshram
committed
Aug 27, 2021
0 parents
commit dac9f74
Showing
76 changed files
with
2,281 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/com/arvind/nikeshop/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.arvind.nikeshop"> | ||
|
||
<application | ||
android:name=".app.NikeShopApp" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:largeHeap="true" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.NikeShop"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:exported="true" | ||
android:label="@string/app_name" | ||
android:theme="@style/Theme.NikeShop.NoActionBar"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.arvind.nikeshop.app | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class NikeShopApp : Application() { | ||
} |
81 changes: 81 additions & 0 deletions
81
app/src/main/java/com/arvind/nikeshop/component/BottomBar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
) | ||
|
||
|
||
} | ||
|
||
} |
Oops, something went wrong.