Skip to content

Commit

Permalink
namings consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
jbsv committed Jan 18, 2024
1 parent 36e2f05 commit d333161
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.epfl.dedis.hbt.test.ui.page.register
import androidx.annotation.IdRes
import com.epfl.dedis.hbt.R

object ScanPassportFragmentPage {
object PassportScanFragmentPage {

@IdRes
fun scanPassportFragmentId() = R.id.scanPassportFragment
fun scanPassportFragmentId() = R.id.passportScanFragment
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import androidx.lifecycle.Observer
import com.epfl.dedis.hbt.R
import com.epfl.dedis.hbt.databinding.FragmentLoginBinding
import com.epfl.dedis.hbt.ui.MainActivity
import com.epfl.dedis.hbt.ui.register.ScanPassportFragment
import com.epfl.dedis.hbt.ui.register.PassportScanFragment
import com.epfl.dedis.hbt.ui.wallet.WalletFragment
import dagger.hilt.android.AndroidEntryPoint

Expand Down Expand Up @@ -117,7 +117,7 @@ class LoginFragment : Fragment() {
}

registerButton.setOnClickListener {
MainActivity.setCurrentFragment(parentFragmentManager, ScanPassportFragment())
MainActivity.setCurrentFragment(parentFragmentManager, PassportScanFragment())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class PassportDataFragment : Fragment() {
automaticScan.setOnClickListener {
MainActivity.setCurrentFragment(
parentFragmentManager,
ScanPassportFragment()
PassportScanFragment()
)
}

validate.setOnClickListener {
MainActivity.setCurrentFragment(
parentFragmentManager,
NFCPassportFragment.newInstance(
PassportNfcFragment.newInstance(
BACData.create(
passportNumber.text.toString(),
editBirthDate.text.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import androidx.fragment.app.viewModels
import androidx.lifecycle.coroutineScope
import com.epfl.dedis.hbt.R
import com.epfl.dedis.hbt.data.Result
import com.epfl.dedis.hbt.databinding.FragmentNfcPassportBinding
import com.epfl.dedis.hbt.databinding.FragmentPassportNfcBinding
import com.epfl.dedis.hbt.service.passport.Passport
import com.epfl.dedis.hbt.service.passport.mrz.BACData
import com.epfl.dedis.hbt.service.passport.ncf.NFCReader
Expand All @@ -26,10 +26,10 @@ private const val BAC_DATA = "bac_data"

/**
* A simple [Fragment] subclass.
* Use the [NFCPassportFragment.newInstance] factory method to
* Use the [PassportNfcFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class NFCPassportFragment : Fragment() {
class PassportNfcFragment : Fragment() {

private val nfcViewModel: NFCViewModel by viewModels(ownerProducer = { requireActivity() })

Expand Down Expand Up @@ -83,7 +83,7 @@ class NFCPassportFragment : Fragment() {
}
}

return FragmentNfcPassportBinding.inflate(inflater, container, false).root
return FragmentPassportNfcBinding.inflate(inflater, container, false).root
}

private fun extractPersonalData(passport: Passport): String? {
Expand All @@ -109,7 +109,7 @@ class NFCPassportFragment : Fragment() {
*/
@JvmStatic
fun newInstance(bacData: BACData) =
NFCPassportFragment().apply {
PassportNfcFragment().apply {
arguments = Bundle().apply {
putSerializable(BAC_DATA, bacData)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

@AndroidEntryPoint
class ScanPassportFragment : Fragment() {
class PassportScanFragment : Fragment() {

companion object {
private val TAG = ScanPassportFragment::class.java.simpleName
private val TAG = PassportScanFragment::class.java.simpleName
}

private var _binding: FragmentPassportScanBinding? = null
Expand Down Expand Up @@ -112,7 +112,7 @@ class ScanPassportFragment : Fragment() {
is Success ->
MainActivity.setCurrentFragment(
parentFragmentManager,
NFCPassportFragment.newInstance(result.data)
PassportNfcFragment.newInstance(result.data)
)
is Error -> when (result.exception) {
is ValidationException ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nfcFragment"
android:id="@+id/passportNfcFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.register.NFCPassportFragment">
tools:context=".ui.register.PassportNfcFragment">

<ProgressBar
android:id="@+id/progressBar"
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/res/layout/fragment_passport_scan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scanPassportFragment"
android:id="@+id/passportScanFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="@dimen/fragment_horizontal_margin"
android:paddingVertical="@dimen/fragment_vertical_margin"
tools:context=".ui.register.ScanPassportFragment">
tools:context=".ui.register.PassportScanFragment">

<Button
android:id="@+id/manual_input"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import com.epfl.dedis.hbt.test.ui.page.login.LoginFragmentPage.loginButton
import com.epfl.dedis.hbt.test.ui.page.login.LoginFragmentPage.pincodeInput
import com.epfl.dedis.hbt.test.ui.page.login.LoginFragmentPage.registerButton
import com.epfl.dedis.hbt.test.ui.page.login.LoginFragmentPage.usernameInput
import com.epfl.dedis.hbt.test.ui.page.register.ScanPassportFragmentPage.scanPassportFragmentId
import com.epfl.dedis.hbt.test.ui.page.register.PassportScanFragmentPage.scanPassportFragmentId
import com.epfl.dedis.hbt.test.ui.page.wallet.WalletFragmentPage.walletFragmentId
import dagger.hilt.android.testing.BindValue
import dagger.hilt.android.testing.HiltAndroidRule
Expand Down

0 comments on commit d333161

Please sign in to comment.