CircleToSearch with multi search engine support for all android
Kotlin
added QR code scanning and made selection lens frame resizable
AKS Labsf8d643670468
diff --git a/app/build.gradle.kts b/app/build.gradle.ktsindex 914fc43..5709d61 100644--- a/app/build.gradle.kts+++ b/app/build.gradle.kts@@ -110,4 +110,5 @@ dependencies {implementation("androidx.webkit:webkit:1.9.0")implementation("com.google.code.gson:gson:2.10.1")implementation("com.github.adaptech-cz.Tesseract4Android:tesseract4android:4.7.0")-}\ No newline at end of file+ implementation("com.google.zxing:core:3.5.4")+}diff --git a/app/src/main/java/com/akslabs/circletosearch/ui/CircleToSearchScreen.kt b/app/src/main/java/com/akslabs/circletosearch/ui/CircleToSearchScreen.ktindex de7e284..0ad07d3 100644--- a/app/src/main/java/com/akslabs/circletosearch/ui/CircleToSearchScreen.kt+++ b/app/src/main/java/com/akslabs/circletosearch/ui/CircleToSearchScreen.kt@@ -77,6 +77,7 @@ import androidx.compose.material.icons.filled.BorderOuterimport androidx.compose.material.icons.filled.Translateimport androidx.compose.material.icons.filled.Fullscreenimport androidx.compose.material.icons.filled.TextFields+import androidx.compose.material.icons.filled.QrCodeimport androidx.compose.animation.core.Springimport androidx.compose.animation.core.springimport androidx.compose.animation.fadeIn@@ -231,6 +232,10 @@ fun CircleToSearchScreen(var isResizing by remember { mutableStateOf(false) }var activeHandle by remember { mutableStateOf<String?>(null) } // "tl", "tr", "bl", "br"+ // QR Scanner state+ var showQrSheet by remember { mutableStateOf(false) }+ var qrScanBitmap by remember { mutableStateOf<android.graphics.Bitmap?>(null) }+LaunchedEffect(Unit) {if (uiPreferences.isShowFriendlyMessages()) {val manager = FriendlyMessageManager(context)@@ -955,6 +960,7 @@ fun CircleToSearchScreen(if (rect.width() > 10 && rect.height() > 10) {selectionRect = rect+ currentPathPoints.clear() // Hide the drawn circleif (screenshot != null) {selectedBitmap = ImageUtils.cropBitmap(screenshot!!, rect)}@@ -1465,6 +1471,12 @@ fun CircleToSearchScreen(isCopyTextTriggered = true}+ // QR Scan+ BottomBarButton("Scan QR", { Icon(Icons.Default.QrCode, null) }) {+ qrScanBitmap = selectedBitmap ?: screenshot+ showQrSheet = true+ }+// FullscreenBottomBarButton("Fullscreen", { Icon(Icons.Default.Fullscreen, null) }) {if (screenshot != null) {@@ -1614,6 +1626,34 @@ fun CircleToSearchScreen(}}+ // QR Code Result Sheet+ if (showQrSheet) {+ Box(+ modifier = Modifier+ .fillMaxWidth()+ .align(Alignment.BottomCenter)+ .navigationBarsPadding()+ .padding(bottom = 16.dp)+ .zIndex(3000f),+ contentAlignment = Alignment.BottomCenter+ ) {+ Column {+ QrCodeResultSheet(+ context = context,+ bitmap = qrScanBitmap,+ onDismiss = { showQrSheet = false }+ )+ // Dismiss tap area+ androidx.compose.foundation.layout.Box(+ modifier = Modifier+ .fillMaxWidth()+ .height(8.dp)+ .clickable { showQrSheet = false }+ )+ }+ }+ }+if (showSupportSheet) {com.akslabs.circletosearch.SupportSheet(sheetState = supportSheetState,diff --git a/app/src/main/java/com/akslabs/circletosearch/ui/QrCodeResultSheet.kt b/app/src/main/java/com/akslabs/circletosearch/ui/QrCodeResultSheet.ktnew file mode 100644index 0000000..fb73469--- /dev/null+++ b/app/src/main/java/com/akslabs/circletosearch/ui/QrCodeResultSheet.kt@@ -0,0 +1,415 @@+package com.akslabs.circletosearch.ui++import android.content.ClipData+import android.content.ClipboardManager+import android.content.Context+import android.content.Intent+import android.net.Uri+import android.provider.ContactsContract+import android.widget.Toast+import androidx.compose.animation.AnimatedContent+import androidx.compose.animation.AnimatedVisibility+import androidx.compose.animation.core.FastOutSlowInEasing+import androidx.compose.animation.core.LinearEasing+import androidx.compose.animation.core.RepeatMode+import androidx.compose.animation.core.animateFloat+import androidx.compose.animation.core.animateFloatAsState+import androidx.compose.animation.core.infiniteRepeatable+import androidx.compose.animation.core.rememberInfiniteTransition+import androidx.compose.animation.core.tween+import androidx.compose.animation.fadeIn+import androidx.compose.animation.fadeOut+import androidx.compose.animation.slideInVertically+import androidx.compose.animation.togetherWith+import androidx.compose.foundation.background+import androidx.compose.foundation.layout.Arrangement+import androidx.compose.foundation.layout.Box+import androidx.compose.foundation.layout.Column+import androidx.compose.foundation.layout.Row+import androidx.compose.foundation.layout.Spacer+import androidx.compose.foundation.layout.fillMaxWidth+import androidx.compose.foundation.layout.height+import androidx.compose.foundation.layout.offset+import androidx.compose.foundation.layout.padding+import androidx.compose.foundation.layout.size+import androidx.compose.foundation.layout.width+import androidx.compose.foundation.shape.CircleShape+import androidx.compose.foundation.shape.RoundedCornerShape+import androidx.compose.material.icons.Icons+import androidx.compose.material.icons.filled.ContentCopy+import androidx.compose.material.icons.filled.Language+import androidx.compose.material.icons.filled.LocationOn+import androidx.compose.material.icons.filled.Phone+import androidx.compose.material.icons.filled.QrCode+import androidx.compose.material.icons.filled.Search+import androidx.compose.material.icons.filled.ShoppingBag+import androidx.compose.material.icons.filled.Sms+import androidx.compose.material.icons.filled.Wifi+import androidx.compose.material3.Button+import androidx.compose.material3.CircularProgressIndicator+import androidx.compose.material3.FilledTonalButton+import androidx.compose.material3.Icon+import androidx.compose.material3.MaterialTheme+import androidx.compose.material3.OutlinedButton+import androidx.compose.material3.Surface+import androidx.compose.material3.Text+import androidx.compose.runtime.Composable+import androidx.compose.runtime.LaunchedEffect+import androidx.compose.runtime.getValue+import androidx.compose.runtime.mutableStateOf+import androidx.compose.runtime.remember+import androidx.compose.runtime.rememberCoroutineScope+import androidx.compose.runtime.setValue+import androidx.compose.ui.Alignment+import androidx.compose.ui.Modifier+import androidx.compose.ui.draw.clip+import androidx.compose.ui.graphics.Brush+import androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.graphicsLayer+import androidx.compose.ui.text.font.FontWeight+import androidx.compose.ui.text.style.TextOverflow+import androidx.compose.ui.unit.dp+import com.akslabs.circletosearch.utils.QrResult+import kotlinx.coroutines.Dispatchers+import kotlinx.coroutines.launch+import kotlinx.coroutines.withContext++private fun copyToClipboard(context: Context, label: String, text: String) {+ val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager+ clipboard.setPrimaryClip(ClipData.newPlainText(label, text))+ Toast.makeText(context, "Copied", Toast.LENGTH_SHORT).show()+}++private fun openUrl(context: Context, url: String) {+ context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).apply {+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)+ })+}++@Composable+fun QrCodeResultSheet(+ context: Context,+ bitmap: android.graphics.Bitmap?,+ onDismiss: () -> Unit+) {+ val scope = rememberCoroutineScope()+ var qrResult by remember { mutableStateOf<QrResult?>(null) }+ var isScanning by remember { mutableStateOf(true) }+ var notFound by remember { mutableStateOf(false) }++ // Animate scanline+ val infiniteTransition = rememberInfiniteTransition(label = "scanline")+ val scanlineY by infiniteTransition.animateFloat(+ initialValue = 0f,+ targetValue = 1f,+ animationSpec = infiniteRepeatable(+ animation = tween(1500, easing = LinearEasing),+ repeatMode = RepeatMode.Reverse+ ),+ label = "scanlineY"+ )++ LaunchedEffect(bitmap) {+ if (bitmap == null) { isScanning = false; notFound = true; return@LaunchedEffect }+ isScanning = true+ notFound = false+ qrResult = null+ val result = withContext(Dispatchers.Default) {+ com.akslabs.circletosearch.utils.QrScanner.scanBitmap(bitmap)+ }+ isScanning = false+ if (result == null) notFound = true else qrResult = result+ }++ // Overall container+ val slideIn = slideInVertically(tween(400, easing = FastOutSlowInEasing)) { it / 2 }+ val fadeIn = fadeIn(tween(400))++ AnimatedVisibility(+ visible = true,+ enter = slideIn + fadeIn+ ) {+ Surface(+ modifier = Modifier+ .fillMaxWidth()+ .padding(horizontal = 16.dp, vertical = 8.dp),+ shape = RoundedCornerShape(24.dp),+ color = MaterialTheme.colorScheme.surfaceContainerHigh,+ tonalElevation = 6.dp,+ shadowElevation = 12.dp+ ) {+ Column(+ modifier = Modifier.padding(20.dp),+ horizontalAlignment = Alignment.CenterHorizontally+ ) {+ // Header+ Row(verticalAlignment = Alignment.CenterVertically) {+ Icon(+ Icons.Default.QrCode,+ contentDescription = null,+ tint = MaterialTheme.colorScheme.primary,+ modifier = Modifier.size(20.dp)+ )+ Spacer(Modifier.width(8.dp))+ Text(+ "QR / Barcode",+ style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.SemiBold)+ )+ }++ Spacer(Modifier.height(16.dp))++ // Content area+ AnimatedContent(+ targetState = when {+ isScanning -> "scanning"+ notFound -> "notfound"+ else -> "result"+ },+ transitionSpec = { fadeIn(tween(300)) togetherWith fadeOut(tween(200)) },+ label = "qrContent"+ ) { state ->+ when (state) {+ "scanning" -> ScanningIndicator(scanlineY)+ "notfound" -> NotFoundContent()+ else -> qrResult?.let { QrResultContent(context, it) }+ }+ }+ }+ }+ }+}++@Composable+private fun ScanningIndicator(scanlineY: Float) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Box(+ modifier = Modifier+ .size(80.dp)+ .clip(RoundedCornerShape(16.dp))+ .background(MaterialTheme.colorScheme.surfaceContainerHighest),+ contentAlignment = Alignment.Center+ ) {+ CircularProgressIndicator(+ modifier = Modifier.size(40.dp),+ strokeWidth = 3.dp,+ color = MaterialTheme.colorScheme.primary+ )+ // Scanline effect+ Box(+ modifier = Modifier+ .fillMaxWidth()+ .height(2.dp)+ .offset(y = (80.dp * scanlineY) - 40.dp)+ .background(+ Brush.horizontalGradient(+ listOf(Color.Transparent, MaterialTheme.colorScheme.primary, Color.Transparent)+ )+ )+ )+ }+ Spacer(Modifier.height(12.dp))+ Text("Scanning for QR codesβ¦", style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.onSurfaceVariant)+ }+}++@Composable+private fun NotFoundContent() {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Text("π", style = MaterialTheme.typography.headlineLarge)+ Spacer(Modifier.height(8.dp))+ Text("No QR code found", style = MaterialTheme.typography.bodyLarge,+ color = MaterialTheme.colorScheme.onSurfaceVariant)+ Text("Try circling the QR code more precisely",+ style = MaterialTheme.typography.bodySmall,+ color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.7f))+ }+}++@Composable+private fun QrResultContent(context: Context, result: QrResult) {+ val slideIn = slideInVertically(tween(350, delayMillis = 50)) { it / 3 } + fadeIn(tween(300))+ AnimatedVisibility(visible = true, enter = slideIn) {+ when (result) {+ is QrResult.Url -> UrlResult(context, result)+ is QrResult.WiFi -> WifiResult(context, result)+ is QrResult.Phone -> PhoneResult(context, result)+ is QrResult.Product -> ProductResult(context, result)+ is QrResult.VCard -> VCardResult(context, result)+ is QrResult.GeoPoint -> GeoResult(context, result)+ is QrResult.PlainText -> PlainTextResult(context, result)+ }+ }+}++// ββ Result types ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ++@Composable+private fun UrlResult(context: Context, result: QrResult.Url) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ ResultHeader("π", result.displayUrl.substringBefore("/"), result.displayUrl)+ Spacer(Modifier.height(16.dp))+ ActionRow {+ PrimaryAction("Open in Browser") { openUrl(context, result.url) }+ SecondaryAction("Copy Link") { copyToClipboard(context, "URL", result.url) }+ }+ }+}++@Composable+private fun WifiResult(context: Context, result: QrResult.WiFi) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Icon(Icons.Default.Wifi, null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(32.dp))+ Spacer(Modifier.height(4.dp))+ Text(result.ssid, style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold))+ Text("${result.security} Β· Password: ${result.password ?: "None"}",+ style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)+ Spacer(Modifier.height(16.dp))+ ActionRow {+ if (result.password != null) {+ SecondaryAction("Copy Password") { copyToClipboard(context, "WiFi Password", result.password) }+ }+ }+ }+}++@Composable+private fun PhoneResult(context: Context, result: QrResult.Phone) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Icon(Icons.Default.Phone, null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(32.dp))+ Spacer(Modifier.height(4.dp))+ Text(result.number, style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold))+ Spacer(Modifier.height(16.dp))+ ActionRow {+ PrimaryAction("Call") { openUrl(context, "tel:${result.number}") }+ SecondaryAction("Send SMS") { openUrl(context, "sms:${result.number}") }+ SecondaryAction("Copy") { copyToClipboard(context, "Phone", result.number) }+ }+ }+}++@Composable+private fun ProductResult(context: Context, result: QrResult.Product) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Icon(Icons.Default.ShoppingBag, null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(32.dp))+ Spacer(Modifier.height(4.dp))+ Text(result.barcode, style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold))+ Spacer(Modifier.height(16.dp))+ ActionRow {+ PrimaryAction("Search Amazon") {+ openUrl(context, "https://www.amazon.com/s?k=${result.barcode}")+ }+ SecondaryAction("Google") {+ openUrl(context, "https://www.google.com/search?q=${result.barcode}")+ }+ SecondaryAction("Copy") { copyToClipboard(context, "Barcode", result.barcode) }+ }+ }+}++@Composable+private fun VCardResult(context: Context, result: QrResult.VCard) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Text("π€", style = MaterialTheme.typography.headlineLarge)+ if (result.name != null) Text(result.name, style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold))+ val sub = listOfNotNull(result.phone, result.email).joinToString(" Β· ")+ if (sub.isNotEmpty()) Text(sub, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant)+ Spacer(Modifier.height(16.dp))+ ActionRow {+ PrimaryAction("Save Contact") {+ val i = Intent(Intent.ACTION_INSERT).apply {+ type = ContactsContract.RawContacts.CONTENT_TYPE+ result.name?.let { putExtra(ContactsContract.Intents.Insert.NAME, it) }+ result.phone?.let { putExtra(ContactsContract.Intents.Insert.PHONE, it) }+ result.email?.let { putExtra(ContactsContract.Intents.Insert.EMAIL, it) }+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)+ }+ context.startActivity(i)+ }+ SecondaryAction("Copy") { copyToClipboard(context, "Contact", result.raw) }+ }+ }+}++@Composable+private fun GeoResult(context: Context, result: QrResult.GeoPoint) {+ val coordStr = "%.4fΒ° N, %.4fΒ° E".format(result.lat, result.lng)+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Icon(Icons.Default.LocationOn, null, tint = MaterialTheme.colorScheme.primary, modifier = Modifier.size(32.dp))+ Spacer(Modifier.height(4.dp))+ Text(coordStr, style = MaterialTheme.typography.titleMedium.copy(fontWeight = FontWeight.Bold))+ Spacer(Modifier.height(16.dp))+ ActionRow {+ PrimaryAction("Open in Maps") {+ openUrl(context, "geo:${result.lat},${result.lng}?q=${result.lat},${result.lng}")+ }+ SecondaryAction("Copy") { copyToClipboard(context, "Coordinates", coordStr) }+ }+ }+}++@Composable+private fun PlainTextResult(context: Context, result: QrResult.PlainText) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Text("π", style = MaterialTheme.typography.headlineLarge)+ Spacer(Modifier.height(4.dp))+ Text(+ "\"${result.text}\"",+ style = MaterialTheme.typography.bodyLarge,+ maxLines = 4,+ overflow = TextOverflow.Ellipsis,+ color = MaterialTheme.colorScheme.onSurface+ )+ Spacer(Modifier.height(16.dp))+ ActionRow {+ SecondaryAction("Copy") { copyToClipboard(context, "Text", result.text) }+ SecondaryAction("Search") {+ openUrl(context, "https://www.google.com/search?q=${Uri.encode(result.text)}")+ }+ SecondaryAction("Translate") {+ openUrl(context, "https://translate.google.com/?text=${Uri.encode(result.text)}")+ }+ }+ }+}++// ββ Shared UI helpers βββββββββββββββββββββββββββββββββββββββββββββββββββββββ++@Composable+private fun ResultHeader(emoji: String, title: String, subtitle: String) {+ Column(horizontalAlignment = Alignment.CenterHorizontally) {+ Text(emoji, style = MaterialTheme.typography.headlineLarge)+ Spacer(Modifier.height(4.dp))+ Text(title, style = MaterialTheme.typography.titleLarge.copy(fontWeight = FontWeight.Bold),+ maxLines = 1, overflow = TextOverflow.Ellipsis)+ Text(subtitle, style = MaterialTheme.typography.bodyMedium,+ color = MaterialTheme.colorScheme.onSurfaceVariant,+ maxLines = 2, overflow = TextOverflow.Ellipsis)+ }+}++@Composable+private fun ActionRow(content: @Composable () -> Unit) {+ Row(+ modifier = Modifier.fillMaxWidth(),+ horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),+ verticalAlignment = Alignment.CenterVertically+ ) {+ content()+ }+}++@Composable+private fun PrimaryAction(label: String, onClick: () -> Unit) {+ Button(onClick = onClick, shape = RoundedCornerShape(12.dp)) {+ Text(label, style = MaterialTheme.typography.labelMedium)+ }+}++@Composable+private fun SecondaryAction(label: String, onClick: () -> Unit) {+ FilledTonalButton(onClick = onClick, shape = RoundedCornerShape(12.dp)) {+ Text(label, style = MaterialTheme.typography.labelMedium)+ }+}diff --git a/app/src/main/java/com/akslabs/circletosearch/utils/QrScanner.kt b/app/src/main/java/com/akslabs/circletosearch/utils/QrScanner.ktnew file mode 100644index 0000000..1df4a2c--- /dev/null+++ b/app/src/main/java/com/akslabs/circletosearch/utils/QrScanner.kt@@ -0,0 +1,103 @@+package com.akslabs.circletosearch.utils++import android.graphics.Bitmap+import com.google.zxing.BarcodeFormat+import com.google.zxing.BinaryBitmap+import com.google.zxing.DecodeHintType+import com.google.zxing.MultiFormatReader+import com.google.zxing.RGBLuminanceSource+import com.google.zxing.Result+import com.google.zxing.common.HybridBinarizer++// Sealed class representing all supported QR / barcode result types+sealed class QrResult {+ data class Url(val url: String, val displayUrl: String) : QrResult()+ data class WiFi(val ssid: String, val password: String?, val security: String) : QrResult()+ data class Phone(val number: String) : QrResult()+ data class Product(val barcode: String) : QrResult()+ data class VCard(val name: String?, val phone: String?, val email: String?, val raw: String) : QrResult()+ data class GeoPoint(val lat: Double, val lng: Double) : QrResult()+ data class PlainText(val text: String) : QrResult()+}++object QrScanner {++ fun scanBitmap(bitmap: Bitmap): QrResult? {+ return try {+ val width = bitmap.width+ val height = bitmap.height+ val pixels = IntArray(width * height)+ bitmap.getPixels(pixels, 0, width, 0, 0, width, height)++ val source = RGBLuminanceSource(width, height, pixels)+ val binaryBitmap = BinaryBitmap(HybridBinarizer(source))++ val hints = mapOf(+ DecodeHintType.TRY_HARDER to true,+ DecodeHintType.POSSIBLE_FORMATS to listOf(+ BarcodeFormat.QR_CODE,+ BarcodeFormat.EAN_13,+ BarcodeFormat.EAN_8,+ BarcodeFormat.UPC_A,+ BarcodeFormat.DATA_MATRIX,+ BarcodeFormat.PDF_417+ )+ )++ val reader = MultiFormatReader()+ val result: Result = reader.decode(binaryBitmap, hints)+ parseResult(result.text)+ } catch (e: Exception) {+ null+ }+ }++ private fun parseResult(text: String): QrResult {+ return when {+ // URL+ text.startsWith("http://", ignoreCase = true) || text.startsWith("https://", ignoreCase = true) -> {+ val display = text.removePrefix("http://").removePrefix("https://").trimEnd('/')+ QrResult.Url(text, display)+ }+ // WiFi: WIFI:S:SSID;T:WPA;P:password;;+ text.startsWith("WIFI:", ignoreCase = true) -> parseWifi(text)+ // Tel+ text.startsWith("tel:", ignoreCase = true) -> {+ QrResult.Phone(text.removePrefix("tel:").trim())+ }+ // vCard+ text.startsWith("BEGIN:VCARD", ignoreCase = true) -> parseVCard(text)+ // Geo+ text.startsWith("geo:", ignoreCase = true) -> parseGeo(text)+ // Barcode-only (all digits, length 8-14)+ text.matches(Regex("\\d{8,14}")) -> QrResult.Product(text)+ // Plain text fallback+ else -> QrResult.PlainText(text)+ }+ }++ private fun parseWifi(text: String): QrResult {+ val ssid = Regex("S:([^;]*)").find(text)?.groupValues?.get(1) ?: ""+ val pass = Regex("P:([^;]*)").find(text)?.groupValues?.get(1)+ val sec = Regex("T:([^;]*)").find(text)?.groupValues?.get(1) ?: "WPA"+ return QrResult.WiFi(ssid, pass, sec)+ }++ private fun parseVCard(text: String): QrResult {+ val name = Regex("FN:([^\r\n]+)").find(text)?.groupValues?.get(1)+ val phone = Regex("TEL[^:]*:([^\r\n]+)").find(text)?.groupValues?.get(1)+ val email = Regex("EMAIL[^:]*:([^\r\n]+)").find(text)?.groupValues?.get(1)+ return QrResult.VCard(name, phone, email, text)+ }++ private fun parseGeo(text: String): QrResult {+ return try {+ val coords = text.removePrefix("geo:").split(",")+ val lat = coords[0].toDouble()+ val lng = coords[1].split("?")[0].toDouble()+ QrResult.GeoPoint(lat, lng)+ } catch (e: Exception) {+ QrResult.PlainText(text)+ }+ }+}diff --git a/build_errors_37.txt b/build_errors_37.txtnew file mode 100644index 0000000..d42edc6Binary files /dev/null and b/build_errors_37.txt differdiff --git a/build_errors_38.txt b/build_errors_38.txtnew file mode 100644index 0000000..e8f5743Binary files /dev/null and b/build_errors_38.txt differ