Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Kingbond470/Move-On into umang
Browse files Browse the repository at this point in the history
  • Loading branch information
umangsh28 committed Nov 14, 2021
2 parents 1747f97 + 44d207e commit 75e16f9
Show file tree
Hide file tree
Showing 36 changed files with 750 additions and 99 deletions.
6 changes: 4 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/download_warehouse_pic1"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@drawable/ic_packers_home"
android:supportsRtl="true"
android:theme="@style/NoActionBarTheme">

Expand Down Expand Up @@ -41,8 +41,7 @@
<activity
android:name=".ui.login.EmailLoginActivity"
android:exported="true"
android:theme="@style/MaterialTheme"
android:windowSoftInputMode="adjustResize" />
android:theme="@style/MaterialTheme" />

<activity
android:name=".ui.warehouses.whOrderDetails"
Expand Down Expand Up @@ -116,7 +115,7 @@
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.MoveonHome" />
android:theme="@style/Theme.MoveonHome"></activity>

<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
Expand Down
83 changes: 82 additions & 1 deletion app/src/main/java/dev/kingbond/moveon/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import android.os.Handler
import android.view.MenuItem
import android.view.View
import android.widget.ImageButton
import android.widget.RadioButton
import android.widget.SearchView
import android.widget.Toast
import androidx.appcompat.app.ActionBarDrawerToggle
Expand Down Expand Up @@ -47,11 +48,16 @@ import dev.kingbond.moveon.ui.settings.SettingsFragment
import dev.kingbond.moveon.ui.warehouses.whPersonalDetailsActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.booking_confirmed_layout.*
import kotlinx.android.synthetic.main.booking_confirmed_layout.cancelBooking
import kotlinx.android.synthetic.main.booking_confirmed_layout.driverDetailsLayout
import kotlinx.android.synthetic.main.booking_vehicle_layout.*
import kotlinx.android.synthetic.main.fragment_settings.*
import kotlinx.android.synthetic.main.fragment_settings.view.*
import kotlinx.android.synthetic.main.nav_header.*
import kotlinx.android.synthetic.main.nav_header.view.*
import kotlinx.android.synthetic.main.payment_layout.*
import kotlinx.android.synthetic.main.payment_methods_layout.*
import kotlinx.android.synthetic.main.payment_successful_layout.*
import kotlinx.android.synthetic.main.vehivle_info_layout.*
import java.io.IOException

Expand All @@ -66,6 +72,9 @@ class MainActivity : FragmentActivity(), OnMapReadyCallback, LocationListener,
private lateinit var bottomSheetDialogForDirections: BottomSheetDialog
private lateinit var bottomSheetDialogForBookedVehicle: BottomSheetDialog
private lateinit var bottomSheetDialogForVehicleInfo: BottomSheetDialog
private lateinit var bottomSheetDialogForPayment: BottomSheetDialog
private lateinit var bottomSheetDialogForPaymentMethods: BottomSheetDialog
private lateinit var bottomSheetDialogForPaymentSuccessful: BottomSheetDialog

var map: GoogleMap? = null
private var currentLongitude: Double = 0.0
Expand Down Expand Up @@ -442,6 +451,73 @@ class MainActivity : FragmentActivity(), OnMapReadyCallback, LocationListener,
}
}

private fun bottomSheetForPayment(vehicle: Vehicles, position: Int) {
bottomSheetDialogForPayment = BottomSheetDialog(this@MainActivity)
val viewPayment = layoutInflater.inflate(R.layout.payment_layout, null)
bottomSheetDialogForPayment.setContentView(viewPayment)

bottomSheetDialogForDirections.cancel()
bottomSheetDialogForPayment.show()

bottomSheetDialogForPayment.paymentCancelBooking.setOnClickListener {
bottomSheetForPaymentMethods(vehicle, position)
}

bottomSheetDialogForPayment.btnConfirmPayment.setOnClickListener {
bottomSheetDialogForPayment.cancel()
bottomSheetForPaymentSuccessful(vehicle, position)
}

}

private fun bottomSheetForPaymentSuccessful(vehicle: Vehicles, position: Int) {
bottomSheetDialogForPaymentSuccessful = BottomSheetDialog(this@MainActivity)
val viewPaymentSuccessful = layoutInflater.inflate(R.layout.payment_successful_layout, null)
bottomSheetDialogForPaymentSuccessful.setContentView(viewPaymentSuccessful)
bottomSheetDialogForPaymentSuccessful.show()


bottomSheetDialogForPaymentSuccessful.btnConfirmPaymentSuccessful.setOnClickListener {
bottomSheetDialogForPaymentSuccessful.cancel()
bottomSheetForBookedVehicle(vehicle, position)
}
}

