diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..603b140
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+*.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
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..88ea3aa
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/uttam.xml b/.idea/dictionaries/uttam.xml
new file mode 100644
index 0000000..a19ebdb
--- /dev/null
+++ b/.idea/dictionaries/uttam.xml
@@ -0,0 +1,12 @@
+
+
+
+ detailsf
+ dosen
+ foodrunner
+ kartikey
+ relativelayout
+ sharma
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 0000000..ac6b0ae
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644
index 0000000..a5f05cd
--- /dev/null
+++ b/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..37a7509
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..8106220
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,47 @@
+apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+apply plugin: 'kotlin-kapt'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.0"
+
+ defaultConfig {
+ applicationId "com.kartikey.foodrunner"
+ minSdkVersion 18
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+
+ def room_version = "2.2.5"
+ implementation "androidx.room:room-runtime:$room_version"
+ kapt "androidx.room:room-compiler:$room_version"
+
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
+ implementation 'androidx.core:core-ktx:1.3.0'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ implementation 'com.squareup.picasso:picasso:2.71828'
+ implementation 'com.android.support:design:28.0.0'
+ implementation 'com.android.volley:volley:1.1.1'
+ implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..481bb43
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/app/src/androidTest/java/com/kartikey/foodrunner/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/kartikey/foodrunner/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..5e6e1c8
--- /dev/null
+++ b/app/src/androidTest/java/com/kartikey/foodrunner/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.kartikey.foodrunner
+
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
+
+import org.junit.Test
+import org.junit.runner.RunWith
+
+import org.junit.Assert.*
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+@RunWith(AndroidJUnit4::class)
+class ExampleInstrumentedTest {
+ @Test
+ fun useAppContext() {
+ // Context of the app under test.
+ val appContext = InstrumentationRegistry.getInstrumentation().targetContext
+ assertEquals("com.kartikey.foodrunner", appContext.packageName)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..8706f05
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/ic_app_logo-playstore.png b/app/src/main/ic_app_logo-playstore.png
new file mode 100644
index 0000000..49a0300
Binary files /dev/null and b/app/src/main/ic_app_logo-playstore.png differ
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/CartActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/CartActivity.kt
new file mode 100644
index 0000000..aab58f3
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/CartActivity.kt
@@ -0,0 +1,364 @@
+package com.kartikey.foodrunner.activity
+
+
+import android.app.NotificationChannel
+import android.app.NotificationManager
+import android.content.Context
+import android.content.Intent
+import android.os.Build
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.provider.Settings
+import android.view.MenuItem
+import android.view.View
+import android.widget.*
+import androidx.core.app.NotificationCompat
+import androidx.core.app.NotificationManagerCompat
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.adapter.CartAdapter
+import com.kartikey.foodrunner.model.CartItems
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONArray
+import org.json.JSONException
+import org.json.JSONObject
+
+
+class CartActivity : AppCompatActivity() {
+
+ lateinit var toolbar: androidx.appcompat.widget.Toolbar
+ lateinit var txtOrderingFrom: TextView
+ lateinit var btnPlaceOrder: Button
+ lateinit var recyclerView: RecyclerView
+ lateinit var layoutManager: RecyclerView.LayoutManager
+ lateinit var menuAdapter: CartAdapter
+ lateinit var restaurantId: String
+ lateinit var restaurantName: String
+ lateinit var linearLayout: LinearLayout
+ lateinit var progressLayout: RelativeLayout
+ lateinit var selectedItemsId: ArrayList
+
+ var totalCost = 0
+ var cartListItems = arrayListOf()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_cart)
+
+ btnPlaceOrder = findViewById(R.id.btnPlaceOrder)
+ txtOrderingFrom = findViewById(R.id.txtOrderingFrom)
+ linearLayout = findViewById(R.id.linearLayout)
+ toolbar = findViewById(R.id.toolBar)
+ progressLayout = findViewById(R.id.activityCartProgressLayout)
+
+ restaurantId = intent.getStringExtra("restaurantId").toString()
+ restaurantName = intent.getStringExtra("restaurantName").toString()
+ selectedItemsId = intent.getStringArrayListExtra("selectedItemsId") as ArrayList
+
+ //set the restaurant name
+ txtOrderingFrom.text = restaurantName
+
+ btnPlaceOrder.setOnClickListener {
+
+ val sharedPreferences = this.getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ if (ConnectionManager().checkConnectivity(this)) {
+ progressLayout.visibility = View.VISIBLE
+
+ try {
+
+ val foodJsonArray = JSONArray()
+
+ for (foodItem in selectedItemsId) {
+ val singleItemObject = JSONObject()
+ singleItemObject.put("food_item_id", foodItem)
+ foodJsonArray.put(singleItemObject)
+
+ }
+
+ val sendOrder = JSONObject()
+
+ sendOrder.put("user_id", sharedPreferences.getString("user_id", "0"))
+ sendOrder.put("restaurant_id", restaurantId.toString())
+ sendOrder.put("total_cost", totalCost)
+ sendOrder.put("food", foodJsonArray)
+
+ val queue = Volley.newRequestQueue(this)
+ val url = "http://13.235.250.119/v2/place_order/fetch_result/"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.POST,
+ url,
+ sendOrder,
+ Response.Listener
+ {
+
+ val jsonObjectData = it.getJSONObject("data")
+ val success = jsonObjectData.getBoolean("success")
+
+ if (success) {
+ Toast.makeText(
+ this,
+ "Order Placed",
+ Toast.LENGTH_SHORT
+ ).show()
+ //send a notification to the user regarding his order
+ createNotification()
+
+ val intent = Intent(this, OrderPlacedActivity::class.java)
+ startActivity(intent)
+ finishAffinity()
+
+ } else {
+ val responseMessageServer =
+ jsonObjectData.getString("errorMessage")
+ Toast.makeText(
+ this,
+ responseMessageServer.toString(),
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }
+ progressLayout.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ Toast.makeText(
+ this,
+ "Some Error occurred!!!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ this,
+ "Some unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }
+
+ } else {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+ //setting the toolbar
+ setToolBar()
+
+ layoutManager = LinearLayoutManager(this)
+ recyclerView = findViewById(R.id.recyclerViewCart)
+
+ }
+
+ fun fetchData() {
+ if (ConnectionManager().checkConnectivity(this)) {
+ progressLayout.visibility = View.VISIBLE
+ try {
+
+ val queue = Volley.newRequestQueue(this)
+ val url = "http://13.235.250.119/v2/restaurants/fetch_result/${restaurantId}"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+
+ val data = responseJsonObjectData.getJSONArray("data")
+ //old listener of jsonObjectRequest are still listening therefore clear is used
+ cartListItems.clear()
+ totalCost = 0
+
+ for (i in 0 until data.length()) {
+ val cartItemJsonObject = data.getJSONObject(i)
+
+ if (selectedItemsId.contains(cartItemJsonObject.getString("id"))) {
+ val menuObject = CartItems(
+ cartItemJsonObject.getString("id"),
+ cartItemJsonObject.getString("name"),
+ cartItemJsonObject.getString("cost_for_one"),
+ cartItemJsonObject.getString("restaurant_id")
+ )
+
+ this.totalCost += cartItemJsonObject.getString("cost_for_one")
+ .toString().toInt()
+ cartListItems.add(menuObject)
+
+ }
+ menuAdapter = CartAdapter(
+ this,
+ cartListItems
+ )
+
+ recyclerView.adapter = menuAdapter
+ recyclerView.layoutManager = layoutManager
+ }
+
+ //set the total on the button
+ btnPlaceOrder.text = "Place Order (Total Cost: Rs. $totalCost)"
+ }
+ progressLayout.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+
+ Toast.makeText(
+ this,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ progressLayout.visibility = View.GONE
+
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ this,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+
+ } else {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+
+ }
+
+ fun setToolBar() {
+ setSupportActionBar(toolbar)
+ supportActionBar?.title = "My Cart"
+ supportActionBar?.setHomeButtonEnabled(true)
+ supportActionBar?.setDisplayHomeAsUpEnabled(true)
+ supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_white_back_arrow)
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val id = item.itemId
+ when (id) {
+ android.R.id.home -> {
+ super.onBackPressed()
+ }
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+
+ override fun onResume() {
+ if (ConnectionManager().checkConnectivity(this)) {
+ fetchData()
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+ }
+
+ //Learnt about it online and decided to implement it
+ fun createNotification() {
+ val notificationId = 1;
+ val channelId = "personal_notification"
+ val notificationBuilder = NotificationCompat.Builder(this, channelId)
+ notificationBuilder.setSmallIcon(R.drawable.food_runner_logo)
+ notificationBuilder.setContentTitle("Order Placed")
+ notificationBuilder.setContentText("Your order has been placed successfully!")
+ notificationBuilder.setStyle(
+ NotificationCompat.BigTextStyle()
+ .bigText("Ordered from ${restaurantName} and amounting to Rs.${totalCost} .Thank you for ordering from FoodRunner. Stay Safe!")
+ )
+ notificationBuilder.priority = NotificationCompat.PRIORITY_DEFAULT
+ val notificationManagerCompat = NotificationManagerCompat.from(this)
+ notificationManagerCompat.notify(notificationId, notificationBuilder.build())
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) //if the version is less than oreo
+ {
+ val name = "Order Placed"
+ val description = "Your order has been placed!"
+ val importance = NotificationManager.IMPORTANCE_DEFAULT
+
+ val notificationChannel = NotificationChannel(channelId, name, importance)
+ notificationChannel.description = description
+ val notificationManager =
+ (getSystemService(Context.NOTIFICATION_SERVICE)) as NotificationManager
+ notificationManager.createNotificationChannel(notificationChannel)
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/DashboardActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/DashboardActivity.kt
new file mode 100644
index 0000000..a496961
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/DashboardActivity.kt
@@ -0,0 +1,251 @@
+package com.kartikey.foodrunner.activity
+
+import android.content.Context
+import android.content.Intent
+import android.content.SharedPreferences
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.os.Handler
+import android.view.MenuItem
+import android.view.WindowManager
+import android.widget.FrameLayout
+import android.widget.TextView
+import android.widget.Toast
+import androidx.appcompat.app.ActionBarDrawerToggle
+import androidx.coordinatorlayout.widget.CoordinatorLayout
+import androidx.core.app.ActivityCompat
+import androidx.core.view.GravityCompat
+import androidx.drawerlayout.widget.DrawerLayout
+import com.google.android.material.navigation.NavigationView
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.fragment.*
+
+
+class DashboardActivity : AppCompatActivity() {
+
+ lateinit var coordinatorLayout: CoordinatorLayout
+ lateinit var toolbar: androidx.appcompat.widget.Toolbar
+ lateinit var frameLayout: FrameLayout
+ lateinit var navigationView: NavigationView
+ lateinit var drawerLayout: DrawerLayout
+ lateinit var txtCurrentUser: TextView
+ lateinit var txtMobileNumber: TextView
+ lateinit var sharedPreferences: SharedPreferences
+
+ var previousMenuItemSelected: MenuItem? = null
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_dashboard)
+ sharedPreferences = getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ coordinatorLayout = findViewById(R.id.coordinatorLayout)
+ toolbar = findViewById(R.id.toolBar)
+ frameLayout = findViewById(R.id.frameLayout)
+ navigationView = findViewById(R.id.navigationView)
+ drawerLayout = findViewById(R.id.drawerLayout)
+ val headerView = navigationView.getHeaderView(0)
+ txtCurrentUser = headerView.findViewById(R.id.txtCurrentUser)
+ txtMobileNumber = headerView.findViewById(R.id.txtMobileNumber)
+
+ //Used to set the default dashboard to checked when the
+ //app opens or the back btn is pressed to go to the previous fragment
+ navigationView.menu.getItem(0).setCheckable(true)
+ navigationView.menu.getItem(0).setChecked(true)
+
+ //set tool bar
+ setToolBar()
+
+ //default user details
+ txtCurrentUser.text = sharedPreferences.getString("name", "Kartikey Sharma")
+ txtMobileNumber.text = "+91-" + sharedPreferences.getString("mobile_number", "9876543210")
+
+ val actionBarDrawerToggle = ActionBarDrawerToggle(
+ this@DashboardActivity,
+ drawerLayout,
+ R.string.open_drawer,//hamburger icon to open
+ R.string.close_drawer
+ )//once opened it changes to back arrow
+
+ drawerLayout.addDrawerListener(actionBarDrawerToggle)
+ actionBarDrawerToggle.syncState()
+ //to sync with the state of the navigation toggle with the state of the navigation drawer
+
+ navigationView.setNavigationItemSelectedListener {
+
+ if (previousMenuItemSelected != null && previousMenuItemSelected!!.itemId != R.id.logout) {
+ previousMenuItemSelected?.isChecked = true
+ }
+
+ //the current fragment will be previous fragment when a user clicks a new fragment
+ previousMenuItemSelected = it
+ it.isCheckable = true
+ it.isChecked = true
+
+ //The closing of navigation drawer is delayed to make the transition smoother
+ //Delayed by 0.2s
+ val pendingRunnable = Runnable { drawerLayout.closeDrawer(GravityCompat.START) }
+ Handler().postDelayed(
+ pendingRunnable,
+ 100
+ )
+
+ when (it.itemId) {
+
+ R.id.home -> {
+ openDashboard()
+ drawerLayout.closeDrawers()
+ }
+ R.id.profile -> {
+
+ supportFragmentManager.beginTransaction()
+ .replace(
+ R.id.frameLayout,
+ ProfileFragment(this)
+ )
+ .commit()
+
+ supportActionBar?.title = "My Profile"
+ drawerLayout.closeDrawers()
+ Toast.makeText(
+ this@DashboardActivity,
+ "My Profile",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+
+ }
+ R.id.favouriteRestaurants -> {
+
+ supportFragmentManager.beginTransaction()
+ .replace(
+ R.id.frameLayout,
+ FavouriteRestaurantFragment(this)
+ )
+ .commit()
+
+ supportActionBar?.title = "Favourite Restaurants"
+ drawerLayout.closeDrawers()
+
+ }
+ R.id.orderHistory -> {
+
+ supportFragmentManager.beginTransaction().replace(
+ R.id.frameLayout, OrderHistoryFragment()
+ ).commit()
+ supportActionBar?.title = "My Previous Orders"
+ drawerLayout.closeDrawers()
+
+ Toast.makeText(
+ this@DashboardActivity,
+ "Order History",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }
+ R.id.faqs -> {
+
+ supportFragmentManager.beginTransaction()
+ .replace(
+ R.id.frameLayout,
+ FaqsFragment()
+ )
+ .commit()
+
+ supportActionBar?.title = "Frequently Asked Questions"
+ drawerLayout.closeDrawers()
+
+ Toast.makeText(
+ this@DashboardActivity,
+ " FAQs ",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ }
+ R.id.logout -> {
+ drawerLayout.closeDrawers()
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("Confirmation")
+ alterDialog.setMessage("Are you sure you want to log out?")
+ alterDialog.setPositiveButton("Yes")
+ { _, _ ->
+ sharedPreferences.edit().putBoolean("user_logged_in", false).apply()
+ val intent =
+ Intent(this@DashboardActivity, LoginRegisterActivity::class.java)
+ startActivity(intent)
+ ActivityCompat.finishAffinity(this)
+ //app login user credentials are erased and it takes the user to the login screen
+ }
+
+ alterDialog.setNegativeButton("No")
+ { _, _ ->
+ openDashboard()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+
+ return@setNavigationItemSelectedListener true
+ }
+ openDashboard()
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+
+ val id = item.itemId
+ if (id == android.R.id.home) {
+ drawerLayout.openDrawer(GravityCompat.START)
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+ override fun onBackPressed() {
+
+ val currentFragment = supportFragmentManager.findFragmentById(R.id.frameLayout)
+
+ when (currentFragment) {
+ !is DashboardFragment -> {
+ navigationView.menu.getItem(0).setChecked(true)
+ openDashboard()
+ }
+ else -> {
+ super.onBackPressed()
+ }
+ }
+ }
+
+ fun setToolBar() {
+ setSupportActionBar(toolbar)
+ supportActionBar?.title = "All Restaurants"
+ supportActionBar?.setHomeButtonEnabled(true)
+ supportActionBar?.setDisplayHomeAsUpEnabled(true)
+ supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_menu)
+ }
+
+ fun openDashboard() {
+ val transaction = supportFragmentManager.beginTransaction()
+ transaction.replace(
+ R.id.frameLayout,
+ DashboardFragment(this)
+ )
+ transaction.commit()
+
+ supportActionBar?.title = "All Restaurants"
+ navigationView.setCheckedItem(R.id.home)
+ }
+
+ //to disable auto pop of soft keyboard on the search
+ override fun onResume() {
+ window.setSoftInputMode(
+ WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN
+ );
+ super.onResume()
+ }
+}
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/LoginRegisterActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/LoginRegisterActivity.kt
new file mode 100644
index 0000000..c2856aa
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/LoginRegisterActivity.kt
@@ -0,0 +1,65 @@
+package com.kartikey.foodrunner.activity
+
+import android.content.Context
+import android.content.Intent
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.view.MenuItem
+import com.kartikey.foodrunner.fragment.LoginFragment
+import com.kartikey.foodrunner.R
+
+class LoginRegisterActivity : AppCompatActivity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_login_register)
+
+ val sharedPreferences = getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ if (sharedPreferences.getBoolean("user_logged_in", false)) {
+ val intent = Intent(this@LoginRegisterActivity, DashboardActivity::class.java)
+ startActivity(intent)
+ finish();
+ } else {
+ openLoginFragment()
+ }
+ }
+
+ fun openLoginFragment() {
+
+ val transaction = supportFragmentManager.beginTransaction()
+ transaction.replace(
+ R.id.frameLayout,
+ LoginFragment(this)
+ )
+ transaction.commit()
+ supportActionBar?.title = "DashboardActivity"
+
+ }
+
+ override fun onBackPressed() {
+ val currentFragment = supportFragmentManager.findFragmentById(R.id.frameLayout)
+ when (currentFragment) {
+ !is LoginFragment -> {
+ openLoginFragment()
+ }
+ else -> {
+ super.onBackPressed()
+ }
+ }
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val id = item.itemId
+ when (id) {
+ android.R.id.home -> {
+ openLoginFragment()
+ }
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/OrderPlacedActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/OrderPlacedActivity.kt
new file mode 100644
index 0000000..fdc3778
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/OrderPlacedActivity.kt
@@ -0,0 +1,41 @@
+package com.kartikey.foodrunner.activity
+
+
+import android.content.Intent
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.widget.Button
+import android.widget.RelativeLayout
+import android.widget.Toast
+import com.kartikey.foodrunner.R
+
+class OrderPlacedActivity : AppCompatActivity() {
+
+ lateinit var btnOkay: Button
+ lateinit var orderPlacedSuccessfully: RelativeLayout
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_order_placed)
+ orderPlacedSuccessfully = findViewById(R.id.orderPlacedSuccessfully)
+ btnOkay = findViewById(R.id.btnOkay)
+
+ btnOkay.setOnClickListener {
+ val intent = Intent(this, DashboardActivity::class.java)
+ startActivity(intent)
+ finishAffinity()
+ }
+ }
+
+ override fun onBackPressed() {
+ Toast.makeText(
+ this@OrderPlacedActivity,
+ "Press OK for Main Menu",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ //force user to press okay button to take him to dashboard screen
+ //user can't use back button
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/RestaurantMenuActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/RestaurantMenuActivity.kt
new file mode 100644
index 0000000..7790bb9
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/RestaurantMenuActivity.kt
@@ -0,0 +1,238 @@
+package com.kartikey.foodrunner.activity
+
+import android.content.Intent
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.provider.Settings
+import android.view.MenuItem
+import android.view.View
+import android.widget.Button
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.adapter.RestaurantMenuAdapter
+import com.kartikey.foodrunner.model.RestaurantMenu
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+import kotlin.collections.HashMap
+
+class RestaurantMenuActivity : AppCompatActivity() {
+
+ lateinit var toolbar: androidx.appcompat.widget.Toolbar
+ lateinit var recyclerView: RecyclerView
+ lateinit var layoutManager: RecyclerView.LayoutManager
+ lateinit var menuAdapter: RestaurantMenuAdapter
+ lateinit var restaurantId: String
+ lateinit var restaurantName: String
+ lateinit var proceedToCartLayout: RelativeLayout
+ lateinit var btnProceedToCart: Button
+ lateinit var restaurantMenuProgressDialog: RelativeLayout
+
+ var restaurantMenuList = arrayListOf()
+
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_restaurant_menu)
+
+ proceedToCartLayout = findViewById(R.id.rlProceedToCart)
+ btnProceedToCart = findViewById(R.id.btnProceedToCart)
+ restaurantMenuProgressDialog =
+ findViewById(R.id.restaurantMenuProgressDialog)
+
+ toolbar = findViewById(R.id.toolBar)
+
+ restaurantId = intent.getStringExtra("restaurantId").toString()
+ restaurantName = intent.getStringExtra("restaurantName").toString()
+
+ setToolBar()
+ layoutManager = LinearLayoutManager(this)
+ recyclerView = findViewById(R.id.recyclerViewRestaurantMenu)
+
+ }
+
+ fun fetchData() {
+ if (ConnectionManager().checkConnectivity(this)) {
+ restaurantMenuProgressDialog.visibility = View.VISIBLE
+ try {
+
+ val queue = Volley.newRequestQueue(this)
+ val url = "http://13.235.250.119/v2/restaurants/fetch_result/${restaurantId}"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ restaurantMenuList.clear()
+
+ val data = responseJsonObjectData.getJSONArray("data")
+
+ for (i in 0 until data.length()) {
+ val bookJsonObject = data.getJSONObject(i)
+ val menuObject = RestaurantMenu(
+ bookJsonObject.getString("id"),
+ bookJsonObject.getString("name"),
+ bookJsonObject.getString("cost_for_one")
+
+ )
+ restaurantMenuList.add(menuObject)
+
+ menuAdapter = RestaurantMenuAdapter(
+ this,
+ restaurantId,
+ restaurantName,
+ proceedToCartLayout,//pass the relative layout which has the button to enable it later
+ btnProceedToCart,
+ restaurantMenuList
+ )
+
+ recyclerView.adapter = menuAdapter
+ recyclerView.layoutManager = layoutManager
+ }
+ }
+ restaurantMenuProgressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ Toast.makeText(
+ this,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ restaurantMenuProgressDialog.visibility = View.GONE
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ this,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+
+ } else {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+
+ }
+
+ fun setToolBar() {
+ setSupportActionBar(toolbar)
+ supportActionBar?.title = restaurantName
+ supportActionBar?.setHomeButtonEnabled(true)
+ supportActionBar?.setDisplayHomeAsUpEnabled(true)
+ supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_white_back_arrow)
+ }
+
+ override fun onBackPressed() {
+
+ if (menuAdapter.getSelectedItemCount() > 0) {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("Alert!")
+ alterDialog.setMessage("Going back will remove everything from cart")
+ alterDialog.setPositiveButton("Okay")
+ { _, _ ->
+ super.onBackPressed()
+ }
+ alterDialog.setNegativeButton("No")
+ { _, _ ->
+ //do nothing
+ }
+ alterDialog.show()
+ } else {
+ super.onBackPressed()
+ }
+
+ }
+
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val id = item.itemId
+ when (id) {
+ android.R.id.home -> {
+ if (menuAdapter.getSelectedItemCount() > 0) {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("Alert!")
+ alterDialog.setMessage("Going back will remove everything from cart")
+ alterDialog.setPositiveButton("Okay")
+ { _, _ ->
+ super.onBackPressed()
+ }
+ alterDialog.setNegativeButton("No")
+ { _, _ ->
+
+ }
+ alterDialog.show()
+ } else {
+ super.onBackPressed()
+ }
+ }
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+ override fun onResume() {
+
+ if (ConnectionManager().checkConnectivity(this)) {
+ if (restaurantMenuList.isEmpty())
+ fetchData()
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(this)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ //chose to make an intent to ACTION_SETTINGS instead of WIRELESS_ACTION_SETTINGS as it
+ //is more convenient for someone who wants to choose between opening mobile data or WIFI
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity()
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/activity/SplashActivity.kt b/app/src/main/java/com/kartikey/foodrunner/activity/SplashActivity.kt
new file mode 100644
index 0000000..1e9e4d1
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/activity/SplashActivity.kt
@@ -0,0 +1,23 @@
+package com.kartikey.foodrunner.activity
+
+import android.content.Intent
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import android.os.Handler
+import com.kartikey.foodrunner.R
+
+class SplashActivity : AppCompatActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_splash)
+
+ //Used handler to delay the intent by 1 seconds
+ Handler().postDelayed(
+ {
+ val intent = Intent(this@SplashActivity, LoginRegisterActivity::class.java)
+ finish()
+ startActivity(intent)
+ }, 1000
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/adapter/CartAdapter.kt b/app/src/main/java/com/kartikey/foodrunner/adapter/CartAdapter.kt
new file mode 100644
index 0000000..b00ee6e
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/adapter/CartAdapter.kt
@@ -0,0 +1,37 @@
+package com.kartikey.foodrunner.adapter
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.model.CartItems
+
+
+class CartAdapter(val context: Context, val cartItems: ArrayList) :
+ RecyclerView.Adapter() {
+
+ class ViewHolderCart(view: View) : RecyclerView.ViewHolder(view) {
+ val txtOrderItem: TextView = view.findViewById(R.id.txtCartItemName)
+ val txtOrderItemPrice: TextView = view.findViewById(R.id.txtCartPrice)
+ }
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolderCart {
+ val view = LayoutInflater.from(parent.context)
+ .inflate(R.layout.cart_recycler_view_single_row, parent, false)
+ return ViewHolderCart(view)
+ }
+
+ override fun getItemCount(): Int {
+ return cartItems.size
+ }
+
+ override fun onBindViewHolder(holder: ViewHolderCart, position: Int) {
+ val cartItemObject = cartItems[position]
+ holder.txtOrderItem.text = cartItemObject.itemName
+ holder.txtOrderItemPrice.text = "Rs. ${cartItemObject.itemPrice}"
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/adapter/DashboardFragmentAdapter.kt b/app/src/main/java/com/kartikey/foodrunner/adapter/DashboardFragmentAdapter.kt
new file mode 100644
index 0000000..4f20a9e
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/adapter/DashboardFragmentAdapter.kt
@@ -0,0 +1,154 @@
+package com.kartikey.foodrunner.adapter
+
+
+import android.content.Context
+import android.content.Intent
+import android.os.AsyncTask
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.*
+import androidx.recyclerview.widget.RecyclerView
+import androidx.room.Room
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.activity.RestaurantMenuActivity
+import com.kartikey.foodrunner.database.RestaurantDatabase
+import com.kartikey.foodrunner.database.RestaurantEntity
+import com.kartikey.foodrunner.model.Restaurant
+import com.squareup.picasso.Picasso
+
+
+class DashboardFragmentAdapter(val context: Context, var itemList: ArrayList) :
+ RecyclerView.Adapter() {
+
+ class ViewHolderDashboard(view: View) : RecyclerView.ViewHolder(view) {
+ val imgRestaurant: ImageView = view.findViewById(R.id.imgRestaurant)
+ val txtRestaurantName: TextView = view.findViewById(R.id.txtRestaurantName)
+ val txtPricePerPerson: TextView = view.findViewById(R.id.txtPricePerPerson)
+ val txtRating: TextView = view.findViewById(R.id.txtRating)
+ val llContent: LinearLayout = view.findViewById(R.id.llContent)
+ val txtFavourite: TextView = view.findViewById(R.id.txtFavourite)
+ }
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolderDashboard {
+ val view = LayoutInflater.from(parent.context)
+ .inflate(R.layout.dashboard_recycler_view_single_row, parent, false)
+ return ViewHolderDashboard(view)
+ }
+
+ override fun getItemCount(): Int {
+ return itemList.size
+ }
+
+ override fun onBindViewHolder(holder: ViewHolderDashboard, position: Int) {
+ val restaurant = itemList[position]
+ val restaurantEntity = RestaurantEntity(
+ restaurant.restaurantId,
+ restaurant.restaurantName
+ )
+
+ holder.txtFavourite.setOnClickListener {
+ if (!DBAsynTask(context, restaurantEntity, 1).execute().get()) {
+ val result = DBAsynTask(context, restaurantEntity, 2).execute().get()
+
+ if (result) {
+ holder.txtFavourite.setTag("liked")//new value
+ holder.txtFavourite.background =
+ context.resources.getDrawable(R.drawable.ic_fav_fill)
+ } else {
+ Toast.makeText(
+ context,
+ "Some error occurred!",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ }
+
+ } else {
+ val result = DBAsynTask(context, restaurantEntity, 3).execute().get()
+
+ if (result) {
+ holder.txtFavourite.setTag("unliked")
+ holder.txtFavourite.background =
+ context.resources.getDrawable(R.drawable.ic_fav_outline)
+ } else {
+ Toast.makeText(
+ context,
+ "Some error occurred!",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ }
+ }
+ }
+
+ holder.llContent.setOnClickListener {
+
+ val intent = Intent(context, RestaurantMenuActivity::class.java)
+ intent.putExtra("restaurantId", holder.txtRestaurantName.getTag().toString())
+ intent.putExtra("restaurantName", holder.txtRestaurantName.text.toString())
+ context.startActivity(intent)
+
+ }
+
+ holder.txtRestaurantName.setTag(restaurant.restaurantId + "")
+ holder.txtRestaurantName.text = restaurant.restaurantName
+ holder.txtPricePerPerson.text = restaurant.costForOne + "/Person "
+ holder.txtRating.text = restaurant.restaurantRating
+ Picasso.get().load(restaurant.restaurantImage).error(R.drawable.ic_default_image_restaurant)
+ .into(holder.imgRestaurant)
+
+ val checkFav = DBAsynTask(context, restaurantEntity, 1).execute()
+ val isFav = checkFav.get()
+
+ if (isFav) {
+ holder.txtFavourite.setTag("liked")
+ holder.txtFavourite.background = context.resources.getDrawable(R.drawable.ic_fav_fill)
+ } else {
+ holder.txtFavourite.setTag("unliked")
+ holder.txtFavourite.background =
+ context.resources.getDrawable(R.drawable.ic_fav_outline)
+ }
+
+ }
+
+ fun filterList(filteredList: ArrayList) {
+ itemList = filteredList
+ notifyDataSetChanged()
+ }
+
+ class DBAsynTask(val context: Context, val restaurantEntity: RestaurantEntity, val mode: Int) :
+ AsyncTask() {
+ val db =
+ Room.databaseBuilder(context, RestaurantDatabase::class.java, "restaurant-db").build()
+
+ override fun doInBackground(vararg p0: Void?): Boolean {
+ /*
+ * Mode 1->check if restaurant is in favourites
+ * Mode 2->Save the restaurant into DB as favourites
+ * Mode 3-> Remove the favourite restaurant
+ */
+ when (mode) {
+ 1 -> {
+ val restaurant: RestaurantEntity? = db.restaurantDao()
+ .getRestaurantById(restaurantEntity.restaurantId)
+ db.close()
+ return restaurant != null
+ }
+ 2 -> {
+ db.restaurantDao().insertRestaurant(restaurantEntity)
+ db.close()
+ return true
+ }
+ 3 -> {
+ db.restaurantDao().deleteRestaurant(restaurantEntity)
+ db.close()
+ return true
+ }
+ else -> {
+ return false
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/adapter/OrderHistoryAdapter.kt b/app/src/main/java/com/kartikey/foodrunner/adapter/OrderHistoryAdapter.kt
new file mode 100644
index 0000000..45117bf
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/adapter/OrderHistoryAdapter.kt
@@ -0,0 +1,140 @@
+package com.kartikey.foodrunner.adapter
+
+import android.content.Context
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import android.widget.Toast
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.model.CartItems
+import com.kartikey.foodrunner.model.OrderHistoryRestaurant
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+
+
+class OrderHistoryAdapter(
+ val context: Context,
+ val orderedRestaurantList: ArrayList
+) : RecyclerView.Adapter() {
+
+ class ViewHolderOrderHistoryRestaurant(view: View) : RecyclerView.ViewHolder(view) {
+ val txtRestaurantName: TextView = view.findViewById(R.id.txtRestaurantName)
+ val txtDate: TextView = view.findViewById(R.id.txtDate)
+ val recyclerViewItemsOrdered: RecyclerView =
+ view.findViewById(R.id.recyclerViewItemsOrdered)
+ }
+
+ override fun onCreateViewHolder(
+ parent: ViewGroup,
+ viewType: Int
+ ): ViewHolderOrderHistoryRestaurant {
+ val view = LayoutInflater.from(parent.context)
+ .inflate(R.layout.order_history_recycler_single_row, parent, false)
+
+ return ViewHolderOrderHistoryRestaurant(view)
+ }
+
+ override fun getItemCount(): Int {
+ return orderedRestaurantList.size
+ }
+
+ override fun onBindViewHolder(holder: ViewHolderOrderHistoryRestaurant, position: Int) {
+ val restaurantObject = orderedRestaurantList[position]
+ holder.txtRestaurantName.text = restaurantObject.restaurantName
+ var formatDate = restaurantObject.orderPlacedAt
+ formatDate = formatDate.replace("-", "/") //01-01-20 to 01/01/20
+ formatDate = formatDate.substring(0, 6) + "20" + formatDate.substring(
+ 6,
+ 8
+ ) //01/01/20 to 01/01/2020
+ holder.txtDate.text = formatDate
+
+ val layoutManager = LinearLayoutManager(context)
+ var orderedItemAdapter: CartAdapter
+
+ if (ConnectionManager().checkConnectivity(context)) {
+ try {
+ val orderItemsPerRestaurant = ArrayList()
+ val sharedPreferences = context.getSharedPreferences(
+ context.getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ val userId = sharedPreferences.getString("user_id", "0")
+
+ val queue = Volley.newRequestQueue(context)
+ val url = "http://13.235.250.119/v2/orders/fetch_result/${userId}"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ val data = responseJsonObjectData.getJSONArray("data")
+ val fetchedRestaurantJSONObject = data.getJSONObject(position)
+ orderItemsPerRestaurant.clear()
+
+ val foodOrderedJsonArray =
+ fetchedRestaurantJSONObject.getJSONArray("food_items")
+
+ for (j in 0 until foodOrderedJsonArray.length()) {
+ val eachFoodItem = foodOrderedJsonArray.getJSONObject(j)
+ val itemObject = CartItems(
+ eachFoodItem.getString("food_item_id"),
+ eachFoodItem.getString("name"),
+ eachFoodItem.getString("cost"),
+ "000"
+ )
+ orderItemsPerRestaurant.add(itemObject)
+ }
+
+ orderedItemAdapter = CartAdapter(
+ context,
+ orderItemsPerRestaurant
+ )
+
+ holder.recyclerViewItemsOrdered.adapter = orderedItemAdapter
+ holder.recyclerViewItemsOrdered.layoutManager = layoutManager
+ }
+ },
+ Response.ErrorListener
+ {
+ Toast.makeText(
+ context,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }) {
+
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ context,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/adapter/RestaurantMenuAdapter.kt b/app/src/main/java/com/kartikey/foodrunner/adapter/RestaurantMenuAdapter.kt
new file mode 100644
index 0000000..9d216e2
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/adapter/RestaurantMenuAdapter.kt
@@ -0,0 +1,107 @@
+package com.kartikey.foodrunner.adapter
+
+import android.content.Context
+import android.content.Intent
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.RelativeLayout
+import android.widget.TextView
+import androidx.recyclerview.widget.RecyclerView
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.activity.CartActivity
+import com.kartikey.foodrunner.model.RestaurantMenu
+
+class RestaurantMenuAdapter
+ (
+ val context: Context,
+ val restaurantId: String,
+ val restaurantName: String,
+ val proceedToCartPassed: RelativeLayout,
+ val btnProceedToCart: Button,
+ val restaurantMenu: ArrayList
+) : RecyclerView.Adapter() {
+
+ var itemSelectedCount: Int = 0
+ lateinit var proceedToCart: RelativeLayout
+
+ var itemsSelectedId = arrayListOf()
+
+ class ViewHolderRestaurantMenu(view: View) : RecyclerView.ViewHolder(view) {
+ val txtSerialNumber: TextView = view.findViewById(R.id.txtSerialName)
+ val txtItemName: TextView = view.findViewById(R.id.txtItemName)
+ val txtItemPrice: TextView = view.findViewById(R.id.txtItemPrice)
+ val btnAddToCart: Button = view.findViewById(R.id.btnAddToCart)
+ }
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolderRestaurantMenu {
+ val view = LayoutInflater.from(parent.context)
+ .inflate(R.layout.restuarant_menu_recycler_view_single_row, parent, false)
+
+ return ViewHolderRestaurantMenu(view)
+ }
+
+ override fun getItemCount(): Int {
+ return restaurantMenu.size
+ }
+
+ fun getSelectedItemCount(): Int {
+ return itemSelectedCount
+ }
+
+ override fun onBindViewHolder(holder: ViewHolderRestaurantMenu, position: Int) {
+ val restaurantMenuItem = restaurantMenu[position]
+ proceedToCart = proceedToCartPassed//button view passed from the RestaurantMenuActivity
+
+ btnProceedToCart.setOnClickListener(View.OnClickListener
+ {
+ val intent = Intent(context, CartActivity::class.java)
+ intent.putExtra(
+ "restaurantId",
+ restaurantId.toString()
+ )
+
+ intent.putExtra("restaurantName", restaurantName)
+ intent.putExtra(
+ "selectedItemsId",
+ itemsSelectedId
+ )
+ context.startActivity(intent)
+
+ })
+
+ holder.btnAddToCart.setOnClickListener(View.OnClickListener
+ {
+ if (holder.btnAddToCart.text.toString().equals("Remove")) {
+ itemSelectedCount-- //item unselected
+
+ itemsSelectedId.remove(holder.btnAddToCart.getTag().toString())
+ holder.btnAddToCart.text = context.getString(R.string.add)
+ holder.btnAddToCart.setBackgroundResource(R.drawable.rounded_view_for_menu_red)
+
+ } else {
+
+ itemSelectedCount++ //item selected
+ itemsSelectedId.add(holder.btnAddToCart.getTag().toString())
+
+ holder.btnAddToCart.text = context.getString(R.string.remove)
+ holder.btnAddToCart.setBackgroundResource(R.drawable.rounded_view_for_menu_chosen)
+ }
+
+ if (itemSelectedCount > 0) {
+ proceedToCart.visibility = View.VISIBLE
+ } else {
+ proceedToCart.visibility = View.GONE
+ }
+
+ })
+
+ holder.btnAddToCart.setTag(restaurantMenuItem.id + "") //save the item id in textViewName Tag ,will be used to add to cart
+ holder.txtSerialNumber.text = (position + 1).toString() //position starts from 0
+ holder.txtItemName.text = restaurantMenuItem.name
+ holder.txtItemPrice.text = """Rs.${restaurantMenuItem.cost_for_one}"""
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDao.kt b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDao.kt
new file mode 100644
index 0000000..55b20ea
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDao.kt
@@ -0,0 +1,22 @@
+package com.kartikey.foodrunner.database
+
+import androidx.room.Dao
+import androidx.room.Delete
+import androidx.room.Insert
+import androidx.room.Query
+
+@Dao
+interface RestaurantDao {
+ @Insert
+ fun insertRestaurant(restaurantEntity: RestaurantEntity)
+
+ @Delete
+ fun deleteRestaurant(restaurantEntity: RestaurantEntity)
+
+ @Query("SELECT * FROM restaurants")
+ fun getAllRestaurants(): List
+
+ @Query("SELECT * FROM restaurants WHERE restaurant_id = :restaurantId")
+ fun getRestaurantById(restaurantId: String): RestaurantEntity
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDatabase.kt b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDatabase.kt
new file mode 100644
index 0000000..ea74f2b
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantDatabase.kt
@@ -0,0 +1,10 @@
+package com.kartikey.foodrunner.database
+
+import androidx.room.Database
+import androidx.room.RoomDatabase
+
+@Database(entities = [RestaurantEntity::class], version = 1)
+abstract class RestaurantDatabase : RoomDatabase() {
+ abstract fun restaurantDao(): RestaurantDao
+
+}
diff --git a/app/src/main/java/com/kartikey/foodrunner/database/RestaurantEntity.kt b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantEntity.kt
new file mode 100644
index 0000000..e92b08e
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/database/RestaurantEntity.kt
@@ -0,0 +1,12 @@
+package com.kartikey.foodrunner.database
+
+import androidx.room.ColumnInfo
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+
+@Entity(tableName = "restaurants")
+data class RestaurantEntity
+ (
+ @ColumnInfo(name = "restaurant_id") @PrimaryKey var restaurantId: String,
+ @ColumnInfo(name = "restaurant_name") var restaurantName: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/DashboardFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/DashboardFragment.kt
new file mode 100644
index 0000000..6101db3
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/DashboardFragment.kt
@@ -0,0 +1,264 @@
+package com.kartikey.foodrunner.fragment
+
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.provider.Settings
+import android.text.Editable
+import android.text.TextWatcher
+import android.view.*
+import android.widget.EditText
+import android.widget.RelativeLayout
+import androidx.fragment.app.Fragment
+import android.widget.Toast
+import androidx.core.app.ActivityCompat
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.adapter.DashboardFragmentAdapter
+import com.kartikey.foodrunner.model.Restaurant
+import com.kartikey.foodrunner.utils.ConnectionManager
+import kotlinx.android.synthetic.main.sort_radio_button.view.*
+import org.json.JSONException
+import java.util.*
+import kotlin.Comparator
+import kotlin.collections.HashMap
+
+
+class DashboardFragment(val contextParam: Context) : Fragment() {
+
+ lateinit var recyclerView: RecyclerView
+ lateinit var layoutManager: RecyclerView.LayoutManager
+ lateinit var dashboardAdapter: DashboardFragmentAdapter
+ lateinit var etSearch: EditText
+ lateinit var radioButtonView: View
+ lateinit var progressDialog: RelativeLayout
+ lateinit var rlNoRestaurantFound: RelativeLayout
+
+ var restaurantInfoList = arrayListOf()
+ var ratingComparator = Comparator
+ { rest1, rest2 ->
+
+ if (rest1.restaurantRating.compareTo(rest2.restaurantRating, true) == 0) {
+ rest1.restaurantName.compareTo(rest2.restaurantName, true)
+ } else {
+ rest1.restaurantRating.compareTo(rest2.restaurantRating, true)
+ }
+
+ }
+
+ var costComparator = Comparator
+ { rest1, rest2 ->
+ rest1.costForOne.compareTo(rest2.costForOne, true)
+ }
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+
+ setHasOptionsMenu(true)
+ val view = inflater.inflate(R.layout.fragment_dashboard, container, false)
+
+ layoutManager = LinearLayoutManager(activity)
+ recyclerView = view.findViewById(R.id.recyclerViewDashboard)
+ etSearch = view.findViewById(R.id.etSearch)
+ progressDialog = view.findViewById(R.id.dashboardProgressDialog)
+ rlNoRestaurantFound = view.findViewById(R.id.noRestaurantFound)
+
+ rlNoRestaurantFound.visibility = View.INVISIBLE
+
+ fun filterFun(strTyped: String) {
+ rlNoRestaurantFound.visibility = View.INVISIBLE
+ val filteredList = arrayListOf()
+ for (item in restaurantInfoList) {
+ if (item.restaurantName.toLowerCase(Locale.ROOT)
+ .contains(strTyped.toLowerCase(Locale.ROOT))
+ ) {
+ filteredList.add(item)
+ }
+ }
+ if (filteredList.size == 0) {
+ rlNoRestaurantFound.visibility = View.VISIBLE
+ }
+ dashboardAdapter.filterList(filteredList)
+ }
+
+ etSearch.addTextChangedListener(object : TextWatcher {
+ //as the user types the search filter is applied
+ override fun afterTextChanged(strTyped: Editable?) {
+ filterFun(strTyped.toString())
+ }
+
+ override fun beforeTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}
+ override fun onTextChanged(p0: CharSequence?, p1: Int, p2: Int, p3: Int) {}
+ }
+ )
+ return view
+
+ }
+
+ fun fetchData() {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ progressDialog.visibility = View.VISIBLE
+ try {
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/restaurants/fetch_result/"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ val data = responseJsonObjectData.getJSONArray("data")
+
+ for (i in 0 until data.length()) {
+ val restaurantJsonObject = data.getJSONObject(i)
+ val restaurantObject = Restaurant(
+ restaurantJsonObject.getString("id"),
+ restaurantJsonObject.getString("name"),
+ restaurantJsonObject.getString("rating"),
+ restaurantJsonObject.getString("cost_for_one"),
+ restaurantJsonObject.getString("image_url")
+ )
+ restaurantInfoList.add(restaurantObject)
+
+ dashboardAdapter = DashboardFragmentAdapter(
+ activity as Context,
+ restaurantInfoList
+ )
+ recyclerView.adapter = dashboardAdapter
+ recyclerView.layoutManager = layoutManager
+ }
+ }
+ progressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ progressDialog.visibility = View.GONE
+ Toast.makeText(
+ activity as Context,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ activity as Context,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ }
+ } else {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+
+ }
+
+ override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
+ inflater.inflate(R.menu.menu_dashboard, menu)
+ }
+
+ override fun onOptionsItemSelected(item: MenuItem): Boolean {
+ val id = item.itemId
+
+ when (id) {
+
+ R.id.sort -> {
+ radioButtonView = View.inflate(
+ contextParam,
+ R.layout.sort_radio_button,
+ null
+ ) //radiobutton view for sorting display
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("Sort By?")
+ alterDialog.setView(radioButtonView)
+ alterDialog.setPositiveButton("OK")
+ { _, _ ->
+ if (radioButtonView.radioHighToLow.isChecked) {
+ Collections.sort(restaurantInfoList, costComparator)
+ restaurantInfoList.reverse()
+ dashboardAdapter.notifyDataSetChanged() //update the adapter of changes
+ }
+ if (radioButtonView.radioLowToHigh.isChecked) {
+ Collections.sort(restaurantInfoList, costComparator)
+ dashboardAdapter.notifyDataSetChanged() //updates the adapter of changes
+ }
+ if (radioButtonView.radioRating.isChecked) {
+ Collections.sort(restaurantInfoList, ratingComparator)
+ restaurantInfoList.reverse()
+ dashboardAdapter.notifyDataSetChanged()
+ }
+ }
+ alterDialog.setNegativeButton("CANCEL")
+ { _, _ ->
+ //do nothing
+ }
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+ return super.onOptionsItemSelected(item)
+ }
+
+
+ override fun onResume() {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ if (restaurantInfoList.isEmpty())
+ fetchData()
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+ }
+}
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/FaqsFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/FaqsFragment.kt
new file mode 100644
index 0000000..bd5c8db
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/FaqsFragment.kt
@@ -0,0 +1,18 @@
+package com.kartikey.foodrunner.fragment
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.kartikey.foodrunner.R
+
+class FaqsFragment : Fragment() {
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ return inflater.inflate(R.layout.fragment_faqs, container, false)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/FavouriteRestaurantFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/FavouriteRestaurantFragment.kt
new file mode 100644
index 0000000..03e4614
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/FavouriteRestaurantFragment.kt
@@ -0,0 +1,207 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.AsyncTask
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.core.app.ActivityCompat
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import androidx.room.Room
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.adapter.DashboardFragmentAdapter
+import com.kartikey.foodrunner.database.RestaurantDatabase
+import com.kartikey.foodrunner.database.RestaurantEntity
+import com.kartikey.foodrunner.model.Restaurant
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+
+
+class FavouriteRestaurantFragment(val contextParam: Context) : Fragment() {
+
+ lateinit var recyclerView: RecyclerView
+ lateinit var layoutManager: RecyclerView.LayoutManager
+ lateinit var favouriteAdapter: DashboardFragmentAdapter
+ lateinit var progressDialog: RelativeLayout
+ lateinit var noFavouritesLayout: RelativeLayout
+
+ var restaurantInfoList = arrayListOf()
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val view = inflater.inflate(R.layout.fragment_favourite_restaurant, container, false)
+
+ layoutManager = LinearLayoutManager(activity)
+ recyclerView = view.findViewById(R.id.recyclerViewFavouriteRestaurant)
+ progressDialog = view.findViewById(R.id.favouriteRestaurantProgressDialog)
+ noFavouritesLayout = view.findViewById(R.id.noFavouriteRestaurantsLayout)
+
+ return view
+ }
+
+ fun fetchData() {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+
+ progressDialog.visibility = View.VISIBLE
+ noFavouritesLayout.visibility = View.INVISIBLE
+ try {
+
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/restaurants/fetch_result/"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+
+ restaurantInfoList.clear()
+ val data = responseJsonObjectData.getJSONArray("data")
+
+ for (i in 0 until data.length()) {
+ val restaurantJsonObject = data.getJSONObject(i)
+ val restaurantEntity = RestaurantEntity(
+ restaurantJsonObject.getString("id"),
+ restaurantJsonObject.getString("name")
+ )
+
+ if (DBAsynTask(contextParam, restaurantEntity, 1).execute().get()) {
+ val restaurantObject = Restaurant(
+ restaurantJsonObject.getString("id"),
+ restaurantJsonObject.getString("name"),
+ restaurantJsonObject.getString("rating"),
+ restaurantJsonObject.getString("cost_for_one"),
+ restaurantJsonObject.getString("image_url")
+ )
+
+ restaurantInfoList.add(restaurantObject)
+ favouriteAdapter = DashboardFragmentAdapter(
+ activity as Context,
+ restaurantInfoList
+ )
+
+ recyclerView.adapter = favouriteAdapter
+ recyclerView.layoutManager = layoutManager
+ }
+ }
+ //Edge case. No items found
+ if (restaurantInfoList.size == 0) {
+ noFavouritesLayout.visibility = View.VISIBLE
+ }
+ }
+ progressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener {
+ Toast.makeText(
+ activity as Context,
+ "mSome Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ progressDialog.visibility = View.GONE
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ activity as Context,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ )
+ .show()
+ }
+ } else {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+
+ }
+
+ class DBAsynTask(val context: Context, val restaurantEntity: RestaurantEntity, val mode: Int) :
+ AsyncTask() {
+ val db =
+ Room.databaseBuilder(context, RestaurantDatabase::class.java, "restaurant-db").build()
+
+ override fun doInBackground(vararg p0: Void?): Boolean {
+ /*
+ * Mode 1-> check if restaurant is in favourites
+ * Mode 2-> Save the restaurant into DB as favourites
+ * Mode 3-> Remove the favourite restaurant
+ */
+ when (mode) {
+ 1 -> {
+ val restaurant: RestaurantEntity? = db.restaurantDao()
+ .getRestaurantById(restaurantEntity.restaurantId)
+ db.close()
+ return restaurant != null
+ }
+ else ->
+ return false
+
+ }
+ }
+ }
+
+ override fun onResume() {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ fetchData()
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordFragment.kt
new file mode 100644
index 0000000..146b228
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordFragment.kt
@@ -0,0 +1,191 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.EditText
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.core.app.ActivityCompat
+
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+import org.json.JSONObject
+
+
+class ForgotPasswordFragment(val contextParam: Context, val mobile_number: String) : Fragment() {
+
+ lateinit var etOTP: EditText
+ lateinit var etNewPassword: EditText
+ lateinit var etConfirmForgotPassword: EditText
+ lateinit var forgotPasswordProgressDialog: RelativeLayout
+ lateinit var btnSubmit: Button
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val view = inflater.inflate(R.layout.fragment_forgot_password, container, false)
+
+ etOTP = view.findViewById(R.id.etOTP)
+ etNewPassword = view.findViewById(R.id.etNewPassword)
+ etConfirmForgotPassword = view.findViewById(R.id.etConfirmForgotPassword)
+ btnSubmit = view.findViewById(R.id.btnSubmit)
+ forgotPasswordProgressDialog = view.findViewById(R.id.forgotPasswordProgressDialog)
+
+ btnSubmit.setOnClickListener(View.OnClickListener
+ {
+ if (etOTP.text.isBlank()) {
+ etOTP.setError("OTP missing")
+ } else {
+ if (etNewPassword.text.isBlank()) {
+ etNewPassword.setError("Password Missing")
+ } else {
+ if (etConfirmForgotPassword.text.isBlank()) {
+ etConfirmForgotPassword.setError("Confirm Password Missing")
+ } else {
+ if ((etNewPassword.text.toString()
+ .toInt() == etConfirmForgotPassword.text.toString().toInt())
+ ) {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ forgotPasswordProgressDialog.visibility = View.VISIBLE
+
+ try {
+ val loginUser = JSONObject()
+
+ loginUser.put("mobile_number", mobile_number)
+ loginUser.put("password", etNewPassword.text.toString())
+ loginUser.put("otp", etOTP.text.toString())
+
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/reset_password/fetch_result"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.POST,
+ url,
+ loginUser,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success =
+ responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ val serverMessage =
+ responseJsonObjectData.getString("successMessage")
+
+ Toast.makeText(
+ contextParam,
+ serverMessage,
+ Toast.LENGTH_SHORT
+ ).show()
+
+ passwordChanged()
+ } else {
+ val responseMessageServer =
+ responseJsonObjectData.getString("errorMessage")
+ Toast.makeText(
+ contextParam,
+ responseMessageServer.toString(),
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ forgotPasswordProgressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ forgotPasswordProgressDialog.visibility = View.GONE
+ Toast.makeText(
+ contextParam,
+ "mSome Error occurred!!!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+ } catch (e: JSONException) {
+ Toast.makeText(
+ contextParam,
+ "Some unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ } else {
+ val alterDialog =
+ androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.create()
+ alterDialog.show()
+ }
+ } else {
+ etConfirmForgotPassword.setError("Passwords don't match")
+ }
+ }
+ }
+ }
+
+ })
+
+ return view
+ }
+
+ fun passwordChanged() {
+ val transaction = fragmentManager?.beginTransaction()
+ transaction?.replace(
+ R.id.frameLayout,
+ LoginFragment(contextParam)
+ )
+ transaction?.commit()
+ }
+
+ override fun onResume() {
+
+ if (!ConnectionManager().checkConnectivity(activity as Context)) {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordInputFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordInputFragment.kt
new file mode 100644
index 0000000..fe21765
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/ForgotPasswordInputFragment.kt
@@ -0,0 +1,201 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.EditText
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.core.app.ActivityCompat
+
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+import org.json.JSONObject
+
+
+class ForgotPasswordInputFragment(val contextParam: Context) : Fragment() {
+
+ lateinit var etMobileNumber: EditText
+ lateinit var etEmail: EditText
+ lateinit var btnNext: Button
+ lateinit var progressDialog: RelativeLayout
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val view = inflater.inflate(R.layout.fragment_forgot_password_input, container, false)
+
+ etMobileNumber = view.findViewById(R.id.etMobileNumber)
+ etEmail = view.findViewById(R.id.etEmail)
+ btnNext = view.findViewById(R.id.btnNext)
+ progressDialog = view.findViewById(R.id.forgotPasswordInputProgressDialog)
+
+ btnNext.setOnClickListener(View.OnClickListener
+ {
+
+ if (etMobileNumber.text.isBlank()) {
+ etMobileNumber.setError("Mobile Number Missing")
+ } else {
+ if (etEmail.text.isBlank()) {
+ etEmail.setError("Email Missing")
+ } else {
+
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ try {
+ val loginUser = JSONObject()
+
+ loginUser.put("mobile_number", etMobileNumber.text)
+ loginUser.put("email", etEmail.text)
+
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/forgot_password/fetch_result/"
+
+ progressDialog.visibility = View.VISIBLE
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.POST,
+ url,
+ loginUser,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ val firstTry =
+ responseJsonObjectData.getBoolean("first_try")
+
+ if (firstTry) {
+ Toast.makeText(
+ contextParam,
+ "OTP sent",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ callChangePasswordFragment()
+
+ } else {
+ Toast.makeText(
+ contextParam,
+ "OTP sent already",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ callChangePasswordFragment()
+ }
+
+ } else {
+ val responseMessageServer =
+ responseJsonObjectData.getString("errorMessage")
+ Toast.makeText(
+ contextParam,
+ responseMessageServer.toString(),
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }
+ progressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ println(it)
+ Toast.makeText(
+ context,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+
+ progressDialog.visibility = View.GONE
+
+ }) {
+
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ contextParam,
+ "Some unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ } else {
+ val alterDialog =
+ androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+ }
+ })
+
+ return view
+ }
+
+ fun callChangePasswordFragment() {
+ val transaction = fragmentManager?.beginTransaction()
+
+ transaction?.replace(
+ R.id.frameLayout,
+ ForgotPasswordFragment(contextParam, etMobileNumber.text.toString())
+ )
+ transaction?.commit()
+ }
+
+
+ override fun onResume() {
+ if (!ConnectionManager().checkConnectivity(activity as Context)) {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+
+ }
+
+ super.onResume()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/LoginFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/LoginFragment.kt
new file mode 100644
index 0000000..02d0bee
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/LoginFragment.kt
@@ -0,0 +1,238 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.graphics.Paint
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.*
+import androidx.core.app.ActivityCompat
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.activity.DashboardActivity
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+import org.json.JSONObject
+
+
+class LoginFragment(val contextParam: Context) : Fragment() {
+ lateinit var txtSignUp: TextView
+ lateinit var etMobileNumber: EditText
+ lateinit var etPassword: EditText
+ lateinit var txtForgotPassword: TextView
+ lateinit var btnLogin: Button
+ lateinit var loginProgressDialog: RelativeLayout
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ val view = inflater.inflate(R.layout.fragment_login, container, false)
+
+ etMobileNumber = view.findViewById(R.id.etMobileNumber)
+ etPassword = view.findViewById(R.id.etPassword)
+ txtForgotPassword = view.findViewById(R.id.txtForgotPassword)
+ txtSignUp = view.findViewById(R.id.txtSignUp)
+ btnLogin = view.findViewById(R.id.btnLogin)
+ loginProgressDialog = view.findViewById(R.id.loginProgressDialog)
+
+ loginProgressDialog.visibility = View.GONE
+
+ //under line text
+ txtForgotPassword.paintFlags = Paint.UNDERLINE_TEXT_FLAG
+ txtSignUp.paintFlags = Paint.UNDERLINE_TEXT_FLAG
+
+ txtForgotPassword.setOnClickListener {
+ openForgotPasswordInputFragment()
+ }
+
+ txtSignUp.setOnClickListener {
+ openRegisterFragment()
+ }
+
+ btnLogin.setOnClickListener {
+
+ btnLogin.visibility = View.GONE
+
+ if (etMobileNumber.text.isBlank()) {
+ etMobileNumber.setError("Mobile Number Missing")
+ btnLogin.visibility = View.VISIBLE
+ } else {
+ if (etPassword.text.isBlank()) {
+ btnLogin.visibility = View.VISIBLE
+ etPassword.setError("Missing Password")
+ } else {
+ loginUserFun()
+ }
+ }
+ }
+ return view
+ }
+
+ fun openForgotPasswordInputFragment() {
+ val transaction = fragmentManager?.beginTransaction()
+ transaction?.replace(
+ R.id.frameLayout,
+ ForgotPasswordInputFragment(contextParam)
+ )
+ transaction?.commit()//apply changes
+ }
+
+
+ fun openRegisterFragment() {
+ val transaction = fragmentManager?.beginTransaction()
+ transaction?.replace(
+ R.id.frameLayout,
+ RegisterFragment(contextParam)
+ )
+ transaction?.commit()
+ }
+
+
+ fun loginUserFun() {
+ val sharedPreferencess = contextParam.getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ loginProgressDialog.visibility = View.VISIBLE
+ try {
+ val loginUser = JSONObject()
+ loginUser.put("mobile_number", etMobileNumber.text)
+ loginUser.put("password", etPassword.text)
+
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/login/fetch_result/"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.POST,
+ url,
+ loginUser,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+
+ if (success) {
+ val data = responseJsonObjectData.getJSONObject("data")
+ sharedPreferencess.edit().putBoolean("user_logged_in", true).apply()
+ sharedPreferencess.edit()
+ .putString("user_id", data.getString("user_id")).apply()
+ sharedPreferencess.edit().putString("name", data.getString("name"))
+ .apply()
+ sharedPreferencess.edit().putString("email", data.getString("email"))
+ .apply()
+ sharedPreferencess.edit()
+ .putString("mobile_number", data.getString("mobile_number")).apply()
+ sharedPreferencess.edit()
+ .putString("address", data.getString("address")).apply()
+
+ Toast.makeText(
+ contextParam,
+ "Welcome " + data.getString("name"),
+ Toast.LENGTH_LONG
+ ).show()
+
+ userSuccessfullyLoggedIn()
+
+ } else {
+ btnLogin.visibility = View.VISIBLE
+
+ val responseMessageServer =
+ responseJsonObjectData.getString("errorMessage")
+ Toast.makeText(
+ contextParam,
+ responseMessageServer.toString(),
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ loginProgressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ println(it)
+ btnLogin.visibility = View.VISIBLE
+ loginProgressDialog.visibility = View.GONE
+
+ Toast.makeText(
+ contextParam,
+ "Some Error occurred!!!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ btnLogin.visibility = View.VISIBLE
+ Toast.makeText(
+ contextParam,
+ "Some unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ } else {
+ btnLogin.visibility = View.VISIBLE
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+
+ fun userSuccessfullyLoggedIn() {
+ val intent = Intent(activity as Context, DashboardActivity::class.java)
+ startActivity(intent)
+ activity?.finish();
+ }
+
+ override fun onResume() {
+ if (!ConnectionManager().checkConnectivity(activity as Context)) {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/OrderHistoryFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/OrderHistoryFragment.kt
new file mode 100644
index 0000000..7c79e42
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/OrderHistoryFragment.kt
@@ -0,0 +1,186 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.LinearLayout
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.core.app.ActivityCompat.finishAffinity
+import androidx.recyclerview.widget.LinearLayoutManager
+import androidx.recyclerview.widget.RecyclerView
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.adapter.OrderHistoryAdapter
+import com.kartikey.foodrunner.model.OrderHistoryRestaurant
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+
+
+class OrderHistoryFragment : Fragment() {
+
+ lateinit var layoutManager: RecyclerView.LayoutManager
+ lateinit var menuAdapter: OrderHistoryAdapter
+ lateinit var recyclerViewAllOrders: RecyclerView
+ lateinit var orderHistoryProgressDialog: RelativeLayout
+ lateinit var orderHistoryNoOrders: RelativeLayout
+ lateinit var orderHistoryDefaultOrders: LinearLayout
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+ // Inflate the layout for this fragment
+ val view = inflater.inflate(R.layout.fragment_order_history, container, false)
+
+ recyclerViewAllOrders = view.findViewById(R.id.recyclerViewAllOrders)
+ orderHistoryProgressDialog = view.findViewById(R.id.orderHistoryProgressLayout)
+ orderHistoryNoOrders = view.findViewById(R.id.orderHistoryNoOrders)
+ orderHistoryDefaultOrders = view.findViewById(R.id.linearLayoutOrder)
+
+ return view
+ }
+
+ fun setItemsForEachRestaurant() {
+ layoutManager = LinearLayoutManager(activity)
+
+ val orderedRestaurantList = ArrayList()
+ val sharedPreferences = activity?.getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+ val userId = sharedPreferences?.getString("user_id", "000")
+
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ orderHistoryProgressDialog.visibility = View.VISIBLE
+
+ try {
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/orders/fetch_result/${userId}"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.GET,
+ url,
+ null,
+ Response.Listener
+ {
+
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+ val data = responseJsonObjectData.getJSONArray("data")
+
+ //Edge Case. No orders present
+ if (data.length() == 0) {
+ orderHistoryNoOrders.visibility = View.VISIBLE
+ orderHistoryDefaultOrders.visibility = View.INVISIBLE
+ } else {
+ orderHistoryNoOrders.visibility = View.GONE
+
+ for (i in 0 until data.length()) {
+ val restaurantItemJsonObject = data.getJSONObject(i)
+
+ val eachRestaurantObject = OrderHistoryRestaurant(
+ restaurantItemJsonObject.getString("order_id"),
+ restaurantItemJsonObject.getString("restaurant_name"),
+ restaurantItemJsonObject.getString("total_cost"),
+ restaurantItemJsonObject.getString("order_placed_at")
+ .substring(0, 10)
+ )
+
+ orderedRestaurantList.add(eachRestaurantObject)
+ menuAdapter = OrderHistoryAdapter(
+ activity as Context,
+ orderedRestaurantList
+ )
+ recyclerViewAllOrders.adapter = menuAdapter
+ recyclerViewAllOrders.layoutManager = layoutManager
+
+ }
+ }
+ }
+ orderHistoryProgressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ orderHistoryProgressDialog.visibility = View.GONE
+
+ Toast.makeText(
+ activity,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ context,
+ "Some Unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+
+ override fun onResume() {
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ setItemsForEachRestaurant()
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/ProfileFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/ProfileFragment.kt
new file mode 100644
index 0000000..7b8c8bf
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/ProfileFragment.kt
@@ -0,0 +1,43 @@
+package com.kartikey.foodrunner.fragment
+
+import android.content.Context
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.TextView
+import com.kartikey.foodrunner.R
+
+class ProfileFragment(val contextParam: Context) : Fragment() {
+
+ lateinit var txtName: TextView
+ lateinit var txtEmail: TextView
+ lateinit var txtMobileNumber: TextView
+ lateinit var txtAddress: TextView
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+
+ val view = inflater.inflate(R.layout.fragment_profile, container, false)
+
+ txtName = view.findViewById(R.id.txtName)
+ txtEmail = view.findViewById(R.id.txtEmail)
+ txtMobileNumber = view.findViewById(R.id.txtMobileNumber)
+ txtAddress = view.findViewById(R.id.txtAddress)
+
+ val sharedPreferences = contextParam.getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ txtName.text = sharedPreferences.getString("name", "")
+ txtEmail.text = sharedPreferences.getString("email", "")
+ txtMobileNumber.text = "+91-" + sharedPreferences.getString("mobile_number", "")
+ txtAddress.text = sharedPreferences.getString("address", "")
+
+ return view
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/fragment/RegisterFragment.kt b/app/src/main/java/com/kartikey/foodrunner/fragment/RegisterFragment.kt
new file mode 100644
index 0000000..ffb04a7
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/fragment/RegisterFragment.kt
@@ -0,0 +1,249 @@
+package com.kartikey.foodrunner.fragment
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.os.Bundle
+import android.provider.Settings
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.widget.Button
+import android.widget.EditText
+import android.widget.RelativeLayout
+import android.widget.Toast
+import androidx.appcompat.app.AppCompatActivity
+import androidx.appcompat.widget.Toolbar
+import androidx.core.app.ActivityCompat
+import com.android.volley.Request
+import com.android.volley.Response
+import com.android.volley.toolbox.JsonObjectRequest
+import com.android.volley.toolbox.Volley
+import com.kartikey.foodrunner.R
+import com.kartikey.foodrunner.activity.DashboardActivity
+import com.kartikey.foodrunner.utils.ConnectionManager
+import org.json.JSONException
+import org.json.JSONObject
+
+
+class RegisterFragment(val contextParam: Context) : Fragment() {
+
+ lateinit var etName: EditText
+ lateinit var etEmail: EditText
+ lateinit var etMobileNumber: EditText
+ lateinit var etDeliveryAddress: EditText
+ lateinit var etPassword: EditText
+ lateinit var etConfirmPassword: EditText
+ lateinit var btnRegister: Button
+ lateinit var registerProgressDialog: RelativeLayout
+
+ override fun onCreateView(
+ inflater: LayoutInflater, container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View? {
+
+ val view = inflater.inflate(R.layout.fragment_register, container, false)
+
+ etName = view.findViewById(R.id.etName)
+ etEmail = view.findViewById(R.id.etEmail)
+ etMobileNumber = view.findViewById(R.id.etMobileNumber)
+ etDeliveryAddress = view.findViewById(R.id.etDeliveryAddress)
+ etPassword = view.findViewById(R.id.etPassword)
+ etConfirmPassword = view.findViewById(R.id.etConfirmPassword)
+ btnRegister = view.findViewById(R.id.btnSubmit)
+ registerProgressDialog = view.findViewById(R.id.registerProgressdialog)
+
+ btnRegister.setOnClickListener {
+ registerUserFun()
+ }
+ return view
+ }
+
+ fun userSuccessfullyRegistered() {
+ openDashBoard()
+ }
+
+ fun openDashBoard() {
+ val intent = Intent(activity as Context, DashboardActivity::class.java)
+ startActivity(intent)
+ activity?.finish();
+ }
+
+ fun registerUserFun() {
+ val sharedPreferences = contextParam.getSharedPreferences(
+ getString(R.string.shared_preferences),
+ Context.MODE_PRIVATE
+ )
+
+ sharedPreferences.edit().putBoolean("user_logged_in", false).apply()
+
+ if (ConnectionManager().checkConnectivity(activity as Context)) {
+ if (checkForErrors()) {
+ registerProgressDialog.visibility = View.VISIBLE
+ try {
+ val registerUser = JSONObject()
+ registerUser.put("name", etName.text)
+ registerUser.put("mobile_number", etMobileNumber.text)
+ registerUser.put("password", etPassword.text)
+ registerUser.put("address", etDeliveryAddress.text)
+ registerUser.put("email", etEmail.text)
+
+ val queue = Volley.newRequestQueue(activity as Context)
+ val url = "http://13.235.250.119/v2/register/fetch_result"
+
+ val jsonObjectRequest = object : JsonObjectRequest(
+ Request.Method.POST,
+ url,
+ registerUser,
+ Response.Listener
+ {
+ val responseJsonObjectData = it.getJSONObject("data")
+ val success = responseJsonObjectData.getBoolean("success")
+
+ if (success) {
+
+ val data = responseJsonObjectData.getJSONObject("data")
+ sharedPreferences.edit()
+ .putBoolean("user_logged_in", true).apply()
+ sharedPreferences.edit()
+ .putString("user_id", data.getString("user_id")).apply()
+ sharedPreferences.edit().putString("name", data.getString("name"))
+ .apply()
+ sharedPreferences.edit().putString("email", data.getString("email"))
+ .apply()
+ sharedPreferences.edit()
+ .putString("mobile_number", data.getString("mobile_number"))
+ .apply()
+ sharedPreferences.edit()
+ .putString("address", data.getString("address")).apply()
+
+ Toast.makeText(
+ contextParam,
+ "Registered successfully",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ userSuccessfullyRegistered()
+
+ } else {
+ val responseMessageServer =
+ responseJsonObjectData.getString("errorMessage")
+ Toast.makeText(
+ contextParam,
+ responseMessageServer.toString(),
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ registerProgressDialog.visibility = View.GONE
+ },
+ Response.ErrorListener
+ {
+ registerProgressDialog.visibility = View.GONE
+ Toast.makeText(
+ contextParam,
+ "Some Error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+
+ }) {
+ override fun getHeaders(): MutableMap {
+ val headers = HashMap()
+ headers["Content-type"] = "application/json"
+ headers["token"] = "13714ab03e5a4d"
+ return headers
+ }
+ }
+ queue.add(jsonObjectRequest)
+
+ } catch (e: JSONException) {
+ Toast.makeText(
+ contextParam,
+ "Some unexpected error occurred!",
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ }
+ } else {
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.create()
+ alterDialog.show()
+ }
+ }
+
+ fun checkForErrors(): Boolean {
+ //errorPassCount determines if there are any errors or not
+ var errorPassCount = 0
+ if (etName.text.isBlank()) {
+ etName.error = "Field Missing!"
+ } else {
+ errorPassCount++
+ }
+ if (etMobileNumber.text.isBlank()) {
+ etMobileNumber.error = "Field Missing!"
+ } else {
+ errorPassCount++
+ }
+ if (etEmail.text.isBlank()) {
+ etEmail.error = "Field Missing!"
+ } else {
+ errorPassCount++
+ }
+ if (etDeliveryAddress.text.isBlank()) {
+ etDeliveryAddress.setError("Field Missing!")
+ } else {
+ errorPassCount++
+ }
+ if (etConfirmPassword.text.isBlank()) {
+ etConfirmPassword.setError("Field Missing!")
+ } else {
+ errorPassCount++
+ }
+ if (etPassword.text.isBlank()) {
+ etPassword.setError("Field Missing!")
+ } else {
+ errorPassCount++
+ }
+ if (etPassword.text.isNotBlank() && etConfirmPassword.text.isNotBlank()) {
+ if (etPassword.text.toString().toInt() == etConfirmPassword.text.toString().toInt()) {
+ errorPassCount++
+ } else {
+ etConfirmPassword.setError("Confirmed Password doesn't match")
+ }
+ }
+ return errorPassCount == 7
+ }
+
+ override fun onResume() {
+ if (!ConnectionManager().checkConnectivity(activity as Context)) {
+
+ val alterDialog = androidx.appcompat.app.AlertDialog.Builder(activity as Context)
+ alterDialog.setTitle("No Internet")
+ alterDialog.setMessage("Internet Connection can't be established!")
+ alterDialog.setPositiveButton("Open Settings")
+ { _, _ ->
+ val settingsIntent = Intent(Settings.ACTION_SETTINGS)
+ startActivity(settingsIntent)
+ }
+ alterDialog.setNegativeButton("Exit")
+ { _, _ ->
+ ActivityCompat.finishAffinity(activity as Activity)
+ }
+ alterDialog.setCancelable(false)
+ alterDialog.create()
+ alterDialog.show()
+ }
+ super.onResume()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/model/CartItems.kt b/app/src/main/java/com/kartikey/foodrunner/model/CartItems.kt
new file mode 100644
index 0000000..70dd71f
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/model/CartItems.kt
@@ -0,0 +1,9 @@
+package com.kartikey.foodrunner.model
+
+data class CartItems
+ (
+ var itemId: String,
+ var itemName: String,
+ var itemPrice: String,
+ var restaurantId: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/model/OrderHistoryRestaurant.kt b/app/src/main/java/com/kartikey/foodrunner/model/OrderHistoryRestaurant.kt
new file mode 100644
index 0000000..a145a80
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/model/OrderHistoryRestaurant.kt
@@ -0,0 +1,9 @@
+package com.kartikey.foodrunner.model
+
+data class OrderHistoryRestaurant
+ (
+ var orderId: String,
+ var restaurantName: String,
+ var totalCost: String,
+ var orderPlacedAt: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/model/Restaurant.kt b/app/src/main/java/com/kartikey/foodrunner/model/Restaurant.kt
new file mode 100644
index 0000000..6adaa29
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/model/Restaurant.kt
@@ -0,0 +1,10 @@
+package com.kartikey.foodrunner.model
+
+data class Restaurant
+ (
+ var restaurantId: String,
+ var restaurantName: String,
+ var restaurantRating: String,
+ var costForOne: String,
+ var restaurantImage: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/model/RestaurantMenu.kt b/app/src/main/java/com/kartikey/foodrunner/model/RestaurantMenu.kt
new file mode 100644
index 0000000..30e336a
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/model/RestaurantMenu.kt
@@ -0,0 +1,8 @@
+package com.kartikey.foodrunner.model
+
+data class RestaurantMenu
+ (
+ var id: String,
+ var name: String,
+ var cost_for_one: String
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/kartikey/foodrunner/utils/ConnectionManager.kt b/app/src/main/java/com/kartikey/foodrunner/utils/ConnectionManager.kt
new file mode 100644
index 0000000..6a034f2
--- /dev/null
+++ b/app/src/main/java/com/kartikey/foodrunner/utils/ConnectionManager.kt
@@ -0,0 +1,21 @@
+package com.kartikey.foodrunner.utils
+
+import android.content.Context
+import android.net.ConnectivityManager
+import android.net.NetworkInfo
+
+class ConnectionManager {
+
+ fun checkConnectivity(context: Context): Boolean {
+
+ val connectivityManager =
+ context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
+ val activeNetwork: NetworkInfo? = connectivityManager.activeNetworkInfo
+
+ if (activeNetwork?.isConnected !== null) {
+ return activeNetwork.isConnected
+ } else {
+ return false
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-anydpi/ic_default_image_restaurant.xml b/app/src/main/res/drawable-anydpi/ic_default_image_restaurant.xml
new file mode 100644
index 0000000..6aaa315
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_default_image_restaurant.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_fav_fill.xml b/app/src/main/res/drawable-anydpi/ic_fav_fill.xml
new file mode 100644
index 0000000..c3ab836
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_fav_fill.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_fav_outline.xml b/app/src/main/res/drawable-anydpi/ic_fav_outline.xml
new file mode 100644
index 0000000..d2f6b39
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_fav_outline.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_cart.xml b/app/src/main/res/drawable-anydpi/ic_icon_cart.xml
new file mode 100644
index 0000000..056088a
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_cart.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_email.xml b/app/src/main/res/drawable-anydpi/ic_icon_email.xml
new file mode 100644
index 0000000..8e64dcc
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_email.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_favourite.xml b/app/src/main/res/drawable-anydpi/ic_icon_favourite.xml
new file mode 100644
index 0000000..2cecffe
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_favourite.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_home.xml b/app/src/main/res/drawable-anydpi/ic_icon_home.xml
new file mode 100644
index 0000000..a5c6a23
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_home.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_location.xml b/app/src/main/res/drawable-anydpi/ic_icon_location.xml
new file mode 100644
index 0000000..7a45625
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_location.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_logout.xml b/app/src/main/res/drawable-anydpi/ic_icon_logout.xml
new file mode 100644
index 0000000..c0ce723
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_logout.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_mobile.xml b/app/src/main/res/drawable-anydpi/ic_icon_mobile.xml
new file mode 100644
index 0000000..7887370
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_mobile.xml
@@ -0,0 +1,11 @@
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_order_history.xml b/app/src/main/res/drawable-anydpi/ic_icon_order_history.xml
new file mode 100644
index 0000000..3702ba5
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_order_history.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_password.xml b/app/src/main/res/drawable-anydpi/ic_icon_password.xml
new file mode 100644
index 0000000..01e838a
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_password.xml
@@ -0,0 +1,11 @@
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_person.xml b/app/src/main/res/drawable-anydpi/ic_icon_person.xml
new file mode 100644
index 0000000..b7c595e
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_person.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_icon_person_filled.xml b/app/src/main/res/drawable-anydpi/ic_icon_person_filled.xml
new file mode 100644
index 0000000..38b9c74
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_icon_person_filled.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_menu.xml b/app/src/main/res/drawable-anydpi/ic_menu.xml
new file mode 100644
index 0000000..6783379
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_menu.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_search.xml b/app/src/main/res/drawable-anydpi/ic_search.xml
new file mode 100644
index 0000000..22f20e5
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_search.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-anydpi/ic_white_back_arrow.xml b/app/src/main/res/drawable-anydpi/ic_white_back_arrow.xml
new file mode 100644
index 0000000..3a26503
--- /dev/null
+++ b/app/src/main/res/drawable-anydpi/ic_white_back_arrow.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
diff --git a/app/src/main/res/drawable-hdpi/ic_default_image_restaurant.png b/app/src/main/res/drawable-hdpi/ic_default_image_restaurant.png
new file mode 100644
index 0000000..3fffd75
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_default_image_restaurant.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_fav_fill.png b/app/src/main/res/drawable-hdpi/ic_fav_fill.png
new file mode 100644
index 0000000..1242901
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_fav_fill.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_fav_outline.png b/app/src/main/res/drawable-hdpi/ic_fav_outline.png
new file mode 100644
index 0000000..019260d
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_fav_outline.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_cart.png b/app/src/main/res/drawable-hdpi/ic_icon_cart.png
new file mode 100644
index 0000000..0b96f28
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_cart.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_email.png b/app/src/main/res/drawable-hdpi/ic_icon_email.png
new file mode 100644
index 0000000..1e4f1ce
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_email.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_faqs.png b/app/src/main/res/drawable-hdpi/ic_icon_faqs.png
new file mode 100644
index 0000000..18bdeac
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_faqs.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_favourite.png b/app/src/main/res/drawable-hdpi/ic_icon_favourite.png
new file mode 100644
index 0000000..89f0276
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_favourite.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_home.png b/app/src/main/res/drawable-hdpi/ic_icon_home.png
new file mode 100644
index 0000000..67d102b
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_home.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_location.png b/app/src/main/res/drawable-hdpi/ic_icon_location.png
new file mode 100644
index 0000000..8adcffa
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_location.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_logout.png b/app/src/main/res/drawable-hdpi/ic_icon_logout.png
new file mode 100644
index 0000000..1e38ca2
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_logout.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_mobile.png b/app/src/main/res/drawable-hdpi/ic_icon_mobile.png
new file mode 100644
index 0000000..5399f10
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_mobile.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_order_history.png b/app/src/main/res/drawable-hdpi/ic_icon_order_history.png
new file mode 100644
index 0000000..59186c5
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_order_history.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_password.png b/app/src/main/res/drawable-hdpi/ic_icon_password.png
new file mode 100644
index 0000000..13254d1
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_password.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_person.png b/app/src/main/res/drawable-hdpi/ic_icon_person.png
new file mode 100644
index 0000000..5f6efcd
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_person.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_icon_person_filled.png b/app/src/main/res/drawable-hdpi/ic_icon_person_filled.png
new file mode 100644
index 0000000..dd5139b
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_icon_person_filled.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_menu.png b/app/src/main/res/drawable-hdpi/ic_menu.png
new file mode 100644
index 0000000..d771ec2
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_menu.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_rating_star.png b/app/src/main/res/drawable-hdpi/ic_rating_star.png
new file mode 100644
index 0000000..5c230f0
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_rating_star.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_search.png b/app/src/main/res/drawable-hdpi/ic_search.png
new file mode 100644
index 0000000..9b8cdd3
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_search.png differ
diff --git a/app/src/main/res/drawable-hdpi/ic_white_back_arrow.png b/app/src/main/res/drawable-hdpi/ic_white_back_arrow.png
new file mode 100644
index 0000000..5153c62
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_white_back_arrow.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_default_image_restaurant.png b/app/src/main/res/drawable-mdpi/ic_default_image_restaurant.png
new file mode 100644
index 0000000..23f94b2
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_default_image_restaurant.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_fav_fill.png b/app/src/main/res/drawable-mdpi/ic_fav_fill.png
new file mode 100644
index 0000000..a757fca
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_fav_fill.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_fav_outline.png b/app/src/main/res/drawable-mdpi/ic_fav_outline.png
new file mode 100644
index 0000000..0f6be64
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_fav_outline.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_cart.png b/app/src/main/res/drawable-mdpi/ic_icon_cart.png
new file mode 100644
index 0000000..ea6f0a3
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_cart.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_email.png b/app/src/main/res/drawable-mdpi/ic_icon_email.png
new file mode 100644
index 0000000..c4dfc54
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_email.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_faqs.png b/app/src/main/res/drawable-mdpi/ic_icon_faqs.png
new file mode 100644
index 0000000..6f4528e
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_faqs.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_favourite.png b/app/src/main/res/drawable-mdpi/ic_icon_favourite.png
new file mode 100644
index 0000000..af746be
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_favourite.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_home.png b/app/src/main/res/drawable-mdpi/ic_icon_home.png
new file mode 100644
index 0000000..f34a246
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_home.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_location.png b/app/src/main/res/drawable-mdpi/ic_icon_location.png
new file mode 100644
index 0000000..5671687
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_location.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_logout.png b/app/src/main/res/drawable-mdpi/ic_icon_logout.png
new file mode 100644
index 0000000..0692435
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_logout.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_mobile.png b/app/src/main/res/drawable-mdpi/ic_icon_mobile.png
new file mode 100644
index 0000000..3d646c1
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_mobile.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_order_history.png b/app/src/main/res/drawable-mdpi/ic_icon_order_history.png
new file mode 100644
index 0000000..8636b17
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_order_history.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_password.png b/app/src/main/res/drawable-mdpi/ic_icon_password.png
new file mode 100644
index 0000000..0fdc058
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_password.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_person.png b/app/src/main/res/drawable-mdpi/ic_icon_person.png
new file mode 100644
index 0000000..01d2a3f
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_person.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_icon_person_filled.png b/app/src/main/res/drawable-mdpi/ic_icon_person_filled.png
new file mode 100644
index 0000000..d6d2b33
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_icon_person_filled.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_menu.png b/app/src/main/res/drawable-mdpi/ic_menu.png
new file mode 100644
index 0000000..8b415a6
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_menu.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_rating_star.png b/app/src/main/res/drawable-mdpi/ic_rating_star.png
new file mode 100644
index 0000000..f1f2b4d
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_rating_star.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_search.png b/app/src/main/res/drawable-mdpi/ic_search.png
new file mode 100644
index 0000000..3176c09
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_search.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_white_back_arrow.png b/app/src/main/res/drawable-mdpi/ic_white_back_arrow.png
new file mode 100644
index 0000000..f41cfe8
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_white_back_arrow.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_default_image_restaurant.png b/app/src/main/res/drawable-xhdpi/ic_default_image_restaurant.png
new file mode 100644
index 0000000..7f6e317
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_default_image_restaurant.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_fav_fill.png b/app/src/main/res/drawable-xhdpi/ic_fav_fill.png
new file mode 100644
index 0000000..e3d1b6d
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_fav_fill.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_fav_outline.png b/app/src/main/res/drawable-xhdpi/ic_fav_outline.png
new file mode 100644
index 0000000..4e49a94
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_fav_outline.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_cart.png b/app/src/main/res/drawable-xhdpi/ic_icon_cart.png
new file mode 100644
index 0000000..976908b
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_cart.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_email.png b/app/src/main/res/drawable-xhdpi/ic_icon_email.png
new file mode 100644
index 0000000..e47ce93
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_email.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_faqs.png b/app/src/main/res/drawable-xhdpi/ic_icon_faqs.png
new file mode 100644
index 0000000..c52b502
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_faqs.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_favourite.png b/app/src/main/res/drawable-xhdpi/ic_icon_favourite.png
new file mode 100644
index 0000000..db1c87b
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_favourite.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_home.png b/app/src/main/res/drawable-xhdpi/ic_icon_home.png
new file mode 100644
index 0000000..f3a7433
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_home.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_location.png b/app/src/main/res/drawable-xhdpi/ic_icon_location.png
new file mode 100644
index 0000000..cffe52e
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_location.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_logout.png b/app/src/main/res/drawable-xhdpi/ic_icon_logout.png
new file mode 100644
index 0000000..236fe5e
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_logout.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_mobile.png b/app/src/main/res/drawable-xhdpi/ic_icon_mobile.png
new file mode 100644
index 0000000..cec9169
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_mobile.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_order_history.png b/app/src/main/res/drawable-xhdpi/ic_icon_order_history.png
new file mode 100644
index 0000000..b0861ae
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_order_history.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_password.png b/app/src/main/res/drawable-xhdpi/ic_icon_password.png
new file mode 100644
index 0000000..ec56aaf
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_password.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_person.png b/app/src/main/res/drawable-xhdpi/ic_icon_person.png
new file mode 100644
index 0000000..beec856
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_person.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_icon_person_filled.png b/app/src/main/res/drawable-xhdpi/ic_icon_person_filled.png
new file mode 100644
index 0000000..6f4c23c
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_icon_person_filled.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_menu.png b/app/src/main/res/drawable-xhdpi/ic_menu.png
new file mode 100644
index 0000000..ab98cad
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_menu.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_rating_star.png b/app/src/main/res/drawable-xhdpi/ic_rating_star.png
new file mode 100644
index 0000000..ad0f2b3
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_rating_star.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_search.png b/app/src/main/res/drawable-xhdpi/ic_search.png
new file mode 100644
index 0000000..be56c4b
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_search.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_white_back_arrow.png b/app/src/main/res/drawable-xhdpi/ic_white_back_arrow.png
new file mode 100644
index 0000000..fe88ecf
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_white_back_arrow.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_default_image_restaurant.png b/app/src/main/res/drawable-xxhdpi/ic_default_image_restaurant.png
new file mode 100644
index 0000000..e036ee6
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_default_image_restaurant.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_fav_fill.png b/app/src/main/res/drawable-xxhdpi/ic_fav_fill.png
new file mode 100644
index 0000000..478e0d1
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fav_fill.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_fav_outline.png b/app/src/main/res/drawable-xxhdpi/ic_fav_outline.png
new file mode 100644
index 0000000..d458fd3
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_fav_outline.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_cart.png b/app/src/main/res/drawable-xxhdpi/ic_icon_cart.png
new file mode 100644
index 0000000..f4595ca
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_cart.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_email.png b/app/src/main/res/drawable-xxhdpi/ic_icon_email.png
new file mode 100644
index 0000000..731ca7a
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_email.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_faqs.png b/app/src/main/res/drawable-xxhdpi/ic_icon_faqs.png
new file mode 100644
index 0000000..91238ff
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_faqs.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_favourite.png b/app/src/main/res/drawable-xxhdpi/ic_icon_favourite.png
new file mode 100644
index 0000000..ac54017
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_favourite.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_home.png b/app/src/main/res/drawable-xxhdpi/ic_icon_home.png
new file mode 100644
index 0000000..43cdd90
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_home.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_location.png b/app/src/main/res/drawable-xxhdpi/ic_icon_location.png
new file mode 100644
index 0000000..b303e1d
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_location.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_logout.png b/app/src/main/res/drawable-xxhdpi/ic_icon_logout.png
new file mode 100644
index 0000000..f1fdcd4
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_logout.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_mobile.png b/app/src/main/res/drawable-xxhdpi/ic_icon_mobile.png
new file mode 100644
index 0000000..50f022b
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_mobile.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_order_history.png b/app/src/main/res/drawable-xxhdpi/ic_icon_order_history.png
new file mode 100644
index 0000000..e322e4b
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_order_history.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_password.png b/app/src/main/res/drawable-xxhdpi/ic_icon_password.png
new file mode 100644
index 0000000..7d0bf4f
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_password.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_person.png b/app/src/main/res/drawable-xxhdpi/ic_icon_person.png
new file mode 100644
index 0000000..08ff56a
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_person.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_icon_person_filled.png b/app/src/main/res/drawable-xxhdpi/ic_icon_person_filled.png
new file mode 100644
index 0000000..d2a73a1
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_icon_person_filled.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_menu.png b/app/src/main/res/drawable-xxhdpi/ic_menu.png
new file mode 100644
index 0000000..65091d3
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_menu.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_rating_star.png b/app/src/main/res/drawable-xxhdpi/ic_rating_star.png
new file mode 100644
index 0000000..209671f
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_rating_star.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_search.png b/app/src/main/res/drawable-xxhdpi/ic_search.png
new file mode 100644
index 0000000..bcc211f
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_search.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_white_back_arrow.png b/app/src/main/res/drawable-xxhdpi/ic_white_back_arrow.png
new file mode 100644
index 0000000..6c73d0f
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_white_back_arrow.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_icon_faqs.png b/app/src/main/res/drawable-xxxhdpi/ic_icon_faqs.png
new file mode 100644
index 0000000..2c252bd
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_icon_faqs.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_rating_star.png b/app/src/main/res/drawable-xxxhdpi/ic_rating_star.png
new file mode 100644
index 0000000..09bb02f
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_rating_star.png differ
diff --git a/app/src/main/res/drawable/action_filter.png b/app/src/main/res/drawable/action_filter.png
new file mode 100644
index 0000000..1548d68
Binary files /dev/null and b/app/src/main/res/drawable/action_filter.png differ
diff --git a/app/src/main/res/drawable/food_runner_logo.png b/app/src/main/res/drawable/food_runner_logo.png
new file mode 100644
index 0000000..3b5e3e0
Binary files /dev/null and b/app/src/main/res/drawable/food_runner_logo.png differ
diff --git a/app/src/main/res/drawable/ic_rupee_indian.png b/app/src/main/res/drawable/ic_rupee_indian.png
new file mode 100644
index 0000000..6b0a808
Binary files /dev/null and b/app/src/main/res/drawable/ic_rupee_indian.png differ
diff --git a/app/src/main/res/drawable/ic_tick_red.png b/app/src/main/res/drawable/ic_tick_red.png
new file mode 100644
index 0000000..f1d1521
Binary files /dev/null and b/app/src/main/res/drawable/ic_tick_red.png differ
diff --git a/app/src/main/res/drawable/profile_new.png b/app/src/main/res/drawable/profile_new.png
new file mode 100644
index 0000000..477ec63
Binary files /dev/null and b/app/src/main/res/drawable/profile_new.png differ
diff --git a/app/src/main/res/drawable/profile_pic_new_white.png b/app/src/main/res/drawable/profile_pic_new_white.png
new file mode 100644
index 0000000..2152611
Binary files /dev/null and b/app/src/main/res/drawable/profile_pic_new_white.png differ
diff --git a/app/src/main/res/drawable/rounded_border_for_view.xml b/app/src/main/res/drawable/rounded_border_for_view.xml
new file mode 100644
index 0000000..c9f0c3e
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_border_for_view.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_corner_search.xml b/app/src/main/res/drawable/rounded_corner_search.xml
new file mode 100644
index 0000000..3c30051
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_corner_search.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_view_for_menu_chosen.xml b/app/src/main/res/drawable/rounded_view_for_menu_chosen.xml
new file mode 100644
index 0000000..fe5c71f
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_view_for_menu_chosen.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_view_for_menu_red.xml b/app/src/main/res/drawable/rounded_view_for_menu_red.xml
new file mode 100644
index 0000000..4deb429
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_view_for_menu_red.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_cart.xml b/app/src/main/res/layout/activity_cart.xml
new file mode 100644
index 0000000..e40b77b
--- /dev/null
+++ b/app/src/main/res/layout/activity_cart.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_dashboard.xml b/app/src/main/res/layout/activity_dashboard.xml
new file mode 100644
index 0000000..abeb58d
--- /dev/null
+++ b/app/src/main/res/layout/activity_dashboard.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_login_register.xml b/app/src/main/res/layout/activity_login_register.xml
new file mode 100644
index 0000000..ed4f10f
--- /dev/null
+++ b/app/src/main/res/layout/activity_login_register.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_order_placed.xml b/app/src/main/res/layout/activity_order_placed.xml
new file mode 100644
index 0000000..712e2d1
--- /dev/null
+++ b/app/src/main/res/layout/activity_order_placed.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_restaurant_menu.xml b/app/src/main/res/layout/activity_restaurant_menu.xml
new file mode 100644
index 0000000..306ae63
--- /dev/null
+++ b/app/src/main/res/layout/activity_restaurant_menu.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml
new file mode 100644
index 0000000..674e904
--- /dev/null
+++ b/app/src/main/res/layout/activity_splash.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/cart_recycler_view_single_row.xml b/app/src/main/res/layout/cart_recycler_view_single_row.xml
new file mode 100644
index 0000000..192ead9
--- /dev/null
+++ b/app/src/main/res/layout/cart_recycler_view_single_row.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/dashboard_recycler_view_single_row.xml b/app/src/main/res/layout/dashboard_recycler_view_single_row.xml
new file mode 100644
index 0000000..a1dce97
--- /dev/null
+++ b/app/src/main/res/layout/dashboard_recycler_view_single_row.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml
new file mode 100644
index 0000000..e8f593f
--- /dev/null
+++ b/app/src/main/res/layout/drawer_header.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml
new file mode 100644
index 0000000..0124af1
--- /dev/null
+++ b/app/src/main/res/layout/fragment_dashboard.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_faqs.xml b/app/src/main/res/layout/fragment_faqs.xml
new file mode 100644
index 0000000..69956ed
--- /dev/null
+++ b/app/src/main/res/layout/fragment_faqs.xml
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_favourite_restaurant.xml b/app/src/main/res/layout/fragment_favourite_restaurant.xml
new file mode 100644
index 0000000..1af373a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_favourite_restaurant.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_forgot_password.xml b/app/src/main/res/layout/fragment_forgot_password.xml
new file mode 100644
index 0000000..10efbd4
--- /dev/null
+++ b/app/src/main/res/layout/fragment_forgot_password.xml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_forgot_password_input.xml b/app/src/main/res/layout/fragment_forgot_password_input.xml
new file mode 100644
index 0000000..1de4ebe
--- /dev/null
+++ b/app/src/main/res/layout/fragment_forgot_password_input.xml
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml
new file mode 100644
index 0000000..78a795a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_login.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_order_history.xml b/app/src/main/res/layout/fragment_order_history.xml
new file mode 100644
index 0000000..2179191
--- /dev/null
+++ b/app/src/main/res/layout/fragment_order_history.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_profile.xml b/app/src/main/res/layout/fragment_profile.xml
new file mode 100644
index 0000000..6d6a59e
--- /dev/null
+++ b/app/src/main/res/layout/fragment_profile.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_register.xml b/app/src/main/res/layout/fragment_register.xml
new file mode 100644
index 0000000..f5df35a
--- /dev/null
+++ b/app/src/main/res/layout/fragment_register.xml
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/order_history_recycler_single_row.xml b/app/src/main/res/layout/order_history_recycler_single_row.xml
new file mode 100644
index 0000000..dde1e07
--- /dev/null
+++ b/app/src/main/res/layout/order_history_recycler_single_row.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/restuarant_menu_recycler_view_single_row.xml b/app/src/main/res/layout/restuarant_menu_recycler_view_single_row.xml
new file mode 100644
index 0000000..1dd2cf1
--- /dev/null
+++ b/app/src/main/res/layout/restuarant_menu_recycler_view_single_row.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/sort_radio_button.xml b/app/src/main/res/layout/sort_radio_button.xml
new file mode 100644
index 0000000..065879f
--- /dev/null
+++ b/app/src/main/res/layout/sort_radio_button.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/drawer_menu.xml b/app/src/main/res/menu/drawer_menu.xml
new file mode 100644
index 0000000..172105d
--- /dev/null
+++ b/app/src/main/res/menu/drawer_menu.xml
@@ -0,0 +1,31 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/menu_dashboard.xml b/app/src/main/res/menu/menu_dashboard.xml
new file mode 100644
index 0000000..3e17378
--- /dev/null
+++ b/app/src/main/res/menu/menu_dashboard.xml
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_app_logo.xml b/app/src/main/res/mipmap-anydpi-v26/ic_app_logo.xml
new file mode 100644
index 0000000..26db868
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_app_logo.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_app_logo_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_app_logo_round.xml
new file mode 100644
index 0000000..26db868
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_app_logo_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_app_logo.png b/app/src/main/res/mipmap-hdpi/ic_app_logo.png
new file mode 100644
index 0000000..cf1af09
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_app_logo.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_app_logo_foreground.png b/app/src/main/res/mipmap-hdpi/ic_app_logo_foreground.png
new file mode 100644
index 0000000..2047407
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_app_logo_foreground.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_app_logo_round.png b/app/src/main/res/mipmap-hdpi/ic_app_logo_round.png
new file mode 100644
index 0000000..5961ee8
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_app_logo_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_app_logo.png b/app/src/main/res/mipmap-mdpi/ic_app_logo.png
new file mode 100644
index 0000000..fb55892
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_app_logo.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_app_logo_foreground.png b/app/src/main/res/mipmap-mdpi/ic_app_logo_foreground.png
new file mode 100644
index 0000000..decbb26
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_app_logo_foreground.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_app_logo_round.png b/app/src/main/res/mipmap-mdpi/ic_app_logo_round.png
new file mode 100644
index 0000000..90d9edb
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_app_logo_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_app_logo.png b/app/src/main/res/mipmap-xhdpi/ic_app_logo.png
new file mode 100644
index 0000000..9d6f0aa
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_app_logo.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_app_logo_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_app_logo_foreground.png
new file mode 100644
index 0000000..58fb2cb
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_app_logo_foreground.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_app_logo_round.png b/app/src/main/res/mipmap-xhdpi/ic_app_logo_round.png
new file mode 100644
index 0000000..1cfad28
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_app_logo_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_app_logo.png b/app/src/main/res/mipmap-xxhdpi/ic_app_logo.png
new file mode 100644
index 0000000..fe8f6a8
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_app_logo.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_app_logo_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_app_logo_foreground.png
new file mode 100644
index 0000000..97165f5
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_app_logo_foreground.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_app_logo_round.png b/app/src/main/res/mipmap-xxhdpi/ic_app_logo_round.png
new file mode 100644
index 0000000..f3725ef
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_app_logo_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_app_logo.png b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo.png
new file mode 100644
index 0000000..f567c3b
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_foreground.png
new file mode 100644
index 0000000..9917dcc
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_foreground.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_round.png
new file mode 100644
index 0000000..06e8fe1
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_app_logo_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..88ca74b
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,13 @@
+
+
+ #d85050
+ #dd1b1b
+ #FF5139
+ #ff6753
+ #FFFFFF
+ #000000
+ #757575
+ #909090
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/ic_app_logo_background.xml b/app/src/main/res/values/ic_app_logo_background.xml
new file mode 100644
index 0000000..655e81a
--- /dev/null
+++ b/app/src/main/res/values/ic_app_logo_background.xml
@@ -0,0 +1,4 @@
+
+
+ #F0533E
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..c0421e2
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,74 @@
+
+
+ FoodRunner
+ Mobile Number (10 digits)
+ Password
+ Login
+ Forgot Password?
+ Don\'t have an account? Sign up now.
+ RestaurantPreference
+ Open Drawer
+ Close Drawer
+ Add
+ Proceed to Cart
+ Choose from menu listed below:
+ Ordering From:
+ Place Order (Rs)
+
+ Your previous orders are listed below:
+ Your order has been placed successfully!
+ OK
+ Search Restaurants
+ Enter the OTP received below
+ OTP (4 characters)
+ OTP will be send to the registered email id
+ Enter the following details
+ Next
+ Register
+ 300/person
+ 4.5
+ Kartikey Sharma
+ Pind Tadka
+ 22/12/2018
+ Rs.200
+ Cost (Low to High)
+ Cost (High to Low)
+ Rating
+ Add
+ Remove
+ Name (Min 3 characters)
+ Email Address
+ Delivery Address
+ Password (Min 4 digits)
+ Confirm Password
+ You do not have any favourite restaurants
+ You haven\'t placed any orders yet!
+ Rs. 400
+ +91 1234567890
+ No Restaurants Found
+
+
+ Q1. Why is Food Runner doing this?
+ A1. At Food Runner we always strive to add value to your business. We understand the challenges you face on a
+ daily basis in sourcing the best quality packaging material.Food Runner Packaging Assist is here to take care of all your packaging needs.
+ Q2. How are you guys different from other delivery apps?
+
+ A2. Best products - We only list the products which have passed our tests and are best suitable for delivery.
+ They will help in giving a better consumer experience, so you can get repeated orders from satisfied customers.\n\nBest prices - We have
+ negotiated rates with our distributors exclusively for FoodRunner Restaurant.\n\nConvenience - No need to haggle for prices.
+ No need to follow-up on delivery. We track all orders to ensure you have a hassle free experience.
+ Q3. Can I order from 2 or more restaurants at the same time?
+ A3. No. At the moment we only allow orders to be placed from one restaurant. Each restaurant has a huge variety to
+ choose from and we believe you won\'t be disappointed.
+ Q4. How do I know my order has been confirmed?
+ A4. We will send you a notification to your mobile every time you place an order. You will
+ also be able to view the order in Order History once it has been placed successfully.
+ Q5. When are you getting more restaurants as partners?
+ A5. We would like to deliver for as many restaurants as possible. However, we must establish a relationship
+ agreement with the restaurant to become partners with them.\n\nYou can help by telling your favorite restaurant\'s owner/manager
+ you want us to deliver their food to you.
+ Register Yourself
+ New Password (Min 4 digits)
+ Submit
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..13f74a4
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/network_security_config.xml b/app/src/main/res/xml/network_security_config.xml
new file mode 100644
index 0000000..09aa079
--- /dev/null
+++ b/app/src/main/res/xml/network_security_config.xml
@@ -0,0 +1,9 @@
+
+
+
+ 13.235.250.119
+ 13.234.239.174
+
+
+
+
\ No newline at end of file
diff --git a/app/src/test/java/com/kartikey/foodrunner/ExampleUnitTest.kt b/app/src/test/java/com/kartikey/foodrunner/ExampleUnitTest.kt
new file mode 100644
index 0000000..bde3648
--- /dev/null
+++ b/app/src/test/java/com/kartikey/foodrunner/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.kartikey.foodrunner
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..6553a37
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,26 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ ext.kotlin_version = "1.3.72"
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:4.0.1'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+
+ // 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/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..4d15d01
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# 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
+# 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
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..cf00681
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Mon Jul 13 00:37:18 IST 2020
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/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/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/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/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..ac48a46
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,2 @@
+include ':app'
+rootProject.name = "FoodRunner"
\ No newline at end of file