Skip to content

Commit ac9fb6e

Browse files
author
Arvind Meshram
committed
Initial commit
0 parents  commit ac9fb6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2034
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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.jetsunglass"
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+
89+
90+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.arvind.jetsunglass
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.jetsunglass", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.arvind.jetsunglass">
4+
5+
<application
6+
android:name=".app.JetSunglass"
7+
android:allowBackup="true"
8+
android:icon="@mipmap/ic_launcher"
9+
android:label="@string/app_name"
10+
android:largeHeap="true"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.JetSunglass">
14+
<activity
15+
android:name=".MainActivity"
16+
android:exported="true"
17+
android:label="@string/app_name"
18+
android:theme="@style/Theme.JetSunglass.NoActionBar">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
</application>
26+
27+
</manifest>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.arvind.jetsunglass
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.runtime.Composable
9+
import com.arvind.jetsunglass.navigation.Navigation
10+
import com.arvind.jetsunglass.ui.theme.JetSunglassTheme
11+
12+
class MainActivity : ComponentActivity() {
13+
override fun onCreate(savedInstanceState: Bundle?) {
14+
super.onCreate(savedInstanceState)
15+
setContent {
16+
JetSunglassAppUiMain()
17+
}
18+
}
19+
20+
@Composable
21+
fun JetSunglassAppUiMain() {
22+
JetSunglassTheme {
23+
Surface(color = MaterialTheme.colors.background) {
24+
Navigation()
25+
}
26+
27+
}
28+
}
29+
30+
}
31+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.arvind.jetsunglass.app
2+
3+
import android.app.Application
4+
import dagger.hilt.android.HiltAndroidApp
5+
6+
@HiltAndroidApp
7+
class JetSunglass : Application() {
8+
9+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.arvind.jetsunglass.component
2+
3+
import androidx.compose.foundation.layout.*
4+
import androidx.compose.foundation.shape.CircleShape
5+
import androidx.compose.material.Card
6+
import androidx.compose.material.Icon
7+
import androidx.compose.material.IconButton
8+
import androidx.compose.material.icons.Icons
9+
import androidx.compose.material.icons.filled.KeyboardArrowLeft
10+
import androidx.compose.material.icons.outlined.Favorite
11+
import androidx.compose.runtime.Composable
12+
import androidx.compose.ui.Alignment
13+
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.draw.clip
15+
import androidx.compose.ui.tooling.preview.Preview
16+
import androidx.compose.ui.unit.dp
17+
import com.arvind.jetsunglass.ui.theme.black
18+
19+
@Composable
20+
fun TopAppBarWithBack(onBackClick: () -> Unit) {
21+
22+
Row(
23+
modifier = Modifier
24+
.fillMaxWidth()
25+
.padding(top = 16.dp),
26+
horizontalArrangement = Arrangement.SpaceBetween,
27+
verticalAlignment = Alignment.CenterVertically
28+
) {
29+
IconButton(onClick = { onBackClick() }) {
30+
Icon(
31+
imageVector = Icons.Default.KeyboardArrowLeft,
32+
contentDescription = "On Back",
33+
tint = black,
34+
modifier = Modifier.size(32.dp, 32.dp)
35+
36+
)
37+
}
38+
39+
Card(
40+
modifier = Modifier
41+
.padding(end = 20.dp)
42+
.width(50.dp)
43+
.clip(CircleShape),
44+
elevation = 4.dp
45+
) {
46+
IconButton(onClick = { }) {
47+
Icon(
48+
imageVector = Icons.Outlined.Favorite,
49+
contentDescription = ""
50+
)
51+
52+
}
53+
}
54+
55+
}
56+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.arvind.jetsunglass.navigation
2+
3+
import androidx.compose.runtime.Composable
4+
import androidx.navigation.compose.NavHost
5+
import androidx.navigation.compose.composable
6+
import androidx.navigation.compose.rememberNavController
7+
import com.arvind.jetsunglass.view.DashboardScreen
8+
import com.arvind.jetsunglass.view.OnBoardingScreen
9+
import com.arvind.jetsunglass.view.ProductDetailsScreen
10+
import com.arvind.jetsunglass.view.SplashScreen
11+
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.OnBoardingScreen.route) {
27+
OnBoardingScreen()
28+
}
29+
30+
composable(Screen.ProductDetailScreen.route) {
31+
ProductDetailsScreen()
32+
}
33+
34+
35+
}
36+
}

0 commit comments

Comments
 (0)