fun onRadioButtonClicked(view: View) {
var checked = view as RadioButton
if(rb_wallet == checked) {
message(rb_wallet.text.toString() + if (rb_wallet.isChecked) " Checked " else " UnChecked ")
}
if (rb_cash == checked) {
message(rb_cash.text.toString() + if (rb_cash.isChecked) " Checked " else " UnChecked ")
}
if (rb_paytm == checked) {
message(rb_paytm.text.toString() + if (rb_paytm.isChecked) " Checked " else " UnChecked ")
}

if (rb_google_pay == checked) {
message(rb_google_pay.text.toString() + if (rb_google_pay.isChecked) " Checked " else " UnChecked ")
}
}

fun message(str: String) {
Toast.makeText(this, str, Toast.LENGTH_LONG).show()
}

private fun bottomSheetForPaymentMethods(vehicle: Vehicles, position: Int) {
bottomSheetDialogForPaymentMethods = BottomSheetDialog(this@MainActivity)
val viewPaymentMethods = layoutInflater.inflate(R.layout.payment_methods_layout, null)
bottomSheetDialogForPaymentMethods.setContentView(viewPaymentMethods)
bottomSheetDialogForPaymentMethods.rb_cash.isChecked = true
bottomSheetDialogForPaymentMethods.show()

bottomSheetDialogForPaymentMethods.btnConfirmPaymentMethods.setOnClickListener {
bottomSheetDialogForPaymentMethods.cancel()
}

}


override fun onVehicleClick(vehicle: Vehicles, position: Int) {
// Toast.makeText(this, "View Clicked", Toast.LENGTH_SHORT).show()
}
Expand All @@ -457,7 +533,12 @@ class MainActivity : FragmentActivity(), OnMapReadyCallback, LocationListener,

override fun onBookVehicleClick(vehicle: Vehicles, position: Int) {
// Toast.makeText(this, "Book Vehicle Clicked", Toast.LENGTH_SHORT).show()
bottomSheetForBookedVehicle(vehicle, position)
bottomSheetForPayment(vehicle, position)
}

override fun onPaymentMethodsClick(vehicle: Vehicles, position: Int) {
// Toast.makeText(this, "Payment Methods Clicked", Toast.LENGTH_SHORT).show()
bottomSheetForPaymentMethods(vehicle, position)
}

