mirror of
https://github.com/hmalik144/Driver.git
synced 2026-03-18 15:36:03 +00:00
- mid commit
Took 8 hours 5 minutes
This commit is contained in:
@@ -18,15 +18,15 @@ import org.kodein.di.generic.singleton
|
||||
|
||||
class DriverApplication : Application(), KodeinAware {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
val localHost = "10.0.2.2"
|
||||
|
||||
FirebaseAuth.getInstance().useEmulator(localHost, 9099)
|
||||
FirebaseDatabase.getInstance().useEmulator(localHost, 9000)
|
||||
FirebaseStorage.getInstance().useEmulator(localHost, 9199)
|
||||
}
|
||||
// override fun onCreate() {
|
||||
// super.onCreate()
|
||||
//
|
||||
// val localHost = "10.0.2.2"
|
||||
//
|
||||
// FirebaseAuth.getInstance().useEmulator(localHost, 9099)
|
||||
// FirebaseDatabase.getInstance().useEmulator(localHost, 9000)
|
||||
// FirebaseStorage.getInstance().useEmulator(localHost, 9199)
|
||||
// }
|
||||
|
||||
// Kodein aware to initialise the classes used for DI
|
||||
override val kodein = Kodein.lazy {
|
||||
|
||||
@@ -20,6 +20,7 @@ import h_mal.appttude.com.driver.utils.PermissionsUtils
|
||||
import org.kodein.di.KodeinAware
|
||||
import org.kodein.di.android.x.kodein
|
||||
import org.kodein.di.generic.instance
|
||||
import java.io.File
|
||||
|
||||
abstract class BaseFragment<V : BaseViewModel, VB : ViewBinding> : Fragment(), KodeinAware {
|
||||
|
||||
@@ -151,10 +152,10 @@ abstract class BaseFragment<V : BaseViewModel, VB : ViewBinding> : Fragment(), K
|
||||
private fun getResultsContract(): ActivityResultContract<Boolean, Any?> {
|
||||
return object : ActivityResultContract<Boolean, Any?>() {
|
||||
override fun createIntent(context: Context, input: Boolean): Intent {
|
||||
return Intent(Intent.ACTION_PICK).apply {
|
||||
type = "image/*"
|
||||
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, input)
|
||||
}
|
||||
return Intent(Intent.ACTION_GET_CONTENT)
|
||||
.addCategory(Intent.CATEGORY_OPENABLE)
|
||||
.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, input)
|
||||
.setType("image/*")
|
||||
}
|
||||
|
||||
override fun parseResult(resultCode: Int, intent: Intent?): Any? {
|
||||
|
||||
@@ -12,7 +12,7 @@ class DeleteProfileFragment :
|
||||
|
||||
override fun setupView(binding: FragmentDeleteProfileBinding) = binding.run {
|
||||
passwordTop.setEnterPressedListener { deleteUser() }
|
||||
submissionButtonLabel.setOnClickListener { deleteUser() }
|
||||
submit.setOnClickListener { deleteUser() }
|
||||
}
|
||||
|
||||
private fun deleteUser() = applyBinding {
|
||||
|
||||
@@ -12,7 +12,7 @@ class UpdateEmailFragment : BaseFragment<UpdateUserViewModel, FragmentUpdateEmai
|
||||
|
||||
override fun setupView(binding: FragmentUpdateEmailBinding) = binding.run {
|
||||
newEmail.setEnterPressedListener { registerUser() }
|
||||
submissionButtonLabel.setOnClickListener { registerUser() }
|
||||
submit.setOnClickListener { registerUser() }
|
||||
}
|
||||
|
||||
private fun registerUser() {
|
||||
|
||||
@@ -13,7 +13,7 @@ class UpdatePasswordFragment : BaseFragment<UpdateUserViewModel, FragmentUpdateP
|
||||
override fun setupView(binding: FragmentUpdatePasswordBinding) {
|
||||
applyBinding {
|
||||
emailUpdate.setEnterPressedListener { registerUser() }
|
||||
emailSignUp.setOnClickListener { registerUser() }
|
||||
submit.setOnClickListener { registerUser() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class UpdateProfileFragment : BaseFragment<UpdateUserViewModel, FragmentUpdatePr
|
||||
}
|
||||
}
|
||||
|
||||
submitUpdateProfile.setOnClickListener { submitProfileUpdate() }
|
||||
submit.setOnClickListener { submitProfileUpdate() }
|
||||
}
|
||||
|
||||
private fun submitProfileUpdate() {
|
||||
|
||||
@@ -13,13 +13,13 @@ class RegisterFragment :
|
||||
|
||||
override fun setupView(binding: FragmentRegisterBinding) = binding.run {
|
||||
passwordBottom.setEnterPressedListener { registerUser() }
|
||||
emailSignUp.setOnClickListener { registerUser() }
|
||||
submit.setOnClickListener { registerUser() }
|
||||
}
|
||||
|
||||
private fun registerUser() {
|
||||
applyBinding {
|
||||
val nameString = nameRegister.validatePasswordEditText() ?: return@applyBinding
|
||||
val emailText = emailRegister.validateEmailEditText() ?: return@applyBinding
|
||||
val emailText = email.validateEmailEditText() ?: return@applyBinding
|
||||
val passwordText = passwordTop.validatePasswordEditText() ?: return@applyBinding
|
||||
val passwordTextBottom =
|
||||
passwordBottom.validatePasswordEditText() ?: return@applyBinding
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
style="@style/subheader"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="@string/delete_profile_subtitle"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_old_email"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_old_email"
|
||||
android:id="@+id/til_name"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -47,7 +47,7 @@
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_old_email">
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password_top"
|
||||
@@ -58,7 +58,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submission_button_label"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_driver"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton"
|
||||
android:text="@string/submit" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_ins"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_lb"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_mot"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -3,75 +3,71 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
style="@style/constraint_container"
|
||||
style="@style/parent_constraint_layout"
|
||||
android:background="#73000000"
|
||||
tools:context="ui.user.ForgotPasswordFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_title_tv"
|
||||
style="@style/title_text"
|
||||
android:layout_width="0dp"
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="96dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="@string/register_label"
|
||||
android:textColor="#ffffff"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toBottomOf="@id/til_new_password"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_title_tv"
|
||||
style="@style/headerStyle"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:text="@string/register_label"
|
||||
app:layout_constraintBottom_toTopOf="@id/login_subtitle_tv"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_subtitle_tv"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
style="@style/subheader"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="@string/register_subtitle"
|
||||
android:textColor="#ffffff"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/login_title_tv" />
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_old_email"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="#99000000"
|
||||
android:textColorHint="@android:color/white"
|
||||
android:id="@+id/til_name"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/login_subtitle_tv">
|
||||
app:layout_constraintBottom_toTopOf="@id/til_email">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/name_register"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="@string/promt_name"
|
||||
android:inputType="textPersonName"
|
||||
android:autofillHints="name" />
|
||||
android:autofillHints="name"/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_email"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="#99000000"
|
||||
android:textColorHint="@android:color/white"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_old_email">
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||
<EditText
|
||||
android:id="@+id/email_register"
|
||||
android:id="@+id/email"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -81,74 +77,31 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_password_top"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="#99000000"
|
||||
android:textColorHint="@android:color/white"
|
||||
android:id="@+id/til_new_password"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_email">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password_top"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="@string/prompt_password"
|
||||
android:inputType="textPassword"
|
||||
android:autofillHints="password" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_password_bottom"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:background="#99000000"
|
||||
android:textColorHint="@android:color/white"
|
||||
android:id="@+id/til_new_password_again"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_password_top">
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_new_password">
|
||||
<EditText
|
||||
android:id="@+id/password_bottom"
|
||||
style="@style/EditTextStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:hint="@string/prompt_password"
|
||||
android:inputType="textPassword"
|
||||
android:autofillHints="password" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/email_sign_up"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="64dp"
|
||||
android:backgroundTint="@color/colour_one"
|
||||
android:enabled="false"
|
||||
app:cardCornerRadius="24dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_password_bottom">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/submission_button_label"
|
||||
style="@style/button_inner_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/submit"
|
||||
android:textColor="@android:color/white" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
android:text="@string/update_email_subtitle"
|
||||
style="@style/subheader"
|
||||
android:layout_marginBottom="24dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_old_email"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_old_email"
|
||||
android:id="@+id/til_name"
|
||||
style="@style/text_input_layout"
|
||||
android:layout_marginTop="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -79,7 +79,7 @@
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
android:id="@+id/submission_button_label"
|
||||
android:id="@+id/submit"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintVertical_bias="0.8"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
style="@style/parent_constraint_layout"
|
||||
tools:context="ui.user.ForgotPasswordFragment">
|
||||
tools:context="ui.update.UpdatePasswordFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_title_tv"
|
||||
@@ -22,14 +22,14 @@
|
||||
style="@style/subheader"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:text="@string/update_password_subtitle"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_old_email"
|
||||
app:layout_constraintBottom_toTopOf="@id/til_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/til_old_email"
|
||||
android:id="@+id/til_name"
|
||||
style="@style/text_input_layout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -50,7 +50,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_old_email">
|
||||
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/password_top"
|
||||
@@ -76,7 +76,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/email_sign_up"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/container"
|
||||
style="@style/parent_constraint_layout"
|
||||
tools:context=".ui.user.ForgotPasswordFragment">
|
||||
tools:context=".ui.update.UpdateProfileFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/login_title_tv"
|
||||
@@ -67,7 +67,7 @@
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_update_profile"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -134,9 +134,8 @@
|
||||
android:padding="12dp"
|
||||
android:textSize="18sp" />
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/submit_vehicle"
|
||||
android:id="@+id/submit"
|
||||
style="@style/TextButton.WithIcon"
|
||||
android:text="@string/submit"
|
||||
android:layout_marginBottom="48dp"
|
||||
|
||||
Reference in New Issue
Block a user