From c57c05cd533e8154e337a4ec9a4837d489a3748f Mon Sep 17 00:00:00 2001 From: ismoy Date: Fri, 6 Jun 2025 20:33:26 -0400 Subject: [PATCH 1/5] =?UTF-8?q?docs:=20a=C3=B1ade=20documentaci=C3=B3n=20d?= =?UTF-8?q?el=20proyecto=20y=20configuraci=C3=B3n=20de=20GitHub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug_report.md | 34 +++ .github/ISSUE_TEMPLATE/feature_request.md | 25 +++ .github/ISSUE_TEMPLATE/question.md | 31 +++ .github/pull_request_template.md | 33 +++ .github/workflows/ci.yml | 92 ++++++++ CODE_OF_CONDUCT.md | 60 ++++++ CONTRIBUTING.md | 100 +++++++++ README.md | 247 ++++++++-------------- ROADMAP.md | 74 +++++++ 9 files changed, 533 insertions(+), 163 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 ROADMAP.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..0fab472 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,34 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '[BUG] ' +labels: bug +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environment:** + - Device: [e.g. iPhone 6, Samsung Galaxy S21] + - OS: [e.g. iOS 14.5, Android 12] + - Version [e.g. 1.0.11] + - Platform: [e.g. Android Native, KMP] + +**Additional context** +Add any other context about the problem here. + +**Possible Solution** +If you have suggestions on how to fix the issue, please describe them here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..83a2302 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '[FEATURE] ' +labels: enhancement +assignees: '' +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. + +**Would you like to work on this feature?** +- [ ] Yes, I would like to implement this feature +- [ ] No, I just want to suggest it + +If you would like to implement this feature, please let us know and we can guide you through the process! \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..899a750 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,31 @@ +--- +name: Question +about: Ask a question about the project +title: '[QUESTION] ' +labels: question +assignees: '' +--- + +**Question** +Please describe your question clearly and concisely. + +**Context** +Provide any relevant context about your question, such as: +- What you're trying to achieve +- What you've tried so far +- Any relevant code snippets +- Any error messages you're seeing + +**Environment** +- Device: [e.g. iPhone 6, Samsung Galaxy S21] +- OS: [e.g. iOS 14.5, Android 12] +- Version [e.g. 1.0.11] +- Platform: [e.g. Android Native, KMP] + +**Additional Information** +Add any other information about your question here. + +**Checklist** +- [ ] I have searched the [documentation](https://github.com/ismoy/BelZSpeedScan/wiki) +- [ ] I have searched existing [issues](https://github.com/ismoy/BelZSpeedScan/issues) +- [ ] I have searched existing [discussions](https://github.com/ismoy/BelZSpeedScan/discussions) \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..001131e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,33 @@ +## Description +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. + +Fixes # (issue) + +## Type of change +Please delete options that are not relevant. + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## How Has This Been Tested? +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. + +- [ ] Test A +- [ ] Test B + +## Checklist: +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] New and existing unit tests pass locally with my changes +- [ ] Any dependent changes have been merged and published in downstream modules + +## Screenshots (if appropriate): + +## Additional context +Add any other context about the pull request here. \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3b31678 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Run tests + run: ./gradlew test + + - name: Check formatting + run: ./gradlew ktlintCheck + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: build-artifacts + path: build/ + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Run ktlint + run: ./gradlew ktlintCheck + + security: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Run dependency check + run: ./gradlew dependencyCheckAnalyze + + release: + needs: [build, lint, security] + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + + - name: Publish to Maven Central + run: ./gradlew publish + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7ce2004 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,60 @@ +# Código de Conducta para Contribuidores + +## Nuestro Compromiso + +En el interés de fomentar un ambiente abierto y acogedor, nosotros como contribuidores y mantenedores nos comprometemos a hacer de la participación en nuestro proyecto y nuestra comunidad una experiencia libre de acoso para todos, independientemente de: + +- Edad +- Tamaño corporal +- Discapacidad +- Etnia +- Características sexuales +- Identidad y expresión de género +- Nivel de experiencia +- Educación +- Estatus socio-económico +- Nacionalidad +- Apariencia personal +- Raza +- Religión +- Identidad y orientación sexual + +## Nuestros Estándares + +Ejemplos de comportamiento que contribuyen a crear un ambiente positivo: + +- Usar lenguaje acogedor e inclusivo +- Respetar diferentes puntos de vista y experiencias +- Aceptar con gracia la crítica constructiva +- Enfocarse en lo que es mejor para la comunidad +- Mostrar empatía hacia otros miembros de la comunidad + +Ejemplos de comportamiento inaceptable: + +- Uso de lenguaje o imágenes sexualizadas +- Trolling, comentarios insultantes/despectivos, y ataques personales o políticos +- Acoso público o privado +- Publicar información privada de otros, como direcciones físicas o electrónicas, sin permiso explícito +- Otra conducta que razonablemente podría considerarse inapropiada en un entorno profesional + +## Nuestras Responsabilidades + +Los mantenedores del proyecto son responsables de aclarar los estándares de comportamiento aceptable y se espera que tomen medidas correctivas apropiadas y justas en respuesta a cualquier caso de comportamiento inaceptable. + +Los mantenedores del proyecto tienen el derecho y la responsabilidad de: + +- Remover, editar, o rechazar comentarios, commits, código, ediciones de wiki, issues, y otras contribuciones que no estén alineadas con este Código de Conducta +- Banear temporal o permanentemente a cualquier contribuidor por comportamientos que consideren inapropiados, amenazantes, ofensivos, o dañinos + +## Alcance + +Este Código de Conducta aplica tanto en espacios del proyecto como en espacios públicos cuando un individuo está representando al proyecto o su comunidad. + +## Aplicación + +Casos de comportamiento abusivo, acosador, o inaceptable pueden ser reportados contactando al equipo del proyecto. Todas las quejas serán revisadas e investigadas y resultarán en una respuesta que se considere necesaria y apropiada a las circunstancias. + +## Atribución + +Este Código de Conducta es una adaptación del [Contributor Covenant](https://www.contributor-covenant.org), versión 2.0, +disponible en https://www.contributor-covenant.org/es/version/2/0/code_of_conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..c1c3172 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,100 @@ +# Guía para Contribuir a BelZSpeedScan + +¡Gracias por tu interés en contribuir a BelZSpeedScan! Este documento proporciona las directrices y el proceso para contribuir al proyecto. + +## 🎯 ¿Por qué contribuir? + +BelZSpeedScan es una librería de escaneo de códigos de barras y QR que busca hacer el proceso de escaneo más rápido y eficiente. Tu contribución puede ayudar a: + +- Mejorar la experiencia de los usuarios +- Añadir nuevas funcionalidades +- Corregir bugs +- Mejorar la documentación +- Optimizar el rendimiento + +## 🚀 ¿Cómo empezar? + +1. **Fork del repositorio** + - Haz click en el botón "Fork" en la parte superior derecha de la página del repositorio + +2. **Clona tu fork** + ```bash + git clone https://github.com/TU-USUARIO/BelZSpeedScan.git + cd BelZSpeedScan + ``` + +3. **Configura el entorno de desarrollo** + - Asegúrate de tener instalado: + - Android Studio (última versión estable) + - Xcode (para desarrollo iOS) + - Kotlin 1.8.0 o superior + - Gradle 7.0 o superior + +4. **Crea una rama para tu feature** + ```bash + git checkout -b feature/nombre-de-tu-feature + ``` + +## 📝 Proceso de Contribución + +1. **Desarrollo** + - Sigue las convenciones de código existentes + - Añade tests para nuevas funcionalidades + - Actualiza la documentación según sea necesario + +2. **Commits** + - Usa mensajes de commit descriptivos + - Sigue el formato: `tipo(alcance): descripción` + - Ejemplo: `feat(android): añade soporte para escaneo en segundo plano` + +3. **Pull Request** + - Asegúrate de que tu código compila y pasa todos los tests + - Actualiza la documentación si es necesario + - Describe claramente los cambios en el PR + - Referencia cualquier issue relacionado + +## 🎨 Guías de Estilo + +### Kotlin +- Sigue las [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html) +- Usa `camelCase` para variables y funciones +- Usa `PascalCase` para clases y objetos +- Mantén las funciones cortas y enfocadas + +### Documentación +- Documenta todas las APIs públicas +- Usa KDoc para documentación de código +- Mantén el README actualizado + +## 🧪 Testing + +- Escribe tests unitarios para nueva funcionalidad +- Asegúrate de que todos los tests pasan antes de enviar un PR +- Mantén la cobertura de tests por encima del 80% + +## 📋 Checklist para Pull Requests + +- [ ] El código sigue las guías de estilo +- [ ] Se han añadido tests para nueva funcionalidad +- [ ] La documentación ha sido actualizada +- [ ] Los tests pasan localmente +- [ ] El código compila sin warnings +- [ ] Se han resuelto conflictos con la rama principal + +## 🤝 Código de Conducta + +Por favor, lee nuestro [Código de Conducta](CODE_OF_CONDUCT.md) antes de contribuir. + +## ❓ ¿Necesitas ayuda? + +- Abre un issue para preguntas o problemas +- Únete a nuestras discusiones en GitHub +- Contacta a los mantenedores del proyecto + +## 📜 Licencia + +Al contribuir, aceptas que tu código será licenciado bajo la misma licencia que el proyecto (MIT). + +--- + +¡Gracias por contribuir a BelZSpeedScan! 🎉 \ No newline at end of file diff --git a/README.md b/README.md index c441745..0820963 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,38 @@ # [BelZSpeedScan](https://github.com/ismoy/BelZSpeedScan) ### A Cross-Platform QR Code and Barcode Scanning Library, using MLKIT for decoding. -BelZSpeedScan is a lightweight and easy-to-use library for scanning QR codes and barcodes. It supports both Kotlin Multiplatform (KMP) and native Android development, providing a consistent API across platforms. This allows you to use the same scanning logic in your shared KMP code and seamlessly integrate it into your Android application. - - -[![Buy Me a Coffee](https://img.buymeacoffee.com/button-api/?text=Buy%20Me%20a%20Coffee&emoji=☕&slug=ismoy&button_colour=FFDD00&font_colour=000000&font_family=Arial&outline_colour=000000&coffee_colour=ffffff)](https://www.buymeacoffee.com/Ismoy) - +[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Maven Central](https://img.shields.io/maven-central/v/io.github.ismoy/kmpswipe.svg)](https://search.maven.org/artifact/io.github.ismoy/kmpswipe) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![API](https://img.shields.io/badge/API-21%2B-brightgreen.svg)](https://android-arsenal.com/api?level=21) - [![Kotlin](https://img.shields.io/badge/Kotlin-1.9.0-blue.svg?logo=kotlin)](https://kotlinlang.org) [![Compose](https://img.shields.io/badge/Compose-1.5.0-green.svg?logo=jetpackcompose)](https://developer.android.com/jetpack/compose) [![Platform](https://img.shields.io/badge/Platform-Android%20|%20iOS-orange.svg)](https://kotlinlang.org/docs/multiplatform.html) - [![KMP](https://img.shields.io/badge/KMP-Kotlin%20Multiplatform-7F52FF.svg)](https://kotlinlang.org/docs/multiplatform.html) [![Swipe](https://img.shields.io/badge/UI-Swipe%20Gestures-red.svg)](https://github.com/ismoy/kmpswipe) [![UX](https://img.shields.io/badge/UX-Haptic%20Feedback-blueviolet.svg)](https://github.com/ismoy/kmpswipe) -# Demonstrations +![Issues](https://img.shields.io/github/issues/ismoy/BelZSpeedScan) + +BelZSpeedScan is a lightweight and easy-to-use library for scanning QR codes and barcodes. It supports both Kotlin Multiplatform (KMP) and native Android development, providing a consistent API across platforms. This allows you to use the same scanning logic in your shared KMP code and seamlessly integrate it into your Android application. + +## 🌟 Features + +- 📱 Cross-platform support (Android & iOS) +- 🚀 High-performance scanning using MLKit +- 🎨 Customizable UI components +- 🔒 Security alerts for suspicious codes +- 🔊 Audio feedback on successful scans +- 🎯 Multiple barcode formats support +- ⚡ Real-time scanning +- 🛠️ Easy integration with KMP projects + +## 📱 Demonstrations + | Android | iOS | |---------|-----| | ![Android](https://github.com/ismoy/DemoBelzSpeedScan/blob/main/demoCamera_compressed.gif) | ![Demo](https://github.com/ismoy/BelZSpeedScan/blob/main/images/iosDemo%20(1).gif) | - -## Installation +## 🚀 Quick Start ### Kotlin Multiplatform (KMP) @@ -36,25 +45,69 @@ repositories { dependencies { commonMain { - implementation("io.github.ismoy:belzspeedscan:1.0.11") // Replace with the actual version + implementation("io.github.ismoy:belzspeedscan:1.0.11") } - // ... other dependencies } ``` -## Android Native + +### Android Native + For native Android development, include the dependency in your module's build.gradle file: + ```gradle repositories { mavenCentral() } dependencies { - implementation("io.github.ismoy:belzspeedscan:1.0.11") // Replace with the actual version - // ... other dependencies + implementation("io.github.ismoy:belzspeedscan:1.0.11") } ``` -## How to Use -The core functionality of BelZSpeedScan is accessed through the App function (or similar entry point in your KMP project). This function requires a context parameter, which in Android would typically be your MainActivity's context. + +## 📖 Documentation + +For detailed documentation and examples, please visit our [documentation site](https://github.com/ismoy/BelZSpeedScan/wiki). + +## 🤝 Contributing + +We love your input! We want to make contributing to BelZSpeedScan as easy and transparent as possible, whether it's: + +- Reporting a bug +- Discussing the current state of the code +- Submitting a fix +- Proposing new features +- Becoming a maintainer + +Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests. + +## 📋 Roadmap + +Check out our [Roadmap](ROADMAP.md) to see what's coming next and how you can help! + +## 🐛 Known Issues + +Please report any bugs or issues you find in the [issues section](https://github.com/ismoy/BelZSpeedScan/issues). + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## 🙏 Acknowledgments + +- Thanks to all our contributors +- Special thanks to the MLKit team for their amazing work +- The Kotlin Multiplatform community for their support + +## 📞 Contact + +- GitHub Issues: [Create an issue](https://github.com/ismoy/BelZSpeedScan/issues) +- Email: [Your email] +- Twitter: [@YourTwitter] + +## ⭐ Show your support + +Give a ⭐️ if this project helped you! + # Use in your KMP #### App.kt ```kotlin @@ -62,7 +115,7 @@ import io.github.ismoy.belzspeedscan.domain.CodeScanner // Import CodeScanner import androidx.compose.runtime.* import androidx.compose.ui.platform.LocalLifecycleOwner fun App(context: Any? = null) { -CameraScreen(context) + CameraScreen(context) } ``` ### composeApp/src/androidMain/MainActivity.kt @@ -79,12 +132,12 @@ class MainActivity : ComponentActivity() { ### composeApp/src/iosApp/iosApp/Info.plist ```xml NSCameraUsageDescription - Necesitamos acceso a la cámara para escanear códigos QR y códigos de barras - UIBackgroundModes +Necesitamos acceso a la cámara para escanear códigos QR y códigos de barras +UIBackgroundModes - - audio - + +audio + ``` ### Create this resource composeApp/src/iosMain/resources/beep.mp3 ### Create CameraManager function @@ -107,9 +160,9 @@ fun CameraManagerUtils( RequestCameraPermission { granted -> hasCameraPermission = granted } - var securityAlertVisible by remember { mutableStateOf(false) } - var securityAlertMessage by remember { mutableStateOf("") } -Scaffold( + var securityAlertVisible by remember { mutableStateOf(false) } + var securityAlertMessage by remember { mutableStateOf("") } + Scaffold( content = { innerPadding -> if (hasCameraPermission) { Box( @@ -184,148 +237,16 @@ Scaffold( ### Create a Camera Screen ```kotlin fun CameraScreen(context: Any?) { -CameraManagerUtils(context) { codeScanned -> - // Scan result - } + CameraManagerUtils(context) { codeScanned -> + // Scan result + } } ``` ### Default Request Camera Permission ```kotlin RequestCameraPermission { granted -> - hasCameraPermission = granted - } - -``` -### Custom Request Camera Permission -```kotlin - RequestCameraPermission( - titleDialogConfig = "Your app needs camera permission", - descriptionDialogConfig = "Your app needs camera permission to scan QR codes", - btnDialogConfig = "Open Settings", - titleDialogDenied = "Camera permission denied", - descriptionDialogDenied = "You need to grant camera permission to scan QR codes", - btnDialogDenied = "Grant Permission", - customDeniedDialog = { - //Your compose custom dialog - }, - customSettingsDialog = { - //Your compose custom dialog - } - ) {granted-> - println("CameraManagerUtils: $granted") - } - -``` -# Use in your Android Native App -### Create CameraManager function -```kotlin - @Composable -fun CameraManagerUtils( - onCodeScanned: (String) -> Unit -) { - val context = LocalContext.current - val lifecycleOwner = androidx.lifecycle.compose.LocalLifecycleOwner.current - var hasCameraPermission by remember { mutableStateOf(false) } - val scanner: CodeScanner? by remember { mutableStateOf(null) } - - DisposableEffect(Unit) { - onDispose { - scanner?.stopScanning() - } - } - - RequestCameraPermission { granted -> - hasCameraPermission = granted - } - - Scaffold( - content = { innerPadding -> - if (hasCameraPermission) { - Box( - modifier = Modifier - .padding(innerPadding) - .fillMaxSize() - ) { - Box { - var currentScanner by remember { mutableStateOf(null) } - CameraPreview( - onPreviewViewReady = { preview -> - currentScanner = createBelSpeedScanCodeScanner( - context = context, - lifecycleOwner = lifecycleOwner, - previewView = preview, - playSound = true, - resourceName = "sounds", - resourceExtension = "mp3", - delayToNextScan = 1000, - onCodeScanned = { scannedText -> - onCodeScanned(scannedText) - } - ).also { - it.startScanning() - } - }, - scanner = currentScanner, - modifier = Modifier.fillMaxHeight(1F), - waterMark = "", - tooFarText = "", - tooOptimalText = "", - ) - } - } - } else { - Box( - modifier = Modifier - .fillMaxSize() - .fillMaxHeight(1F) - .padding(innerPadding) - .background(Color.Black.copy(alpha = 0.8f)) - ) - } - } - ) -} - -``` -### Create a Camera Screen -```kotlin - fun CameraScreen() { - CameraManagerUtils() { codeScanned -> - // Scan Result + hasCameraPermission = granted } -} - -``` -## Camera Permissions - -BelZSpeedScan handles camera permissions automatically on Android. However, on iOS, you need to add the camera usage description to your `Info.plist` file. -### iOS Permission -If you don't have an `Info.plist` file, you need to create it. Then, go to `composeApp/iosMain/iosApp/iosApp/Info.plist` and add the following: -```xml -NSCameraUsageDescription -We need access to the camera to scan QR codes and barcodes. -``` -### Add your Scanner Sound -If you need emit a sound when the code scan., go to `composeApp/iosMain/resources/beep.mp3` remember respect this exactly name resources/beep.mp3 - -## Explanation: -1. **Imports:** Import necessary classes, including CodeScanner from the library. -2. **Function:** This function serves as the entry point for using the scanner. The context parameter is crucial for Android integration. -3. ## State Variables: -• **scannedCode**: Stores the result of the scan. -• **hasCameraPermission**: Tracks whether the user has granted camera permission. -• **scanner**: Holds an instance of the CodeScanner. - -4. **RequestCameraPermission:** This function handles requesting camera permissions. The default implementation provides a standard dialog. You can customize the dialogs by using the customDeniedDialog and customSettingsDialog parameters. The onResult lambda provides a boolean indicating whether permission was granted. -5. **Conditional Rendering:** The if (hasCameraPermission) block ensures that the camera preview and scanner are only initialized if permission has been granted. -6. **CameraPreview:** This composable displays the camera preview. The onPreviewViewReady lambda is called when the PreviewView is ready, allowing you to initialize the CodeScanner. -7. **createBelSpeedScanCodeScanner:** This function creates an instance of the CodeScanner. It takes the context, LifecycleOwner, PreviewView, isQRScanning (true for QR code scanning only, false for barcode scanning only. No default value), playSound, and a lambda for handling the scanned code. -8. **startScanning():** Starts the scanning process. -9. **Scanned Code Handling:** The lambda passed to createBelSpeedScanCodeScanner is called when a code is scanned. The scannedCode parameter contains the scanned data. - -## Native iOS Support - -Good news! Native iOS support is on the way. We're working hard to bring the functionality of BelZSpeedScan to the iOS platform, allowing you to use the same scanning logic in your iOS applications. Stay tuned for future updates and announcements regarding the availability of iOS support. -## This detailed explanation should help you integrate BelZSpeedScan into your KMP and Android projects effectively. Remember to replace placeholder version numbers and adapt the code to your specific UI and application logic. +``` \ No newline at end of file diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000..c88b870 --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,74 @@ +# Hoja de Ruta de BelZSpeedScan + +Esta hoja de ruta describe los planes futuros y las mejoras previstas para BelZSpeedScan. Las fechas son aproximadas y pueden cambiar según la disponibilidad de recursos y las necesidades de la comunidad. + +## 🎯 Objetivos a Corto Plazo (1-3 meses) + +### Mejoras de Rendimiento +- [ ] Optimización del procesamiento de imágenes +- [ ] Reducción del consumo de memoria +- [ ] Mejora de la velocidad de escaneo + +### Mejoras de UX +- [ ] Personalización del overlay de cámara +- [ ] Feedback táctil al escanear +- [ ] Modo oscuro/claro automático + +### Documentación +- [ ] Guía de migración para versiones anteriores +- [ ] Ejemplos de código más detallados +- [ ] Documentación de API completa + +## 🚀 Objetivos a Medio Plazo (3-6 meses) + +### Nuevas Características +- [ ] Escaneo en segundo plano +- [ ] Detección de múltiples códigos simultáneos +- [ ] Soporte para más formatos de códigos +- [ ] Modo de escaneo continuo + +### Mejoras Técnicas +- [ ] Implementación de pruebas de rendimiento +- [ ] Mejora de la gestión de errores +- [ ] Optimización para diferentes tamaños de pantalla + +### Integración +- [ ] Mejor soporte para Flutter +- [ ] Integración con más frameworks +- [ ] Plugins para editores populares + +## 🌟 Objetivos a Largo Plazo (6-12 meses) + +### Características Avanzadas +- [ ] Escaneo 3D de códigos +- [ ] Reconocimiento de texto (OCR) +- [ ] Escaneo de documentos +- [ ] Análisis de calidad de códigos + +### Plataforma +- [ ] Soporte para wearables +- [ ] Versión web +- [ ] Soporte para realidad aumentada + +### Comunidad +- [ ] Programa de embajadores +- [ ] Hackathons y eventos +- [ ] Programa de mentores + +## 🤝 Contribución + +¡Tu ayuda es bienvenida! Si quieres contribuir a cualquiera de estos objetivos: + +1. Revisa los [issues abiertos](https://github.com/ismoy/BelZSpeedScan/issues) +2. Consulta la [guía de contribución](CONTRIBUTING.md) +3. Únete a nuestras [discusiones](https://github.com/ismoy/BelZSpeedScan/discussions) + +## 📝 Notas + +- Esta hoja de ruta es un documento vivo y puede cambiar según las necesidades de la comunidad +- Las prioridades pueden ajustarse según el feedback de los usuarios +- Las fechas son estimaciones y pueden variar + +--- + +¿Tienes ideas o sugerencias? ¡Abre un issue o únete a la discusión! \ No newline at end of file From 58a7247916a6726e3882f2804e229a325fd7eef4 Mon Sep 17 00:00:00 2001 From: ismoy Date: Fri, 6 Jun 2025 20:35:03 -0400 Subject: [PATCH 2/5] chore: cambia la licencia de Apache 2.0 a MIT --- LICENSE | 222 ++++++-------------------------------------------------- 1 file changed, 21 insertions(+), 201 deletions(-) diff --git a/LICENSE b/LICENSE index fc73b50..d304151 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,21 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2023 JetBrains s.r.o. and and respective authors and developers. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +MIT License + +Copyright (c) 2024 Ismoy + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 2c8897b06f0deabce3bd751da11b060257989d9d Mon Sep 17 00:00:00 2001 From: ismoy Date: Fri, 6 Jun 2025 21:29:11 -0400 Subject: [PATCH 3/5] Translate documents to English and update roadmap This commit translates the following project documents from Spanish to English: - `ROADMAP.md` - `README.md` - `CONTRIBUTING.md` - `CODE_OF_CONDUCT.md` The `ROADMAP.md` has also been updated with new goals and a revised structure. The copyright year in `LICENSE` has been updated to 2025. The `README.md` has been updated with more detailed instructions for KMP/CMP and Android Native usage, including code examples and explanations for camera permissions and sound resources. --- CODE_OF_CONDUCT.md | 84 ++++++++++----------- CONTRIBUTING.md | 142 +++++++++++++++++------------------ LICENSE | 2 +- README.md | 179 ++++++++++++++++++++++++++++++++++++++------- ROADMAP.md | 113 ++++++++++++++-------------- 5 files changed, 324 insertions(+), 196 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7ce2004..1489267 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,60 +1,60 @@ -# Código de Conducta para Contribuidores +# Contributor Code of Conduct -## Nuestro Compromiso +## Our Pledge -En el interés de fomentar un ambiente abierto y acogedor, nosotros como contribuidores y mantenedores nos comprometemos a hacer de la participación en nuestro proyecto y nuestra comunidad una experiencia libre de acoso para todos, independientemente de: +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and community a harassment-free experience for everyone, regardless of: -- Edad -- Tamaño corporal -- Discapacidad -- Etnia -- Características sexuales -- Identidad y expresión de género -- Nivel de experiencia -- Educación -- Estatus socio-económico -- Nacionalidad -- Apariencia personal -- Raza -- Religión -- Identidad y orientación sexual +- Age +- Body size +- Disability +- Ethnicity +- Sex characteristics +- Gender identity and expression +- Level of experience +- Education +- Socio-economic status +- Nationality +- Personal appearance +- Race +- Religion +- Sexual identity and orientation -## Nuestros Estándares +## Our Standards -Ejemplos de comportamiento que contribuyen a crear un ambiente positivo: +Examples of behavior that contributes to creating a positive environment include: -- Usar lenguaje acogedor e inclusivo -- Respetar diferentes puntos de vista y experiencias -- Aceptar con gracia la crítica constructiva -- Enfocarse en lo que es mejor para la comunidad -- Mostrar empatía hacia otros miembros de la comunidad +- Using welcoming and inclusive language +- Respecting different viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy toward other community members -Ejemplos de comportamiento inaceptable: +Examples of unacceptable behavior by participants include: -- Uso de lenguaje o imágenes sexualizadas -- Trolling, comentarios insultantes/despectivos, y ataques personales o políticos -- Acoso público o privado -- Publicar información privada de otros, como direcciones físicas o electrónicas, sin permiso explícito -- Otra conducta que razonablemente podría considerarse inapropiada en un entorno profesional +- The use of sexualized language or imagery +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others’ private information, such as physical or electronic addresses, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting -## Nuestras Responsabilidades +## Our Responsibilities -Los mantenedores del proyecto son responsables de aclarar los estándares de comportamiento aceptable y se espera que tomen medidas correctivas apropiadas y justas en respuesta a cualquier caso de comportamiento inaceptable. +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. -Los mantenedores del proyecto tienen el derecho y la responsabilidad de: +Project maintainers have the right and responsibility to: -- Remover, editar, o rechazar comentarios, commits, código, ediciones de wiki, issues, y otras contribuciones que no estén alineadas con este Código de Conducta -- Banear temporal o permanentemente a cualquier contribuidor por comportamientos que consideren inapropiados, amenazantes, ofensivos, o dañinos +- Remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct +- Temporarily or permanently ban any contributor for behaviors that they deem inappropriate, threatening, offensive, or harmful -## Alcance +## Scope -Este Código de Conducta aplica tanto en espacios del proyecto como en espacios públicos cuando un individuo está representando al proyecto o su comunidad. +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. -## Aplicación +## Enforcement -Casos de comportamiento abusivo, acosador, o inaceptable pueden ser reportados contactando al equipo del proyecto. Todas las quejas serán revisadas e investigadas y resultarán en una respuesta que se considere necesaria y apropiada a las circunstancias. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. -## Atribución +## Attribution -Este Código de Conducta es una adaptación del [Contributor Covenant](https://www.contributor-covenant.org), versión 2.0, -disponible en https://www.contributor-covenant.org/es/version/2/0/code_of_conduct.html \ No newline at end of file +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1c3172..7a5f1f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,100 +1,94 @@ -# Guía para Contribuir a BelZSpeedScan -¡Gracias por tu interés en contribuir a BelZSpeedScan! Este documento proporciona las directrices y el proceso para contribuir al proyecto. +# Contributing Guide to BelZSpeedScan -## 🎯 ¿Por qué contribuir? +Thank you for your interest in contributing to BelZSpeedScan! This document provides guidelines and the process for contributing to the project. -BelZSpeedScan es una librería de escaneo de códigos de barras y QR que busca hacer el proceso de escaneo más rápido y eficiente. Tu contribución puede ayudar a: +## 🎯 Why Contribute? -- Mejorar la experiencia de los usuarios -- Añadir nuevas funcionalidades -- Corregir bugs -- Mejorar la documentación -- Optimizar el rendimiento +BelZSpeedScan is a barcode and QR code scanning library designed to make scanning faster and more efficient. Your contribution can help: -## 🚀 ¿Cómo empezar? +- Improve user experience +- Add new features +- Fix bugs +- Improve documentation +- Optimize performance -1. **Fork del repositorio** - - Haz click en el botón "Fork" en la parte superior derecha de la página del repositorio +## 🚀 Getting Started -2. **Clona tu fork** - ```bash - git clone https://github.com/TU-USUARIO/BelZSpeedScan.git - cd BelZSpeedScan - ``` - -3. **Configura el entorno de desarrollo** - - Asegúrate de tener instalado: - - Android Studio (última versión estable) - - Xcode (para desarrollo iOS) - - Kotlin 1.8.0 o superior - - Gradle 7.0 o superior +1. **Fork the repository** + - Click the "Fork" button at the top right of the repository page. -4. **Crea una rama para tu feature** +2. **Clone your fork** ```bash - git checkout -b feature/nombre-de-tu-feature - ``` - -## 📝 Proceso de Contribución - -1. **Desarrollo** - - Sigue las convenciones de código existentes - - Añade tests para nuevas funcionalidades - - Actualiza la documentación según sea necesario + git clone https://github.com/YOUR-USERNAME/BelZSpeedScan.git + cd BelZSpeedScan -2. **Commits** - - Usa mensajes de commit descriptivos - - Sigue el formato: `tipo(alcance): descripción` - - Ejemplo: `feat(android): añade soporte para escaneo en segundo plano` + 3. Set up your development environment +Make sure you have: +• Android Studio (latest stable version) +• Xcode (for iOS development) +• Kotlin 1.8.0 or higher +• Gradle 7.0 or higher + 4. Create a branch for your feature -3. **Pull Request** - - Asegúrate de que tu código compila y pasa todos los tests - - Actualiza la documentación si es necesario - - Describe claramente los cambios en el PR - - Referencia cualquier issue relacionado +git checkout -b feature/your-feature-name -## 🎨 Guías de Estilo -### Kotlin -- Sigue las [Kotlin Coding Conventions](https://kotlinlang.org/docs/coding-conventions.html) -- Usa `camelCase` para variables y funciones -- Usa `PascalCase` para clases y objetos -- Mantén las funciones cortas y enfocadas -### Documentación -- Documenta todas las APIs públicas -- Usa KDoc para documentación de código -- Mantén el README actualizado +📝 Contribution Process +1. Development +• Follow existing code conventions +• Add tests for new features +• Update documentation as needed +2. Commits +• Use descriptive commit messages +• Follow the format: type(scope): description +• Example: feat(android): add background scanning support +3. Pull Request +• Make sure your code compiles and passes all tests +• Update documentation if necessary +• Clearly describe your changes in the PR +• Reference any related issues -## 🧪 Testing +🎨 Style Guide -- Escribe tests unitarios para nueva funcionalidad -- Asegúrate de que todos los tests pasan antes de enviar un PR -- Mantén la cobertura de tests por encima del 80% +Kotlin +• Follow the Kotlin Coding Conventions +• Use camelCase for variables and functions +• Use PascalCase for classes and objects +• Keep functions short and focused -## 📋 Checklist para Pull Requests +Documentation +• Document all public APIs +• Use KDoc for code documentation +• Keep the README up to date -- [ ] El código sigue las guías de estilo -- [ ] Se han añadido tests para nueva funcionalidad -- [ ] La documentación ha sido actualizada -- [ ] Los tests pasan localmente -- [ ] El código compila sin warnings -- [ ] Se han resuelto conflictos con la rama principal +🧪 Testing +• Write unit tests for any new functionality +• Ensure all tests pass before submitting a PR +• Keep test coverage above 80% -## 🤝 Código de Conducta +📋 Pull Request Checklist +• Code follows the style guide +• Tests have been added for new functionality +• Documentation has been updated +• Tests pass locally +• Code compiles without warnings +• Conflicts with the main branch are resolved -Por favor, lee nuestro [Código de Conducta](CODE_OF_CONDUCT.md) antes de contribuir. +🤝 Code of Conduct -## ❓ ¿Necesitas ayuda? +Please read our Code of Conduct before contributing. -- Abre un issue para preguntas o problemas -- Únete a nuestras discusiones en GitHub -- Contacta a los mantenedores del proyecto +❓ Need Help? +• Open an issue for questions or problems +• Join our GitHub discussions +• Reach out to the project maintainers -## 📜 Licencia +📜 License -Al contribuir, aceptas que tu código será licenciado bajo la misma licencia que el proyecto (MIT). +By contributing, you agree that your code will be licensed under the same license as the project (MIT). ---- +⸻ -¡Gracias por contribuir a BelZSpeedScan! 🎉 \ No newline at end of file +Thank you for contributing to BelZSpeedScan! 🎉 diff --git a/LICENSE b/LICENSE index d304151..71e9e81 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Ismoy +Copyright (c) 2025 Ismoy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 0820963..1f5c1de 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,7 @@ BelZSpeedScan is a lightweight and easy-to-use library for scanning QR codes and - 🎯 Multiple barcode formats support - ⚡ Real-time scanning - 🛠️ Easy integration with KMP projects - ## 📱 Demonstrations - | Android | iOS | |---------|-----| | ![Android](https://github.com/ismoy/DemoBelzSpeedScan/blob/main/demoCamera_compressed.gif) | ![Demo](https://github.com/ismoy/BelZSpeedScan/blob/main/images/iosDemo%20(1).gif) | @@ -45,25 +43,23 @@ repositories { dependencies { commonMain { - implementation("io.github.ismoy:belzspeedscan:1.0.11") + implementation("io.github.ismoy:belzspeedscan:1.0.11") // Replace with the actual version } + // ... other dependencies } ``` - -### Android Native - +## Android Native For native Android development, include the dependency in your module's build.gradle file: - ```gradle repositories { mavenCentral() } dependencies { - implementation("io.github.ismoy:belzspeedscan:1.0.11") + implementation("io.github.ismoy:belzspeedscan:1.0.11") // Replace with the actual version + // ... other dependencies } ``` - ## 📖 Documentation For detailed documentation and examples, please visit our [documentation site](https://github.com/ismoy/BelZSpeedScan/wiki). @@ -101,21 +97,20 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file ## 📞 Contact - GitHub Issues: [Create an issue](https://github.com/ismoy/BelZSpeedScan/issues) -- Email: [Your email] -- Twitter: [@YourTwitter] +- Email: belizairesmoy72@gmail.com ## ⭐ Show your support Give a ⭐️ if this project helped you! -# Use in your KMP +# Use in your KMP/CMP #### App.kt ```kotlin import io.github.ismoy.belzspeedscan.domain.CodeScanner // Import CodeScanner import androidx.compose.runtime.* import androidx.compose.ui.platform.LocalLifecycleOwner fun App(context: Any? = null) { - CameraScreen(context) +CameraScreen(context) } ``` ### composeApp/src/androidMain/MainActivity.kt @@ -132,12 +127,12 @@ class MainActivity : ComponentActivity() { ### composeApp/src/iosApp/iosApp/Info.plist ```xml NSCameraUsageDescription -Necesitamos acceso a la cámara para escanear códigos QR y códigos de barras -UIBackgroundModes + Necesitamos acceso a la cámara para escanear códigos QR y códigos de barras + UIBackgroundModes - -audio - + + audio + ``` ### Create this resource composeApp/src/iosMain/resources/beep.mp3 ### Create CameraManager function @@ -160,9 +155,9 @@ fun CameraManagerUtils( RequestCameraPermission { granted -> hasCameraPermission = granted } - var securityAlertVisible by remember { mutableStateOf(false) } - var securityAlertMessage by remember { mutableStateOf("") } - Scaffold( + var securityAlertVisible by remember { mutableStateOf(false) } + var securityAlertMessage by remember { mutableStateOf("") } +Scaffold( content = { innerPadding -> if (hasCameraPermission) { Box( @@ -237,16 +232,148 @@ fun CameraManagerUtils( ### Create a Camera Screen ```kotlin fun CameraScreen(context: Any?) { - CameraManagerUtils(context) { codeScanned -> - // Scan result - } +CameraManagerUtils(context) { codeScanned -> + // Scan result + } } ``` ### Default Request Camera Permission ```kotlin RequestCameraPermission { granted -> - hasCameraPermission = granted + hasCameraPermission = granted + } + +``` +### Custom Request Camera Permission +```kotlin + RequestCameraPermission( + titleDialogConfig = "Your app needs camera permission", + descriptionDialogConfig = "Your app needs camera permission to scan QR codes", + btnDialogConfig = "Open Settings", + titleDialogDenied = "Camera permission denied", + descriptionDialogDenied = "You need to grant camera permission to scan QR codes", + btnDialogDenied = "Grant Permission", + customDeniedDialog = { + //Your compose custom dialog + }, + customSettingsDialog = { + //Your compose custom dialog + } + ) {granted-> + println("CameraManagerUtils: $granted") + } + +``` +# Use in your Android Native App +### Create CameraManager function +```kotlin + @Composable +fun CameraManagerUtils( + onCodeScanned: (String) -> Unit +) { + val context = LocalContext.current + val lifecycleOwner = androidx.lifecycle.compose.LocalLifecycleOwner.current + var hasCameraPermission by remember { mutableStateOf(false) } + val scanner: CodeScanner? by remember { mutableStateOf(null) } + + DisposableEffect(Unit) { + onDispose { + scanner?.stopScanning() + } + } + + RequestCameraPermission { granted -> + hasCameraPermission = granted + } + + Scaffold( + content = { innerPadding -> + if (hasCameraPermission) { + Box( + modifier = Modifier + .padding(innerPadding) + .fillMaxSize() + ) { + Box { + var currentScanner by remember { mutableStateOf(null) } + CameraPreview( + onPreviewViewReady = { preview -> + currentScanner = createBelSpeedScanCodeScanner( + context = context, + lifecycleOwner = lifecycleOwner, + previewView = preview, + playSound = true, + resourceName = "sounds", + resourceExtension = "mp3", + delayToNextScan = 1000, + onCodeScanned = { scannedText -> + onCodeScanned(scannedText) + } + ).also { + it.startScanning() + } + }, + scanner = currentScanner, + modifier = Modifier.fillMaxHeight(1F), + waterMark = "", + tooFarText = "", + tooOptimalText = "", + ) + } + } + } else { + Box( + modifier = Modifier + .fillMaxSize() + .fillMaxHeight(1F) + .padding(innerPadding) + .background(Color.Black.copy(alpha = 0.8f)) + ) + } + } + ) +} + +``` +### Create a Camera Screen +```kotlin + fun CameraScreen() { + CameraManagerUtils() { codeScanned -> + // Scan Result +} } -``` \ No newline at end of file +``` +## Camera Permissions + +BelZSpeedScan handles camera permissions automatically on Android. However, on iOS, you need to add the camera usage description to your `Info.plist` file. + +### iOS Permission +If you don't have an `Info.plist` file, you need to create it. Then, go to `composeApp/iosMain/iosApp/iosApp/Info.plist` and add the following: +```xml +NSCameraUsageDescription +We need access to the camera to scan QR codes and barcodes. +``` +### Add your Scanner Sound +If you need emit a sound when the code scan., go to `composeApp/iosMain/resources/beep.mp3` remember respect this exactly name resources/beep.mp3 + +## Explanation: +1. **Imports:** Import necessary classes, including CodeScanner from the library. +2. **Function:** This function serves as the entry point for using the scanner. The context parameter is crucial for Android integration. +3. ## State Variables: +• **scannedCode**: Stores the result of the scan. +• **hasCameraPermission**: Tracks whether the user has granted camera permission. +• **scanner**: Holds an instance of the CodeScanner. + +4. **RequestCameraPermission:** This function handles requesting camera permissions. The default implementation provides a standard dialog. You can customize the dialogs by using the customDeniedDialog and customSettingsDialog parameters. The onResult lambda provides a boolean indicating whether permission was granted. +5. **Conditional Rendering:** The if (hasCameraPermission) block ensures that the camera preview and scanner are only initialized if permission has been granted. +6. **CameraPreview:** This composable displays the camera preview. The onPreviewViewReady lambda is called when the PreviewView is ready, allowing you to initialize the CodeScanner. +7. **createBelSpeedScanCodeScanner:** This function creates an instance of the CodeScanner. It takes the context, LifecycleOwner, PreviewView, isQRScanning (true for QR code scanning only, false for barcode scanning only. No default value), playSound, and a lambda for handling the scanned code. +8. **startScanning():** Starts the scanning process. +9. **Scanned Code Handling:** The lambda passed to createBelSpeedScanCodeScanner is called when a code is scanned. The scannedCode parameter contains the scanned data. + +## Native iOS Support + +Good news! Native iOS support is on the way. We're working hard to bring the functionality of BelZSpeedScan to the iOS platform, allowing you to use the same scanning logic in your iOS applications. Stay tuned for future updates and announcements regarding the availability of iOS support. +## This detailed explanation should help you integrate BelZSpeedScan into your KMP and Android projects effectively. Remember to replace placeholder version numbers and adapt the code to your specific UI and application logic. diff --git a/ROADMAP.md b/ROADMAP.md index c88b870..3c6430c 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,74 +1,81 @@ -# Hoja de Ruta de BelZSpeedScan +# 🚧 BelZSpeedScan Roadmap -Esta hoja de ruta describe los planes futuros y las mejoras previstas para BelZSpeedScan. Las fechas son aproximadas y pueden cambiar según la disponibilidad de recursos y las necesidades de la comunidad. +This document defines the strategic goals to transform **BelZSpeedScan** into a universal scanning solution for all mobile and web platforms, using a single shared codebase with Kotlin Multiplatform (KMP) and Compose Multiplatform (CMP). -## 🎯 Objetivos a Corto Plazo (1-3 meses) +--- -### Mejoras de Rendimiento -- [ ] Optimización del procesamiento de imágenes -- [ ] Reducción del consumo de memoria -- [ ] Mejora de la velocidad de escaneo +## 🟢 Short Term (1–3 months) -### Mejoras de UX -- [ ] Personalización del overlay de cámara -- [ ] Feedback táctil al escanear -- [ ] Modo oscuro/claro automático +### 🔧 Technical Improvements +- [ ] Refactor core logic into `commonMain` to enhance portability +- [ ] Modularize camera renderer and decoder logic +- [ ] Abstract native interfaces for external bindings (e.g., React Native, Flutter) -### Documentación -- [ ] Guía de migración para versiones anteriores -- [ ] Ejemplos de código más detallados -- [ ] Documentación de API completa +### 🖼️ UI/UX via Compose Multiplatform +- [ ] Support Compose Multiplatform UI (Desktop and Web - beta) +- [ ] Support automatic dark/light mode switching +- [ ] Customizable overlay via composable UI props -## 🚀 Objetivos a Medio Plazo (3-6 meses) +### 📖 Documentation & Community +- [ ] Provide full example projects (KMP/CMP) for Android, iOS, Desktop +- [ ] Improve integration guides step-by-step +- [ ] Provide ready-to-use template with KMP + JetBrains Compose setup -### Nuevas Características -- [ ] Escaneo en segundo plano -- [ ] Detección de múltiples códigos simultáneos -- [ ] Soporte para más formatos de códigos -- [ ] Modo de escaneo continuo +--- -### Mejoras Técnicas -- [ ] Implementación de pruebas de rendimiento -- [ ] Mejora de la gestión de errores -- [ ] Optimización para diferentes tamaños de pantalla +## 🚀 Medium Term (3–6 months) -### Integración -- [ ] Mejor soporte para Flutter -- [ ] Integración con más frameworks -- [ ] Plugins para editores populares +### 🧩 Cross-Framework Integrations +- [ ] NPM compatibility via Kotlin/JS for React Native +- [ ] Create bridge/wrapper for React Native usage with documentation +- [ ] Experimental Flutter support (via platform channels + host app support) -## 🌟 Objetivos a Largo Plazo (6-12 meses) +### 🔍 New Features +- [ ] Multi-code simultaneous scanning +- [ ] Continuous scanning mode (loop-based) +- [ ] Per-platform custom sound feedback +- [ ] Auto-detection of code type (QR, EAN, etc.) -### Características Avanzadas -- [ ] Escaneo 3D de códigos -- [ ] Reconocimiento de texto (OCR) -- [ ] Escaneo de documentos -- [ ] Análisis de calidad de códigos +### 🧪 Testing & Quality +- [ ] Cross-platform automated testing (Android, iOS, Desktop) +- [ ] CI/CD setup for publishing multiplatform artifacts (Maven, NPM) +- [ ] Visual debug mode with bounding boxes and scan overlays -### Plataforma -- [ ] Soporte para wearables -- [ ] Versión web -- [ ] Soporte para realidad aumentada +--- -### Comunidad -- [ ] Programa de embajadores -- [ ] Hackathons y eventos -- [ ] Programa de mentores +## 🌐 Long Term (6–12 months) -## 🤝 Contribución +### 🌍 Platform Expansion +- [ ] Web compatibility (via Kotlin/JS + WebAssembly + WebRTC) +- [ ] Wearable support (Wear OS, watchOS) +- [ ] SDK/API for third-party integration (Maven/NPM plugins) -¡Tu ayuda es bienvenida! Si quieres contribuir a cualquiera de estos objetivos: +### 📦 Distribution & Tooling +- [ ] Official NPM release as `@belz/scan` +- [ ] Plugin for JetBrains Marketplace +- [ ] Compatibility with other Multiplatform libraries via Gradle modules -1. Revisa los [issues abiertos](https://github.com/ismoy/BelZSpeedScan/issues) -2. Consulta la [guía de contribución](CONTRIBUTING.md) -3. Únete a nuestras [discusiones](https://github.com/ismoy/BelZSpeedScan/discussions) +### 👥 Community & Ecosystem +- [ ] Simplified contribution workflow (templates, linters, CI helpers) +- [ ] Community events and hackathons +- [ ] Establish a small team of core maintainers -## 📝 Notas +### 🧩 Optional Future Additions +- [ ] External camera support (USB cameras, browser camera APIs) +- [ ] Integration with OCR libraries (text recognition) +- [ ] AI-assisted scan correction (blur/shadow detection) -- Esta hoja de ruta es un documento vivo y puede cambiar según las necesidades de la comunidad -- Las prioridades pueden ajustarse según el feedback de los usuarios -- Las fechas son estimaciones y pueden variar +--- + +## 🤝 How to Contribute + +1. Check [issues labeled `help wanted`](https://github.com/ismoy/BelZSpeedScan/issues) +2. Read the [Contributing Guide](CONTRIBUTING.md) +3. Join the [GitHub Discussions](https://github.com/ismoy/BelZSpeedScan/discussions) --- -¿Tienes ideas o sugerencias? ¡Abre un issue o únete a la discusión! \ No newline at end of file +## 📝 Final Notes + +- This roadmap is a living document and may evolve based on community feedback and technical progress. +- Stability and ease of integration in modern mobile frameworks are always the top priority. \ No newline at end of file From d83e4864fc8a923bb58797c0390748bbe0f99249 Mon Sep 17 00:00:00 2001 From: Ismoy Belizaire <72107070+ismoy@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:37:35 -0400 Subject: [PATCH 4/5] Update ROADMAP.md --- ROADMAP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 3c6430c..7b1d915 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -71,11 +71,11 @@ This document defines the strategic goals to transform **BelZSpeedScan** into a 1. Check [issues labeled `help wanted`](https://github.com/ismoy/BelZSpeedScan/issues) 2. Read the [Contributing Guide](CONTRIBUTING.md) -3. Join the [GitHub Discussions](https://github.com/ismoy/BelZSpeedScan/discussions) +3. Join the [GitHub Discussions](https://github.com/ismoy/BelZSpeedScan/discussions/) --- ## 📝 Final Notes - This roadmap is a living document and may evolve based on community feedback and technical progress. -- Stability and ease of integration in modern mobile frameworks are always the top priority. \ No newline at end of file +- Stability and ease of integration in modern mobile frameworks are always the top priority. From c04de0f4191cf96c0240a252f49f076247178b3b Mon Sep 17 00:00:00 2001 From: Ismoy Belizaire <72107070+ismoy@users.noreply.github.com> Date: Fri, 6 Jun 2025 21:48:31 -0400 Subject: [PATCH 5/5] add Contributing Guide into ./github --- .github/CONTRIBUTING.md | 94 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 .github/CONTRIBUTING.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..7a5f1f8 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,94 @@ + +# Contributing Guide to BelZSpeedScan + +Thank you for your interest in contributing to BelZSpeedScan! This document provides guidelines and the process for contributing to the project. + +## 🎯 Why Contribute? + +BelZSpeedScan is a barcode and QR code scanning library designed to make scanning faster and more efficient. Your contribution can help: + +- Improve user experience +- Add new features +- Fix bugs +- Improve documentation +- Optimize performance + +## 🚀 Getting Started + +1. **Fork the repository** + - Click the "Fork" button at the top right of the repository page. + +2. **Clone your fork** + ```bash + git clone https://github.com/YOUR-USERNAME/BelZSpeedScan.git + cd BelZSpeedScan + + 3. Set up your development environment +Make sure you have: +• Android Studio (latest stable version) +• Xcode (for iOS development) +• Kotlin 1.8.0 or higher +• Gradle 7.0 or higher + 4. Create a branch for your feature + +git checkout -b feature/your-feature-name + + + +📝 Contribution Process +1. Development +• Follow existing code conventions +• Add tests for new features +• Update documentation as needed +2. Commits +• Use descriptive commit messages +• Follow the format: type(scope): description +• Example: feat(android): add background scanning support +3. Pull Request +• Make sure your code compiles and passes all tests +• Update documentation if necessary +• Clearly describe your changes in the PR +• Reference any related issues + +🎨 Style Guide + +Kotlin +• Follow the Kotlin Coding Conventions +• Use camelCase for variables and functions +• Use PascalCase for classes and objects +• Keep functions short and focused + +Documentation +• Document all public APIs +• Use KDoc for code documentation +• Keep the README up to date + +🧪 Testing +• Write unit tests for any new functionality +• Ensure all tests pass before submitting a PR +• Keep test coverage above 80% + +📋 Pull Request Checklist +• Code follows the style guide +• Tests have been added for new functionality +• Documentation has been updated +• Tests pass locally +• Code compiles without warnings +• Conflicts with the main branch are resolved + +🤝 Code of Conduct + +Please read our Code of Conduct before contributing. + +❓ Need Help? +• Open an issue for questions or problems +• Join our GitHub discussions +• Reach out to the project maintainers + +📜 License + +By contributing, you agree that your code will be licensed under the same license as the project (MIT). + +⸻ + +Thank you for contributing to BelZSpeedScan! 🎉