mirror of
https://github.com/hmalik144/Driver.git
synced 2026-01-31 02:41:46 +00:00
- mid commit
Took 8 hours 5 minutes
This commit is contained in:
@@ -122,6 +122,7 @@ dependencies {
|
|||||||
implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
|
implementation "androidx.test.espresso:espresso-idling-resource:$espressoVersion"
|
||||||
androidTestImplementation "androidx.test:runner:$testRunnerVersion"
|
androidTestImplementation "androidx.test:runner:$testRunnerVersion"
|
||||||
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
|
androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
|
||||||
|
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"
|
||||||
/ * Google play services */
|
/ * Google play services */
|
||||||
implementation "com.google.android.gms:play-services-auth:20.4.1"
|
implementation "com.google.android.gms:play-services-auth:20.4.1"
|
||||||
/ * Google firebase */
|
/ * Google firebase */
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class InsuranceFragment :
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentInsuranceBinding) {
|
override fun setupView(binding: FragmentInsuranceBinding) {
|
||||||
super.setupView(binding)
|
super.setupView(binding)
|
||||||
viewsToHide(binding.submitIns, binding.uploadInsurance)
|
viewsToHide(binding.submit, binding.uploadInsurance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class LogbookFragment :
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentLogbookBinding) {
|
override fun setupView(binding: FragmentLogbookBinding) {
|
||||||
super.setupView(binding)
|
super.setupView(binding)
|
||||||
viewsToHide(binding.submitLb, binding.uploadLb)
|
viewsToHide(binding.submit, binding.uploadLb)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setFields(data: Logbook) {
|
override fun setFields(data: Logbook) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class MotFragment : DataViewerFragment<MotViewModel, FragmentMotBinding, Mot>()
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentMotBinding) {
|
override fun setupView(binding: FragmentMotBinding) {
|
||||||
super.setupView(binding)
|
super.setupView(binding)
|
||||||
viewsToHide(binding.submitMot, binding.uploadmot)
|
viewsToHide(binding.submit, binding.uploadmot)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setFields(data: Mot) {
|
override fun setFields(data: Mot) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class VehicleProfileFragment :
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentVehicleSetupBinding) {
|
override fun setupView(binding: FragmentVehicleSetupBinding) {
|
||||||
super.setupView(binding)
|
super.setupView(binding)
|
||||||
viewsToHide(binding.submitVehicle)
|
viewsToHide(binding.submit)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setFields(data: VehicleProfile) {
|
override fun setFields(data: VehicleProfile) {
|
||||||
|
|||||||
@@ -1,16 +1,32 @@
|
|||||||
package h_mal.appttude.com.driver
|
package h_mal.appttude.com.driver
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.app.Instrumentation
|
||||||
|
import android.content.Intent
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
|
import android.net.Uri
|
||||||
|
import android.provider.MediaStore
|
||||||
|
import android.widget.DatePicker
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.test.espresso.Espresso.onData
|
import androidx.test.espresso.Espresso.onData
|
||||||
import androidx.test.espresso.Espresso.onView
|
import androidx.test.espresso.Espresso.onView
|
||||||
import androidx.test.espresso.ViewInteraction
|
import androidx.test.espresso.ViewInteraction
|
||||||
import androidx.test.espresso.action.ViewActions
|
import androidx.test.espresso.action.ViewActions
|
||||||
|
import androidx.test.espresso.action.ViewActions.swipeDown
|
||||||
import androidx.test.espresso.assertion.ViewAssertions.matches
|
import androidx.test.espresso.assertion.ViewAssertions.matches
|
||||||
|
import androidx.test.espresso.contrib.PickerActions
|
||||||
|
import androidx.test.espresso.intent.Intents
|
||||||
|
import androidx.test.espresso.intent.Intents.intending
|
||||||
|
import androidx.test.espresso.intent.matcher.IntentMatchers
|
||||||
|
import androidx.test.espresso.intent.matcher.IntentMatchers.hasAction
|
||||||
|
import androidx.test.espresso.intent.matcher.IntentMatchers.isInternal
|
||||||
import androidx.test.espresso.matcher.ViewMatchers
|
import androidx.test.espresso.matcher.ViewMatchers
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
import org.hamcrest.CoreMatchers.allOf
|
import h_mal.appttude.com.driver.helpers.DataHelper
|
||||||
import org.hamcrest.CoreMatchers.anything
|
import h_mal.appttude.com.driver.helpers.DataHelper.addFilePaths
|
||||||
|
import org.hamcrest.CoreMatchers.*
|
||||||
|
import org.hamcrest.Matchers
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
open class BaseTestRobot {
|
open class BaseTestRobot {
|
||||||
|
|
||||||
@@ -23,12 +39,12 @@ open class BaseTestRobot {
|
|||||||
fun clickButton(resId: Int): ViewInteraction =
|
fun clickButton(resId: Int): ViewInteraction =
|
||||||
onView((withId(resId))).perform(ViewActions.click())
|
onView((withId(resId))).perform(ViewActions.click())
|
||||||
|
|
||||||
fun textView(resId: Int): ViewInteraction = onView(withId(resId))
|
fun matchView(resId: Int): ViewInteraction = onView(withId(resId))
|
||||||
|
|
||||||
fun matchText(viewInteraction: ViewInteraction, text: String): ViewInteraction = viewInteraction
|
fun matchText(viewInteraction: ViewInteraction, text: String): ViewInteraction = viewInteraction
|
||||||
.check(matches(ViewMatchers.withText(text)))
|
.check(matches(ViewMatchers.withText(text)))
|
||||||
|
|
||||||
fun matchText(resId: Int, text: String): ViewInteraction = matchText(textView(resId), text)
|
fun matchText(resId: Int, text: String): ViewInteraction = matchText(matchView(resId), text)
|
||||||
|
|
||||||
fun clickListItem(listRes: Int, position: Int) {
|
fun clickListItem(listRes: Int, position: Int) {
|
||||||
onData(anything())
|
onData(anything())
|
||||||
@@ -39,7 +55,49 @@ open class BaseTestRobot {
|
|||||||
fun checkErrorOnTextEntry(resId: Int, errorMessage: String): ViewInteraction =
|
fun checkErrorOnTextEntry(resId: Int, errorMessage: String): ViewInteraction =
|
||||||
onView(withId(resId)).check(matches(checkErrorMessage(errorMessage)))
|
onView(withId(resId)).check(matches(checkErrorMessage(errorMessage)))
|
||||||
|
|
||||||
|
fun swipeDown(resId: Int): ViewInteraction =
|
||||||
|
onView(withId(resId)).perform(swipeDown())
|
||||||
|
|
||||||
fun getStringFromResource(@StringRes resId: Int): String =
|
fun getStringFromResource(@StringRes resId: Int): String =
|
||||||
Resources.getSystem().getString(resId)
|
Resources.getSystem().getString(resId)
|
||||||
|
|
||||||
|
fun selectDateInPicker(year: Int, month: Int, day: Int) {
|
||||||
|
onView(ViewMatchers.withClassName(Matchers.equalTo(DatePicker::class.java.name))).perform(
|
||||||
|
PickerActions.setDate(
|
||||||
|
year,
|
||||||
|
month,
|
||||||
|
day
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun selectSingleImageFromGallery(filePath: String, openSelector: () -> Unit) {
|
||||||
|
Intents.init()
|
||||||
|
// Build the result to return when the activity is launched.
|
||||||
|
val resultData = Intent()
|
||||||
|
resultData.flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
|
||||||
|
resultData.data = Uri.fromFile(File(filePath))
|
||||||
|
val result = Instrumentation.ActivityResult(Activity.RESULT_OK, resultData)
|
||||||
|
// Set up result stubbing when an intent sent to image picker is seen.
|
||||||
|
intending(hasAction(Intent.ACTION_GET_CONTENT)).respondWith(result)
|
||||||
|
|
||||||
|
openSelector()
|
||||||
|
Intents.release()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun selectMultipleImageFromGallery(filePaths: Array<String>, openSelector: () -> Unit) {
|
||||||
|
Intents.init()
|
||||||
|
openSelector()
|
||||||
|
// Build the result to return when the activity is launched.
|
||||||
|
val resultData = Intent()
|
||||||
|
val clipData = DataHelper.createClipData(filePaths[0])
|
||||||
|
val remainingFiles = filePaths.copyOfRange(1, filePaths.size-1)
|
||||||
|
clipData.addFilePaths(remainingFiles)
|
||||||
|
resultData.clipData = clipData
|
||||||
|
val result = Instrumentation.ActivityResult(Activity.RESULT_OK, resultData)
|
||||||
|
|
||||||
|
// Set up result stubbing when an intent sent to "contacts" is seen.
|
||||||
|
Intents.intending(IntentMatchers.toPackage("android.intent.action.PICK")).respondWith(result)
|
||||||
|
Intents.release()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -30,6 +30,7 @@ open class BaseUiTest<T : BaseActivity<*,*>>(
|
|||||||
mActivityScenarioRule.onActivity {
|
mActivityScenarioRule.onActivity {
|
||||||
mIdlingResource = it.getIdlingResource()!!
|
mIdlingResource = it.getIdlingResource()!!
|
||||||
IdlingRegistry.getInstance().register(mIdlingResource)
|
IdlingRegistry.getInstance().register(mIdlingResource)
|
||||||
|
afterLaunch()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,4 +58,5 @@ open class BaseUiTest<T : BaseActivity<*,*>>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
open fun beforeLaunch() {}
|
open fun beforeLaunch() {}
|
||||||
|
open fun afterLaunch() {}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,27 @@
|
|||||||
package h_mal.appttude.com.driver
|
package h_mal.appttude.com.driver
|
||||||
|
|
||||||
|
import androidx.test.espresso.intent.rule.IntentsRule
|
||||||
import com.google.firebase.auth.FirebaseAuth
|
import com.google.firebase.auth.FirebaseAuth
|
||||||
import com.google.firebase.database.FirebaseDatabase
|
import com.google.firebase.database.FirebaseDatabase
|
||||||
import com.google.firebase.storage.FirebaseStorage
|
import com.google.firebase.storage.FirebaseStorage
|
||||||
import h_mal.appttude.com.driver.base.BaseActivity
|
import h_mal.appttude.com.driver.base.BaseActivity
|
||||||
import h_mal.appttude.com.driver.data.FirebaseAuthSource
|
import h_mal.appttude.com.driver.data.FirebaseAuthSource
|
||||||
|
import h_mal.appttude.com.driver.utils.GenericsHelper.getGenericClassAt
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
import kotlinx.coroutines.tasks.await
|
import kotlinx.coroutines.tasks.await
|
||||||
import org.junit.After
|
import org.junit.After
|
||||||
import org.junit.BeforeClass
|
import org.junit.BeforeClass
|
||||||
|
import org.junit.Rule
|
||||||
|
|
||||||
open class FirebaseTest<T : BaseActivity<*,*>>(
|
open class FirebaseTest<T : BaseActivity<*, *>>(
|
||||||
activity: Class<T>,
|
activity: Class<T>,
|
||||||
private val registered: Boolean = false,
|
private val registered: Boolean = false,
|
||||||
private val signedIn: Boolean = false
|
private val signedIn: Boolean = false
|
||||||
) : BaseUiTest<T>(activity) {
|
) : BaseUiTest<T>(activity) {
|
||||||
|
|
||||||
|
// @get:Rule
|
||||||
|
// val intentsRule = IntentsRule()
|
||||||
|
|
||||||
private val firebaseAuthSource by lazy { FirebaseAuthSource() }
|
private val firebaseAuthSource by lazy { FirebaseAuthSource() }
|
||||||
|
|
||||||
private var email: String? = null
|
private var email: String? = null
|
||||||
|
|||||||
@@ -1,6 +1,30 @@
|
|||||||
package h_mal.appttude.com.driver
|
package h_mal.appttude.com.driver
|
||||||
|
|
||||||
class FormRobot: BaseTestRobot() {
|
import android.net.Uri
|
||||||
|
import androidx.test.espresso.Espresso.onView
|
||||||
|
import androidx.test.espresso.action.ViewActions.click
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers.withId
|
||||||
|
|
||||||
// fun selectImage
|
|
||||||
|
open class FormRobot : BaseTestRobot() {
|
||||||
|
fun submit() = clickButton(R.id.submit)
|
||||||
|
fun setDate(datePickerLaunchViewId: Int, year: Int, monthOfYear: Int, dayOfMonth: Int) {
|
||||||
|
onView(withId(datePickerLaunchViewId)).perform(click())
|
||||||
|
selectDateInPicker(year, monthOfYear, dayOfMonth)
|
||||||
|
// click ok in date picker
|
||||||
|
onView(withId(android.R.id.button1)).perform(click())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun selectSingleImage(imagePickerLauncherViewId: Int, filePath: String) {
|
||||||
|
selectSingleImageFromGallery(filePath) {
|
||||||
|
onView(withId(imagePickerLauncherViewId)).perform(click())
|
||||||
|
}
|
||||||
|
// click ok in date picker
|
||||||
|
}
|
||||||
|
|
||||||
|
fun selectMultipleImage(imagePickerLauncherViewId: Int, filePaths: Array<String>) {
|
||||||
|
selectMultipleImageFromGallery(filePaths) {
|
||||||
|
onView(withId(imagePickerLauncherViewId)).perform(click())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package h_mal.appttude.com.driver.helpers
|
||||||
|
|
||||||
|
import android.os.Environment
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File paths for images on device
|
||||||
|
*/
|
||||||
|
private const val BASE = "/Camera/images/"
|
||||||
|
const val PROFILE_PIC = "${BASE}driver_profile_pic.jpg"
|
||||||
|
const val INSURANCE = "${BASE}driver_insurance.jpg"
|
||||||
|
const val PRIVATE_HIRE = "${BASE}driver_license_private_hire.jpg"
|
||||||
|
const val PRIVATE_HIRE_CAR = "${BASE}driver_license_private_hire_car.jpg"
|
||||||
|
const val LOGBOOK = "${BASE}driver_logbook.jpg"
|
||||||
|
const val MOT = "${BASE}driver_mot.jpg"
|
||||||
|
const val LICENSE = "${BASE}driver_license_driver.jpg"
|
||||||
|
|
||||||
|
fun getImagePath(imageConst: String): String {
|
||||||
|
return File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM), imageConst).absolutePath
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package h_mal.appttude.com.driver.helpers
|
||||||
|
|
||||||
|
import android.content.ClipData
|
||||||
|
import android.content.ClipData.Item
|
||||||
|
import android.content.ClipDescription
|
||||||
|
import android.net.Uri
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
|
object DataHelper {
|
||||||
|
|
||||||
|
fun createClipItem(filePath: String) = Item(
|
||||||
|
Uri.fromFile(File(filePath)
|
||||||
|
))
|
||||||
|
|
||||||
|
fun createClipData(item: Item, mimeType: String = "text/uri-list") = ClipData(null, arrayOf(mimeType), item)
|
||||||
|
|
||||||
|
fun createClipData(filePath: String) = createClipData(createClipItem(filePath))
|
||||||
|
|
||||||
|
fun createClipData(uri: Uri) = createClipData(Item(uri))
|
||||||
|
|
||||||
|
fun ClipData.addFilePaths(filePaths: Array<String>) {
|
||||||
|
filePaths.forEach { addItem(createClipItem(it)) }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,17 +8,17 @@ class RegisterRobot : BaseTestRobot() {
|
|||||||
|
|
||||||
fun setName(name: String) = fillEditText(R.id.name_register, name)
|
fun setName(name: String) = fillEditText(R.id.name_register, name)
|
||||||
|
|
||||||
fun setEmail(email: String) = fillEditText(R.id.email_register, email)
|
fun setEmail(email: String) = fillEditText(R.id.email, email)
|
||||||
|
|
||||||
fun setPassword(pass: String) = fillEditText(R.id.password_top, pass)
|
fun setPassword(pass: String) = fillEditText(R.id.password_top, pass)
|
||||||
|
|
||||||
fun setPasswordConfirm(pass: String) = fillEditText(R.id.password_bottom, pass)
|
fun setPasswordConfirm(pass: String) = fillEditText(R.id.password_bottom, pass)
|
||||||
|
|
||||||
fun clickLogin() = clickButton(R.id.email_sign_up)
|
fun clickLogin() = clickButton(R.id.submit)
|
||||||
|
|
||||||
fun checkNameError(err: String) = checkErrorOnTextEntry(R.id.name_register, err)
|
fun checkNameError(err: String) = checkErrorOnTextEntry(R.id.name_register, err)
|
||||||
|
|
||||||
fun checkEmailError(err: String) = checkErrorOnTextEntry(R.id.email_register, err)
|
fun checkEmailError(err: String) = checkErrorOnTextEntry(R.id.email, err)
|
||||||
|
|
||||||
fun checkPasswordError(err: String) = checkErrorOnTextEntry(R.id.password_top, err)
|
fun checkPasswordError(err: String) = checkErrorOnTextEntry(R.id.password_top, err)
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
|
||||||
fun delete(func: DeleteRobot.() -> Unit) = DeleteRobot().apply { func() }
|
fun delete(func: DeleteRobot.() -> Unit) = DeleteRobot().apply { func() }
|
||||||
class DeleteRobot : BaseTestRobot() {
|
class DeleteRobot : FormRobot() {
|
||||||
|
|
||||||
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
||||||
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
||||||
fun submitDelete() = clickButton(R.id.submission_button_label)
|
|
||||||
|
|
||||||
fun submitForm(email: String, password: String) {
|
fun submitForm(email: String, password: String) {
|
||||||
enterEmail(email)
|
enterEmail(email)
|
||||||
enterPassword(password)
|
enterPassword(password)
|
||||||
submitDelete()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,21 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
import h_mal.appttude.com.driver.helpers.LICENSE
|
||||||
|
import h_mal.appttude.com.driver.helpers.getImagePath
|
||||||
|
|
||||||
fun driversLicense(func: DriversLicenseRobot.() -> Unit) = DriversLicenseRobot().apply { func() }
|
fun driversLicense(func: DriversLicenseRobot.() -> Unit) = DriversLicenseRobot().apply { func() }
|
||||||
class DriversLicenseRobot : BaseTestRobot() {
|
class DriversLicenseRobot : FormRobot() {
|
||||||
|
|
||||||
fun enterLicenseNumber(text: String) = fillEditText(R.id.lic_no, text)
|
fun enterLicenseNumber(text: String) = fillEditText(R.id.lic_no, text)
|
||||||
fun enterLicenseExpiry(text: String) = fillEditText(R.id.lic_expiry, text)
|
fun enterLicenseExpiry(year: Int, monthOfYear: Int, dayOfMonth: Int) = setDate(R.id.lic_expiry, year, monthOfYear, dayOfMonth)
|
||||||
fun selectImage() = clickButton(R.id.search_image)
|
fun selectImage() = selectSingleImage(R.id.search_image, getImagePath(LICENSE))
|
||||||
fun clickSubmit() = clickButton(R.id.submit)
|
|
||||||
|
|
||||||
fun submitForm(licenseNumber: String, licenseExpiry: String) {
|
fun submitForm(licenseNumber: String, year: Int, monthOfYear: Int, dayOfMonth: Int) {
|
||||||
selectImage()
|
selectImage()
|
||||||
// TODO: select image in gallery
|
|
||||||
enterLicenseNumber(licenseNumber)
|
enterLicenseNumber(licenseNumber)
|
||||||
enterLicenseExpiry(licenseExpiry)
|
enterLicenseExpiry(year, monthOfYear, dayOfMonth)
|
||||||
clickSubmit()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,26 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import android.text.InputType
|
||||||
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
|
||||||
fun driversProfile(func: DriversProfileRobot.() -> Unit) = DriversProfileRobot().apply { func() }
|
fun driversProfile(func: DriversProfileRobot.() -> Unit) = DriversProfileRobot().apply { func() }
|
||||||
class DriversProfileRobot : BaseTestRobot() {
|
class DriversProfileRobot : FormRobot() {
|
||||||
|
|
||||||
|
fun enterName(name: String) = fillEditText(R.id.names_input, name)
|
||||||
|
fun enterAddress(address: String) = fillEditText(R.id.address_input, address)
|
||||||
|
fun enterPostcode(postcode: String) = fillEditText(R.id.postcode_input, postcode)
|
||||||
|
fun enterDateOfBirth(dob: String) = fillEditText(R.id.dob_input, dob)
|
||||||
|
fun enterNINumber(niNumber: String) = fillEditText(R.id.ni_number, niNumber)
|
||||||
|
fun enterDateFirstAvailable(year: Int, monthOfYear: Int, dayOfMonth: Int) = setDate(R.id.date_first, year, monthOfYear, dayOfMonth)
|
||||||
|
|
||||||
fun enterLicenseNumber(text: String) = fillEditText(R.id.lic_no, text)
|
|
||||||
fun enterLicenseExpiry(text: String) = fillEditText(R.id.lic_expiry, text)
|
|
||||||
fun selectImage() = clickButton(R.id.add_photo)
|
fun selectImage() = clickButton(R.id.add_photo)
|
||||||
fun clickSubmit() = clickButton(R.id.submit_driver)
|
|
||||||
|
|
||||||
fun submitForm(licenseNumber: String, licenseExpiry: String) {
|
fun submitForm(name: String, address: String, postcode: String, dob: String, niNumber: String, year: Int, monthOfYear: Int, dayOfMonth: Int) {
|
||||||
selectImage()
|
selectImage()
|
||||||
// TODO: select image in gallery
|
// TODO: select image in gallery
|
||||||
enterLicenseNumber(licenseNumber)
|
enterName(name)
|
||||||
enterLicenseExpiry(licenseExpiry)
|
enterAddress(address)
|
||||||
clickSubmit()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,4 +27,5 @@ class HomeRobot : BaseTestRobot() {
|
|||||||
fun openDriverProfile() = clickButton(R.id.driver)
|
fun openDriverProfile() = clickButton(R.id.driver)
|
||||||
fun openVehicleProfile() = clickButton(R.id.car)
|
fun openVehicleProfile() = clickButton(R.id.car)
|
||||||
|
|
||||||
|
fun requestProfile() = clickButton(R.id.request_driver_button)
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,19 @@
|
|||||||
@file:JvmName("UpdateEmailRobotKt")
|
|
||||||
|
|
||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
|
||||||
fun updateEmail(func: UpdateEmailRobot.() -> Unit) = UpdateEmailRobot().apply { func() }
|
fun updateEmail(func: UpdateEmailRobot.() -> Unit) = UpdateEmailRobot().apply { func() }
|
||||||
class UpdateEmailRobot : BaseTestRobot() {
|
class UpdateEmailRobot : FormRobot() {
|
||||||
|
|
||||||
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
||||||
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
||||||
fun enterNewEmail(email: String) = fillEditText(R.id.new_email, email)
|
fun enterNewEmail(email: String) = fillEditText(R.id.new_email, email)
|
||||||
fun submitDelete() = clickButton(R.id.submission_button_label)
|
|
||||||
|
|
||||||
fun submitForm(email: String, password: String, newEmail: String) {
|
fun submitForm(email: String, password: String, newEmail: String) {
|
||||||
enterEmail(email)
|
enterEmail(email)
|
||||||
enterPassword(password)
|
enterPassword(password)
|
||||||
enterNewEmail(newEmail)
|
enterNewEmail(newEmail)
|
||||||
submitDelete()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
|
||||||
fun updatePassword(func: UpdatePasswordRobot.() -> Unit) = UpdatePasswordRobot().apply { func() }
|
fun updatePassword(func: UpdatePasswordRobot.() -> Unit) = UpdatePasswordRobot().apply { func() }
|
||||||
class UpdatePasswordRobot : BaseTestRobot() {
|
class UpdatePasswordRobot : FormRobot() {
|
||||||
|
|
||||||
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
fun enterEmail(email: String) = fillEditText(R.id.email_update, email)
|
||||||
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
fun enterPassword(password: String) = fillEditText(R.id.password_top, password)
|
||||||
fun enterNewPassword(email: String) = fillEditText(R.id.password_bottom, email)
|
fun enterNewPassword(email: String) = fillEditText(R.id.password_bottom, email)
|
||||||
fun submitDelete() = clickButton(R.id.email_sign_up)
|
fun submitDelete() = clickButton(R.id.submit)
|
||||||
|
|
||||||
fun submitForm(email: String, password: String, newPassword: String) {
|
fun submitForm(email: String, password: String, newPassword: String) {
|
||||||
enterEmail(email)
|
enterEmail(email)
|
||||||
enterPassword(password)
|
enterPassword(password)
|
||||||
enterNewPassword(newPassword)
|
enterNewPassword(newPassword)
|
||||||
submitDelete()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,19 +1,18 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.FormRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
import h_mal.appttude.com.driver.helpers.PROFILE_PIC
|
||||||
|
|
||||||
fun updateProfile(func: UpdateProfileRobot.() -> Unit) = UpdateProfileRobot().apply { func() }
|
fun updateProfile(func: UpdateProfileRobot.() -> Unit) = UpdateProfileRobot().apply { func() }
|
||||||
class UpdateProfileRobot : BaseTestRobot() {
|
class UpdateProfileRobot : FormRobot() {
|
||||||
|
|
||||||
fun enterName(name: String) = fillEditText(R.id.update_name, name)
|
fun enterName(name: String) = fillEditText(R.id.update_name, name)
|
||||||
fun selectImage() = clickButton(R.id.profile_img)
|
// fun selectImage() = selectSingleImage(R.id.profile_img, PROFILE_PIC)
|
||||||
fun submitProfileUpdate() = clickButton(R.id.submit_update_profile)
|
|
||||||
|
|
||||||
fun submitForm(name: String) {
|
fun submitForm(name: String) {
|
||||||
selectImage()
|
// selectImage()
|
||||||
// TODO: select image in gallery
|
|
||||||
enterName(name)
|
enterName(name)
|
||||||
submitProfileUpdate()
|
submit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
package h_mal.appttude.com.driver.robots
|
package h_mal.appttude.com.driver.robots
|
||||||
|
|
||||||
import androidx.test.espresso.Espresso.onView
|
|
||||||
import androidx.test.espresso.contrib.DrawerActions
|
|
||||||
import androidx.test.espresso.matcher.ViewMatchers.withId
|
|
||||||
import h_mal.appttude.com.driver.BaseTestRobot
|
import h_mal.appttude.com.driver.BaseTestRobot
|
||||||
import h_mal.appttude.com.driver.R
|
import h_mal.appttude.com.driver.R
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package h_mal.appttude.com.driver.tests.newUser
|
||||||
|
|
||||||
|
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||||
|
import androidx.test.filters.LargeTest
|
||||||
|
import androidx.test.rule.GrantPermissionRule
|
||||||
|
import h_mal.appttude.com.driver.FirebaseTest
|
||||||
|
import h_mal.appttude.com.driver.R
|
||||||
|
import h_mal.appttude.com.driver.robots.*
|
||||||
|
import h_mal.appttude.com.driver.ui.MainActivity
|
||||||
|
import h_mal.appttude.com.driver.ui.user.LoginActivity
|
||||||
|
import org.junit.*
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
|
||||||
|
@LargeTest
|
||||||
|
@RunWith(AndroidJUnit4::class)
|
||||||
|
class SubmitNewDataActivityTest :
|
||||||
|
FirebaseTest<MainActivity>(MainActivity::class.java, registered = true, signedIn = true) {
|
||||||
|
|
||||||
|
@get:Rule var permissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun verifyUserRegistration_validUsernameAndPassword_loggedIn() {
|
||||||
|
home {
|
||||||
|
waitFor(2500)
|
||||||
|
checkTitleExists(getResourceString(R.string.welcome_title))
|
||||||
|
requestProfile()
|
||||||
|
openDriverProfile()
|
||||||
|
}
|
||||||
|
driverScreen {
|
||||||
|
|
||||||
|
driverLicense()
|
||||||
|
}
|
||||||
|
driversLicense {
|
||||||
|
submitForm("SAMPLE8456310LTU", 2022, 10, 2)
|
||||||
|
}
|
||||||
|
waitFor(5000)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ class DriverProfileFragment :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
addPhoto.setOnClickListener { openGalleryWithPermissionRequest() }
|
addPhoto.setOnClickListener { openGalleryWithPermissionRequest() }
|
||||||
submitDriver.setOnClickListener { submit() }
|
submit.setOnClickListener { submit() }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun submit() {
|
override fun submit() {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class InsuranceFragment :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
uploadInsurance.setOnClickListener { openGalleryWithPermissionRequest() }
|
uploadInsurance.setOnClickListener { openGalleryWithPermissionRequest() }
|
||||||
submitIns.setOnClickListener { submit() }
|
submit.setOnClickListener { submit() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class LogbookFragment :
|
|||||||
override fun setupView(binding: FragmentLogbookBinding) = binding.run {
|
override fun setupView(binding: FragmentLogbookBinding) = binding.run {
|
||||||
v5cNo.setTextOnChange { model.v5cnumber = it }
|
v5cNo.setTextOnChange { model.v5cnumber = it }
|
||||||
uploadLb.setOnClickListener { openGalleryWithPermissionRequest() }
|
uploadLb.setOnClickListener { openGalleryWithPermissionRequest() }
|
||||||
submitLb.setOnClickListener { submit() }
|
submit.setOnClickListener { submit() }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun submit() {
|
override fun submit() {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class MotFragment : DataSubmissionBaseFragment<MotViewModel, FragmentMotBinding,
|
|||||||
}
|
}
|
||||||
|
|
||||||
uploadmot.setOnClickListener { openGalleryWithPermissionRequest() }
|
uploadmot.setOnClickListener { openGalleryWithPermissionRequest() }
|
||||||
submitMot.setOnClickListener {
|
submit.setOnClickListener {
|
||||||
validateEditTexts(motExpiry).isTrue {
|
validateEditTexts(motExpiry).isTrue {
|
||||||
viewModel.setDataInDatabase(model, picUri)
|
viewModel.setDataInDatabase(model, picUri)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class VehicleProfileFragment : DataSubmissionBaseFragment
|
|||||||
}
|
}
|
||||||
seizedCheckbox.setOnCheckedChangeListener { _, res -> model.isSeized = res }
|
seizedCheckbox.setOnCheckedChangeListener { _, res -> model.isSeized = res }
|
||||||
|
|
||||||
submitVehicle.setOnClickListener {
|
submit.setOnClickListener {
|
||||||
validateEditTexts(
|
validateEditTexts(
|
||||||
reg,
|
reg,
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -18,15 +18,15 @@ import org.kodein.di.generic.singleton
|
|||||||
|
|
||||||
class DriverApplication : Application(), KodeinAware {
|
class DriverApplication : Application(), KodeinAware {
|
||||||
|
|
||||||
override fun onCreate() {
|
// override fun onCreate() {
|
||||||
super.onCreate()
|
// super.onCreate()
|
||||||
|
//
|
||||||
val localHost = "10.0.2.2"
|
// val localHost = "10.0.2.2"
|
||||||
|
//
|
||||||
FirebaseAuth.getInstance().useEmulator(localHost, 9099)
|
// FirebaseAuth.getInstance().useEmulator(localHost, 9099)
|
||||||
FirebaseDatabase.getInstance().useEmulator(localHost, 9000)
|
// FirebaseDatabase.getInstance().useEmulator(localHost, 9000)
|
||||||
FirebaseStorage.getInstance().useEmulator(localHost, 9199)
|
// FirebaseStorage.getInstance().useEmulator(localHost, 9199)
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Kodein aware to initialise the classes used for DI
|
// Kodein aware to initialise the classes used for DI
|
||||||
override val kodein = Kodein.lazy {
|
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.KodeinAware
|
||||||
import org.kodein.di.android.x.kodein
|
import org.kodein.di.android.x.kodein
|
||||||
import org.kodein.di.generic.instance
|
import org.kodein.di.generic.instance
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
abstract class BaseFragment<V : BaseViewModel, VB : ViewBinding> : Fragment(), KodeinAware {
|
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?> {
|
private fun getResultsContract(): ActivityResultContract<Boolean, Any?> {
|
||||||
return object : ActivityResultContract<Boolean, Any?>() {
|
return object : ActivityResultContract<Boolean, Any?>() {
|
||||||
override fun createIntent(context: Context, input: Boolean): Intent {
|
override fun createIntent(context: Context, input: Boolean): Intent {
|
||||||
return Intent(Intent.ACTION_PICK).apply {
|
return Intent(Intent.ACTION_GET_CONTENT)
|
||||||
type = "image/*"
|
.addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, input)
|
.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, input)
|
||||||
}
|
.setType("image/*")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun parseResult(resultCode: Int, intent: Intent?): Any? {
|
override fun parseResult(resultCode: Int, intent: Intent?): Any? {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class DeleteProfileFragment :
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentDeleteProfileBinding) = binding.run {
|
override fun setupView(binding: FragmentDeleteProfileBinding) = binding.run {
|
||||||
passwordTop.setEnterPressedListener { deleteUser() }
|
passwordTop.setEnterPressedListener { deleteUser() }
|
||||||
submissionButtonLabel.setOnClickListener { deleteUser() }
|
submit.setOnClickListener { deleteUser() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun deleteUser() = applyBinding {
|
private fun deleteUser() = applyBinding {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class UpdateEmailFragment : BaseFragment<UpdateUserViewModel, FragmentUpdateEmai
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentUpdateEmailBinding) = binding.run {
|
override fun setupView(binding: FragmentUpdateEmailBinding) = binding.run {
|
||||||
newEmail.setEnterPressedListener { registerUser() }
|
newEmail.setEnterPressedListener { registerUser() }
|
||||||
submissionButtonLabel.setOnClickListener { registerUser() }
|
submit.setOnClickListener { registerUser() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun registerUser() {
|
private fun registerUser() {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class UpdatePasswordFragment : BaseFragment<UpdateUserViewModel, FragmentUpdateP
|
|||||||
override fun setupView(binding: FragmentUpdatePasswordBinding) {
|
override fun setupView(binding: FragmentUpdatePasswordBinding) {
|
||||||
applyBinding {
|
applyBinding {
|
||||||
emailUpdate.setEnterPressedListener { registerUser() }
|
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() {
|
private fun submitProfileUpdate() {
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ class RegisterFragment :
|
|||||||
|
|
||||||
override fun setupView(binding: FragmentRegisterBinding) = binding.run {
|
override fun setupView(binding: FragmentRegisterBinding) = binding.run {
|
||||||
passwordBottom.setEnterPressedListener { registerUser() }
|
passwordBottom.setEnterPressedListener { registerUser() }
|
||||||
emailSignUp.setOnClickListener { registerUser() }
|
submit.setOnClickListener { registerUser() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun registerUser() {
|
private fun registerUser() {
|
||||||
applyBinding {
|
applyBinding {
|
||||||
val nameString = nameRegister.validatePasswordEditText() ?: return@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 passwordText = passwordTop.validatePasswordEditText() ?: return@applyBinding
|
||||||
val passwordTextBottom =
|
val passwordTextBottom =
|
||||||
passwordBottom.validatePasswordEditText() ?: return@applyBinding
|
passwordBottom.validatePasswordEditText() ?: return@applyBinding
|
||||||
|
|||||||
@@ -22,12 +22,12 @@
|
|||||||
style="@style/subheader"
|
style="@style/subheader"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:text="@string/delete_profile_subtitle"
|
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_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_old_email"
|
android:id="@+id/til_name"
|
||||||
style="@style/text_input_layout"
|
style="@style/text_input_layout"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
style="@style/text_input_layout"
|
style="@style/text_input_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/til_old_email">
|
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password_top"
|
android:id="@+id/password_top"
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submission_button_label"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -132,7 +132,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_driver"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton"
|
style="@style/TextButton"
|
||||||
android:text="@string/submit" />
|
android:text="@string/submit" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_ins"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_lb"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_mot"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -3,75 +3,71 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
style="@style/constraint_container"
|
style="@style/parent_constraint_layout"
|
||||||
android:background="#73000000"
|
android:background="#73000000"
|
||||||
tools:context="ui.user.ForgotPasswordFragment">
|
tools:context="ui.user.ForgotPasswordFragment">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/login_title_tv"
|
<com.google.android.material.button.MaterialButton
|
||||||
style="@style/title_text"
|
android:id="@+id/submit"
|
||||||
android:layout_width="0dp"
|
style="@style/TextButton.WithIcon"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:text="@string/submit"
|
||||||
android:layout_marginTop="96dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:text="@string/register_label"
|
|
||||||
android:textColor="#ffffff"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="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
|
<TextView
|
||||||
android:id="@+id/login_subtitle_tv"
|
android:id="@+id/login_subtitle_tv"
|
||||||
android:layout_width="0dp"
|
style="@style/subheader"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginBottom="24dp"
|
||||||
android:layout_marginStart="24dp"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginEnd="24dp"
|
|
||||||
android:text="@string/register_subtitle"
|
android:text="@string/register_subtitle"
|
||||||
android:textColor="#ffffff"
|
app:layout_constraintBottom_toTopOf="@id/til_name"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/login_title_tv" />
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_old_email"
|
android:id="@+id/til_name"
|
||||||
android:layout_width="0dp"
|
style="@style/text_input_layout"
|
||||||
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"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/login_subtitle_tv">
|
app:layout_constraintBottom_toTopOf="@id/til_email">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/name_register"
|
android:id="@+id/name_register"
|
||||||
style="@style/EditTextStyle"
|
style="@style/EditTextStyle"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:hint="@string/promt_name"
|
android:hint="@string/promt_name"
|
||||||
android:inputType="textPersonName"
|
android:inputType="textPersonName"
|
||||||
android:autofillHints="name" />
|
android:autofillHints="name"/>
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_email"
|
android:id="@+id/til_email"
|
||||||
android:layout_width="0dp"
|
style="@style/text_input_layout"
|
||||||
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"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="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
|
<EditText
|
||||||
android:id="@+id/email_register"
|
android:id="@+id/email"
|
||||||
style="@style/EditTextStyle"
|
style="@style/EditTextStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -81,74 +77,31 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_password_top"
|
android:id="@+id/til_new_password"
|
||||||
android:layout_width="0dp"
|
style="@style/text_input_layout"
|
||||||
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"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/til_email">
|
app:layout_constraintTop_toBottomOf="@+id/til_email">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password_top"
|
android:id="@+id/password_top"
|
||||||
style="@style/EditTextStyle"
|
style="@style/EditTextStyle"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:hint="@string/prompt_password"
|
android:hint="@string/prompt_password"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:autofillHints="password" />
|
android:autofillHints="password" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_password_bottom"
|
android:id="@+id/til_new_password_again"
|
||||||
android:layout_width="0dp"
|
style="@style/text_input_layout"
|
||||||
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"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/til_password_top">
|
app:layout_constraintTop_toBottomOf="@+id/til_new_password">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password_bottom"
|
android:id="@+id/password_bottom"
|
||||||
style="@style/EditTextStyle"
|
style="@style/EditTextStyle"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:hint="@string/prompt_password"
|
android:hint="@string/prompt_password"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:autofillHints="password" />
|
android:autofillHints="password" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</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>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@@ -23,14 +23,14 @@
|
|||||||
android:text="@string/update_email_subtitle"
|
android:text="@string/update_email_subtitle"
|
||||||
style="@style/subheader"
|
style="@style/subheader"
|
||||||
android:layout_marginBottom="24dp"
|
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_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_old_email"
|
android:id="@+id/til_name"
|
||||||
style="@style/text_input_layout"
|
style="@style/text_input_layout"
|
||||||
android:layout_marginTop="48dp"
|
android:layout_marginTop="48dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
android:id="@+id/submission_button_label"
|
android:id="@+id/submit"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.8"
|
app:layout_constraintVertical_bias="0.8"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
style="@style/parent_constraint_layout"
|
style="@style/parent_constraint_layout"
|
||||||
tools:context="ui.user.ForgotPasswordFragment">
|
tools:context="ui.update.UpdatePasswordFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/login_title_tv"
|
android:id="@+id/login_title_tv"
|
||||||
@@ -22,14 +22,14 @@
|
|||||||
style="@style/subheader"
|
style="@style/subheader"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:text="@string/update_password_subtitle"
|
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_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/til_old_email"
|
android:id="@+id/til_name"
|
||||||
style="@style/text_input_layout"
|
style="@style/text_input_layout"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/til_old_email">
|
app:layout_constraintTop_toBottomOf="@+id/til_name">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/password_top"
|
android:id="@+id/password_top"
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/email_sign_up"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
style="@style/parent_constraint_layout"
|
style="@style/parent_constraint_layout"
|
||||||
tools:context=".ui.user.ForgotPasswordFragment">
|
tools:context=".ui.update.UpdateProfileFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/login_title_tv"
|
android:id="@+id/login_title_tv"
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_update_profile"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -134,9 +134,8 @@
|
|||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:textSize="18sp" />
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/submit_vehicle"
|
android:id="@+id/submit"
|
||||||
style="@style/TextButton.WithIcon"
|
style="@style/TextButton.WithIcon"
|
||||||
android:text="@string/submit"
|
android:text="@string/submit"
|
||||||
android:layout_marginBottom="48dp"
|
android:layout_marginBottom="48dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user