Skip to content

Commit

Permalink
Fix distorted ID PASS branding in older android devices
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmangubat23 committed Jul 26, 2022
1 parent afb7e51 commit 43dac1f
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class MainActivity : AppCompatActivity() {
binding.itemBarcode.item.setOnClickListener { scanBarcode(BarcodeOptions.default) }
binding.itemIdpassLite.item.setOnClickListener { scanIDPassLite() }
binding.itemMrz.item.setOnClickListener { scanMRZ() }
binding.itemQR.item.setOnClickListener { scanQRCode() }
binding.itemQr.item.setOnClickListener { scanQRCode() }
binding.itemNfc.item.setOnClickListener { scanNFC() }
// Change language
binding.languageSettings.setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class IDPassResultActivity : AppCompatActivity(), View.OnClickListener {
setContentView(R.layout.activity_idpass_result)
// Initialize UI
val toolbar : Toolbar? = findViewById(R.id.toolbar)
val pinCodeBtn: Button = findViewById(R.id.pinCodeAuth)
val pinCodeBtn: Button = findViewById(R.id.pin_code_auth)
pinCodeBtn.setOnClickListener(this)
// Setup toolbar
setSupportActionBar(toolbar)
Expand Down Expand Up @@ -197,8 +197,8 @@ class IDPassResultActivity : AppCompatActivity(), View.OnClickListener {

override fun onClick(v: View?) {
when (v?.id) {
R.id.pinCodeAuth -> {
val cardpincode = findViewById<EditText>(R.id.cardPinCode)
R.id.pin_code_auth -> {
val cardpincode = findViewById<EditText>(R.id.card_pin_code)
pinCode = cardpincode.text.toString()
displayResult(qrBytes)
hideKeyboard(cardpincode)
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/layout/activity_idpass_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="org.idpass.smartscanner.org.newlogic.smartscanner.result.IDPassResultActivity">
tools:context="org.newlogic.smartscanner.result.IDPassResultActivity">

<LinearLayout
android:id="@+id/linearLayout"
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand Down Expand Up @@ -57,7 +57,7 @@
</LinearLayout>

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/cardPinCode"
android:id="@+id/card_pin_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -70,10 +70,10 @@
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
app:layout_constraintTop_toBottomOf="@+id/layout" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/pinCodeAuth"
android:id="@+id/pin_code_auth"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="16dp"
Expand All @@ -85,5 +85,5 @@
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cardPinCode" />
app:layout_constraintTop_toBottomOf="@+id/card_pin_code" />
</androidx.constraintlayout.widget.ConstraintLayout>
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
tools:context="org.newlogic.smartscanner.result.ResultActivity">

<LinearLayout
android:id="@+id/linearLayout"
android:id="@+id/linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
Expand All @@ -25,7 +25,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/toolbarTitle"
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
Expand All @@ -40,7 +40,7 @@
</androidx.appcompat.widget.Toolbar>

<TextView
android:id="@+id/textResult"
android:id="@+id/text_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -55,7 +55,7 @@
tools:text="54 65 73 74 20 51 52 20 Test QR\n43 6F 64 65 Code" />

<TextView
android:id="@+id/imageLabel"
android:id="@+id/image_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
Expand All @@ -69,7 +69,7 @@
android:visibility="gone" />

<com.jsibbold.zoomage.ZoomageView
android:id="@+id/imageResult"
android:id="@+id/image_result"
android:layout_width="match_parent"
android:layout_height="220dp"
android:layout_marginStart="16dp"
Expand All @@ -81,7 +81,7 @@
android:visibility="gone" />

<TextView
android:id="@+id/textRawLabel"
android:id="@+id/text_raw_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
Expand All @@ -94,7 +94,7 @@
android:visibility="gone" />

<EditText
android:id="@+id/editTextRaw"
android:id="@+id/edit_text_raw"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_barcode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingTop="16dp">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appCompatImageView"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txtBarcode"
android:id="@+id/txt_barcode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -29,7 +29,7 @@
android:text="@string/mode_barcode"
android:textColor="@color/newlogic_black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/appCompatImageView"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />

<View
Expand All @@ -41,5 +41,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtBarcode" />
app:layout_constraintTop_toBottomOf="@+id/txt_barcode" />
</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_idpass_lite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingTop="16dp">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appCompatImageView"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txtQR"
android:id="@+id/txt_idpass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -29,7 +29,7 @@
android:text="@string/mode_idpass_lite"
android:textColor="@color/newlogic_black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/appCompatImageView"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />

<View
Expand All @@ -41,5 +41,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtQR" />
app:layout_constraintTop_toBottomOf="@+id/txt_idpass" />
</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_mrz.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingTop="16dp">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appCompatImageView"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txtMrz"
android:id="@+id/txt_mrz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -29,7 +29,7 @@
android:text="@string/mode_mrz"
android:textColor="@color/newlogic_black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/appCompatImageView"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />

<View
Expand All @@ -41,5 +41,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtMrz" />
app:layout_constraintTop_toBottomOf="@+id/txt_mrz" />
</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_nfc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingTop="16dp">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appCompatImageView"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txtNfc"
android:id="@+id/txt_nfc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -29,7 +29,7 @@
android:text="@string/mode_nfc"
android:textColor="@color/newlogic_black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/appCompatImageView"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />

<View
Expand All @@ -41,5 +41,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtNfc" />
app:layout_constraintTop_toBottomOf="@+id/txt_nfc" />
</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 4 additions & 4 deletions app/src/main/res/layout/item_qr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
android:paddingTop="16dp">

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/appCompatImageView"
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/txtQR"
android:id="@+id/txt_qr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
Expand All @@ -29,7 +29,7 @@
android:text="@string/mode_qr"
android:textColor="@color/newlogic_black"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@+id/appCompatImageView"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />

<View
Expand All @@ -41,5 +41,5 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/txtQR" />
app:layout_constraintTop_toBottomOf="@+id/txt_qr" />
</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/sheet_qrcode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">

<LinearLayout
android:id="@+id/btnGzipped"
android:id="@+id/btn_gzipped"
android:layout_width="match_parent"
android:layout_height="60dp"
android:clickable="true"
Expand All @@ -33,7 +33,7 @@
android:background="@android:color/darker_gray" />

<LinearLayout
android:id="@+id/btnRegular"
android:id="@+id/btn_regular"
android:layout_width="match_parent"
android:layout_height="60dp"
android:clickable="true"
Expand All @@ -58,7 +58,7 @@
android:background="@android:color/darker_gray" />

<LinearLayout
android:id="@+id/btnCancel"
android:id="@+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="60dp"
android:clickable="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ class SmartScannerActivity : BaseActivity(), OnClickListener {
setContentView(R.layout.activity_smart_scanner)

// assign view ids
coordinatorLayoutView = findViewById(R.id.coordinatorLayout)
modelLayoutView = findViewById(R.id.viewLayout)
viewFinder = findViewById(R.id.viewFinder)
coordinatorLayoutView = findViewById(R.id.coordinator_layout)
modelLayoutView = findViewById(R.id.view_layout)
viewFinder = findViewById(R.id.view_finder)
flashButton = findViewById(R.id.flash_button)
closeButton = findViewById(R.id.close_button)
rectangle = findViewById(R.id.rectimage)
rectangle = findViewById(R.id.rect_image)
rectangleMRZGuide = findViewById(R.id.rect_image_crop)
modelText = findViewById(R.id.modelText)
modelTextLoading = findViewById(R.id.modelTextLoading)
brandingImage = findViewById(R.id.brandingImage)
manualCapture = findViewById(R.id.manualCapture)
captureLabelText = findViewById(R.id.captureLabelText)
captureHeaderText = findViewById(R.id.captureHeaderText)
captureSubHeaderText = findViewById(R.id.captureSubHeaderText)
modelText = findViewById(R.id.model_text)
modelTextLoading = findViewById(R.id.model_text_loading)
brandingImage = findViewById(R.id.branding_image)
manualCapture = findViewById(R.id.manual_capture)
captureLabelText = findViewById(R.id.capture_label_text)
captureHeaderText = findViewById(R.id.capture_header_text)
captureSubHeaderText = findViewById(R.id.capture_sub_header_text)
// Scanner setup from intent
hideActionBar()
if (intent.action != null) {
Expand Down Expand Up @@ -539,7 +539,7 @@ class SmartScannerActivity : BaseActivity(), OnClickListener {
}
}
}
R.id.manualCapture -> {
R.id.manual_capture -> {
// hide capture button during image capture
manualCapture?.isEnabled = false
val imageFile = File(cacheImagePath())
Expand Down Expand Up @@ -602,9 +602,9 @@ class SmartScannerActivity : BaseActivity(), OnClickListener {
// id pass reader
val reader = IDPassManager.getIDPassReader()
// bottom sheet ids
val pinCodeInpt = sheetView.findViewById<EditText>(R.id.cardPinCode)
val verifyBtn = sheetView.findViewById<Button>(R.id.pinCodeVerify)
val skipBtn = sheetView.findViewById<Button>(R.id.pinCodeSkip)
val pinCodeInpt = sheetView.findViewById<EditText>(R.id.card_pin_code)
val verifyBtn = sheetView.findViewById<Button>(R.id.pin_code_verify)
val skipBtn = sheetView.findViewById<Button>(R.id.pin_code_skip)
// stop smartscanner camera scanning
cameraProvider?.unbindAll()
// bottom sheet listeners
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class NFCFragment : Fragment() {
if (arguments?.containsKey(IntentData.KEY_CAPTURE_LOG) == true) {
captureLog = arguments.getBoolean(IntentData.KEY_CAPTURE_LOG)
}
textViewNfcTitle = view.findViewById(R.id.textViewNfcTitle)
textViewNfcTitle = view.findViewById(R.id.tv_nfc_title)
textViewPassportNumber = view.findViewById(R.id.value_passport_number)
textViewDateOfBirth = view.findViewById(R.id.value_DOB)
textViewDateOfExpiry = view.findViewById(R.id.value_expiration_date)
Expand Down
Loading

0 comments on commit 43dac1f

Please sign in to comment.