diff --git a/TASK4_Product_Ordering/.gitignore b/TASK4_Product_Ordering/.gitignore
new file mode 100644
index 0000000..aa724b7
--- /dev/null
+++ b/TASK4_Product_Ordering/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
diff --git a/TASK4_Product_Ordering/.idea/.gitignore b/TASK4_Product_Ordering/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/TASK4_Product_Ordering/.idea/.name b/TASK4_Product_Ordering/.idea/.name
new file mode 100644
index 0000000..754c9e3
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/.name
@@ -0,0 +1 @@
+ShopCart
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/compiler.xml b/TASK4_Product_Ordering/.idea/compiler.xml
new file mode 100644
index 0000000..fb7f4a8
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/gradle.xml b/TASK4_Product_Ordering/.idea/gradle.xml
new file mode 100644
index 0000000..23a89bb
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/jarRepositories.xml b/TASK4_Product_Ordering/.idea/jarRepositories.xml
new file mode 100644
index 0000000..e34606c
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/misc.xml b/TASK4_Product_Ordering/.idea/misc.xml
new file mode 100644
index 0000000..860da66
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/runConfigurations.xml b/TASK4_Product_Ordering/.idea/runConfigurations.xml
new file mode 100644
index 0000000..797acea
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/.idea/vcs.xml b/TASK4_Product_Ordering/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/TASK4_Product_Ordering/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/README.md b/TASK4_Product_Ordering/README.md
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/TASK4_Product_Ordering/README.md
@@ -0,0 +1 @@
+
diff --git a/TASK4_Product_Ordering/app/.gitignore b/TASK4_Product_Ordering/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/TASK4_Product_Ordering/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/build.gradle b/TASK4_Product_Ordering/app/build.gradle
new file mode 100644
index 0000000..955baa7
--- /dev/null
+++ b/TASK4_Product_Ordering/app/build.gradle
@@ -0,0 +1,57 @@
+plugins {
+ id 'com.android.application'
+ id 'com.google.gms.google-services'
+ id 'androidx.navigation.safeargs'
+
+}
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.2"
+
+ defaultConfig {
+ applicationId "com.example.shopcart"
+ minSdkVersion 16
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+ multiDexEnabled true
+
+
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+}
+
+dependencies {
+
+ implementation 'androidx.appcompat:appcompat:1.3.1'
+ implementation 'com.google.android.material:material:1.4.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
+ implementation 'androidx.navigation:navigation-fragment:2.3.5'
+ implementation 'androidx.navigation:navigation-ui:2.3.5'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ implementation 'com.google.firebase:firebase-auth:21.0.1'
+ implementation 'com.google.firebase:firebase-firestore:23.0.4'
+ testImplementation 'junit:junit:'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
+
+
+
+ implementation 'de.hdodenhof:circleimageview:3.1.0'
+ implementation 'com.github.bumptech.glide:glide:4.12.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
+ implementation 'com.android.support:multidex:1.0.3'
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/google-services.json b/TASK4_Product_Ordering/app/google-services.json
new file mode 100644
index 0000000..8f74d15
--- /dev/null
+++ b/TASK4_Product_Ordering/app/google-services.json
@@ -0,0 +1,47 @@
+{
+ "project_info": {
+ "project_number": "75601636598",
+ "project_id": "shreya-2bea6",
+ "storage_bucket": "shreya-2bea6.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:75601636598:android:264c04640efa1aa2c250d7",
+ "android_client_info": {
+ "package_name": "com.example.shopcart"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "75601636598-jo2vp8qjij7sabm14fmse51mvri87m29.apps.googleusercontent.com",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "com.example.shopcart",
+ "certificate_hash": "27bc0acd1530f8519c1c6fc4a51636fc36562c01"
+ }
+ },
+ {
+ "client_id": "75601636598-vuf1nbne7vjeb7der3tu6lb3hvirb2fs.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyDv5Su4hWhpNabg4TUbAlPlYgENw9z6iXE"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "75601636598-vuf1nbne7vjeb7der3tu6lb3hvirb2fs.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/proguard-rules.pro b/TASK4_Product_Ordering/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/TASK4_Product_Ordering/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/androidTest/java/com/example/shopcart/ExampleInstrumentedTest.java b/TASK4_Product_Ordering/app/src/androidTest/java/com/example/shopcart/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..b33033d
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/androidTest/java/com/example/shopcart/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.shopcart;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.shopcart", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/AndroidManifest.xml b/TASK4_Product_Ordering/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..09d673a
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/CartAdapter.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/CartAdapter.java
new file mode 100644
index 0000000..345f5ed
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/CartAdapter.java
@@ -0,0 +1,131 @@
+package com.example.shopcart.Adapter;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageButton;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
+
+import com.bumptech.glide.Glide;
+import com.example.shopcart.Model.Cart;
+import com.example.shopcart.R;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.FirebaseFirestore;
+
+import java.util.List;
+
+import de.hdodenhof.circleimageview.CircleImageView;
+
+public class CartAdapter extends RecyclerView.Adapter {
+
+
+ List cartList;
+ FirebaseFirestore firestore = FirebaseFirestore.getInstance();
+ FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
+ String userid;
+ String documentid;
+
+
+
+ public void setCartList(List cartList) {
+ this.cartList = cartList;
+ }
+
+
+ @NonNull
+ @Override
+ public CartHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.cartliststyle, parent, false);
+ return new CartHolder(view);
+
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull CartHolder holder, int position) {
+
+ holder.title.setText(cartList.get(position).getTitle());
+ holder.price.setText("Total Price is: " + cartList.get(position).getPrice() + " For the items: " + cartList.get(position).getQuantity());
+
+ Glide.with(holder.itemView.getContext()).load(cartList.get(position).getImageUrl()).centerCrop().into(holder.imageView);
+
+
+
+ }
+
+ @Override
+ public int getItemCount() {
+
+ if (cartList == null) {
+
+ return 0;
+
+
+ } else {
+ return cartList.size();
+ }
+ }
+
+ class CartHolder extends ViewHolder {
+
+
+ TextView title, price;
+ CircleImageView imageView;
+ ImageButton deleteItem;
+
+ public CartHolder(@NonNull View itemView) {
+ super(itemView);
+
+ title = itemView.findViewById(R.id.cartproducttitle);
+ price = itemView.findViewById(R.id.cartdesc);
+ imageView = itemView.findViewById(R.id.cartmainimage);
+ deleteItem = itemView.findViewById(R.id.deleteitem);
+
+ deleteItem.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ String title = cartList.get(getAdapterPosition()).getTitle();
+ userid = firebaseAuth.getCurrentUser().getUid();
+
+
+ documentid = cartList.get(getAdapterPosition()).getProductid();
+
+
+
+
+ firestore.collection("Products").document(documentid).update("quantity", 0).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ }
+ });
+
+
+ firestore.collection("Cart" + userid).document(title).delete();
+
+
+ cartList.remove(cartList.get(getAdapterPosition()));
+ notifyItemRemoved(getAdapterPosition());
+
+ }
+
+ });
+
+
+
+ }
+ }
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/ProductsAdapter.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/ProductsAdapter.java
new file mode 100644
index 0000000..1aa62f4
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Adapter/ProductsAdapter.java
@@ -0,0 +1,102 @@
+package com.example.shopcart.Adapter;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import androidx.recyclerview.widget.RecyclerView.ViewHolder;
+
+import com.bumptech.glide.Glide;
+import com.example.shopcart.Model.Product;
+import com.example.shopcart.R;
+
+import java.util.List;
+
+import de.hdodenhof.circleimageview.CircleImageView;
+
+public class ProductsAdapter extends RecyclerView.Adapter {
+
+
+ List productList;
+ OnClickedProducct interfaceclickedonProduct;
+
+ public ProductsAdapter(OnClickedProducct interfaceclickedonProduct) {
+ this.interfaceclickedonProduct = interfaceclickedonProduct;
+ }
+
+ public void setProductList(List productList) {
+ this.productList = productList;
+ }
+
+ @NonNull
+ @Override
+ public ProductHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.productstyleslist, parent, false);
+ return new ProductHolder(view);
+
+
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ProductHolder holder, int position) {
+
+ holder.titeofproduct.setText(productList.get(position).getTitle());
+ holder.descriptionofproduct.setText(productList.get(position).getDescription());
+
+ Glide.with(holder.itemView.getContext()).load(productList.get(position).getImageUrl()).centerCrop().into(holder.circleImageView);
+
+
+
+ }
+
+ @Override
+ public int getItemCount() {
+
+
+
+ if (productList == null) {
+
+ return 0;
+
+ } else {
+
+ return productList.size();
+ }
+ }
+
+ class ProductHolder extends ViewHolder implements View.OnClickListener{
+
+
+ TextView titeofproduct, descriptionofproduct;
+ CircleImageView circleImageView;
+
+ public ProductHolder(@NonNull View itemView) {
+ super(itemView);
+
+ titeofproduct = itemView.findViewById(R.id.proudcttitlte);
+ descriptionofproduct = itemView.findViewById(R.id.productdescriptionmain);
+ circleImageView = itemView.findViewById(R.id.productmainiamge);
+
+
+ titeofproduct.setOnClickListener(this);
+ descriptionofproduct.setOnClickListener(this);
+ circleImageView.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View v) {
+ interfaceclickedonProduct.OnProClicked(productList, getAdapterPosition());
+ }
+ }
+
+ public interface OnClickedProducct{
+ void OnProClicked(List productList, int position);
+
+
+ }
+}
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/CartFragment.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/CartFragment.java
new file mode 100644
index 0000000..3ad4c41
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/CartFragment.java
@@ -0,0 +1,199 @@
+package com.example.shopcart;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProvider;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.example.shopcart.Adapter.CartAdapter;
+import com.example.shopcart.MVVM.CartViewModel;
+import com.example.shopcart.Model.Cart;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.DocumentSnapshot;
+import com.google.firebase.firestore.EventListener;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.FirebaseFirestoreException;
+import com.google.firebase.firestore.QuerySnapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CartFragment extends Fragment {
+
+
+ RecyclerView recyclerView;
+ CartViewModel viewModel;
+ CartAdapter mAdapter;
+
+ TextView displaytotalprice;
+ int totalprice = 0;
+ NavController navController;
+ FirebaseFirestore firestore;
+ FirebaseAuth firebaseAuth;
+ String userid;
+
+ Button checkOut;
+ List savetotalprice = new ArrayList<>();
+
+
+
+ public CartFragment() {
+
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ return inflater.inflate(R.layout.fragment_cart, container, false);
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ firebaseAuth = FirebaseAuth.getInstance();
+
+ firestore = FirebaseFirestore.getInstance();
+
+ displaytotalprice = view.findViewById(R.id.totalPriceordercart);
+ checkOut = view.findViewById(R.id.buttoncheckout);
+ navController = Navigation.findNavController(view);
+
+ userid = firebaseAuth.getCurrentUser().getUid();
+ recyclerView = view.findViewById(R.id.recyclerviewcart);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+ mAdapter = new CartAdapter();
+
+
+ viewModel = new ViewModelProvider(getActivity()).get(CartViewModel.class);
+
+ viewModel.cartLiveDataShit().observe(getViewLifecycleOwner(), new Observer>() {
+ @Override
+ public void onChanged(List carts) {
+
+
+ mAdapter.setCartList(carts);
+ recyclerView.setAdapter(mAdapter);
+ }
+ });
+
+
+
+
+ firestore.collection("Cart"+userid).addSnapshotListener(new EventListener() {
+ @Override
+ public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
+
+
+ for (DocumentSnapshot dsn: value.getDocuments()) {
+
+ Cart cart = dsn.toObject(Cart.class);
+
+ int total = cart.getPrice();
+
+ savetotalprice.add(total);
+ }
+
+ for ( int i=0; i < savetotalprice.size(); i++) {
+ totalprice += Integer.parseInt(String.valueOf(savetotalprice.get(i)));
+
+ displaytotalprice.setText(String.valueOf(totalprice));
+
+
+
+ }
+ savetotalprice.clear();
+
+ totalprice = 0;
+ }
+ });
+
+
+
+
+ checkOut.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+
+
+ firestore.collection("Products").get().addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+
+ if (task.isSuccessful()) {
+ QuerySnapshot shit = task.getResult();
+
+
+ for (DocumentSnapshot shs: shit.getDocuments()) {
+
+
+
+ shs.getReference().update("quantity", 0);
+
+ }
+
+
+
+ }
+
+
+ }
+ });
+
+
+ firestore.collection("Cart"+userid).get().addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+
+ if (task.isSuccessful()) {
+
+ QuerySnapshot tasks = task.getResult();
+
+ for (DocumentSnapshot ds: tasks.getDocuments()) {
+
+
+
+ ds.getReference().delete();
+ }
+
+
+
+ }
+ }
+ });
+
+
+
+
+ navController.navigate(R.id.action_cartFragment_to_productsFragment);
+ Toast.makeText(getContext(), "Order Placed", Toast.LENGTH_SHORT).show();
+
+
+
+ }
+ });
+
+ }
+
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/LoginFragment.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/LoginFragment.java
new file mode 100644
index 0000000..1c806e0
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/LoginFragment.java
@@ -0,0 +1,157 @@
+package com.example.shopcart;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.SwitchCompat;
+import androidx.fragment.app.Fragment;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.Toast;
+
+import com.example.shopcart.R;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.android.material.textfield.TextInputLayout;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.firestore.FirebaseFirestore;
+
+
+public class LoginFragment extends Fragment {
+
+ SwitchCompat toggle;
+ NavController navController;
+
+
+ FirebaseFirestore firestore;
+ FirebaseAuth auth;
+ TextInputLayout etemail, etpassword;
+ String email, password;
+ Button signIn;
+
+ public LoginFragment() {
+
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ return inflater.inflate(R.layout.fragment_login, container, false);
+ }
+
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+
+ toggle = view.findViewById(R.id.gotosignUpSwitch);
+ navController = Navigation.findNavController(view);
+
+
+ etemail = view.findViewById(R.id.emailfieldSignIn);
+ etpassword = view.findViewById(R.id.passwordfieldSignIn);
+
+ firestore = FirebaseFirestore.getInstance();
+ auth = FirebaseAuth.getInstance();
+ signIn = view.findViewById(R.id.signInButton);
+
+
+ signIn.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ email = etemail.getEditText().getText().toString();
+ password = etpassword.getEditText().getText().toString();
+
+
+ if (email.isEmpty()) {
+
+ etemail.setError("Enter Email");
+
+
+ } else if (password.isEmpty() || password.length() < 6) {
+
+ etpassword.setError("Password length must be more than 6");
+
+ } else {
+
+
+ SignInUser(email, password);
+
+
+
+ }
+
+
+
+
+
+ }
+ });
+
+
+
+ toggle.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (v.isClickable()) {
+
+ navController.navigate(R.id.action_loginFragment_to_registerFragment);
+ }
+
+ }
+ });
+
+
+
+
+ }
+
+
+ // this is helping us to sign in the user
+
+
+ private void SignInUser(String email, String password) {
+
+ auth.signInWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ if (task.isSuccessful()) {
+
+ navController.navigate(R.id.action_loginFragment_to_productsFragment);
+ Toast.makeText(getContext(), "Signed In", Toast.LENGTH_SHORT).show();
+
+ }
+
+ }
+ });
+ }
+
+
+
+ @Override
+ public void onStart() {
+
+ FirebaseUser firebaseUser = auth.getCurrentUser();
+
+ if (firebaseUser!=null) {
+
+ navController.navigate(R.id.action_loginFragment_to_productsFragment);
+
+
+
+ }
+ super.onStart();
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartRepo.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartRepo.java
new file mode 100644
index 0000000..3b92365
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartRepo.java
@@ -0,0 +1,65 @@
+package com.example.shopcart.MVVM;
+
+import com.example.shopcart.Model.Cart;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.DocumentSnapshot;
+import com.google.firebase.firestore.EventListener;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.FirebaseFirestoreException;
+import com.google.firebase.firestore.QuerySnapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CartRepo {
+
+ FirebaseFirestore firestore = FirebaseFirestore.getInstance();
+ String userid;
+ FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
+ List cartList = new ArrayList<>();
+ CartINTERFACEShit interfaceCart;
+
+ public CartRepo(CartINTERFACEShit interfaceCart) {
+ this.interfaceCart = interfaceCart;
+ }
+
+ public void getCartShit() {
+
+ assert firebaseAuth!=null;
+ userid = firebaseAuth.getCurrentUser().getUid();
+
+ firestore.collection("Cart"+userid).addSnapshotListener(new EventListener() {
+ @Override
+ public void onEvent( QuerySnapshot value, FirebaseFirestoreException error) {
+
+ cartList.clear();
+
+
+ for (DocumentSnapshot ds: value.getDocuments()) {
+
+ Cart cart = ds.toObject(Cart.class);
+
+ cartList.add(cart);
+
+ interfaceCart.CartlIST(cartList);
+
+
+
+ }
+
+
+ }
+
+
+ });
+
+
+
+
+ }
+
+
+ public interface CartINTERFACEShit{
+ void CartlIST(List carts);
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartViewModel.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartViewModel.java
new file mode 100644
index 0000000..1ad4510
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/CartViewModel.java
@@ -0,0 +1,30 @@
+package com.example.shopcart.MVVM;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+import com.example.shopcart.Model.Cart;
+
+import java.util.List;
+
+public class CartViewModel extends ViewModel implements CartRepo.CartINTERFACEShit {
+
+
+ MutableLiveData> mutableLiveData = new MutableLiveData<>();
+ CartRepo rep = new CartRepo(this);
+
+ public CartViewModel() {
+ rep.getCartShit();
+ }
+
+ public LiveData> cartLiveDataShit() {
+ return mutableLiveData;
+ }
+
+
+ @Override
+ public void CartlIST(List carts) {
+ mutableLiveData.setValue(carts);
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductRepo.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductRepo.java
new file mode 100644
index 0000000..dc8c5be
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductRepo.java
@@ -0,0 +1,64 @@
+package com.example.shopcart.MVVM;
+
+import androidx.annotation.ArrayRes;
+import androidx.annotation.Nullable;
+
+import com.example.shopcart.Model.Product;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.DocumentId;
+import com.google.firebase.firestore.DocumentSnapshot;
+import com.google.firebase.firestore.EventListener;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.FirebaseFirestoreException;
+import com.google.firebase.firestore.QuerySnapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ProductRepo {
+
+
+ FirebaseFirestore firestore = FirebaseFirestore.getInstance();
+ List productList = new ArrayList<>();
+
+ OnProductInter interfaceprodcuts;
+
+ public ProductRepo(OnProductInter interfaceprodcuts) {
+ this.interfaceprodcuts = interfaceprodcuts;
+ }
+
+ public void GetAllPRO() {
+
+ firestore.collection("Products").addSnapshotListener(new EventListener() {
+ @Override
+ public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
+
+ productList.clear();
+
+ for (DocumentSnapshot ds: value.getDocuments()) {
+
+ Product product = ds.toObject(Product.class);
+
+
+ productList.add(product);
+
+ interfaceprodcuts.Products(productList);
+
+
+
+ }
+ }
+ });
+
+
+
+
+
+
+ }
+
+
+ public interface OnProductInter{
+ void Products(List products);
+ }
+}
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductViewModel.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductViewModel.java
new file mode 100644
index 0000000..6fa21a3
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MVVM/ProductViewModel.java
@@ -0,0 +1,34 @@
+package com.example.shopcart.MVVM;
+
+import androidx.lifecycle.LiveData;
+import androidx.lifecycle.MutableLiveData;
+import androidx.lifecycle.ViewModel;
+
+import com.example.shopcart.Model.Product;
+
+import java.util.List;
+
+public class ProductViewModel extends ViewModel implements ProductRepo.OnProductInter {
+
+ MutableLiveData> mutableLiveData = new MutableLiveData<>();
+ ProductRepo productRepo = new ProductRepo(this);
+
+
+ public ProductViewModel() {
+ productRepo.GetAllPRO();
+ }
+
+ public LiveData> getAllProducts() {
+ return mutableLiveData;
+
+
+
+
+
+ }
+
+ @Override
+ public void Products(List products) {
+ mutableLiveData.setValue(products);
+ }
+}
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MainActivity.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MainActivity.java
new file mode 100644
index 0000000..faddc81
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/MainActivity.java
@@ -0,0 +1,16 @@
+package com.example.shopcart;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.app.AppCompatDelegate;
+
+import android.os.Bundle;
+
+public class MainActivity extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM);
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Cart.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Cart.java
new file mode 100644
index 0000000..ed31a86
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Cart.java
@@ -0,0 +1,63 @@
+package com.example.shopcart.Model;
+
+import com.google.firebase.firestore.DocumentId;
+
+public class Cart {
+
+
+ String title;
+ String productid, imageUrl;
+ int price, quantity;
+
+
+ public Cart() {
+ }
+
+ public Cart(String title, String productid, String imageUrl, int price, int quantity) {
+ this.title = title;
+ this.productid = productid;
+ this.imageUrl = imageUrl;
+ this.price = price;
+ this.quantity = quantity;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getProductid() {
+ return productid;
+ }
+
+ public void setProductid(String productid) {
+ this.productid = productid;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public int getPrice() {
+ return price;
+ }
+
+ public void setPrice(int price) {
+ this.price = price;
+ }
+
+ public int getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+}
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Product.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Product.java
new file mode 100644
index 0000000..8ef78ba
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/Model/Product.java
@@ -0,0 +1,72 @@
+package com.example.shopcart.Model;
+
+import com.google.firebase.firestore.DocumentId;
+
+public class Product {
+
+
+ @DocumentId
+ String productid;
+ String title, imageUrl, description;
+ int price, quantity;
+
+ public Product() {
+ }
+
+ public Product(String productid, String title, String imageUrl, String description, int price, int quantity) {
+ this.productid = productid;
+ this.title = title;
+ this.imageUrl = imageUrl;
+ this.price = price;
+ this.quantity = quantity;
+ this.description = description;
+ }
+
+ public String getProductid() {
+ return productid;
+ }
+
+ public void setProductid(String productid) {
+ this.productid = productid;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getImageUrl() {
+ return imageUrl;
+ }
+
+ public void setImageUrl(String imageUrl) {
+ this.imageUrl = imageUrl;
+ }
+
+ public int getPrice() {
+ return price;
+ }
+
+ public void setPrice(int price) {
+ this.price = price;
+ }
+
+ public int getQuantity() {
+ return quantity;
+ }
+
+ public void setQuantity(int quantity) {
+ this.quantity = quantity;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+}
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsDetailFragment.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsDetailFragment.java
new file mode 100644
index 0000000..4965dab
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsDetailFragment.java
@@ -0,0 +1,231 @@
+package com.example.shopcart;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.example.shopcart.Model.Product;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.DocumentSnapshot;
+import com.google.firebase.firestore.EventListener;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.FirebaseFirestoreException;
+
+import java.util.HashMap;
+
+public class ProductsDetailFragment extends Fragment {
+
+
+
+ TextView quantitydisplay, titleview, descview, priceview;
+ int quantity = 0;
+ Button addquantity, subquantity, addtocart;
+ FirebaseFirestore firestore;
+ FirebaseAuth firebaseAuth;
+ ImageView imageView;
+ String title, imageUrl, desc, productid, userid;
+ int position = 0;
+ int price = 0;
+ int finalprice = 0;
+
+ NavController navController;
+
+
+ public ProductsDetailFragment() {
+
+ }
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+
+ return inflater.inflate(R.layout.fragment_product_detail, container, false);
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+
+ firestore = FirebaseFirestore.getInstance();
+ firebaseAuth = FirebaseAuth.getInstance();
+ userid = firebaseAuth.getCurrentUser().getUid();
+
+ navController = Navigation.findNavController(view);
+
+
+ quantitydisplay = view.findViewById(R.id.quantitycounterproductdetail);
+ addquantity = view.findViewById(R.id.addquantity);
+ subquantity = view.findViewById(R.id.subquantity);
+ addtocart = view.findViewById(R.id.buttonaddtocart);
+ titleview = view.findViewById(R.id.productdetailtitle);
+ descview = view.findViewById(R.id.productdetaildetail);
+ imageView = view.findViewById(R.id.productdetailimage);
+ priceview = view.findViewById(R.id.totalPriceproductdetail);
+
+ imageUrl = ProductsDetailFragmentArgs.fromBundle(getArguments()).getImageUrl();
+ title = ProductsDetailFragmentArgs.fromBundle(getArguments()).getTitle();
+ desc = ProductsDetailFragmentArgs.fromBundle(getArguments()).getDescription();
+ position = ProductsDetailFragmentArgs.fromBundle(getArguments()).getPosition();
+ productid = ProductsDetailFragmentArgs.fromBundle(getArguments()).getProductid();
+ price = ProductsDetailFragmentArgs.fromBundle(getArguments()).getPrice();
+
+ titleview.setText(title);
+ descview.setText(desc);
+ Glide.with(getActivity()).load(imageUrl).centerCrop().into(imageView);
+ priceview.setText("Price for 1 item is " + String.valueOf(price));
+
+
+
+ firestore.collection("Products").document(productid).addSnapshotListener(new EventListener() {
+ @Override
+ public void onEvent(@Nullable DocumentSnapshot value, @Nullable FirebaseFirestoreException error) {
+
+ Product product = value.toObject(Product.class);
+
+
+ String latestquantity = String.valueOf(product.getQuantity());
+
+
+ quantitydisplay.setText(latestquantity);
+
+ }
+ });
+
+
+
+ addquantity.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ quantity = Integer.parseInt(quantitydisplay.getText().toString());
+
+ quantity++;
+
+
+ finalprice = quantity * price;
+ priceview.setText("Total is " + String.valueOf(quantity) +" x " + String.valueOf(finalprice));
+
+ firestore.collection("Products").document(productid).update("quantity", quantity).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ }
+ });
+
+
+
+ }
+ });
+
+
+ subquantity.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+
+ quantity = Integer.parseInt(quantitydisplay.getText().toString());
+
+
+
+ if (quantity <=0) {
+
+ quantity = 0;
+ finalprice = 0;
+
+
+ } else {
+
+ quantity--;
+ finalprice = quantity * price;
+ priceview.setText("Total is " + String.valueOf(quantity) +" x " + String.valueOf(finalprice));
+
+ firestore.collection("Products").document(productid).update("quantity", quantity).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ }
+ });
+
+
+
+
+
+ }
+
+
+
+ }
+ });
+
+
+ addtocart.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+
+ if (quantity ==0) {
+
+
+
+ navController.navigate(R.id.action_productsDetailFragment_to_productsFragment);
+ Toast.makeText(getContext(), "Nothing Added to Cart", Toast.LENGTH_SHORT).show();
+
+
+
+ } else if (quantity!=0) {
+
+
+ AddedInCart();
+ ProductsDetailFragmentDirections.ActionProductsDetailFragmentToProductsFragment actions = ProductsDetailFragmentDirections.actionProductsDetailFragmentToProductsFragment();
+
+ actions.setQuantity(quantity);
+ navController.navigate(actions);
+
+ Toast.makeText(getContext(), "Added In Cart", Toast.LENGTH_SHORT).show();
+
+
+
+ }
+ }
+ });
+
+
+
+
+
+ }
+
+ private void AddedInCart() {
+
+
+
+ HashMap hashMap = new HashMap<>();
+ hashMap.put("quantity", quantity);
+ hashMap.put("price", finalprice);
+ hashMap.put("title", title);
+ hashMap.put("imageUrl", imageUrl);
+ hashMap.put("productid", productid);
+
+ firestore.collection("Cart"+userid).document(title).set(hashMap).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsFragment.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsFragment.java
new file mode 100644
index 0000000..f8f66cf
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/ProductsFragment.java
@@ -0,0 +1,184 @@
+package com.example.shopcart;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.Fragment;
+import androidx.lifecycle.Observer;
+import androidx.lifecycle.ViewModelProvider;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import com.example.shopcart.Adapter.ProductsAdapter;
+import com.example.shopcart.MVVM.ProductViewModel;
+import com.example.shopcart.Model.Cart;
+import com.example.shopcart.Model.Product;
+import com.google.android.material.floatingactionbutton.FloatingActionButton;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.firestore.DocumentSnapshot;
+import com.google.firebase.firestore.EventListener;
+import com.google.firebase.firestore.FirebaseFirestore;
+import com.google.firebase.firestore.FirebaseFirestoreException;
+import com.google.firebase.firestore.QuerySnapshot;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static android.content.ContentValues.TAG;
+
+public class ProductsFragment extends Fragment implements ProductsAdapter.OnClickedProducct {
+
+
+ RecyclerView recyclerView;
+ ProductViewModel viewModel;
+ ProductsAdapter mAdapter;
+ FloatingActionButton fab;
+ TextView quantityincart;
+
+ FirebaseAuth firebaseAuth;
+ FirebaseFirestore firestore;
+ String userid;
+ int sum = 0;
+
+
+ NavController navController;
+ List savequantity = new ArrayList<>();
+
+
+ public ProductsFragment() {
+
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_product, container, false);
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+
+ firebaseAuth = FirebaseAuth.getInstance();
+ firestore = FirebaseFirestore.getInstance();
+
+ userid = firebaseAuth.getCurrentUser().getUid();
+
+ recyclerView = view.findViewById(R.id.recyclerviewproduct);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+
+ mAdapter = new ProductsAdapter(this);
+ fab = view.findViewById(R.id.fabMainProductPage);
+ navController = Navigation.findNavController(view);
+ quantityincart = view.findViewById(R.id.cartquantity);
+
+
+
+
+
+
+
+
+ fab.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ navController.navigate(R.id.action_productsFragment_to_cartFragment);
+ }
+ });
+
+
+
+ firestore.collection("Cart"+userid).addSnapshotListener(new EventListener() {
+ @Override
+ public void onEvent(@Nullable QuerySnapshot value, @Nullable FirebaseFirestoreException error) {
+
+ for (DocumentSnapshot ds: value.getDocuments()) {
+
+ Cart cart = ds.toObject(Cart.class);
+
+
+ int quantitycounter = cart.getQuantity();
+
+ // add all integers into Integer arraylist
+ savequantity.add(quantitycounter);
+
+
+ }
+
+
+ for (int i =0; i < savequantity.size(); i++) {
+
+
+ sum+= Integer.parseInt(String.valueOf(savequantity.get(i)));
+
+ }
+
+ quantityincart.setText(String.valueOf(sum));
+
+ sum = 0;
+ savequantity.clear();
+
+
+
+
+ }
+ });
+
+
+
+ viewModel = new ViewModelProvider(getActivity()).get(ProductViewModel.class);
+ viewModel.getAllProducts().observe(getViewLifecycleOwner(), new Observer>() {
+ @Override
+ public void onChanged(List products) {
+
+ mAdapter.setProductList(products);
+ recyclerView.setAdapter(mAdapter);
+ }
+ });
+
+ }
+
+
+
+
+
+
+ // for going to next fragment product detail.
+
+ @Override
+ public void OnProClicked(List productList, int position) {
+
+ ProductsFragmentDirections.ActionProductsFragmentToProductsDetailFragment
+ actions = ProductsFragmentDirections.actionProductsFragmentToProductsDetailFragment();
+
+ actions.setTitle(productList.get(position).getTitle());
+ actions.setDescription(productList.get(position).getDescription());
+ actions.setProductid(productList.get(position).getProductid());
+ actions.setPosition(position);
+ actions.setImageUrl(productList.get(position).getImageUrl());
+ actions.setPrice(productList.get(position).getPrice());
+
+ navController.navigate(actions);
+
+
+
+ }
+
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ sum = 0;
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/RegisterFragment.java b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/RegisterFragment.java
new file mode 100644
index 0000000..9ed2c76
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/java/com/example/shopcart/RegisterFragment.java
@@ -0,0 +1,161 @@
+package com.example.shopcart;
+
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.appcompat.widget.SwitchCompat;
+import androidx.fragment.app.Fragment;
+import androidx.navigation.NavController;
+import androidx.navigation.Navigation;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.Toast;
+
+import com.example.shopcart.R;
+import com.google.android.gms.tasks.OnCompleteListener;
+import com.google.android.gms.tasks.Task;
+import com.google.android.material.textfield.TextInputLayout;
+import com.google.firebase.auth.AuthResult;
+import com.google.firebase.auth.FirebaseAuth;
+import com.google.firebase.auth.FirebaseUser;
+import com.google.firebase.firestore.FirebaseFirestore;
+
+import java.util.HashMap;
+
+public class RegisterFragment extends Fragment {
+
+ SwitchCompat toggle;
+ FirebaseFirestore firestore;
+ FirebaseAuth auth;
+ NavController navController;
+ TextInputLayout etname, etemail, etpassword;
+ String name, email, password;
+ Button signUp;
+
+
+
+ public RegisterFragment() {
+
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.fragment_register, container, false);
+ }
+
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+
+ etemail = view.findViewById(R.id.emailfield);
+ etname = view.findViewById(R.id.nameField);
+ etpassword = view.findViewById(R.id.passwordfield);
+
+ firestore = FirebaseFirestore.getInstance();
+ auth = FirebaseAuth.getInstance();
+ signUp = view.findViewById(R.id.signUpButton);
+
+
+ toggle = view.findViewById(R.id.gotosignInSwitch);
+ navController = Navigation.findNavController(view);
+
+
+ signUp.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ name = etname.getEditText().getText().toString();
+ password = etpassword.getEditText().getText().toString();
+ email = etemail.getEditText().getText().toString();
+
+ if (name.isEmpty()) {
+
+
+ etname.setError("Enter name");
+ } else if (email.isEmpty()) {
+
+ etemail.setError("Enter Email");
+
+
+ } else if (password.isEmpty() || password.length() < 6) {
+
+ etpassword.setError("Password length must be more than 6");
+
+ } else {
+
+ CreateUsers(name, email, password);
+
+ }
+
+
+
+ }
+ });
+
+ toggle.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (v.isClickable()) {
+ navController.navigate(R.id.action_registerFragment_to_loginFragment);
+ }
+
+ }
+ });
+
+
+
+ }
+
+
+ private void CreateUsers(String name, String email, String password) {
+
+ auth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ if (task.isSuccessful()) {
+
+ FirebaseUser user = auth.getCurrentUser();
+
+ String userid = user.getUid();
+
+ HashMap hashMap = new HashMap<>();
+ hashMap.put("username", name);
+ hashMap.put("email", email);
+ hashMap.put("userid", userid);
+
+
+ firestore.collection("Users").document().set(hashMap).addOnCompleteListener(new OnCompleteListener() {
+ @Override
+ public void onComplete(@NonNull Task task) {
+
+ }
+ });
+
+
+ Toast.makeText(getContext(), "Registered", Toast.LENGTH_SHORT).show();
+
+
+ navController.navigate(R.id.action_registerFragment_to_productsFragment);
+
+
+
+ }
+
+ }
+ });
+
+
+
+
+
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/custom_size__4.png
new file mode 100644
index 0000000..9be3733
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/rectangle_3.png
new file mode 100644
index 0000000..8ea6770
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-hdpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/custom_size__4.png
new file mode 100644
index 0000000..6d76fe6
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/rectangle_3.png
new file mode 100644
index 0000000..a819487
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-ldpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/custom_size__4.png
new file mode 100644
index 0000000..1b7f704
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/rectangle_3.png
new file mode 100644
index 0000000..31d8acf
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-mdpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-v24/cart.xml b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/cart.xml
new file mode 100644
index 0000000..cf0dcc8
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/cart.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-v24/deleteitem.xml b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/deleteitem.xml
new file mode 100644
index 0000000..b0b1d8d
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/deleteitem.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..2b068d1
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/custom_size__4.png
new file mode 100644
index 0000000..390471b
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/rectangle_3.png
new file mode 100644
index 0000000..d2602f1
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xhdpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/custom_size__4.png
new file mode 100644
index 0000000..d815a10
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/rectangle_3.png
new file mode 100644
index 0000000..cf3f838
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xxhdpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/custom_size__4.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/custom_size__4.png
new file mode 100644
index 0000000..4e01aed
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/custom_size__4.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/rectangle_3.png b/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/rectangle_3.png
new file mode 100644
index 0000000..5af3441
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/drawable-xxxhdpi/rectangle_3.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/drawable/ic_launcher_background.xml b/TASK4_Product_Ordering/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..07d5da9
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/font/allerta.xml b/TASK4_Product_Ordering/app/src/main/res/font/allerta.xml
new file mode 100644
index 0000000..d64580c
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/font/allerta.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/font/carrois_gothic_sc.xml b/TASK4_Product_Ordering/app/src/main/res/font/carrois_gothic_sc.xml
new file mode 100644
index 0000000..b3cd206
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/font/carrois_gothic_sc.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/activity_main.xml b/TASK4_Product_Ordering/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 0000000..ec3fdea
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/cartliststyle.xml b/TASK4_Product_Ordering/app/src/main/res/layout/cartliststyle.xml
new file mode 100644
index 0000000..5baff70
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/cartliststyle.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/fragment_cart.xml b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_cart.xml
new file mode 100644
index 0000000..0d926ab
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_cart.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/fragment_login.xml b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_login.xml
new file mode 100644
index 0000000..5e8c438
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_login.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product.xml b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product.xml
new file mode 100644
index 0000000..6a208df
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product_detail.xml b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product_detail.xml
new file mode 100644
index 0000000..46e6dbb
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_product_detail.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/fragment_register.xml b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_register.xml
new file mode 100644
index 0000000..6e83519
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/fragment_register.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/layout/productstyleslist.xml b/TASK4_Product_Ordering/app/src/main/res/layout/productstyleslist.xml
new file mode 100644
index 0000000..0c1b143
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/layout/productstyleslist.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a571e60
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..61da551
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c41dd28
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..db5080a
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6dba46d
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..da31a87
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..15ac681
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b216f2d
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f25a419
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e96783c
Binary files /dev/null and b/TASK4_Product_Ordering/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/TASK4_Product_Ordering/app/src/main/res/navigation/navgraph.xml b/TASK4_Product_Ordering/app/src/main/res/navigation/navgraph.xml
new file mode 100644
index 0000000..cd05826
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/navigation/navgraph.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/values-night/themes.xml b/TASK4_Product_Ordering/app/src/main/res/values-night/themes.xml
new file mode 100644
index 0000000..f39070e
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values-night/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/values/colors.xml b/TASK4_Product_Ordering/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..f8c6127
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values/colors.xml
@@ -0,0 +1,10 @@
+
+
+ #FFBB86FC
+ #FF6200EE
+ #FF3700B3
+ #FF03DAC5
+ #FF018786
+ #FF000000
+ #FFFFFFFF
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/values/font_certs.xml b/TASK4_Product_Ordering/app/src/main/res/values/font_certs.xml
new file mode 100644
index 0000000..d2226ac
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values/font_certs.xml
@@ -0,0 +1,17 @@
+
+
+
+ - @array/com_google_android_gms_fonts_certs_dev
+ - @array/com_google_android_gms_fonts_certs_prod
+
+
+ -
+ MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
+
+
+
+ -
+ MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
+
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/values/preloaded_fonts.xml b/TASK4_Product_Ordering/app/src/main/res/values/preloaded_fonts.xml
new file mode 100644
index 0000000..ddfd3b5
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values/preloaded_fonts.xml
@@ -0,0 +1,7 @@
+
+
+
+ - @font/allerta
+ - @font/carrois_gothic_sc
+
+
diff --git a/TASK4_Product_Ordering/app/src/main/res/values/strings.xml b/TASK4_Product_Ordering/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..6837e47
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values/strings.xml
@@ -0,0 +1,5 @@
+
+ ShopCart
+
+ Hello blank fragment
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/main/res/values/themes.xml b/TASK4_Product_Ordering/app/src/main/res/values/themes.xml
new file mode 100644
index 0000000..3c63ce8
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/main/res/values/themes.xml
@@ -0,0 +1,16 @@
+
+
+
+
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/app/src/test/java/com/example/shopcart/ExampleUnitTest.java b/TASK4_Product_Ordering/app/src/test/java/com/example/shopcart/ExampleUnitTest.java
new file mode 100644
index 0000000..1b021f7
--- /dev/null
+++ b/TASK4_Product_Ordering/app/src/test/java/com/example/shopcart/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.shopcart;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/build.gradle b/TASK4_Product_Ordering/build.gradle
new file mode 100644
index 0000000..4be5558
--- /dev/null
+++ b/TASK4_Product_Ordering/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.1.3"
+ classpath 'com.google.gms:google-services:4.3.10'
+ classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/gradle.properties b/TASK4_Product_Ordering/gradle.properties
new file mode 100644
index 0000000..52f5917
--- /dev/null
+++ b/TASK4_Product_Ordering/gradle.properties
@@ -0,0 +1,19 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
\ No newline at end of file
diff --git a/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.jar b/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.properties b/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..1669f5e
--- /dev/null
+++ b/TASK4_Product_Ordering/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Mar 01 10:55:12 ICT 2021
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
diff --git a/TASK4_Product_Ordering/gradlew b/TASK4_Product_Ordering/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/TASK4_Product_Ordering/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/TASK4_Product_Ordering/gradlew.bat b/TASK4_Product_Ordering/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/TASK4_Product_Ordering/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/TASK4_Product_Ordering/images/five.jpg b/TASK4_Product_Ordering/images/five.jpg
new file mode 100644
index 0000000..8d96397
Binary files /dev/null and b/TASK4_Product_Ordering/images/five.jpg differ
diff --git a/TASK4_Product_Ordering/images/four.jpg b/TASK4_Product_Ordering/images/four.jpg
new file mode 100644
index 0000000..a330922
Binary files /dev/null and b/TASK4_Product_Ordering/images/four.jpg differ
diff --git a/TASK4_Product_Ordering/images/one.jpg b/TASK4_Product_Ordering/images/one.jpg
new file mode 100644
index 0000000..fd829f0
Binary files /dev/null and b/TASK4_Product_Ordering/images/one.jpg differ
diff --git a/TASK4_Product_Ordering/images/three.jpg b/TASK4_Product_Ordering/images/three.jpg
new file mode 100644
index 0000000..7797998
Binary files /dev/null and b/TASK4_Product_Ordering/images/three.jpg differ
diff --git a/TASK4_Product_Ordering/images/two.jpg b/TASK4_Product_Ordering/images/two.jpg
new file mode 100644
index 0000000..8b83fac
Binary files /dev/null and b/TASK4_Product_Ordering/images/two.jpg differ
diff --git a/TASK4_Product_Ordering/settings.gradle b/TASK4_Product_Ordering/settings.gradle
new file mode 100644
index 0000000..6ee35c5
--- /dev/null
+++ b/TASK4_Product_Ordering/settings.gradle
@@ -0,0 +1,2 @@
+include ':app'
+rootProject.name = "ShopCart"
\ No newline at end of file