Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 24.4 #37

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.aspose:aspose-barcode-cloud:24.3.0'
implementation 'com.aspose:aspose-barcode-cloud:24.4.0'
implementation 'com.google.android.material:material:1.8.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ import androidx.core.content.ContextCompat
import com.aspose.barcode.cloud.ApiClient
import com.aspose.barcode.cloud.ApiException
import com.aspose.barcode.cloud.api.BarcodeApi
import com.aspose.barcode.cloud.model.CodeLocation
import com.aspose.barcode.cloud.model.EncodeBarcodeType
import com.aspose.barcode.cloud.model.PresetType
import com.aspose.barcode.cloud.requests.GetBarcodeGenerateRequest
import com.aspose.barcode.cloud.requests.PostBarcodeRecognizeFromUrlOrContentRequest
import com.aspose.barcode.cloud.requests.ScanBarcodeRequest
import com.google.android.material.snackbar.Snackbar
import java.io.File
import java.io.FileOutputStream
Expand Down Expand Up @@ -197,8 +197,8 @@ class MainActivity : AppCompatActivity() {
if (resultCode == RESULT_OK) {
val bmpImage = data?.extras?.get("data") as Bitmap
recognizeBarcode(bmpImage)
}
}
}

else -> {
showErrorMessage("No file selected")
Expand All @@ -220,12 +220,11 @@ class MainActivity : AppCompatActivity() {
smallerBmp.compress(Bitmap.CompressFormat.PNG, 100, output)
}

val recognizeRequest = PostBarcodeRecognizeFromUrlOrContentRequest()
recognizeRequest.preset = PresetType.HIGHPERFORMANCE.value
recognizeRequest.image = tmpFile
val apiRequest = ScanBarcodeRequest(tmpFile);

Thread {
try {
val recognized = api.postBarcodeRecognizeFromUrlOrContent(recognizeRequest)
val recognized = api.scanBarcode(apiRequest)

runOnUiThread {
stopRecognizeAnimation()
Expand Down Expand Up @@ -278,6 +277,7 @@ class MainActivity : AppCompatActivity() {
barcodeRequest.imageHeight = barcodeImgView.measuredHeight.toDouble()
barcodeRequest.imageWidth = barcodeImgView.measuredWidth.toDouble()
barcodeRequest.format = "png"

Thread {
try {
val generated: File? = api.getBarcodeGenerate(barcodeRequest)
Expand Down Expand Up @@ -318,7 +318,10 @@ class MainActivity : AppCompatActivity() {
getContentIntent.type = "image/*"
getContentIntent.addCategory(Intent.CATEGORY_OPENABLE)
try {
startActivityForResult(Intent.createChooser(getContentIntent, "Select an Image to Recognize"), ACTION_GET_CONTENT_CALLBACK_CODE)
startActivityForResult(
Intent.createChooser(getContentIntent, "Select an Image to Recognize"),
ACTION_GET_CONTENT_CALLBACK_CODE
)
} catch (ex: java.lang.Exception) {
showErrorMessage("Unable to start file selector")
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<resources>
<string name="app_name">Aspose Barcode Cloud</string>
<string name="app_name">Aspose Barcode Cloud demo</string>
<string name="barcode">Barcode</string>
<string name="barcode_type">Barcode type to generate</string>
<string name="default_barcode_text">Barcode text</string>
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '8.2.0' apply false
id 'com.android.library' version '8.2.0' apply false
id 'com.android.application' version '8.3.2' apply false
id 'com.android.library' version '8.3.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
}
ext.kotlin_version = '1.7.21'
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jan 27 19:13:42 YEKT 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Loading