kit scan qr code scanning is added, some issues are still resolving only
This commit is contained in:
@@ -129,7 +129,7 @@ dependencies {
|
|||||||
|
|
||||||
// Barcode scanner
|
// Barcode scanner
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'com.github.yuriy-budiyev:code-scanner:2.3.0'
|
||||||
// Google ML Kit using play services
|
// Google ML Kit using play services
|
||||||
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
implementation 'com.google.android.gms:play-services-code-scanner:16.1.0'
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,15 @@
|
|||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.BATTERY_STATS"
|
android:name="android.permission.BATTERY_STATS"
|
||||||
tools:ignore="ProtectedPermissions" />
|
tools:ignore="ProtectedPermissions" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" />
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.camera"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
@@ -25,16 +26,19 @@
|
|||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="com.example.hpostesting.HPOSTestingApplication"
|
android:name="com.example.hpostesting.HPOSTestingApplication"
|
||||||
android:largeHeap="true"
|
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@mipmap/hpos_icon"
|
android:icon="@mipmap/hpos_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:largeHeap="true"
|
||||||
android:roundIcon="@mipmap/hpos_icon_round"
|
android:roundIcon="@mipmap/hpos_icon_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.HPOSTesting"
|
android:theme="@style/Theme.HPOSTesting"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name="com.example.hpostesting.presentation.ScannerKitActvity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.deviceinfo.DeviceActivity"
|
android:name="com.example.hpostesting.presentation.deviceinfo.DeviceActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
@@ -60,23 +64,20 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.calibration.CalibrationActivity"
|
android:name="com.example.hpostesting.presentation.calibration.CalibrationActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
|
android:name="com.example.hpostesting.presentation.assurance.AssuranceControlsActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"/>
|
android:theme="@style/Theme.HPOS.NoActionBar" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
|
android:name="com.example.hpostesting.presentation.hemocube.HemocubeActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:screenOrientation="portrait"
|
|
||||||
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.trueheme.TrueHemeActivity"
|
android:name="com.example.hpostesting.presentation.trueheme.TrueHemeActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
@@ -84,7 +85,6 @@
|
|||||||
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
android:parentActivityName="com.example.hpostesting.presentation.MainActivity"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.buffercheck.HemocubeBufferCheckActivity"
|
android:name="com.example.hpostesting.presentation.buffercheck.HemocubeBufferCheckActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
@@ -94,27 +94,29 @@
|
|||||||
android:windowSoftInputMode="adjustPan" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.KitScanActivity"
|
android:name="com.example.hpostesting.presentation.KitScanActivity"
|
||||||
|
android:configChanges="orientation|screenSize|keyboardHidden"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar" />
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
|
android:windowSoftInputMode="stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
android:name="com.example.hpostesting.presentation.dashboard.DashboardActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:label="@string/title_activity_dashboard"
|
android:label="@string/title_activity_dashboard"
|
||||||
android:theme="@style/Theme.HPOS.NoActionBar"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
android:theme="@style/Theme.HPOS.NoActionBar"
|
||||||
tools:ignore="AppLinkUrlError,MissingClass">
|
tools:ignore="AppLinkUrlError,MissingClass">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<data android:scheme="content" />
|
<data android:scheme="content" />
|
||||||
<data android:scheme="file" />
|
<data android:scheme="file" />
|
||||||
<data android:mimeType="application/vnd.android.package-archive" />
|
<data android:mimeType="application/vnd.android.package-archive" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
|
||||||
<service
|
<service
|
||||||
android:name="com.example.hpostesting.util.UsbService"
|
android:name="com.example.hpostesting.util.UsbService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
@@ -126,8 +128,9 @@
|
|||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
@@ -164,8 +167,7 @@
|
|||||||
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
android:name="com.journeyapps.barcodescanner.CaptureActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:stateNotNeeded="true"
|
android:stateNotNeeded="true"
|
||||||
tools:replace="android:screenOrientation" />
|
tools:replace="android:screenOrientation" /> <!-- ${applicationId} -->
|
||||||
<!-- ${applicationId}-->
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
android:authorities="${applicationId}.fileprovider"
|
android:authorities="${applicationId}.fileprovider"
|
||||||
@@ -175,7 +177,6 @@
|
|||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
android:resource="@xml/file_paths" />
|
android:resource="@xml/file_paths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.example.hpostesting.presentation
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
@@ -9,6 +10,7 @@ import android.util.Log
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.example.hpostesting.data.constant.DataHolder
|
import com.example.hpostesting.data.constant.DataHolder
|
||||||
import com.example.hpostesting.data.constant.Constants
|
import com.example.hpostesting.data.constant.Constants
|
||||||
@@ -42,23 +44,36 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
var sdkHandler: SDKHandler? = null
|
var sdkHandler: SDKHandler? = null
|
||||||
var editBarcode: EditText? = null
|
var editBarcode: EditText? = null
|
||||||
var mScannerInfoList = ArrayList<DCSScannerInfo>()
|
var mScannerInfoList = ArrayList<DCSScannerInfo>()
|
||||||
|
companion object {
|
||||||
|
const val QR_REQUEST_CODE = 1
|
||||||
|
}
|
||||||
|
// private val barcodeLauncher = registerForActivityResult(
|
||||||
|
// ScanContract()
|
||||||
|
// ) { result: ScanIntentResult ->
|
||||||
|
// Log.d(TAG, result.contents)
|
||||||
|
// if (result.contents.isNullOrEmpty()) {
|
||||||
|
// Toast.makeText(this, R.string.cancelled_unable_scan, Toast.LENGTH_LONG).show()
|
||||||
|
// } else {
|
||||||
|
// Log.d(TAG, result.contents)
|
||||||
|
// processScannedData(result.contents)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private fun processScannedData(contents: String) {
|
||||||
|
// binding.nameEditText.setText(contents)
|
||||||
|
// }
|
||||||
|
|
||||||
private val barcodeLauncher = registerForActivityResult(
|
// In your calling activity
|
||||||
ScanContract()
|
var resultLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||||
) { result: ScanIntentResult ->
|
if (result.resultCode == Activity.RESULT_OK) { // Handle the result
|
||||||
Log.d(TAG, result.contents)
|
val qrCode = result.data?.getStringExtra("QRCode")
|
||||||
if (result.contents.isNullOrEmpty()) {
|
Toast.makeText(this, "scanned kit text:$qrCode",
|
||||||
Toast.makeText(this, R.string.cancelled_unable_scan, Toast.LENGTH_LONG).show()
|
Toast.LENGTH_LONG).show()
|
||||||
} else {
|
// val editText = findViewById<com.google.android.material.textfield.TextInputEditText>(R.id.name_edit_text)
|
||||||
Log.d(TAG, result.contents)
|
binding.nameEditText.setText(qrCode)
|
||||||
processScannedData(result.contents)
|
// Use data to retrieve extra
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun processScannedData(contents: String) {
|
|
||||||
binding.nameEditText.setText(contents)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context?) {
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
val languageCode = LanguageManager.getSavedLanguage(newBase!!)
|
||||||
LanguageManager.setLocale(newBase, languageCode)
|
LanguageManager.setLocale(newBase, languageCode)
|
||||||
@@ -152,8 +167,9 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
setSupportActionBar(binding.toolbar)
|
setSupportActionBar(binding.toolbar)
|
||||||
|
|
||||||
binding.btnScanNow.setOnClickListener {
|
binding.btnScanNow.setOnClickListener {
|
||||||
startScanningNow()
|
// startForResult.launch(Intent(this, ScannerKitActvity::class.java))
|
||||||
// pullTrigger()
|
val intent = Intent(this, ScannerKitActvity::class.java)
|
||||||
|
resultLauncher.launch(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.btnGo.setOnClickListener {
|
binding.btnGo.setOnClickListener {
|
||||||
@@ -304,21 +320,21 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startScanningNow() {
|
// private fun startScanningNow() {
|
||||||
val options = ScanOptions()
|
// val options = ScanOptions()
|
||||||
options.setDesiredBarcodeFormats(ScanOptions.QR_CODE)
|
// options.setDesiredBarcodeFormats(ScanOptions.QR_CODE)
|
||||||
options.setPrompt("Scan a barcode")
|
// options.setPrompt("Scan a barcode")
|
||||||
options.setCameraId(0) // Use a specific camera of the device
|
// options.setCameraId(0) // Use a specific camera of the device
|
||||||
|
//
|
||||||
options.setBeepEnabled(true)
|
// options.setBeepEnabled(true)
|
||||||
options.setBarcodeImageEnabled(true)
|
// options.setBarcodeImageEnabled(true)
|
||||||
|
//
|
||||||
options.setPrompt("Start Scanning")
|
// options.setPrompt("Start Scanning")
|
||||||
options.setOrientationLocked(false)
|
// options.setOrientationLocked(false)
|
||||||
// options.setTimeout(10000) // in ms
|
//// options.setTimeout(10000) // in ms
|
||||||
|
//
|
||||||
barcodeLauncher.launch(options)
|
// barcodeLauncher.launch(options)
|
||||||
}
|
// }
|
||||||
|
|
||||||
private fun checkDataNotNull(): Boolean {
|
private fun checkDataNotNull(): Boolean {
|
||||||
return if (DataHolder.selectedTest?._id == null) {
|
return if (DataHolder.selectedTest?._id == null) {
|
||||||
@@ -334,4 +350,13 @@ class KitScanActivity : AppCompatActivity() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
// super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
// if (requestCode == QR_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
|
||||||
|
// val qrCode = data?.getStringExtra("QRCode")
|
||||||
|
//// val editText = findViewById<com.google.android.material.textfield.TextInputEditText>(R.id.name_edit_text)
|
||||||
|
// binding.nameEditText.setText(qrCode)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.example.hpostesting.presentation
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Toast
|
||||||
|
import com.budiyev.android.codescanner.AutoFocusMode
|
||||||
|
import com.budiyev.android.codescanner.CodeScanner
|
||||||
|
import com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
import com.budiyev.android.codescanner.DecodeCallback
|
||||||
|
import com.budiyev.android.codescanner.ErrorCallback
|
||||||
|
import com.budiyev.android.codescanner.ScanMode
|
||||||
|
import `in`.sminnovations.hpostesting.R
|
||||||
|
|
||||||
|
class ScannerKitActvity : AppCompatActivity() {
|
||||||
|
private lateinit var codeScanner: CodeScanner
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_scanner_kit_actvity)
|
||||||
|
val scannerView = findViewById<CodeScannerView>(R.id.scanner_view)
|
||||||
|
|
||||||
|
codeScanner = CodeScanner(this, scannerView)
|
||||||
|
|
||||||
|
// Parameters (default values)
|
||||||
|
codeScanner.camera = CodeScanner.CAMERA_BACK // or CAMERA_FRONT or specific camera id
|
||||||
|
codeScanner.formats = CodeScanner.ALL_FORMATS // list of type BarcodeFormat,
|
||||||
|
// ex. listOf(BarcodeFormat.QR_CODE)
|
||||||
|
codeScanner.autoFocusMode = AutoFocusMode.SAFE // or CONTINUOUS
|
||||||
|
codeScanner.scanMode = ScanMode.SINGLE // or CONTINUOUS or PREVIEW
|
||||||
|
codeScanner.isAutoFocusEnabled = true // Whether to enable auto focus or not
|
||||||
|
codeScanner.isFlashEnabled = false // Whether to enable flash or not
|
||||||
|
|
||||||
|
// Callbacks
|
||||||
|
codeScanner.decodeCallback = DecodeCallback {
|
||||||
|
runOnUiThread {
|
||||||
|
Toast.makeText(this, "scanned text: ${it.text}",
|
||||||
|
Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
val resultIntent = Intent()
|
||||||
|
resultIntent.putExtra("QRCode", it.text)
|
||||||
|
setResult(Activity.RESULT_OK, resultIntent)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
codeScanner.errorCallback = ErrorCallback { // or ErrorCallback.SUPPRESS
|
||||||
|
runOnUiThread {
|
||||||
|
Toast.makeText(this, "Camera initialization error: ${it.message}",
|
||||||
|
Toast.LENGTH_LONG).show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scannerView.setOnClickListener {
|
||||||
|
codeScanner.startPreview()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
codeScanner.startPreview()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
codeScanner.releaseResources()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
// You can do additional work here before calling super
|
||||||
|
super.onBackPressed() // This calls finish() behind the scenes for you
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,8 +3,7 @@
|
|||||||
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:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
tools:context=".presentation.KitScanActivity">
|
|
||||||
|
|
||||||
<com.google.android.material.appbar.AppBarLayout
|
<com.google.android.material.appbar.AppBarLayout
|
||||||
android:id="@+id/app_bar_layout"
|
android:id="@+id/app_bar_layout"
|
||||||
|
|||||||
25
app/src/main/res/layout/activity_scanner_kit_actvity.xml
Normal file
25
app/src/main/res/layout/activity_scanner_kit_actvity.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
android:id="@+id/scanner_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:autoFocusButtonColor="@android:color/white"
|
||||||
|
app:autoFocusButtonVisible="true"
|
||||||
|
app:flashButtonColor="@android:color/white"
|
||||||
|
app:flashButtonVisible="true"
|
||||||
|
app:frameColor="@android:color/white"
|
||||||
|
app:frameCornersSize="50dp"
|
||||||
|
app:frameCornersRadius="0dp"
|
||||||
|
app:frameAspectRatioWidth="1"
|
||||||
|
app:frameAspectRatioHeight="1"
|
||||||
|
app:frameSize="0.75"
|
||||||
|
app:frameThickness="2dp"
|
||||||
|
app:frameVerticalBias="0.5"
|
||||||
|
app:maskColor="#77000000"/>
|
||||||
|
</FrameLayout>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="com.example.hpostesting.presentation.ScannerKitActvity">
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
25
app/src/main/res/layout/qrscanner.xml
Normal file
25
app/src/main/res/layout/qrscanner.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.budiyev.android.codescanner.CodeScannerView
|
||||||
|
android:id="@+id/scanner_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:autoFocusButtonColor="@android:color/white"
|
||||||
|
app:autoFocusButtonVisible="true"
|
||||||
|
app:flashButtonColor="@android:color/white"
|
||||||
|
app:flashButtonVisible="true"
|
||||||
|
app:frameColor="@android:color/white"
|
||||||
|
app:frameCornersSize="50dp"
|
||||||
|
app:frameCornersRadius="0dp"
|
||||||
|
app:frameAspectRatioWidth="1"
|
||||||
|
app:frameAspectRatioHeight="1"
|
||||||
|
app:frameSize="0.75"
|
||||||
|
app:frameThickness="2dp"
|
||||||
|
app:frameVerticalBias="0.5"
|
||||||
|
app:maskColor="#77000000"/>
|
||||||
|
</FrameLayout>
|
||||||
Reference in New Issue
Block a user