private fun bitmapFromVector(context: Context, vectorResId: Int): BitmapDescriptor? {
Expand Down
49 changes: 1 addition & 48 deletions app/src/main/java/dev/kingbond/moveon/ui/help/HelpFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,7 @@ import android.view.View
import android.view.ViewGroup
import dev.kingbond.moveon.R

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [HelpFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class HelpFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: String? = null
private var param2: String? = null
class HelpFragment : Fragment(R.layout.fragment_help) {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getString(ARG_PARAM1)
param2 = it.getString(ARG_PARAM2)
}
}

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_help, container, false)
}

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment HelpFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: String, param2: String) =
HelpFragment().apply {
arguments = Bundle().apply {
putString(ARG_PARAM1, param1)
putString(ARG_PARAM2, param2)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class VehicleAdapter(
clickListener.onBookVehicleClick(vehicle, adapterPosition)
}

rlPaymentMethods.setOnClickListener {
clickListener.onPaymentMethodsClick(vehicle,adapterPosition)
}



rlMainLayout.setOnClickListener {
if (bool[adapterPosition]) {
labourLayout.visibility = View.GONE
Expand Down Expand Up @@ -103,4 +109,6 @@ interface VehicleClickListener {
fun onVehicleInfoClick(vehicle: Vehicles, position: Int)
fun onAddLabourClick(vehicle: Vehicles, position: Int, labourCount: Int)
fun onBookVehicleClick(vehicle: Vehicles, position: Int)
fun onPaymentMethodsClick(vehicle: Vehicles, position: Int)

}
24 changes: 24 additions & 0 deletions app/src/main/java/dev/kingbond/moveon/ui/login/EmailFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.os.Bundle
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
import android.util.Patterns
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
Expand All @@ -20,6 +22,8 @@ import com.google.firebase.database.DatabaseReference
import dev.kingbond.moveon.MainActivity
import dev.kingbond.moveon.R
import kotlinx.android.synthetic.main.fragment_email.*
import kotlinx.android.synthetic.main.fragment_email.tvLoginSignUp
import kotlinx.android.synthetic.main.fragment_password.*
import java.util.regex.Pattern

class EmailFragment : Fragment(R.layout.fragment_email) {
Expand Down Expand Up @@ -89,6 +93,26 @@ class EmailFragment : Fragment(R.layout.fragment_email) {
// }
// }

// to show and hide the password
etLoginPasswordEmail.transformationMethod = PasswordTransformationMethod.getInstance()
btnShowHideLoginEmail.setOnClickListener {
if (etLoginPasswordEmail.transformationMethod == PasswordTransformationMethod.getInstance()) {
etLoginPasswordEmail.transformationMethod = HideReturnsTransformationMethod.getInstance()
btnShowHideLoginEmail.setBackgroundResource(R.drawable.password_show)

//placing cursor at the end of the text
etLoginPasswordEmail.setSelection(etLoginPasswordEmail.text.toString().length)
} else {
etLoginPasswordEmail.transformationMethod = PasswordTransformationMethod.getInstance()
btnShowHideLoginEmail.setBackgroundResource(R.drawable.password_hide)

//placing cursor at the end of the text
etLoginPasswordEmail.setSelection(etLoginPasswordEmail.text.toString().length)
}

}



}

Expand Down
29 changes: 25 additions & 4 deletions app/src/main/java/dev/kingbond/moveon/ui/login/SignUpFragment.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package dev.kingbond.moveon.ui.login

import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.os.Bundle
import android.text.method.HideReturnsTransformationMethod
import android.text.method.PasswordTransformationMethod
Expand All @@ -9,13 +11,16 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.core.widget.doAfterTextChanged
import androidx.navigation.Navigation
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.FirebaseDatabase
import dev.kingbond.moveon.R
import kotlinx.android.synthetic.main.fragment_email.*
import kotlinx.android.synthetic.main.fragment_password.*
import kotlinx.android.synthetic.main.fragment_sign_up.*
import kotlinx.android.synthetic.main.fragment_sign_up.btnShowHideSignUpFirst
import java.util.regex.Pattern

class SignUpFragment : Fragment(R.layout.fragment_sign_up) {
Expand Down Expand Up @@ -56,6 +61,22 @@ class SignUpFragment : Fragment(R.layout.fragment_sign_up) {
// }
// }

// to change the background color of button
etConfirmPasswordSignUp.doAfterTextChanged {
if (etPasswordSignUp.text.trim().toString().equals(etConfirmPasswordSignUp.text.trim().toString()) && etPasswordSignUp.text.trim().toString().length>=8) {
// btnLoginWithEmailContinue.setBackgroundColor(Color.parseColor("#1E54B7"))
val gradientDrawable = GradientDrawable()
gradientDrawable.setColor(Color.parseColor("#1E54B7"))
gradientDrawable.cornerRadius = 12F
btnSignUpContinue.setBackgroundDrawable(gradientDrawable)
} else {
val gradientDrawable = GradientDrawable()
gradientDrawable.setStroke(5, Color.parseColor("#1E54B7"))
gradientDrawable.cornerRadius = 12F
btnSignUpContinue.setBackgroundDrawable(gradientDrawable)
}
}

// to show and hide the password
etPasswordSignUp.transformationMethod = PasswordTransformationMethod.getInstance()
btnShowHideSignUpFirst.setOnClickListener {
Expand All @@ -65,13 +86,13 @@ class SignUpFragment : Fragment(R.layout.fragment_sign_up) {
btnShowHideSignUpFirst.setBackgroundResource(R.drawable.password_show)

//placing cursor at the end of the text
etPasswordSignUp.setSelection(etLoginPassword.text.toString().length)
etPasswordSignUp.setSelection(etPasswordSignUp.text.toString().length)
} else {
etPasswordSignUp.transformationMethod = PasswordTransformationMethod.getInstance()
btnShowHideSignUpFirst.setBackgroundResource(R.drawable.password_hide)

//placing cursor at the end of the text
etPasswordSignUp.setSelection(etLoginPassword.text.toString().length)
etPasswordSignUp.setSelection(etPasswordSignUp.text.toString().length)
}
}

Expand All @@ -85,14 +106,14 @@ class SignUpFragment : Fragment(R.layout.fragment_sign_up) {
btnShowHideSignUpSecond.setBackgroundResource(R.drawable.password_show)

//placing cursor at the end of the text
etConfirmPasswordSignUp.setSelection(etLoginPassword.text.toString().length)
etConfirmPasswordSignUp.setSelection(etConfirmPasswordSignUp.text.toString().length)
} else {
etConfirmPasswordSignUp.transformationMethod =
PasswordTransformationMethod.getInstance()
btnShowHideSignUpSecond.setBackgroundResource(R.drawable.password_hide)

//placing cursor at the end of the text
etConfirmPasswordSignUp.setSelection(etLoginPassword.text.toString().length)
etConfirmPasswordSignUp.setSelection(etConfirmPasswordSignUp.text.toString().length)
}
}
}
Expand Down
Binary file added app/src/main/res/drawable/coupons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/white"
android:pathData="M10,16c0,-1.104 0.896,-2 2,-2s2,0.896 2,2c0,0.738 -0.404,1.376 -1,1.723v2.277h-2v-2.277c-0.596,-0.347 -1,-0.985 -1,-1.723zM21,10v14h-18v-14h3v-4c0,-3.313 2.687,-6 6,-6s6,2.687 6,6v4h3zM8,10h8v-4c0,-2.206 -1.795,-4 -4,-4s-4,1.794 -4,4v4zM19,12h-14v10h14v-10z"/>
</vector>
Binary file added app/src/main/res/drawable/issue1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/issues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_cash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_coupon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_debit_credit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_googlepay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_moveon_walllet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_new_upi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_paytm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/payment_successful.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/profile_setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/refund.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/refund1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/secuirty4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/security.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/security1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/security2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/settings1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/settings2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/subscription1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 75e16f9

Please sign in to comment.