Skip to content

Commit

Permalink
Release 53.2.0 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-graca authored Aug 6, 2024
1 parent 64c1881 commit 423463a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 239 deletions.
5 changes: 2 additions & 3 deletions AnylineExamples/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ plugins {
}

ext {
anylinesdk_version = "53.0.0"
anylinesdk_version = "53.2.0"
timber_version = "5.0.1"
leakcanary_version = "2.9.1"

anyline_examples_version_code = 13
anyline_examples_version_name = "53.0.0"
anyline_examples_version_name = "53.2.0"
}

android {
Expand Down Expand Up @@ -64,7 +64,6 @@ android {
}

dependencies {
implementation 'com.squareup.moshi:moshi:1.14.0'

implementation "io.anyline:anylinesdk:$anylinesdk_version"

Expand Down
4 changes: 0 additions & 4 deletions AnylineExamples/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.anyline.examples.OTAScanActivity"
android:exported="false"
android:label="OTAScanActivity"/>
<activity
android:name="com.anyline.examples.ScanActivity"
android:exported="false"
Expand Down
45 changes: 0 additions & 45 deletions AnylineExamples/app/src/main/assets/barcode_config_ota.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ class MainActivity : CameraPermissionActivity() {
finish()
}
}
binding.otaUpdateButton.setOnClickListener {
startActivity(OTAScanActivity.buildIntent(this))
}
}

private fun showLicenseKeyAlertDialog() {
Expand Down Expand Up @@ -66,11 +63,9 @@ class MainActivity : CameraPermissionActivity() {
when (checkIfCameraPermissionGranted()) {
true -> {
binding.requestCameraPermissionButton.text = getString(R.string.start_scanning)
binding.otaUpdateButton.isEnabled = true
}
false -> {
binding.requestCameraPermissionButton.text = getString(R.string.request_camera_permission)
binding.otaUpdateButton.isEnabled = false
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import com.anyline.examples.databinding.ActivityScanBinding
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import io.anyline2.Event
import io.anyline2.ScanResult
import io.anyline2.legacy.trainer.AssetContext
import io.anyline2.legacy.trainer.ProjectContext
import io.anyline2.view.ScanView
import io.anyline2.viewplugin.ar.uiFeedback.UIFeedbackOverlayInfoEntry
import io.anyline2.viewplugin.ar.uiFeedback.UIFeedbackOverlayViewElementEventContent
Expand Down Expand Up @@ -186,33 +184,15 @@ open class ScanActivity : AppCompatActivity() {
binding.textLastscannedResultValue.text = ""
}

val assetContextInfo = intent.getStringExtra(INTENT_EXTRA_ASSETCONTEXT_INFO_CONTENT)
assetContextInfo?.let { assetInfo ->
val assetContextJSON = JSONObject(assetInfo)
val assetContext = ProjectContext(this, assetContextJSON)

try {
//initialize ScanView with AssetContext Info
scanView.init(assetContext, 30)
setupScanViewListeners()
} catch (e: Exception) {
showAlertDialog(
"Error",
resources.getString(R.string.ota_initAsset_error) + ": " + e
) { finish() }
}

} ?: run {
try {
//initialize ScanView with JSON asset file config
scanView.init(intent.getStringExtra(INTENT_EXTRA_VIEW_CONFIG)!!)
setupScanViewListeners()
} catch (e: Exception) {
showAlertDialog(
"Error",
resources.getString(R.string.scanview_init_error) + ": " + e
) { finish() }
}
try {
//initialize ScanView with JSON asset file config
scanView.init(intent.getStringExtra(INTENT_EXTRA_VIEW_CONFIG)!!)
setupScanViewListeners()
} catch (e: Exception) {
showAlertDialog(
"Error",
resources.getString(R.string.scanview_init_error) + ": " + e
) { finish() }
}
}

Expand Down Expand Up @@ -301,21 +281,11 @@ open class ScanActivity : AppCompatActivity() {
companion object {
private const val TAG = "AnylineScanActivity"
const val INTENT_EXTRA_VIEW_CONFIG = "INTENT_EXTRA_VIEW_CONFIG"
const val INTENT_EXTRA_ASSETCONTEXT_INFO_CONTENT = "INTENT_EXTRA_ASSET_INFO_CONTENT"

fun buildIntent(context: Context, viewConfig: String): Intent {
val intent = Intent(context, ScanActivity::class.java)
intent.putExtra(INTENT_EXTRA_VIEW_CONFIG, viewConfig)
return intent
}

fun buildIntent(context: Context, assetContext: AssetContext): Intent {
val intent = Intent(context, ScanActivity::class.java)
intent.putExtra(
INTENT_EXTRA_ASSETCONTEXT_INFO_CONTENT,
assetContext.toJSONObject().toString()
)
return intent
}
}
}
10 changes: 0 additions & 10 deletions AnylineExamples/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/ota_update_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ota_checkForUpdate_label"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/request_camera_permission_button" />

<TextView
android:id="@+id/version_textview"
android:layout_width="wrap_content"
Expand Down
8 changes: 0 additions & 8 deletions AnylineExamples/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
<string name="scanview_init_error">An error occurred while initializing ScanView with json</string>
<string name="last_result">Last Result</string>
<string name="scan_again">Scan Again</string>
<string name="ota_checkForUpdate_label">OTA</string>
<string name="ota_checkForUpdate_checking">Checking for new updates</string>
<string name="ota_checkForUpdate_downloading">Downloading new updates</string>
<string name="ota_checkForUpdate_error">An error occurred while getting new updates</string>
<string name="ota_checkForUpdate_error_barcode">Invalid barcode update content</string>
<string name="ota_checkForUpdate_uptodate">No update found for asset</string>
<string name="ota_checkForUpdate_completed">Asset update process complete</string>
<string name="ota_initAsset_error">An error occurred while initializing plugin with asset</string>
<string name="scan_mrz">Scan MRZ</string>
<string name="mrz_info_title">MRZ Info</string>
<string name="mrz_info_message_read_nfc">"Would you like to read additional information from the NFC chip?"</string>
Expand Down

0 comments on commit 423463a

Please sign in to comment.