├── .gitignore
├── .idea
├── .name
├── codeStyles
│ └── Project.xml
├── compiler.xml
├── gradle.xml
├── jarRepositories.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── Screenshots
├── address.jpg
├── cart.jpg
├── home.jpg
├── navigation drawer.jpg
├── order summary.jpg
├── payment.jpg
├── payment2.jpg
├── signin.jpg
└── signup.jpg
├── _config.yml
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── dev
│ │ └── atharvakulkarni
│ │ └── e_commerce
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── dev
│ │ │ └── atharvakulkarni
│ │ │ └── e_commerce
│ │ │ ├── SliderItem.java
│ │ │ ├── ViewModel
│ │ │ ├── AddFavoriteViewModel.java
│ │ │ ├── CartViewModel.java
│ │ │ ├── FromCartViewModel.java
│ │ │ ├── RemoveFavoriteViewModel.java
│ │ │ └── SignInSignUpViewModel.java
│ │ │ ├── adapter
│ │ │ ├── AllCategoryAdapter.java
│ │ │ ├── CartAdapter.java
│ │ │ ├── MyOrdersAdapter.java
│ │ │ ├── search_result_adapter.java
│ │ │ └── slider_adapter.java
│ │ │ ├── model
│ │ │ ├── AllCategory.java
│ │ │ ├── Cart.java
│ │ │ ├── CartApiResponse.java
│ │ │ ├── Favorite.java
│ │ │ ├── FavoriteApiResponse.java
│ │ │ ├── Product.java
│ │ │ ├── ProductApiResponse.java
│ │ │ └── SearchProduct.java
│ │ │ ├── net
│ │ │ ├── Api.java
│ │ │ └── RetrofitClient.java
│ │ │ ├── repository
│ │ │ ├── AddFavoriteRepository.java
│ │ │ ├── CartRepository.java
│ │ │ ├── FromCartRepository.java
│ │ │ ├── RemoveFavoriteRepository.java
│ │ │ └── SignInSignUpRepository.java
│ │ │ ├── storage
│ │ │ └── LoginUtils.java
│ │ │ ├── utils
│ │ │ ├── Constants.java
│ │ │ └── RequestCallback.java
│ │ │ └── view
│ │ │ ├── AllCategoryActivity.java
│ │ │ ├── CartActivity.java
│ │ │ ├── Home.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MyAccountActivity.java
│ │ │ ├── MyOrdersActivity.java
│ │ │ ├── MyWishlistActivity.java
│ │ │ ├── NotificationsActivity.java
│ │ │ ├── OrderDetailsActivity.java
│ │ │ ├── ReportActivity.java
│ │ │ ├── User.java
│ │ │ ├── order_placing.java
│ │ │ ├── search_result.java
│ │ │ ├── show_product.java
│ │ │ └── sigin_signup.java
│ └── res
│ │ ├── drawable-v24
│ │ ├── acer_nitro5.jpg
│ │ ├── ecommerce_logo.jpg
│ │ ├── google_pay.jpg
│ │ ├── shoes1.jpeg
│ │ ├── shoes2.jpeg
│ │ └── shoes3.jpg
│ │ ├── drawable
│ │ ├── add.xml
│ │ ├── arrow_right.xml
│ │ ├── bg_overlay.xml
│ │ ├── bug_report.xml
│ │ ├── cart.xml
│ │ ├── category.xml
│ │ ├── continue2_background.xml
│ │ ├── continue_background.xml
│ │ ├── delete.xml
│ │ ├── email.xml
│ │ ├── favorite_like.xml
│ │ ├── favorite_unlike.xml
│ │ ├── filter.xml
│ │ ├── gradient_home.xml
│ │ ├── home.xml
│ │ ├── home_linear2_background.xml
│ │ ├── linear_dotted_background.xml
│ │ ├── local_offer.xml
│ │ ├── logout.xml
│ │ ├── message.xml
│ │ ├── notifications.xml
│ │ ├── person_outline.xml
│ │ ├── rate.xml
│ │ ├── search.xml
│ │ ├── searchbar_background.xml
│ │ ├── security.xml
│ │ ├── share.xml
│ │ ├── shopping_bag.xml
│ │ ├── show_product_linearlayout_gradient.xml
│ │ ├── textinputlayout_background.xml
│ │ ├── userrating_background.xml
│ │ └── wishlist.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── all_categories.xml
│ │ ├── all_categories_item.xml
│ │ ├── cart.xml
│ │ ├── cart_item.xml
│ │ ├── home.xml
│ │ ├── image_slider_layout_item.xml
│ │ ├── my_account.xml
│ │ ├── my_orders.xml
│ │ ├── my_orders_item.xml
│ │ ├── my_wishlist.xml
│ │ ├── navigation_header.xml
│ │ ├── notifications.xml
│ │ ├── order_details.xml
│ │ ├── order_placing.xml
│ │ ├── report.xml
│ │ ├── search_result.xml
│ │ ├── search_result_list.xml
│ │ ├── show_product.xml
│ │ ├── signin_signup.xml
│ │ └── user.xml
│ │ ├── menu
│ │ ├── bottom_navigation_items.xml
│ │ └── navigation_menu.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── dev
│ └── atharvakulkarni
│ └── e_commerce
│ └── ExampleUnitTest.java
├── 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 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | E-Commerce
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 🛒 E-Commerce 🛍
2 |
3 |
4 |
5 | Part 1 - [Android App]() - currently viewing
6 | Part 2 - [Flutter Mobile App]()
7 | Part 3 - [Web App using MERN Stack Technology]()
8 | Part 4 - [Desktop Application using JavaFX, MySQL & JDBC]()
9 |
10 |
Part 1 - Android App
11 |
12 |
13 |
14 |
15 | This App is linked to my e-commerce website via web-services using a REST API developed; which are the other parts of this project.
16 | The Website, Android App, Flutter App & Flutter Web App are connected to each other
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | - Displaying exact reason for order return
35 | - Google Maps & a article on it
36 | - Poster
37 |
38 |
39 |
40 | [Project Report]()
41 |
42 |
43 |
44 |
45 | ## 📸 Screenshots
46 |
47 |
48 |
49 | Adress
50 | Cart
51 | Home
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | Navigation Drawer
61 | Order Summary
62 | Payment
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | Payment 2
72 | Sign In
73 | Sign Up
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | ## Features
86 |
87 |
88 |
89 |
90 | ## Built With 🛠
91 | - [Java](https://www.java.com/en/) - Most widely used programming language for Android development.
92 | - [Coroutines](https://kotlinlang.org/docs/reference/coroutines-overview.html) - For asynchronous and more..
93 | - [Android Architecture Components](https://developer.android.com/topic/libraries/architecture) - Collection of libraries that help you design robust, testable, and maintainable apps.
94 | - [LiveData](https://developer.android.com/topic/libraries/architecture/livedata) - Data objects that notify views when the underlying database changes.
95 | - [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel) - Stores UI-related data that isn't destroyed on UI changes.
96 | - [ViewBinding](https://developer.android.com/topic/libraries/view-binding) - Generates a binding class for each XML layout file present in that module and allows you to more easily write code that interacts with views.
97 | - [Koin](https://insert-koin.io) - Dependency Injection Framework
98 | - [Retrofit](https://square.github.io/retrofit/) - A type-safe HTTP client for Android and Java.
99 | - [GSON](https://github.com/google/gson) - A Java serialization/deserialization library to convert Java Objects into JSON and back.
100 | - [GSON Converter](https://github.com/square/retrofit/tree/master/retrofit-converters/gson) - A Converter which uses Gson for serialization to and from JSON.
101 | - [OkHttp3](https://github.com/square/okhttp) - For implementing interceptor, logging and mocking web server.
102 | - [Glide](https://github.com/bumptech/glide) - An image loading and caching library for Android focused on smooth scrolling.
103 | - [Material Components for Android](https://github.com/material-components/material-components-android) - Modular and customizable Material Design UI components for Android.
104 |
105 | Broadcast receiver
106 | Room Persistence Library
107 |
108 |
109 |
110 | ### Other Concepts included
111 | - RecyclerView
112 | - GridView
113 | - CardView
114 | - CircularImageView
115 | - ImageSlider
116 | - Fragments
117 | - Passing data between activities, fragments
118 | - SearchView
119 | - SwipeRefresh
120 | - BottomSheet
121 |
122 |
123 |
124 |
125 | # Package Structure
126 |
127 | dev.atharvakulkarni.e_commerce # Root Package
128 | .
129 | ├── data # For data handling.
130 | │ ├── model # Model classes
131 | │ ├── network # Remote Data Handlers
132 | | │ ├── api # Retrofit API for remote end point.
133 | │ └── repository # Single source of data.
134 | |
135 | |
136 | ├── ui # Activity/View layer
137 | │ ├── main # Main Screen Activity & ViewModel
138 | | │ ├── adapter # Adapter for RecyclerView
139 | | │ ├── viewmodel # ViewHolder for RecyclerView
140 | │ └── details # Detail Screen Activity and ViewModel
141 | |
142 | └── utils # Utility Classes / Kotlin extensions
143 |
144 |
145 |
146 |
147 |
148 | ## 👨🔧 Architecture
149 | This app uses [***MVVM (Model View View-Model)***](https://developer.android.com/jetpack/docs/guide#recommended-app-arch) architecture.
150 |
151 | 
152 |
153 |
154 |
155 | ## 📱 Contact - Let's become friend 🤝
156 | - [Portfolio Website](https://kulkarniatharva.github.io/)
157 | - [Github](https://github.com/KulkarniAtharva)
158 | - [LinkedIn](https://www.linkedin.com/in/atharva-kulkarni-146279187/)
159 | - [Facebook](https://www.facebook.com/atharva.kulkarni.96343/)
160 |
161 |
162 |
163 |
164 | ## 😎 More Projects
165 |
166 | I don't stop here.
167 | Some of my best projects you must see : 👇👇👇👇👇👇
168 |
169 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | Android
193 | Flutter
194 | Web
195 | Machine Learning
196 |
197 |
198 | E-Commerce
199 | E-Commerce
200 | E-Commerce
201 | Emotion & Gesture Recognition
202 |
203 |
204 |
205 | Messenger
206 | Messenger
207 | Messenger
208 | Face Recognition
209 |
210 |
211 | Movie Finder
212 | PokeDex
213 | Portfolio (new)
214 | Cartoonify Image
215 |
216 |
217 | Weather App
218 | Meditation & Yoga
219 | Portfolio (old)
220 | Live Sketch using Webcam
221 |
222 |
223 | KKW Alerts
224 | Book App
225 | Photography
226 | Finding Waldo
227 |
228 |
229 |
230 | Doctor Booking
231 | Tic-Tac-Toe
232 | Handwritten Digit Recognition
233 |
234 |
235 |
236 | Dating App
237 | Dating App
238 |
239 |
240 |
241 |
242 | Grocery App
243 |
244 |
245 |
246 |
247 |
248 | News App
249 |
250 |
251 |
252 |
253 |
254 | Wallet App
255 |
256 |
257 |
258 |
259 |
260 | Travel App
261 |
262 |
263 |
264 |
265 |
266 | a
267 |
268 |
269 |
270 |
271 |
272 | a
273 |
274 |
275 |
276 |
277 |
278 | a
279 |
280 |
281 |
282 |
283 |
284 | a
285 |
286 |
287 |
288 |
289 |
290 | a
291 |
292 |
293 |
294 |
295 |
296 | s
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 | An overview of my skills & all my projects done can be found from my [Portfolio Website](https://kulkarniatharva.github.io/).
307 |
308 |
309 |
310 | ## 📜 Licence
311 |
--------------------------------------------------------------------------------
/Screenshots/address.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/address.jpg
--------------------------------------------------------------------------------
/Screenshots/cart.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/cart.jpg
--------------------------------------------------------------------------------
/Screenshots/home.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/home.jpg
--------------------------------------------------------------------------------
/Screenshots/navigation drawer.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/navigation drawer.jpg
--------------------------------------------------------------------------------
/Screenshots/order summary.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/order summary.jpg
--------------------------------------------------------------------------------
/Screenshots/payment.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/payment.jpg
--------------------------------------------------------------------------------
/Screenshots/payment2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/payment2.jpg
--------------------------------------------------------------------------------
/Screenshots/signin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/signin.jpg
--------------------------------------------------------------------------------
/Screenshots/signup.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/Screenshots/signup.jpg
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "30.0.0"
6 |
7 | defaultConfig {
8 | applicationId "dev.atharvakulkarni.e_commerce"
9 | minSdkVersion 28
10 | targetSdkVersion 30
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | }
16 |
17 | dataBinding
18 | {
19 | enabled = true
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | compileOptions {
29 | targetCompatibility JavaVersion.VERSION_1_8
30 | sourceCompatibility JavaVersion.VERSION_1_8
31 | }
32 | }
33 |
34 | dependencies
35 | {
36 | implementation fileTree(dir: "libs", include: ["*.jar"])
37 | implementation 'androidx.appcompat:appcompat:1.2.0'
38 | implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
39 | testImplementation 'junit:junit:4.13.1'
40 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
41 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
42 | implementation 'com.google.android.material:material:1.2.1'
43 | implementation "androidx.cardview:cardview:1.0.0"
44 | implementation 'com.github.jd-alexander:LikeButton:0.2.3'
45 | implementation 'com.github.bumptech.glide:glide:4.11.0'
46 | implementation 'com.github.smarteist:autoimageslider:1.3.9-appcompat'
47 | implementation 'de.hdodenhof:circleimageview:3.1.0'
48 | // implementation 'com.google.android.material:material:1.3.0-alpha03'
49 |
50 | implementation 'com.squareup.retrofit2:retrofit:2.8.1'
51 |
52 | // Dagger
53 | def dagger_version = "2.26"
54 | // def dagger_version = "2.16" // version used by google samples
55 |
56 | // Dagger2 core
57 | implementation "com.google.dagger:dagger:$dagger_version"
58 | annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version"
59 |
60 | // Dagger Android
61 | implementation "com.google.dagger:dagger-android:$dagger_version"
62 | implementation "com.google.dagger:dagger-android-support:$dagger_version"
63 | annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version"
64 |
65 | // Retrofit
66 | def retrofitVersion = "2.8.1"
67 | implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
68 | implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
69 |
70 | // ViewModel and LiveData
71 | def lifecycle_version = '2.2.0'
72 | implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
73 |
74 | implementation "com.squareup.okhttp3:logging-interceptor:4.9.0"
75 | }
--------------------------------------------------------------------------------
/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/dev/atharvakulkarni/e_commerce/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("dev.atharvakulkarni.e_commerce", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/SliderItem.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce;
2 |
3 | public class SliderItem
4 | {
5 | private String description;
6 | private String imageUrl;
7 |
8 | public String getDescription()
9 | {
10 | return description;
11 | }
12 |
13 | public void setDescription(String description)
14 | {
15 | this.description = description;
16 | }
17 |
18 | public String getImageUrl()
19 | {
20 | return imageUrl;
21 | }
22 |
23 | public void setImageUrl(String imageUrl)
24 | {
25 | this.imageUrl = imageUrl;
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/ViewModel/AddFavoriteViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.ViewModel;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.lifecycle.AndroidViewModel;
7 | import androidx.lifecycle.LiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.model.Favorite;
10 | import dev.atharvakulkarni.e_commerce.repository.AddFavoriteRepository;
11 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
12 | import okhttp3.ResponseBody;
13 |
14 | public class AddFavoriteViewModel extends AndroidViewModel
15 | {
16 | private AddFavoriteRepository addFavoriteRepository;
17 |
18 | public AddFavoriteViewModel(@NonNull Application application)
19 | {
20 | super(application);
21 | addFavoriteRepository = new AddFavoriteRepository(application);
22 | }
23 |
24 | public LiveData addFavorite(Favorite favorite, RequestCallback callback)
25 | {
26 | return addFavoriteRepository.addFavorite(favorite,callback);
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/ViewModel/CartViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.ViewModel;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.lifecycle.AndroidViewModel;
7 | import androidx.lifecycle.LiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.model.CartApiResponse;
10 | import dev.atharvakulkarni.e_commerce.repository.CartRepository;
11 | import okhttp3.ResponseBody;
12 |
13 | public class CartViewModel extends AndroidViewModel
14 | {
15 | private CartRepository cartRepository;
16 |
17 | public CartViewModel(@NonNull Application application)
18 | {
19 | super(application);
20 | cartRepository = new CartRepository(application);
21 | }
22 |
23 | public LiveData getProductsInCart(int userId)
24 | {
25 | return cartRepository.getProductsInCart(userId);
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/ViewModel/FromCartViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.ViewModel;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.lifecycle.AndroidViewModel;
7 | import androidx.lifecycle.LiveData;
8 |
9 |
10 | import dev.atharvakulkarni.e_commerce.repository.FromCartRepository;
11 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
12 | import okhttp3.ResponseBody;
13 |
14 | public class FromCartViewModel extends AndroidViewModel
15 | {
16 | private FromCartRepository fromCartRepository;
17 |
18 | public FromCartViewModel(@NonNull Application application)
19 | {
20 | super(application);
21 | fromCartRepository = new FromCartRepository(application);
22 | }
23 |
24 | public LiveData removeFromCart(int userId, int productId, RequestCallback callback)
25 | {
26 | return fromCartRepository.removeFromCart(userId, productId, callback);
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/ViewModel/RemoveFavoriteViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.ViewModel;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.lifecycle.AndroidViewModel;
7 | import androidx.lifecycle.LiveData;
8 |
9 |
10 | import dev.atharvakulkarni.e_commerce.repository.RemoveFavoriteRepository;
11 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
12 | import okhttp3.ResponseBody;
13 |
14 | public class RemoveFavoriteViewModel extends AndroidViewModel
15 | {
16 | private RemoveFavoriteRepository removeFavoriteRepository;
17 |
18 | public RemoveFavoriteViewModel(@NonNull Application application)
19 | {
20 | super(application);
21 | removeFavoriteRepository = new RemoveFavoriteRepository(application);
22 | }
23 |
24 | public LiveData removeFavorite(int userId, int productId, RequestCallback callback)
25 | {
26 | return removeFavoriteRepository.removeFavorite(userId, productId, callback);
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/ViewModel/SignInSignUpViewModel.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.ViewModel;
2 |
3 | import android.app.Application;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.lifecycle.AndroidViewModel;
7 | import androidx.lifecycle.LiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.model.CartApiResponse;
10 | import dev.atharvakulkarni.e_commerce.repository.CartRepository;
11 | import dev.atharvakulkarni.e_commerce.repository.SignInSignUpRepository;
12 |
13 | public class SignInSignUpViewModel extends AndroidViewModel
14 | {
15 | private SignInSignUpRepository signInSignUpRepository;
16 |
17 | public SignInSignUpViewModel(@NonNull Application application)
18 | {
19 | super(application);
20 | signInSignUpRepository = new SignInSignUpRepository(application);
21 | }
22 |
23 | /* public LiveData getProductsInCart(int userId)
24 | {
25 | return signInSignUpRepository.getProductsInCart(userId);
26 | }*/
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/adapter/AllCategoryAdapter.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.adapter;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 | import android.widget.Toast;
12 |
13 | import java.util.ArrayList;
14 |
15 | import dev.atharvakulkarni.e_commerce.R;
16 | import dev.atharvakulkarni.e_commerce.model.AllCategory;
17 | import dev.atharvakulkarni.e_commerce.model.SearchProduct;
18 | import dev.atharvakulkarni.e_commerce.view.show_product;
19 |
20 | public class AllCategoryAdapter extends BaseAdapter
21 | {
22 | Context context;
23 | ArrayList gridPojos;
24 |
25 | public AllCategoryAdapter(Context context,ArrayList gridPojos)
26 | {
27 | this.context = context;
28 | this.gridPojos = gridPojos;
29 | }
30 |
31 | @Override
32 | public int getCount()
33 | {
34 | return gridPojos.size();
35 | }
36 |
37 | @Override
38 | public Object getItem(int i)
39 | {
40 | return null;
41 | }
42 |
43 | @Override
44 | public long getItemId(int i)
45 | {
46 | return 0;
47 | }
48 |
49 | @Override
50 | public View getView(final int i, View view, ViewGroup viewGroup)
51 | {
52 | view = LayoutInflater.from(context).inflate(R.layout.all_categories_item,viewGroup,false);
53 |
54 | TextView title = view.findViewById(R.id.title);
55 | ImageView image = view.findViewById(R.id.imageview);
56 |
57 | title.setText(gridPojos.get(i).getTitle());
58 | image.setImageResource(gridPojos.get(i).getImages());
59 |
60 | view.setOnClickListener(new View.OnClickListener()
61 | {
62 | @Override
63 | public void onClick(View view)
64 | {
65 | Toast.makeText(context, i+"", Toast.LENGTH_SHORT).show();
66 |
67 | Intent intent = new Intent(context, show_product.class);
68 | context.startActivity(intent);
69 | }
70 | });
71 |
72 | return view;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/adapter/CartAdapter.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 | import android.widget.Toast;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.databinding.DataBindingUtil;
13 | import androidx.fragment.app.FragmentActivity;
14 | import androidx.lifecycle.ViewModelProvider;
15 | import androidx.lifecycle.ViewModelProviders;
16 | import androidx.lifecycle.ViewModelStoreOwner;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | import dev.atharvakulkarni.e_commerce.R;
23 | import dev.atharvakulkarni.e_commerce.ViewModel.AddFavoriteViewModel;
24 | import dev.atharvakulkarni.e_commerce.ViewModel.CartViewModel;
25 | import dev.atharvakulkarni.e_commerce.ViewModel.FromCartViewModel;
26 | import dev.atharvakulkarni.e_commerce.ViewModel.RemoveFavoriteViewModel;
27 | import dev.atharvakulkarni.e_commerce.databinding.CartItemBinding;
28 | import dev.atharvakulkarni.e_commerce.model.Product;
29 |
30 | public class CartAdapter extends RecyclerView.Adapter
31 | {
32 | Context context;
33 | RecyclerView recyclerView;
34 | ArrayList image;
35 | ArrayList title;
36 | ArrayList price;
37 |
38 | private List productsInCart;
39 |
40 | private CartAdapter.CartAdapterOnClickHandler clickHandler;
41 |
42 | private AddFavoriteViewModel addFavoriteViewModel;
43 | private RemoveFavoriteViewModel removeFavoriteViewModel;
44 | private FromCartViewModel fromCartViewModel;
45 |
46 | /**
47 | * The interface that receives onClick messages.
48 | */
49 | public interface CartAdapterOnClickHandler
50 | {
51 | void onClick(Product product);
52 | }
53 |
54 | public CartAdapter(RecyclerView recyclerView, Context context, ArrayList image, ArrayList title, ArrayList price)
55 | {
56 | this.recyclerView = recyclerView;
57 | this.context = context;
58 | this.image = image;
59 | this.title = title;
60 | this.price = price;
61 |
62 |
63 | addFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(AddFavoriteViewModel.class);
64 | removeFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(RemoveFavoriteViewModel.class);
65 | fromCartViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(FromCartViewModel.class);
66 | }
67 |
68 | /*public CartAdapter(Context mContext, List productInCart, CartAdapter.CartAdapterOnClickHandler clickHandler, FragmentActivity activity)
69 | {
70 | this.context = context;
71 | this.productsInCart = productInCart;
72 | this.clickHandler = clickHandler;
73 | addFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(AddFavoriteViewModel.class);
74 | removeFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(RemoveFavoriteViewModel.class);
75 | fromCartViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(FromCartViewModel.class);
76 | }*/
77 |
78 | public void update(Integer images,String titles,String prices)
79 | {
80 | image.add(images);
81 | title.add(titles);
82 | price.add(prices);
83 |
84 | notifyDataSetChanged(); // refreshes the recycler view automatically
85 | }
86 |
87 | @NonNull
88 | @Override
89 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
90 | {
91 | //View view = LayoutInflater.from(context).inflate(R.layout.cart_item,parent,false);
92 | //return new ViewHolder(view);
93 |
94 | CartItemBinding cartListItemBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.cart_item, parent, false);
95 | return new ViewHolder(cartListItemBinding);
96 | }
97 |
98 | @Override
99 | public void onBindViewHolder(@NonNull ViewHolder holder, int position)
100 | {
101 | holder.binding.title.setText(title.get(position));
102 | holder.binding.price.setText(price.get(position));
103 | holder.binding.image.setImageResource(image.get(position));
104 | }
105 |
106 | @Override
107 | public int getItemCount()
108 | {
109 | return title.size();
110 | }
111 |
112 | public class ViewHolder extends RecyclerView.ViewHolder
113 | {
114 | TextView title,price;
115 | ImageView image;
116 | private final CartItemBinding binding;
117 |
118 | public ViewHolder(CartItemBinding binding)
119 | {
120 | super(binding.getRoot());
121 | View itemView = binding.getRoot();
122 |
123 | this.binding = binding;
124 |
125 | title = binding.title;
126 | price = binding.price;
127 | image = binding.image;
128 |
129 | itemView.setOnClickListener(new View.OnClickListener()
130 | {
131 | @Override
132 | public void onClick(View view)
133 | {
134 | int position = recyclerView.getChildLayoutPosition(view);
135 |
136 | Toast.makeText(context, position+"", Toast.LENGTH_SHORT).show();
137 |
138 | // Intent intent = new Intent(context,address.class);
139 | // context.startActivity(intent);
140 | }
141 | });
142 | }
143 | }
144 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/adapter/MyOrdersAdapter.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.adapter;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 | import android.widget.Toast;
12 |
13 | import androidx.annotation.NonNull;
14 | import androidx.databinding.DataBindingUtil;
15 | import androidx.lifecycle.ViewModelProvider;
16 | import androidx.lifecycle.ViewModelStoreOwner;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | import dev.atharvakulkarni.e_commerce.R;
23 | import dev.atharvakulkarni.e_commerce.ViewModel.AddFavoriteViewModel;
24 | import dev.atharvakulkarni.e_commerce.ViewModel.FromCartViewModel;
25 | import dev.atharvakulkarni.e_commerce.ViewModel.RemoveFavoriteViewModel;
26 | import dev.atharvakulkarni.e_commerce.databinding.CartItemBinding;
27 | import dev.atharvakulkarni.e_commerce.databinding.MyOrdersBinding;
28 | import dev.atharvakulkarni.e_commerce.databinding.MyOrdersItemBinding;
29 | import dev.atharvakulkarni.e_commerce.databinding.SearchResultListBinding;
30 | import dev.atharvakulkarni.e_commerce.model.Product;
31 | import dev.atharvakulkarni.e_commerce.model.SearchProduct;
32 | import dev.atharvakulkarni.e_commerce.view.OrderDetailsActivity;
33 | import dev.atharvakulkarni.e_commerce.view.show_product;
34 |
35 | public class MyOrdersAdapter extends RecyclerView.Adapter
36 | {
37 | Context context;
38 | RecyclerView recyclerView;
39 | ArrayList image;
40 | ArrayList title;
41 | ArrayList order_status;
42 |
43 | private List productsInCart;
44 |
45 | private CartAdapter.CartAdapterOnClickHandler clickHandler;
46 |
47 |
48 | /**
49 | * The interface that receives onClick messages.
50 | */
51 | public interface CartAdapterOnClickHandler
52 | {
53 | void onClick(Product product);
54 | }
55 |
56 | public MyOrdersAdapter(RecyclerView recyclerView, Context context, ArrayList image, ArrayListorder_status,ArrayList title)
57 | {
58 | this.recyclerView = recyclerView;
59 | this.context = context;
60 | this.image = image;
61 | this.title = title;
62 | this.order_status = order_status;
63 | }
64 |
65 | public void update(Integer images,String order_status,String titles)
66 | {
67 | image.add(images);
68 | title.add(titles);
69 | this.order_status.add(order_status);
70 |
71 | notifyDataSetChanged(); // refreshes the recycler view automatically
72 | }
73 |
74 | @NonNull
75 | @Override
76 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
77 | {
78 | //View view = LayoutInflater.from(context).inflate(R.layout.cart_item,parent,false);
79 | //return new ViewHolder(view);
80 |
81 | MyOrdersItemBinding myOrdersItemBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.my_orders_item, parent, false);
82 | return new ViewHolder(myOrdersItemBinding);
83 | }
84 |
85 | @Override
86 | public void onBindViewHolder(@NonNull ViewHolder holder, int position)
87 | {
88 | holder.myOrdersItemBinding.title.setText(title.get(position));
89 | holder.myOrdersItemBinding.orderStatus.setText(order_status.get(position));
90 | holder.myOrdersItemBinding.imageview.setImageResource(image.get(position));
91 | }
92 |
93 | @Override
94 | public int getItemCount()
95 | {
96 | return title.size();
97 | }
98 |
99 | public class ViewHolder extends RecyclerView.ViewHolder
100 | {
101 | TextView title,order_status;
102 | ImageView image;
103 | private final MyOrdersItemBinding myOrdersItemBinding;
104 |
105 | public ViewHolder(MyOrdersItemBinding myOrdersItemBinding)
106 | {
107 | super(myOrdersItemBinding.getRoot());
108 | View itemView = myOrdersItemBinding.getRoot();
109 |
110 | this.myOrdersItemBinding = myOrdersItemBinding;
111 |
112 | title = myOrdersItemBinding.title;
113 | order_status = myOrdersItemBinding.orderStatus;
114 | image = myOrdersItemBinding.imageview;
115 |
116 | itemView.setOnClickListener(new View.OnClickListener()
117 | {
118 | @Override
119 | public void onClick(View view)
120 | {
121 | int position = recyclerView.getChildLayoutPosition(view);
122 |
123 | Toast.makeText(context, position+"", Toast.LENGTH_SHORT).show();
124 |
125 | Intent intent = new Intent(context, OrderDetailsActivity.class);
126 | context.startActivity(intent);
127 | }
128 | });
129 | }
130 | }
131 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/adapter/search_result_adapter.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.adapter;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.BaseAdapter;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 | import android.widget.Toast;
12 |
13 | import androidx.annotation.NonNull;
14 | import androidx.databinding.DataBindingUtil;
15 | import androidx.lifecycle.ViewModelProvider;
16 | import androidx.lifecycle.ViewModelStoreOwner;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import java.util.ArrayList;
20 | import java.util.List;
21 |
22 | import dev.atharvakulkarni.e_commerce.R;
23 | import dev.atharvakulkarni.e_commerce.ViewModel.AddFavoriteViewModel;
24 | import dev.atharvakulkarni.e_commerce.ViewModel.FromCartViewModel;
25 | import dev.atharvakulkarni.e_commerce.ViewModel.RemoveFavoriteViewModel;
26 | import dev.atharvakulkarni.e_commerce.databinding.CartItemBinding;
27 | import dev.atharvakulkarni.e_commerce.databinding.SearchResultListBinding;
28 | import dev.atharvakulkarni.e_commerce.model.Product;
29 | import dev.atharvakulkarni.e_commerce.model.SearchProduct;
30 | import dev.atharvakulkarni.e_commerce.view.show_product;
31 |
32 | public class search_result_adapter extends RecyclerView.Adapter
33 | {
34 | Context context;
35 | RecyclerView recyclerView;
36 | ArrayList image;
37 | ArrayList title;
38 | ArrayList price;
39 |
40 | private List productsInCart;
41 |
42 | private CartAdapter.CartAdapterOnClickHandler clickHandler;
43 |
44 |
45 | /**
46 | * The interface that receives onClick messages.
47 | */
48 | public interface CartAdapterOnClickHandler
49 | {
50 | void onClick(Product product);
51 | }
52 |
53 | public search_result_adapter(RecyclerView recyclerView, Context context, ArrayList image, ArrayList title, ArrayList price)
54 | {
55 | this.recyclerView = recyclerView;
56 | this.context = context;
57 | this.image = image;
58 | this.title = title;
59 | this.price = price;
60 |
61 | Toast.makeText(context, "fdfds", Toast.LENGTH_SHORT).show();
62 |
63 | /* addFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(AddFavoriteViewModel.class);
64 | removeFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(RemoveFavoriteViewModel.class);
65 | fromCartViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(FromCartViewModel.class);*/
66 | }
67 |
68 | /*public CartAdapter(Context mContext, List productInCart, CartAdapter.CartAdapterOnClickHandler clickHandler, FragmentActivity activity)
69 | {
70 | this.context = context;
71 | this.productsInCart = productInCart;
72 | this.clickHandler = clickHandler;
73 | addFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(AddFavoriteViewModel.class);
74 | removeFavoriteViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(RemoveFavoriteViewModel.class);
75 | fromCartViewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(FromCartViewModel.class);
76 | }*/
77 |
78 | public void update(Integer images,String titles,String prices)
79 | {
80 | // Toast.makeText(context, titles, Toast.LENGTH_SHORT).show();
81 | image.add(images);
82 | title.add(titles);
83 | price.add(prices);
84 |
85 | notifyDataSetChanged(); // refreshes the recycler view automatically
86 | }
87 |
88 | @NonNull
89 | @Override
90 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType)
91 | {
92 | //View view = LayoutInflater.from(context).inflate(R.layout.cart_item,parent,false);
93 | //return new ViewHolder(view);
94 |
95 | SearchResultListBinding searchResultListBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.search_result_list, parent, false);
96 | return new ViewHolder(searchResultListBinding);
97 | }
98 |
99 | @Override
100 | public void onBindViewHolder(@NonNull ViewHolder holder, int position)
101 | {
102 | holder.searchResultListBinding.title.setText(title.get(position));
103 | holder.searchResultListBinding.price.setText(price.get(position));
104 | holder.searchResultListBinding.imageview.setImageResource(image.get(position));
105 |
106 | // Glide.with(context).load(image.get(position)).into(holder.image);
107 |
108 | Toast.makeText(context, title.get(position), Toast.LENGTH_SHORT).show();
109 | }
110 |
111 | @Override
112 | public int getItemCount()
113 | {
114 | return title.size();
115 | }
116 |
117 | public class ViewHolder extends RecyclerView.ViewHolder
118 | {
119 | TextView title,price;
120 | ImageView image;
121 | private final SearchResultListBinding searchResultListBinding;
122 |
123 | public ViewHolder(SearchResultListBinding searchResultListBinding)
124 | {
125 | super(searchResultListBinding.getRoot());
126 | View itemView = searchResultListBinding.getRoot();
127 |
128 | this.searchResultListBinding = searchResultListBinding;
129 |
130 | title = searchResultListBinding.title;
131 | price = searchResultListBinding.price;
132 | image = searchResultListBinding.imageview;
133 |
134 | itemView.setOnClickListener(new View.OnClickListener()
135 | {
136 | @Override
137 | public void onClick(View view)
138 | {
139 | int position = recyclerView.getChildLayoutPosition(view);
140 |
141 | Toast.makeText(context, position+"", Toast.LENGTH_SHORT).show();
142 |
143 | // Intent intent = new Intent(context,address.class);
144 | // context.startActivity(intent);
145 | }
146 | });
147 | }
148 | }
149 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/adapter/slider_adapter.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.adapter;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 | import android.widget.Toast;
11 |
12 | import com.bumptech.glide.Glide;
13 | import com.smarteist.autoimageslider.SliderViewAdapter;
14 |
15 | import java.util.ArrayList;
16 | import java.util.List;
17 |
18 | import dev.atharvakulkarni.e_commerce.R;
19 | import dev.atharvakulkarni.e_commerce.SliderItem;
20 |
21 | public class slider_adapter extends SliderViewAdapter
22 | {
23 | private Context context;
24 | private List mSliderItems = new ArrayList<>();
25 |
26 | public slider_adapter(Context context)
27 | {
28 | this.context = context;
29 | }
30 |
31 | public void renewItems(List sliderItems)
32 | {
33 | this.mSliderItems = sliderItems;
34 | notifyDataSetChanged();
35 | }
36 |
37 | public void deleteItem(int position)
38 | {
39 | this.mSliderItems.remove(position);
40 | notifyDataSetChanged();
41 | }
42 |
43 | public void addItem(SliderItem sliderItem)
44 | {
45 | this.mSliderItems.add(sliderItem);
46 | notifyDataSetChanged();
47 | }
48 |
49 | @Override
50 | public SliderAdapterVH onCreateViewHolder(ViewGroup parent)
51 | {
52 | View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_slider_layout_item, null);
53 | return new SliderAdapterVH(inflate);
54 | }
55 |
56 | @Override
57 | public void onBindViewHolder(SliderAdapterVH viewHolder, final int position)
58 | {
59 | SliderItem sliderItem = mSliderItems.get(position);
60 |
61 | viewHolder.textViewDescription.setText(sliderItem.getDescription());
62 | viewHolder.textViewDescription.setTextSize(16);
63 | viewHolder.textViewDescription.setTextColor(Color.WHITE);
64 | Glide.with(viewHolder.itemView)
65 | .load(sliderItem.getImageUrl())
66 | .fitCenter()
67 | .into(viewHolder.imageViewBackground);
68 |
69 | viewHolder.itemView.setOnClickListener(new View.OnClickListener()
70 | {
71 | @Override
72 | public void onClick(View v)
73 | {
74 | Toast.makeText(context, "This is item in position " + position, Toast.LENGTH_SHORT).show();
75 | }
76 | });
77 | }
78 |
79 | @Override
80 | public int getCount()
81 | {
82 | //slider view count could be dynamic size
83 | return mSliderItems.size();
84 | }
85 |
86 | class SliderAdapterVH extends SliderViewAdapter.ViewHolder
87 | {
88 | View itemView;
89 | ImageView imageViewBackground;
90 | ImageView imageGifContainer;
91 | TextView textViewDescription;
92 |
93 | public SliderAdapterVH(View itemView)
94 | {
95 | super(itemView);
96 | imageViewBackground = itemView.findViewById(R.id.iv_auto_image_slider);
97 | imageGifContainer = itemView.findViewById(R.id.iv_gif_container);
98 | textViewDescription = itemView.findViewById(R.id.tv_auto_image_slider);
99 | this.itemView = itemView;
100 | }
101 | }
102 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/AllCategory.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | public class AllCategory
4 | {
5 | private String title;
6 | private int images;
7 |
8 | public AllCategory(String title, int images)
9 | {
10 | this.title = title;
11 | this.images = images;
12 | }
13 |
14 | public String getTitle()
15 | {
16 | return title;
17 | }
18 |
19 | public int getImages()
20 | {
21 | return images;
22 | }
23 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/Cart.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | public class Cart
4 | {
5 | private String cart;
6 |
7 | public Cart(String cart)
8 | {
9 | this.cart = cart;
10 | }
11 |
12 | public Cart()
13 | {
14 | }
15 |
16 | public String getCart()
17 | {
18 | return cart;
19 | }
20 |
21 | public void setCart(String cart)
22 | {
23 | this.cart = cart;
24 | }
25 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/CartApiResponse.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | import java.util.List;
6 |
7 | public class CartApiResponse
8 | {
9 | @SerializedName("carts")
10 | private List carts;
11 |
12 | public List getProductsInCart()
13 | {
14 | return carts;
15 | }
16 |
17 | public void setProductsInCart(List carts)
18 | {
19 | this.carts = carts;
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/Favorite.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | public class Favorite {
4 |
5 | private int userId;
6 | private int productId;
7 |
8 | public Favorite(int userId, int productId) {
9 | this.userId = userId;
10 | this.productId = productId;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/FavoriteApiResponse.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | import java.util.List;
6 |
7 | public class FavoriteApiResponse {
8 |
9 | @SerializedName("favorites")
10 | private List favorites;
11 |
12 | public List getFavorites() {
13 | return favorites;
14 | }
15 |
16 | public void setFavorites(List favorites) {
17 | this.favorites = favorites;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/Product.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | import com.google.gson.annotations.SerializedName;
7 |
8 | public class Product implements Parcelable {
9 |
10 | @SerializedName("id")
11 | private int productId;
12 | @SerializedName("product_name")
13 | private String productName;
14 | @SerializedName("price")
15 | private double productPrice;
16 | @SerializedName("quantity")
17 | private int productQuantity;
18 | @SerializedName("supplier")
19 | private String productSupplier;
20 | @SerializedName("category")
21 | private String productCategory;
22 | @SerializedName("image")
23 | private String productImage;
24 | @SerializedName("isFavourite")
25 | private int isFavourite;
26 | @SerializedName("isInCart")
27 | private int isInCart;
28 | // Include child Parcelable objects
29 | private Product mInfo;
30 |
31 |
32 | public Product(String productName, double productPrice, int productQuantity, String productSupplier, String productCategory) {
33 | this.productName = productName;
34 | this.productPrice = productPrice;
35 | this.productQuantity = productQuantity;
36 | this.productSupplier = productSupplier;
37 | this.productCategory = productCategory;
38 | }
39 |
40 | public Product() {
41 |
42 | }
43 |
44 | public int getProductId() {
45 | return productId;
46 | }
47 |
48 | public String getProductName() {
49 | return productName;
50 | }
51 |
52 | public double getProductPrice() {
53 | return productPrice;
54 | }
55 |
56 | public int getProductQuantity() {
57 | return productQuantity;
58 | }
59 |
60 | public String getProductSupplier() {
61 | return productSupplier;
62 | }
63 |
64 | public String getProductCategory() {
65 | return productCategory;
66 | }
67 |
68 | public String getProductImage() {
69 | return productImage;
70 | }
71 |
72 |
73 | public int isFavourite() {
74 | return isFavourite;
75 | }
76 |
77 | public int isInCart() {
78 | return isInCart;
79 | }
80 |
81 | public void setIsFavourite(boolean isFavourite) {
82 | this.isFavourite = isFavourite ? 1 : 0;
83 | }
84 |
85 | public void setIsInCart(boolean isInCart) {
86 | this.isInCart = isInCart ? 1 : 0;
87 | }
88 |
89 | // Write the values to be saved to the `Parcel`.
90 | @Override
91 | public void writeToParcel(Parcel out, int flags) {
92 | out.writeInt(productId);
93 | out.writeString(productName);
94 | out.writeDouble(productPrice);
95 | out.writeInt(productQuantity);
96 | out.writeString(productSupplier);
97 | out.writeString(productCategory);
98 | out.writeString(productImage);
99 | out.writeInt(isFavourite);
100 | out.writeInt(isInCart);
101 | out.writeParcelable(mInfo, flags);
102 | }
103 |
104 | // Retrieve the values written into the `Parcel`.
105 | private Product(Parcel in) {
106 | productId = in.readInt();
107 | productName = in.readString();
108 | productPrice = in.readDouble();
109 | productQuantity = in.readInt();
110 | productSupplier = in.readString();
111 | productCategory = in.readString();
112 | productImage = in.readString();
113 | isFavourite = in.readInt();
114 | isInCart = in.readInt();
115 | mInfo = in.readParcelable(Product.class.getClassLoader());
116 | }
117 |
118 | @Override
119 | public int describeContents() {
120 | return 0;
121 | }
122 |
123 | // Create the Parcelable.Creator CREATOR` constant for our class;
124 | public static final Creator CREATOR
125 | = new Creator()
126 | {
127 | // This simply calls our new constructor and
128 | // passes along `Parcel`, and then returns the new object!
129 | @Override
130 | public Product createFromParcel(Parcel in)
131 | {
132 | return new Product(in);
133 | }
134 |
135 | @Override
136 | public Product[] newArray(int size)
137 | {
138 | return new Product[size];
139 | }
140 | };
141 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/ProductApiResponse.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | import com.google.gson.annotations.SerializedName;
4 |
5 | import java.util.List;
6 |
7 | public class ProductApiResponse {
8 |
9 | @SerializedName("products")
10 | private List products;
11 |
12 | public List getProducts() {
13 | return products;
14 | }
15 |
16 | public void setProducts(List products) {
17 | this.products = products;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/model/SearchProduct.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.model;
2 |
3 | public class SearchProduct
4 | {
5 | private String title,price;
6 | private int images;
7 |
8 | public SearchProduct(String title, int images,String price)
9 | {
10 | this.title = title;
11 | this.images = images;
12 | this.price = price;
13 | }
14 |
15 | public String getTitle()
16 | {
17 | return title;
18 | }
19 |
20 | public int getImages()
21 | {
22 | return images;
23 | }
24 |
25 | public String getPrice()
26 | {
27 | return price;
28 | }
29 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/net/Api.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.net;
2 |
3 |
4 | import android.media.Image;
5 |
6 | import java.util.Map;
7 |
8 | import dev.atharvakulkarni.e_commerce.model.Cart;
9 | import dev.atharvakulkarni.e_commerce.model.CartApiResponse;
10 | import dev.atharvakulkarni.e_commerce.model.Favorite;
11 | import dev.atharvakulkarni.e_commerce.model.FavoriteApiResponse;
12 | import dev.atharvakulkarni.e_commerce.model.ProductApiResponse;
13 | import okhttp3.MultipartBody;
14 | import okhttp3.RequestBody;
15 | import okhttp3.ResponseBody;
16 | import retrofit2.Call;
17 | import retrofit2.http.Body;
18 | import retrofit2.http.DELETE;
19 | import retrofit2.http.GET;
20 | import retrofit2.http.Multipart;
21 | import retrofit2.http.POST;
22 | import retrofit2.http.PUT;
23 | import retrofit2.http.Part;
24 | import retrofit2.http.PartMap;
25 | import retrofit2.http.Path;
26 | import retrofit2.http.Query;
27 |
28 | public interface Api
29 | {
30 | /* @POST("users/register")
31 | Call createUser(@Body User user);
32 |
33 | @GET("users/login")
34 | Call logInUser(@Query("email") String email, @Query("password") String password);*/
35 |
36 | @DELETE("users/{userId}")
37 | Call deleteAccount(@Path("userId") int userId);
38 |
39 | @Multipart
40 | @PUT("users/upload")
41 | Call uploadPhoto(@Part MultipartBody.Part userPhoto, @Part("id") RequestBody userId);
42 |
43 | @PUT("users/info")
44 | Call updatePassword(@Query("password") String password, @Query("id") int userId);
45 |
46 | @Multipart
47 | @POST("products/insert")
48 | Call insertProduct(@PartMap Map productInfo, @Part MultipartBody.Part image);
49 |
50 | @GET("users/getImage")
51 | Call getUserImage(@Query("id") int userId);
52 |
53 | /* @GET("users/otp")
54 | Call getOtp(@Query("email") String email);*/
55 |
56 | @GET("products")
57 | Call getProducts(@Query("page") int page);
58 |
59 | @GET("products")
60 | Call getProductsByCategory(@Query("category") String category, @Query("userId") int userId,@Query("page") int page);
61 |
62 | @GET("products/search")
63 | Call searchForProduct(@Query("q") String keyword, @Query("userId") int userId);
64 |
65 | @POST("favorites/add")
66 | Call addFavorite(@Body Favorite favorite);
67 |
68 | @DELETE("favorites/remove")
69 | Call removeFavorite(@Query("userId") int userId, @Query("productId") int productId);
70 |
71 | @GET("favorites")
72 | Call getFavorites(@Query("userId") int userId);
73 |
74 | @POST("carts/add")
75 | Call addToCart(@Body Cart cart);
76 |
77 | @DELETE("carts/remove")
78 | Call removeFromCart(@Query("userId") int userId, @Query("productId") int productId);
79 |
80 | @GET("carts")
81 | Call getProductsInCart(@Query("userId") int userId);
82 |
83 | /* @POST("history/add")
84 | Call addToHistory(@Body History history);
85 |
86 | @DELETE("history/remove")
87 | Call removeAllFromHistory();
88 |
89 | @GET("history")
90 | Call getProductsInHistory(@Query("userId") int userId, @Query("page") int page);
91 |
92 | @POST("review/add")
93 | Call addReview(@Body Review review);
94 |
95 | @GET("review")
96 | Call getAllReviews(@Query("productId") int productId);
97 |
98 | @GET("posters")
99 | Call getPosters();
100 |
101 | @GET("orders/get")
102 | Call getOrders(@Query("userId") int userId);
103 |
104 | @POST("address/add")
105 | Call addShippingAddress(@Body Shipping shipping);
106 |
107 | @POST("orders/add")
108 | Call orderProduct(@Body Ordering ordering);*/
109 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/net/RetrofitClient.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.net;
2 |
3 | import retrofit2.Retrofit;
4 | import retrofit2.converter.gson.GsonConverterFactory;
5 |
6 | public class RetrofitClient
7 | {
8 | private static final String BASE_URL = "http://192.168.1.4:3000/";
9 | private static RetrofitClient mInstance;
10 | private Retrofit retrofit;
11 |
12 | private RetrofitClient()
13 | {
14 | retrofit = new Retrofit.Builder()
15 | .baseUrl(BASE_URL)
16 | .addConverterFactory(GsonConverterFactory.create())
17 | .build();
18 | }
19 |
20 | public static synchronized RetrofitClient getInstance()
21 | {
22 | if (mInstance == null)
23 | mInstance = new RetrofitClient();
24 | return mInstance;
25 | }
26 |
27 | public Api getApi()
28 | {
29 | return retrofit.create(Api.class);
30 | }
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/repository/AddFavoriteRepository.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.repository;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import androidx.lifecycle.LiveData;
7 | import androidx.lifecycle.MutableLiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.model.Favorite;
10 | import dev.atharvakulkarni.e_commerce.net.RetrofitClient;
11 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
12 | import okhttp3.ResponseBody;
13 | import retrofit2.Call;
14 | import retrofit2.Callback;
15 | import retrofit2.Response;
16 |
17 | public class AddFavoriteRepository
18 | {
19 | private static final String TAG = AddFavoriteRepository.class.getSimpleName();
20 | private Application application;
21 |
22 | public AddFavoriteRepository(Application application)
23 | {
24 | this.application = application;
25 | }
26 |
27 | public LiveData addFavorite(Favorite favorite, RequestCallback callback)
28 | {
29 | final MutableLiveData mutableLiveData = new MutableLiveData<>();
30 | RetrofitClient.getInstance().getApi().addFavorite(favorite).enqueue(new Callback()
31 | {
32 | @Override
33 | public void onResponse(Call call, Response response)
34 | {
35 | Log.d("onResponse", "" + response.code());
36 |
37 | ResponseBody responseBody = response.body();
38 |
39 | if(response.code() == 200)
40 | {
41 | callback.onCallBack();
42 | }
43 |
44 | if (response.body() != null)
45 | {
46 | mutableLiveData.setValue(responseBody);
47 | }
48 | }
49 |
50 | @Override
51 | public void onFailure(Call call, Throwable t)
52 | {
53 | Log.d("onFailure", "" + t.getMessage());
54 | }
55 | });
56 | return mutableLiveData;
57 | }
58 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/repository/CartRepository.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.repository;
2 |
3 |
4 | import android.app.Application;
5 | import android.util.Log;
6 |
7 | import androidx.lifecycle.LiveData;
8 | import androidx.lifecycle.MutableLiveData;
9 |
10 | import dev.atharvakulkarni.e_commerce.model.CartApiResponse;
11 | import dev.atharvakulkarni.e_commerce.net.RetrofitClient;
12 | import retrofit2.Call;
13 | import retrofit2.Callback;
14 | import retrofit2.Response;
15 |
16 | public class CartRepository
17 | {
18 | private static final String TAG = CartRepository.class.getSimpleName();
19 | private Application application;
20 |
21 | public CartRepository(Application application)
22 | {
23 | this.application = application;
24 | }
25 |
26 | public LiveData getProductsInCart(int userId)
27 | {
28 | final MutableLiveData mutableLiveData = new MutableLiveData<>();
29 |
30 | RetrofitClient.getInstance().getApi().getProductsInCart(userId).enqueue(new Callback()
31 | {
32 | @Override
33 | public void onResponse(Call call, Response response)
34 | {
35 | Log.d(TAG, "onResponse: Succeeded");
36 |
37 | CartApiResponse cartApiResponse = response.body();
38 |
39 | if (response.body() != null)
40 | {
41 | mutableLiveData.setValue(cartApiResponse);
42 | Log.d(TAG, String.valueOf(response.body().getProductsInCart()));
43 | }
44 | }
45 |
46 | @Override
47 | public void onFailure(Call call, Throwable t)
48 | {
49 | Log.d(TAG, "onFailure: " + t.getMessage());
50 | }
51 | });
52 | return mutableLiveData;
53 | }
54 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/repository/FromCartRepository.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.repository;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import androidx.lifecycle.LiveData;
7 | import androidx.lifecycle.MutableLiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.net.RetrofitClient;
10 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
11 | import okhttp3.ResponseBody;
12 | import retrofit2.Call;
13 | import retrofit2.Callback;
14 | import retrofit2.Response;
15 |
16 | public class FromCartRepository
17 | {
18 | private static final String TAG = FromCartRepository.class.getSimpleName();
19 | private Application application;
20 |
21 | public FromCartRepository(Application application)
22 | {
23 | this.application = application;
24 | }
25 |
26 | public LiveData removeFromCart(int userId, int productId, RequestCallback callback)
27 | {
28 | final MutableLiveData mutableLiveData = new MutableLiveData<>();
29 | RetrofitClient.getInstance().getApi().removeFromCart(userId, productId).enqueue(new Callback()
30 | {
31 | @Override
32 | public void onResponse(Call call, Response response)
33 | {
34 | Log.d("onResponse", "" + response.code());
35 |
36 | if(response.code() == 200)
37 | {
38 | callback.onCallBack();
39 | }
40 |
41 | ResponseBody responseBody = response.body();
42 |
43 | if (response.body() != null)
44 | {
45 | mutableLiveData.setValue(responseBody);
46 | }
47 | }
48 |
49 | @Override
50 | public void onFailure(Call call, Throwable t)
51 | {
52 | Log.d("onFailure", "" + t.getMessage());
53 | }
54 | });
55 |
56 | return mutableLiveData;
57 | }
58 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/repository/RemoveFavoriteRepository.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.repository;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import androidx.lifecycle.LiveData;
7 | import androidx.lifecycle.MutableLiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.net.RetrofitClient;
10 | import dev.atharvakulkarni.e_commerce.utils.RequestCallback;
11 | import okhttp3.ResponseBody;
12 | import retrofit2.Call;
13 | import retrofit2.Callback;
14 | import retrofit2.Response;
15 |
16 | public class RemoveFavoriteRepository
17 | {
18 | private static final String TAG = RemoveFavoriteRepository.class.getSimpleName();
19 | private Application application;
20 |
21 | public RemoveFavoriteRepository(Application application)
22 | {
23 | this.application = application;
24 | }
25 |
26 | public LiveData removeFavorite(int userId, int productId, RequestCallback callback)
27 | {
28 | final MutableLiveData mutableLiveData = new MutableLiveData<>();
29 | RetrofitClient.getInstance().getApi().removeFavorite(userId,productId).enqueue(new Callback()
30 | {
31 | @Override
32 | public void onResponse(Call call, Response response)
33 | {
34 | Log.d("onResponse", "" + response.code());
35 |
36 | if(response.code() == 200)
37 | {
38 | callback.onCallBack();
39 | }
40 |
41 | ResponseBody responseBody = response.body();
42 |
43 | if (response.body() != null)
44 | {
45 | mutableLiveData.setValue(responseBody);
46 | }
47 | }
48 |
49 | @Override
50 | public void onFailure(Call call, Throwable t)
51 | {
52 | Log.d("onFailure", "" + t.getMessage());
53 | }
54 | });
55 | return mutableLiveData;
56 | }
57 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/repository/SignInSignUpRepository.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.repository;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import androidx.lifecycle.LiveData;
7 | import androidx.lifecycle.MutableLiveData;
8 |
9 | import dev.atharvakulkarni.e_commerce.model.CartApiResponse;
10 | import dev.atharvakulkarni.e_commerce.net.RetrofitClient;
11 | import retrofit2.Call;
12 | import retrofit2.Callback;
13 | import retrofit2.Response;
14 |
15 | public class SignInSignUpRepository
16 | {
17 | private static final String TAG = CartRepository.class.getSimpleName();
18 | private Application application;
19 |
20 | public SignInSignUpRepository(Application application)
21 | {
22 | this.application = application;
23 | }
24 |
25 | public LiveData signinsignup(int userId)
26 | {
27 | final MutableLiveData mutableLiveData = new MutableLiveData<>();
28 |
29 | /* RetrofitClient.getInstance().getApi().signinsignup(userId).enqueue(new Callback()
30 | {
31 | @Override
32 | public void onResponse(Call call, Response response)
33 | {
34 | Log.d(TAG, "onResponse: Succeeded");
35 |
36 | CartApiResponse cartApiResponse = response.body();
37 |
38 | if (response.body() != null)
39 | {
40 | mutableLiveData.setValue(cartApiResponse);
41 | Log.d(TAG, String.valueOf(response.body().getProductsInCart()));
42 | }
43 | }
44 |
45 | @Override
46 | public void onFailure(Call call, Throwable t)
47 | {
48 | Log.d(TAG, "onFailure: " + t.getMessage());
49 | }
50 | });*/
51 | return mutableLiveData;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/storage/LoginUtils.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.storage;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | import dev.atharvakulkarni.e_commerce.view.User;
7 |
8 |
9 | public class LoginUtils {
10 |
11 | private static final String SHARED_PREF_NAME = "shared_preference";
12 |
13 | private static LoginUtils mInstance;
14 | private Context mCtx;
15 |
16 | private LoginUtils(Context mCtx) {
17 | this.mCtx = mCtx;
18 | }
19 |
20 |
21 | public static synchronized LoginUtils getInstance(Context mCtx) {
22 | if (mInstance == null) {
23 | mInstance = new LoginUtils(mCtx);
24 | }
25 | return mInstance;
26 | }
27 |
28 | /* public void saveUserInfo(LoginApiResponse response) {
29 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
30 | SharedPreferences.Editor editor = sharedPreferences.edit();
31 |
32 | editor.putInt("id", response.getId());
33 | editor.putString("name", response.getName());
34 | editor.putString("email", response.getEmail());
35 | editor.putString("password", response.getPassword());
36 | editor.putString("token", response.getToken());
37 | editor.putBoolean("isAdmin", response.isAdmin());
38 | editor.apply();
39 | }
40 |
41 | public boolean isLoggedIn() {
42 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
43 | return sharedPreferences.getInt("id", -1) != -1;
44 | }
45 |
46 | public void saveUserInfo(User user) {
47 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
48 | SharedPreferences.Editor editor = sharedPreferences.edit();
49 |
50 | editor.putInt("id", user.getId());
51 | editor.putString("name", user.getName());
52 | editor.putString("email", user.getEmail());
53 | editor.putString("password", user.getPassword());
54 | editor.putBoolean("isAdmin", user.isAdmin());
55 | editor.apply();
56 | }*/
57 |
58 | public int getUserInfo() {
59 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
60 | /* return new User(
61 | sharedPreferences.getInt("id", -1),
62 | sharedPreferences.getString("name", null),
63 | sharedPreferences.getString("email", null),
64 | sharedPreferences.getString("password", null),
65 | sharedPreferences.getBoolean("isAdmin", false)
66 | );*/
67 |
68 | return 0;
69 | }
70 |
71 | /* public void clearAll() {
72 | SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
73 | SharedPreferences.Editor editor = sharedPreferences.edit();
74 | editor.clear().apply();
75 | editor.apply();
76 | }*/
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/utils/Constants.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.utils;
2 |
3 | public class Constants {
4 | }
5 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/utils/RequestCallback.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.utils;
2 |
3 | public interface RequestCallback {
4 | void onCallBack();
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/AllCategoryActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 | import android.widget.GridView;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.app.AppCompatActivity;
8 | import androidx.databinding.DataBindingUtil;
9 |
10 | import java.util.ArrayList;
11 |
12 | import dev.atharvakulkarni.e_commerce.R;
13 | import dev.atharvakulkarni.e_commerce.adapter.AllCategoryAdapter;
14 | import dev.atharvakulkarni.e_commerce.adapter.search_result_adapter;
15 | import dev.atharvakulkarni.e_commerce.databinding.AllCategoriesBinding;
16 | import dev.atharvakulkarni.e_commerce.model.AllCategory;
17 | import dev.atharvakulkarni.e_commerce.model.SearchProduct;
18 |
19 | public class AllCategoryActivity extends AppCompatActivity
20 | {
21 | GridView gridView;
22 | ArrayList list;
23 | AllCategoryAdapter adapterGrid;
24 | AllCategoriesBinding allCategoriesBinding;
25 |
26 | @Override
27 | protected void onCreate(@Nullable Bundle savedInstanceState)
28 | {
29 | super.onCreate(savedInstanceState);
30 | allCategoriesBinding = DataBindingUtil.setContentView(this, R.layout.all_categories);
31 |
32 | gridView = allCategoriesBinding.gridlayout;
33 |
34 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
35 |
36 | gridList();
37 |
38 | adapterGrid = new AllCategoryAdapter(this,list);
39 | gridView.setAdapter(adapterGrid);
40 | }
41 |
42 | private void gridList()
43 | {
44 | list = new ArrayList();
45 |
46 | list.add(new AllCategory("Fashion",R.drawable.shoes1));
47 | list.add(new AllCategory("Mobiles",R.drawable.shoes2));
48 | list.add(new AllCategory("Electronics",R.drawable.shoes3));
49 | list.add(new AllCategory("Home",R.drawable.shoes3));
50 | list.add(new AllCategory("Appliances",R.drawable.shoes3));
51 | list.add(new AllCategory("Beauty",R.drawable.shoes3));
52 | list.add(new AllCategory("Toys & Baby",R.drawable.shoes3));
53 | list.add(new AllCategory("Sports & More",R.drawable.shoes3));
54 | list.add(new AllCategory("Furniture",R.drawable.shoes3));
55 | list.add(new AllCategory("Flights",R.drawable.shoes3));
56 | list.add(new AllCategory("Gift cards",R.drawable.shoes3));
57 | }
58 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/CartActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.databinding.DataBindingUtil;
11 | import androidx.lifecycle.ViewModelProvider;
12 | import androidx.lifecycle.ViewModelProviders;
13 | import androidx.recyclerview.widget.LinearLayoutManager;
14 | import androidx.recyclerview.widget.RecyclerView;
15 |
16 | import java.util.ArrayList;
17 | import java.util.List;
18 |
19 | import dev.atharvakulkarni.e_commerce.R;
20 | import dev.atharvakulkarni.e_commerce.ViewModel.CartViewModel;
21 | import dev.atharvakulkarni.e_commerce.adapter.CartAdapter;
22 | import dev.atharvakulkarni.e_commerce.databinding.CartBinding;
23 | import dev.atharvakulkarni.e_commerce.model.Product;
24 | import dev.atharvakulkarni.e_commerce.storage.LoginUtils;
25 |
26 | import static android.os.Build.PRODUCT;
27 |
28 | public class CartActivity extends AppCompatActivity
29 | {
30 | CartBinding cartBinding;
31 | RecyclerView recyclerView;
32 | LinearLayoutManager linearLayoutManager;
33 | Button continue_button;
34 | CartViewModel cartViewModel;
35 | CartAdapter cartAdapter;
36 |
37 | private List favoriteList;
38 |
39 | @Override
40 | protected void onCreate(@Nullable Bundle savedInstanceState)
41 | {
42 | super.onCreate(savedInstanceState);
43 | cartBinding = DataBindingUtil.setContentView(this, R.layout.cart);
44 |
45 | getWindow().setStatusBarColor(getResources().getColor(R.color.white, getTheme()));
46 |
47 | recyclerView = cartBinding.recyclerview;
48 | continue_button = cartBinding.continueButton;
49 |
50 | setUpRecyclerView();
51 | getProductsInCart();
52 |
53 | continue_button.setOnClickListener(new View.OnClickListener()
54 | {
55 | @Override
56 | public void onClick(View view)
57 | {
58 | Intent intent = new Intent(CartActivity.this, order_placing.class);
59 | startActivity(intent);
60 | }
61 | });
62 | }
63 |
64 | private void setUpRecyclerView()
65 | {
66 | linearLayoutManager = new LinearLayoutManager(CartActivity.this);
67 | recyclerView.setLayoutManager(linearLayoutManager);
68 | // cartBinding.recyclerview.setHasFixedSize(true);
69 | cartViewModel = new ViewModelProvider(this).get(CartViewModel.class);
70 | }
71 |
72 | private void getProductsInCart()
73 | {
74 | cartAdapter = new CartAdapter(recyclerView,CartActivity.this,new ArrayList(),new ArrayList(),new ArrayList());
75 |
76 |
77 | cartAdapter.update(R.drawable.shoes1,"Asian WNDR-13 Running Shoes for Men(Green, Grey)","₹300.00");
78 | cartAdapter.update(R.drawable.shoes2,"Asian WNDR-13 Running Shoes for Men(Green, Grey)","₹500.00");
79 |
80 | cartBinding.recyclerview.setAdapter(cartAdapter);
81 | cartAdapter.notifyDataSetChanged();
82 |
83 |
84 | /* cartViewModel.getProductsInCart(LoginUtils.getInstance(this).getUserInfo().getId()).observe(this, cartApiResponse ->
85 | {
86 | if (cartApiResponse != null)
87 | {
88 | favoriteList = cartApiResponse.getProductsInCart();
89 | if (favoriteList.size() == 0)
90 | {
91 | //cartBinding.noBookmarks.setVisibility(View.VISIBLE);
92 | // cartBinding.emptyCart.setVisibility(View.VISIBLE);
93 | }
94 | else
95 | cartBinding.recyclerview.setVisibility(View.VISIBLE);
96 |
97 | /*cartAdapter = new CartAdapter(getApplicationContext(), favoriteList, product ->
98 | {
99 | Intent intent = new Intent(CartActivity.this, order_placing.class);
100 | // Pass an object of product class
101 | intent.putExtra(PRODUCT, (product));
102 | startActivity(intent);
103 | }, this);*/
104 |
105 |
106 | }
107 |
108 | // binding.loadingIndicator.setVisibility(View.GONE);
109 |
110 | //});*/
111 |
112 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/Home.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.content.Intent;
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 | import android.util.Log;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.ImageView;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.annotation.Nullable;
14 | import androidx.appcompat.widget.SearchView;
15 | import androidx.databinding.DataBindingUtil;
16 | import androidx.drawerlayout.widget.DrawerLayout;
17 | import androidx.fragment.app.Fragment;
18 | import androidx.lifecycle.ViewModelProvider;
19 |
20 | import com.smarteist.autoimageslider.IndicatorView.animation.type.IndicatorAnimationType;
21 | import com.smarteist.autoimageslider.IndicatorView.draw.controller.DrawController;
22 | import com.smarteist.autoimageslider.SliderAnimations;
23 | import com.smarteist.autoimageslider.SliderView;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | import dev.atharvakulkarni.e_commerce.R;
29 | import dev.atharvakulkarni.e_commerce.SliderItem;
30 |
31 | import dev.atharvakulkarni.e_commerce.adapter.slider_adapter;
32 | import dev.atharvakulkarni.e_commerce.databinding.HomeBinding;
33 |
34 |
35 | public class Home extends Fragment
36 | {
37 | //HomeViewModel mViewModel;
38 | SearchView searchView;
39 | ImageView cart;
40 |
41 | SliderView sliderView;
42 | private slider_adapter adapter;
43 | HomeBinding homeBinding;
44 | DrawerLayout drawerLayout;
45 |
46 | @Nullable
47 | @Override
48 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
49 | {
50 | // View view = inflater.inflate(R.layout.home,container,false);
51 |
52 | homeBinding = DataBindingUtil.inflate(inflater, R.layout.home, container, false);
53 | View view = homeBinding.getRoot();
54 |
55 | cart = homeBinding.cart;
56 | searchView = homeBinding.searchView;
57 | sliderView = homeBinding.imageSlider;
58 |
59 |
60 |
61 | getActivity().getWindow().setStatusBarColor(getActivity().getColor(R.color.purple));
62 |
63 | // mViewModel = ViewModelProviders.of(this).get(HomeViewModel.class);
64 | // mViewModel = new ViewModelProvider(this).get(HomeViewModel.class);
65 |
66 |
67 | // mViewModel.init();
68 |
69 | /*mViewModel.getUsers().observe(this, users -> {
70 | // update UI
71 | });*/
72 |
73 | /* mViewModel.getUsers().observe(getContext(), new Observer()
74 | {
75 | @Override
76 | public void onChanged(VolumesResponse volumesResponse)
77 | {
78 | // update the ui.
79 | if(volumesResponse != null)
80 | adapter.setResults(volumesResponse.getItems());
81 | }
82 | });*/
83 |
84 |
85 | searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener()
86 | {
87 | @Override
88 | public boolean onQueryTextSubmit(String query)
89 | {
90 | if(query.equals("shoes"))
91 | {
92 | Intent intent = new Intent(getContext(), search_result.class);
93 | startActivity(intent);
94 | }
95 |
96 | return false;
97 | }
98 |
99 | @Override
100 | public boolean onQueryTextChange(String newText)
101 | {
102 | return false;
103 | }
104 | });
105 |
106 | cart.setOnClickListener(new View.OnClickListener()
107 | {
108 | @Override
109 | public void onClick(View view)
110 | {
111 | Intent intent = new Intent(getContext(), CartActivity.class);
112 | startActivity(intent);
113 | }
114 | });
115 |
116 |
117 |
118 | adapter = new slider_adapter(getContext());
119 |
120 | sliderView.setSliderAdapter(adapter);
121 |
122 | sliderView.setIndicatorAnimation(IndicatorAnimationType.WORM); //set indicator animation by using IndicatorAnimationType. :WORM or THIN_WORM or COLOR or DROP or FILL or NONE or SCALE or SCALE_DOWN or SLIDE and SWAP!!
123 | sliderView.setSliderTransformAnimation(SliderAnimations.SIMPLETRANSFORMATION);
124 | sliderView.setAutoCycleDirection(SliderView.AUTO_CYCLE_DIRECTION_BACK_AND_FORTH);
125 | sliderView.setIndicatorSelectedColor(Color.WHITE);
126 | sliderView.setIndicatorUnselectedColor(Color.GRAY);
127 | sliderView.setScrollTimeInSec(4); //set scroll delay in seconds :
128 | sliderView.startAutoCycle();
129 |
130 | sliderView.setOnIndicatorClickListener(new DrawController.ClickListener()
131 | {
132 | @Override
133 | public void onIndicatorClicked(int position)
134 | {
135 | Log.i("GGG", "onIndicatorClicked: " + sliderView.getCurrentPagePosition());
136 | }
137 | });
138 |
139 | addNewItem(view);
140 | renewItems(view);
141 | removeLastItem(view);
142 |
143 | return view;
144 | }
145 |
146 | public void renewItems(View view)
147 | {
148 | List sliderItemList = new ArrayList<>();
149 | //dummy data
150 | for (int i = 0; i < 5; i++)
151 | {
152 | SliderItem sliderItem = new SliderItem();
153 | sliderItem.setDescription("Slider Item " + i);
154 | if (i % 2 == 0)
155 | {
156 | sliderItem.setImageUrl("https://images.pexels.com/photos/929778/pexels-photo-929778.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260");
157 | }
158 | else
159 | {
160 | sliderItem.setImageUrl("https://images.pexels.com/photos/747964/pexels-photo-747964.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260");
161 | }
162 | sliderItemList.add(sliderItem);
163 | }
164 | adapter.renewItems(sliderItemList);
165 | }
166 |
167 | public void removeLastItem(View view)
168 | {
169 | if (adapter.getCount() - 1 >= 0)
170 | adapter.deleteItem(adapter.getCount() - 1);
171 | }
172 |
173 | public void addNewItem(View view)
174 | {
175 | SliderItem sliderItem = new SliderItem();
176 | sliderItem.setDescription("Slider Item Added Manually");
177 | sliderItem.setImageUrl("https://images.pexels.com/photos/929778/pexels-photo-929778.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260");
178 | adapter.addItem(sliderItem);
179 | }
180 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/MainActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import androidx.core.view.GravityCompat;
6 | import androidx.drawerlayout.widget.DrawerLayout;
7 | import androidx.fragment.app.Fragment;
8 | import androidx.fragment.app.FragmentManager;
9 |
10 |
11 | import android.content.Context;
12 | import android.content.Intent;
13 | import android.graphics.drawable.Drawable;
14 | import android.os.Bundle;
15 | import android.view.Gravity;
16 | import android.view.MenuItem;
17 | import android.view.View;
18 | import android.widget.Button;
19 | import android.widget.LinearLayout;
20 | import android.widget.TextView;
21 |
22 | import com.google.android.material.bottomnavigation.BottomNavigationView;
23 | import com.google.android.material.internal.NavigationMenu;
24 | import com.google.android.material.navigation.NavigationView;
25 |
26 | import dev.atharvakulkarni.e_commerce.R;
27 | import dev.atharvakulkarni.e_commerce.model.AllCategory;
28 |
29 | public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener
30 | {
31 | Fragment fragment = null;
32 | DrawerLayout drawerLayout;
33 | NavigationView navigationView;
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState)
37 | {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_main);
40 |
41 | drawerLayout = findViewById(R.id.drawerlayout);
42 | navigationView = findViewById(R.id.navigation_view);
43 | navigationView.setNavigationItemSelectedListener(this);
44 |
45 | /*LinearLayout lin_lay_add_paynow = (LinearLayout)findViewById(R.id.home_linear_layout);
46 |
47 | View pay_now_view = getLayoutInflater().inflate(R.layout.home, null);
48 | lin_lay_add_paynow.addView(pay_now_view);
49 | Button button = pay_now_view.findViewById(R.id.hamburger);
50 |
51 | button.setOnClickListener(new View.OnClickListener()
52 | {
53 | @Override
54 | public void onClick(View view)
55 | {
56 | drawerLayout.openDrawer(GravityCompat.START);
57 | }
58 | });*/
59 |
60 |
61 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
62 | //getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
63 |
64 | /* View decorView = getWindow().getDecorView();
65 | // Hide both the navigation bar and the status bar.
66 | // SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
67 | // a general rule, you should design your app to hide the status bar whenever you
68 | // hide the navigation bar.
69 | int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
70 | decorView.setSystemUiVisibility(uiOptions);*/
71 |
72 | Drawable background = getResources().getDrawable(R.drawable.gradient_home,getTheme());
73 | // getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
74 | getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent,getTheme()));
75 | getWindow().setBackgroundDrawable(background);
76 |
77 |
78 |
79 | BottomNavigationView bottomNavigationView = (BottomNavigationView)findViewById(R.id.bottomNavigationView);
80 | bottomNavigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener()
81 | {
82 | @Override
83 | public boolean onNavigationItemSelected(@NonNull MenuItem item)
84 | {
85 | switch(item.getItemId())
86 | {
87 | case R.id.home:
88 |
89 | fragment = new Home();
90 | switchfragment(fragment);
91 |
92 | break;
93 | case R.id.cart:
94 |
95 | break;
96 | case R.id.shopping_bag:
97 |
98 | break;
99 |
100 | case R.id.message:
101 |
102 | break;
103 |
104 | case R.id.user:
105 |
106 | fragment = new User();
107 | switchfragment(fragment);
108 |
109 | break;
110 |
111 | }
112 |
113 |
114 | return false;
115 | }
116 | });
117 |
118 | if (savedInstanceState == null)
119 | {
120 | bottomNavigationView.setSelectedItemId(R.id.home); // change to whichever id should be default
121 | }
122 | }
123 |
124 | @Override
125 | public boolean onNavigationItemSelected(@NonNull MenuItem menuItem)
126 | {
127 | switch (menuItem.getItemId())
128 | {
129 | case R.id.all_categories: all_category(); break;
130 | case R.id.orders: my_orders(); break;
131 | case R.id.cart: cart(); break;
132 | case R.id.wishlist: break;
133 | case R.id.account: break;
134 | case R.id.notifications: break;
135 | case R.id.privacy_policy: break;
136 | case R.id.legal: break;
137 | case R.id.report: break;
138 | case R.id.rate: break;
139 | case R.id.share: break;
140 | case R.id.logout: break;
141 | }
142 | drawerLayout.closeDrawer(GravityCompat.START);
143 | return true;
144 | }
145 |
146 | void cart()
147 | {
148 | Intent intent = new Intent(this,CartActivity.class);
149 | startActivity(intent);
150 | }
151 |
152 | void all_category()
153 | {
154 | Intent intent = new Intent(this, AllCategoryActivity.class);
155 | startActivity(intent);
156 | }
157 |
158 | void my_orders()
159 | {
160 | Intent intent = new Intent(this, MyOrdersActivity.class);
161 | startActivity(intent);
162 | }
163 |
164 | void switchfragment(Fragment fragment)
165 | {
166 | FragmentManager manager = getSupportFragmentManager();
167 | manager.beginTransaction().replace(R.id.framelayout,fragment).commit();
168 | }
169 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/MyAccountActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | public class MyAccountActivity extends AppCompatActivity
9 | {
10 | @Override
11 | protected void onCreate(@Nullable Bundle savedInstanceState)
12 | {
13 | super.onCreate(savedInstanceState);
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/MyOrdersActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.databinding.DataBindingUtil;
8 | import androidx.recyclerview.widget.LinearLayoutManager;
9 | import androidx.recyclerview.widget.RecyclerView;
10 |
11 | import java.util.ArrayList;
12 |
13 | import dev.atharvakulkarni.e_commerce.R;
14 | import dev.atharvakulkarni.e_commerce.adapter.MyOrdersAdapter;
15 | import dev.atharvakulkarni.e_commerce.adapter.search_result_adapter;
16 | import dev.atharvakulkarni.e_commerce.databinding.MyOrdersBinding;
17 | import dev.atharvakulkarni.e_commerce.databinding.SearchResultBinding;
18 |
19 | public class MyOrdersActivity extends AppCompatActivity
20 | {
21 | RecyclerView recyclerView;
22 | LinearLayoutManager linearLayoutManager;
23 | MyOrdersAdapter myOrdersAdapter;
24 | MyOrdersBinding myOrdersBinding;
25 |
26 | @Override
27 | protected void onCreate(@Nullable Bundle savedInstanceState)
28 | {
29 | super.onCreate(savedInstanceState);
30 | myOrdersBinding = DataBindingUtil.setContentView(this, R.layout.my_orders);
31 |
32 | recyclerView = myOrdersBinding.recyclerview;
33 |
34 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
35 |
36 | setUpRecyclerView();
37 | getProductsInCart();
38 | }
39 |
40 | private void setUpRecyclerView()
41 | {
42 | linearLayoutManager = new LinearLayoutManager(MyOrdersActivity.this);
43 | recyclerView.setLayoutManager(linearLayoutManager);
44 | // cartBinding.recyclerview.setHasFixedSize(true);
45 | // cartViewModel = new ViewModelProvider(this).get(CartViewModel.class);
46 | }
47 |
48 | private void getProductsInCart()
49 | {
50 | myOrdersAdapter = new MyOrdersAdapter(recyclerView,MyOrdersActivity.this,new ArrayList(),new ArrayList(),new ArrayList());
51 |
52 |
53 | myOrdersAdapter.update(R.drawable.shoes1,"Refund Accepted","Asian WNDR-13 Running Shoes for Men(Green, Grey)");
54 | myOrdersAdapter.update(R.drawable.shoes2,"Delivered on Oct 30,2019","Asian WNDR-13 Running Shoes for Men(Green, Grey)");
55 |
56 | recyclerView.setAdapter(myOrdersAdapter);
57 | myOrdersAdapter.notifyDataSetChanged();
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/MyWishlistActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | public class MyWishlistActivity extends AppCompatActivity
9 | {
10 | @Override
11 | protected void onCreate(@Nullable Bundle savedInstanceState)
12 | {
13 | super.onCreate(savedInstanceState);
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/NotificationsActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 |
8 | public class NotificationsActivity extends AppCompatActivity
9 | {
10 | @Override
11 | protected void onCreate(@Nullable Bundle savedInstanceState)
12 | {
13 | super.onCreate(savedInstanceState);
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/OrderDetailsActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 |
5 | import androidx.annotation.Nullable;
6 | import androidx.appcompat.app.AppCompatActivity;
7 | import androidx.databinding.DataBindingUtil;
8 |
9 | import dev.atharvakulkarni.e_commerce.R;
10 | import dev.atharvakulkarni.e_commerce.databinding.OrderDetailsBinding;
11 |
12 | public class OrderDetailsActivity extends AppCompatActivity
13 | {
14 | OrderDetailsBinding orderDetailsBinding;
15 |
16 | @Override
17 | protected void onPostCreate(@Nullable Bundle savedInstanceState)
18 | {
19 | super.onPostCreate(savedInstanceState);
20 | orderDetailsBinding = DataBindingUtil.setContentView(this, R.layout.order_details);
21 |
22 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/ReportActivity.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | public class ReportActivity {
4 | }
5 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/User.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.annotation.Nullable;
10 | import androidx.fragment.app.Fragment;
11 |
12 | import dev.atharvakulkarni.e_commerce.R;
13 |
14 | public class User extends Fragment
15 | {
16 | @Nullable
17 | @Override
18 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
19 | {
20 | View view = inflater.inflate(R.layout.user,container,false);
21 |
22 |
23 | return view;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/order_placing.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.graphics.PorterDuff;
4 | import android.os.Bundle;
5 | import android.view.MotionEvent;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.LinearLayout;
9 | import android.widget.SeekBar;
10 |
11 | import androidx.annotation.Nullable;
12 | import androidx.appcompat.app.AppCompatActivity;
13 | import androidx.constraintlayout.widget.ConstraintLayout;
14 | import androidx.databinding.DataBindingUtil;
15 |
16 | import dev.atharvakulkarni.e_commerce.R;
17 | import dev.atharvakulkarni.e_commerce.databinding.OrderPlacingBinding;
18 |
19 | public class order_placing extends AppCompatActivity
20 | {
21 | OrderPlacingBinding binding;
22 | SeekBar seekBar;
23 | Button deliver_here,continue_button;
24 | LinearLayout address,order_summary,linearLayout2;
25 | ConstraintLayout payment;
26 |
27 | @Override
28 | protected void onCreate(@Nullable Bundle savedInstanceState)
29 | {
30 | super.onCreate(savedInstanceState);
31 | binding = DataBindingUtil.setContentView(this, R.layout.order_placing);
32 |
33 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
34 |
35 |
36 | seekBar = binding.seekbar;
37 | deliver_here = binding.deliverHere;
38 | continue_button = binding.continueButton;
39 | address = binding.address;
40 | order_summary = binding.orderSummary;
41 | linearLayout2 = binding.linearlayout2;
42 | payment = binding.payment;
43 |
44 | seekBar.getProgressDrawable().setColorFilter(getResources().getColor(R.color.green2,getTheme()), PorterDuff.Mode.SRC_ATOP);
45 | seekBar.getThumb().setColorFilter(getResources().getColor(R.color.green2,getTheme()), PorterDuff.Mode.SRC_ATOP);
46 |
47 | seekBar.setProgress(10);
48 |
49 | deliver_here.setOnClickListener(new View.OnClickListener()
50 | {
51 | @Override
52 | public void onClick(View view)
53 | {
54 | address.setVisibility(View.GONE);
55 | order_summary.setVisibility(View.VISIBLE);
56 |
57 | seekBar.setProgress(48);
58 | }
59 | });
60 |
61 | continue_button.setOnClickListener(new View.OnClickListener()
62 | {
63 | @Override
64 | public void onClick(View view)
65 | {
66 | order_summary.setVisibility(View.GONE);
67 | payment.setVisibility(View.VISIBLE);
68 | linearLayout2.setVisibility(View.VISIBLE);
69 |
70 | seekBar.setProgress(88);
71 | }
72 | });
73 |
74 | seekBar.setOnTouchListener(new View.OnTouchListener()
75 | {
76 | @Override
77 | public boolean onTouch(View v, MotionEvent event)
78 | {
79 | return true;
80 | }
81 | });
82 |
83 | /*
84 | order_placing.sliderListener sldListener = new order_placing.sliderListener();
85 | seekBar.setOnSeekBarChangeListener(sldListener);
86 |
87 |
88 | seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener()
89 | {
90 | int stepSize = 3;
91 |
92 | @Override
93 | public void onProgressChanged(SeekBar seekBar, int progress, boolean b)
94 | {
95 | // progress = ((int)Math.round(progress/stepSize))*stepSize;
96 | seekBar.setProgress(progress);
97 |
98 | Toast.makeText(order_placing.this, progress+"", Toast.LENGTH_SHORT).show();
99 |
100 | }
101 |
102 | @Override
103 | public void onStartTrackingTouch(SeekBar seekBar)
104 | {
105 |
106 | }
107 |
108 | @Override
109 | public void onStopTrackingTouch(SeekBar seekBar)
110 | {
111 |
112 | }
113 | });*/
114 | }
115 |
116 | /*private class sliderListener implements SeekBar.OnSeekBarChangeListener
117 | {
118 | private int smoothnessFactor = 10;
119 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser)
120 | {
121 | progress = Math.round(progress / smoothnessFactor);
122 | TextView lblProgress = (TextView) findViewById(R.id.seekbar);
123 | lblProgress.setText(String.valueOf(progress));
124 | }
125 |
126 | public void onStartTrackingTouch(SeekBar seekBar)
127 | {
128 | }
129 |
130 | public void onStopTrackingTouch(SeekBar seekBar)
131 | {
132 | seekBar.setProgress(Math.round((seekBar.getProgress() + (smoothnessFactor / 2)) / smoothnessFactor) * smoothnessFactor);
133 | }
134 | }*/
135 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/search_result.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.os.Bundle;
4 | import android.widget.GridView;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.app.AppCompatActivity;
8 | import androidx.databinding.DataBindingUtil;
9 | import androidx.lifecycle.ViewModelProvider;
10 | import androidx.recyclerview.widget.LinearLayoutManager;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import java.util.ArrayList;
14 |
15 | import dev.atharvakulkarni.e_commerce.R;
16 | import dev.atharvakulkarni.e_commerce.ViewModel.CartViewModel;
17 | import dev.atharvakulkarni.e_commerce.adapter.CartAdapter;
18 | import dev.atharvakulkarni.e_commerce.adapter.search_result_adapter;
19 | import dev.atharvakulkarni.e_commerce.databinding.SearchResultBinding;
20 | import dev.atharvakulkarni.e_commerce.model.SearchProduct;
21 |
22 | public class search_result extends AppCompatActivity
23 | {
24 | RecyclerView recyclerView;
25 | LinearLayoutManager linearLayoutManager;
26 | search_result_adapter search_result_adapter;
27 | SearchResultBinding searchResultBinding;
28 |
29 | @Override
30 | protected void onCreate(@Nullable Bundle savedInstanceState)
31 | {
32 | super.onCreate(savedInstanceState);
33 | searchResultBinding = DataBindingUtil.setContentView(this, R.layout.search_result);
34 |
35 | recyclerView = searchResultBinding.recyclerview;
36 |
37 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
38 |
39 | setUpRecyclerView();
40 | getProductsInCart();
41 | }
42 |
43 | private void setUpRecyclerView()
44 | {
45 | linearLayoutManager = new LinearLayoutManager(search_result.this);
46 | recyclerView.setLayoutManager(linearLayoutManager);
47 | // cartBinding.recyclerview.setHasFixedSize(true);
48 | // cartViewModel = new ViewModelProvider(this).get(CartViewModel.class);
49 | }
50 |
51 | private void getProductsInCart()
52 | {
53 | /*list = new ArrayList();
54 |
55 | list.add(new SearchProduct("Cheries",R.drawable.shoes1,"₹300"));
56 | list.add(new SearchProduct("Cheries",R.drawable.shoes2,"₹400"));
57 | list.add(new SearchProduct("Cheries",R.drawable.shoes3,"₹500"));
58 | list.add(new SearchProduct("Cheries",R.drawable.shoes3,"₹600"));*/
59 |
60 |
61 | search_result_adapter = new search_result_adapter(recyclerView,search_result.this,new ArrayList(),new ArrayList(),new ArrayList());
62 |
63 |
64 | search_result_adapter.update(R.drawable.shoes1,"Asian WNDR-13 Running Shoes for Men(Green, Grey)","₹300.00");
65 | search_result_adapter.update(R.drawable.shoes2,"Asian WNDR-13 Running Shoes for Men(Green, Grey)","₹500.00");
66 |
67 | recyclerView.setAdapter(search_result_adapter);
68 | search_result_adapter.notifyDataSetChanged();
69 | }
70 | }
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/show_product.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.appcompat.app.AppCompatActivity;
10 |
11 | import dev.atharvakulkarni.e_commerce.R;
12 |
13 | public class show_product extends AppCompatActivity
14 | {
15 | Button buy_now;
16 |
17 | @Override
18 | protected void onCreate(@Nullable Bundle savedInstanceState)
19 | {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.show_product);
22 |
23 | buy_now = findViewById(R.id.buy_now);
24 |
25 | buy_now.setOnClickListener(new View.OnClickListener()
26 | {
27 | @Override
28 | public void onClick(View view)
29 | {
30 | Intent intent = new Intent(show_product.this, order_placing.class);
31 | startActivity(intent);
32 | }
33 | });
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/atharvakulkarni/e_commerce/view/sigin_signup.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce.view;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.TextView;
8 |
9 | import androidx.annotation.Nullable;
10 | import androidx.appcompat.app.AppCompatActivity;
11 | import androidx.constraintlayout.widget.ConstraintLayout;
12 | import androidx.databinding.DataBindingUtil;
13 | import androidx.lifecycle.ViewModelProvider;
14 |
15 | import dev.atharvakulkarni.e_commerce.R;
16 | import dev.atharvakulkarni.e_commerce.ViewModel.CartViewModel;
17 | import dev.atharvakulkarni.e_commerce.ViewModel.SignInSignUpViewModel;
18 | import dev.atharvakulkarni.e_commerce.databinding.SigninSignupBinding;
19 |
20 | public class sigin_signup extends AppCompatActivity
21 | {
22 | ConstraintLayout signin_page,signup_page;
23 | Button continue_btn, signup_button;
24 | TextView signin,signup;
25 | SigninSignupBinding signinSignupBinding;
26 | SignInSignUpViewModel signInSignUpViewModel;
27 |
28 | @Override
29 | protected void onCreate(@Nullable Bundle savedInstanceState)
30 | {
31 | super.onCreate(savedInstanceState);
32 | setContentView(R.layout.signin_signup);
33 | signinSignupBinding = DataBindingUtil.setContentView(this, R.layout.signin_signup);
34 |
35 | signin_page = signinSignupBinding.signinPage;
36 | signup_page = signinSignupBinding.signupPage;
37 | continue_btn = signinSignupBinding.continueButton;
38 | signup_button = signinSignupBinding.signupButton;
39 | signin = signinSignupBinding.signin;
40 | signup = signinSignupBinding.signup;
41 |
42 | getWindow().setStatusBarColor(getResources().getColor(R.color.white,getTheme()));
43 |
44 | signInSignUpViewModel = new ViewModelProvider(this).get(SignInSignUpViewModel.class);
45 |
46 | continue_btn.setOnClickListener(new View.OnClickListener()
47 | {
48 | @Override
49 | public void onClick(View view)
50 | {
51 | Intent intent = new Intent(sigin_signup.this, MainActivity.class);
52 | startActivity(intent);
53 | }
54 | });
55 |
56 | signup_button.setOnClickListener(new View.OnClickListener()
57 | {
58 | @Override
59 | public void onClick(View view)
60 | {
61 | Intent intent = new Intent(sigin_signup.this,MainActivity.class);
62 | startActivity(intent);
63 | }
64 | });
65 |
66 | signin.setOnClickListener(new View.OnClickListener()
67 | {
68 | @Override
69 | public void onClick(View view)
70 | {
71 | signup_page.setVisibility(View.GONE);
72 | signin_page.setVisibility(View.VISIBLE);
73 | }
74 | });
75 |
76 | signup.setOnClickListener(new View.OnClickListener()
77 | {
78 | @Override
79 | public void onClick(View view)
80 | {
81 | signin_page.setVisibility(View.GONE);
82 | signup_page.setVisibility(View.VISIBLE);
83 | }
84 | });
85 | }
86 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/acer_nitro5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/acer_nitro5.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ecommerce_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/ecommerce_logo.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/google_pay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/google_pay.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shoes1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/shoes1.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shoes2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/shoes2.jpeg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/shoes3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/drawable-v24/shoes3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/add.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/arrow_right.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_overlay.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bug_report.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cart.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/category.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/continue2_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/continue_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/delete.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/email.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/favorite_like.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/favorite_unlike.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/filter.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/gradient_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/home.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/home_linear2_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/linear_dotted_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/local_offer.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logout.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/message.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/notifications.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/person_outline.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rate.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/searchbar_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/security.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/share.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shopping_bag.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/show_product_linearlayout_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/textinputlayout_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/userrating_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/wishlist.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
27 |
28 |
37 |
38 |
39 |
40 |
48 |
49 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/all_categories.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
22 |
23 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/all_categories_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
24 |
25 |
30 |
31 |
35 |
36 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/cart.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
24 |
25 |
32 |
33 |
41 |
42 |
46 |
47 |
52 |
53 |
60 |
61 |
69 |
70 |
77 |
78 |
79 |
80 |
86 |
87 |
95 |
96 |
103 |
104 |
105 |
106 |
113 |
114 |
122 |
123 |
130 |
131 |
132 |
143 |
144 |
145 |
146 |
152 |
153 |
159 |
160 |
168 |
169 |
175 |
176 |
177 |
178 |
188 |
189 |
190 |
191 |
192 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/cart_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
18 |
19 |
20 |
25 |
26 |
33 |
34 |
38 |
39 |
47 |
48 |
55 |
56 |
57 |
58 |
63 |
64 |
70 |
71 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/home.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
17 |
18 |
24 |
25 |
28 |
29 |
34 |
35 |
43 |
44 |
50 |
51 |
58 |
59 |
60 |
61 |
62 |
71 |
72 |
73 |
74 |
84 |
85 |
89 |
90 |
95 |
96 |
113 |
114 |
115 |
116 |
121 |
122 |
130 |
131 |
135 |
136 |
137 |
138 |
142 |
143 |
147 |
148 |
151 |
152 |
157 |
158 |
167 |
168 |
172 |
173 |
179 |
180 |
186 |
187 |
188 |
189 |
190 |
191 |
194 |
195 |
200 |
201 |
210 |
211 |
215 |
216 |
222 |
223 |
229 |
230 |
231 |
232 |
233 |
234 |
237 |
238 |
243 |
244 |
253 |
254 |
258 |
259 |
265 |
266 |
272 |
273 |
274 |
275 |
276 |
277 |
280 |
281 |
286 |
287 |
296 |
297 |
301 |
302 |
308 |
309 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/image_slider_layout_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
21 |
22 |
23 |
29 |
30 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/my_account.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/my_orders.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
21 |
22 |
30 |
31 |
40 |
41 |
49 |
50 |
51 |
52 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/my_orders_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
21 |
22 |
27 |
28 |
32 |
33 |
38 |
39 |
46 |
47 |
54 |
55 |
56 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/my_wishlist.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/navigation_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
29 |
30 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/notifications.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/order_details.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
21 |
22 |
34 |
35 |
43 |
44 |
49 |
50 |
55 |
56 |
61 |
62 |
67 |
68 |
75 |
76 |
77 |
78 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/report.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/search_result.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
21 |
22 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/search_result_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
21 |
22 |
27 |
28 |
32 |
33 |
38 |
39 |
44 |
45 |
52 |
53 |
54 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/show_product.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
22 |
23 |
28 |
29 |
39 |
40 |
51 |
52 |
53 |
54 |
60 |
61 |
67 |
68 |
75 |
76 |
82 |
83 |
84 |
85 |
86 |
92 |
93 |
94 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/user.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_navigation_items.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
17 |
18 |
23 |
24 |
29 |
30 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/navigation_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
12 |
13 |
17 |
21 |
22 |
26 |
27 |
31 |
32 |
36 |
37 |
41 |
42 |
43 |
44 | -
45 |
46 |
50 |
51 |
55 |
59 |
60 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #00CF73
4 | #3700B3
5 | #03DAC5
6 | #FFFFFF
7 | #000000
8 | #00CF73
9 | #00B75F
10 | #4D556A
11 | #874AFF
12 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | E-Commerce
3 | Forgot Password
4 | Sign Up
5 | Sign In
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/test/java/dev/atharvakulkarni/e_commerce/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package dev.atharvakulkarni.e_commerce;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:4.1.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 |
20 | maven { url "https://jitpack.io" }
21 | }
22 | }
23 |
24 | task clean(type: Delete) {
25 | delete rootProject.buildDir
26 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KulkarniAtharva/E-Commerce-Android/5eab67f651e5b4bfe91cc38e72dc2ef3df8d20f8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Oct 15 23:40:04 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "E-Commerce"
--------------------------------------------------------------------------------