{"id":13611021,"url":"https://github.com/nilsjr/Snappy","last_synced_at":"2025-04-13T01:34:09.905Z","repository":{"id":47193990,"uuid":"515922214","full_name":"nilsjr/Snappy","owner":"nilsjr","description":"📸 Android CameraX Library","archived":false,"fork":false,"pushed_at":"2024-03-31T10:19:09.000Z","size":3201,"stargazers_count":41,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-03-31T11:25:56.623Z","etag":null,"topics":["android","android-library","camerax","jetpack-compose","kotlin","library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nilsjr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-20T09:45:32.000Z","updated_at":"2024-03-31T11:25:58.365Z","dependencies_parsed_at":"2023-10-15T11:08:02.182Z","dependency_job_id":"2f31c780-cbcd-4640-aa49-833ccae74387","html_url":"https://github.com/nilsjr/Snappy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsjr%2FSnappy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsjr%2FSnappy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsjr%2FSnappy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsjr%2FSnappy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilsjr","download_url":"https://codeload.github.com/nilsjr/Snappy/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223558474,"owners_count":17165137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","camerax","jetpack-compose","kotlin","library"],"created_at":"2024-08-01T19:01:50.998Z","updated_at":"2024-11-07T17:31:08.282Z","avatar_url":"https://github.com/nilsjr.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"100\" height=\"100\" src=\"https://raw.githubusercontent.com/nilsjr/snappy/gh-pages/images/ic_launcher_round.png\"\u003e\n\u003c/p\u003e\n\n**Snappy** is an android camerax library for taking snapshot fast \u0026 simple. Easy to integrate, 100% Kotlin \u0026 jetpack\ncompose driven.\n\n- Activity Result API usage\n- Android Jetpack CameraX for displaying preview\n- Minimalistic ui design\n- Coil for image loading\n- Different modes (single image \u0026 multiple images)\n\n## Download \n\nAvailable on `mavenCentral()`\n\n[![Maven Central](https://img.shields.io/maven-central/v/de.nilsdruyen.snappy/snappy)](https://search.maven.org/search?q=g:de.nilsdruyen.snappy)\n\n```kotlin\nimplementation(\"de.nilsdruyen.snappy:snappy:0.0.1\")\n```\n\n## Requirements\n\n- AndroidX\n- MinSdk 21\n\n---\n\n\u003ccenter\u003e\u003cb\u003e⚠️Important\u003c/b\u003e\u003c/center\u003e\n\n**File/Storage permissions should be requested by your app. Only camera permissions are requested by Snappy**\n\n---\n\n## Usage\n\nTo use Snappy in our app you need to add following code snippets.\n\n\u003cdetails open\u003e\n  \u003csummary\u003eKotlin\u003c/summary\u003e\n\n```kotlin\nimport de.nilsdruyen.snappy.Snappy\nimport de.nilsdruyen.snappy.models.SnappyConfig\nimport de.nilsdruyen.snappy.models.SnappyResult\n\n// setup snappy activity result launcher\nprivate val launcher = registerForActivityResult(Snappy()) { result -\u003e\n  // do something\n}\n\n// or in compose\nval launcher = rememberLauncherForActivityResult(Snappy()) { result -\u003e\n  when (result) {\n    is SnappyResult.Success -\u003e {\n      // do something\n    }\n    else -\u003e {\n      // \n    }\n  }\n}\n\nlauncher.launch(SnappyConfig(File(\"\")))\n```\n\n\u003c/details\u003e\n\n**SnappyConfig**\n\n```kotlin\nimport de.nilsdruyen.snappy.models.SnappyConfig\n\nval config = SnappyConfig(\n  outputDirectory = File(\"path/\"),    // no default\n  once = true,                        // default = false\n  withHapticFeedback = true,          // default = true\n)\n```\n\n**SnappyResult**\n\n```kotlin\nimport de.nilsdruyen.snappy.models.SnappyResult\n\nsealed interface SnappyResult {\n\n  data class Success(val images: List\u003cUri\u003e) : SnappyResult\n  object Canceled : SnappyResult\n  object PermissionDenied : SnappyResult\n  data class Error(val exception: Exception) : SnappyResult\n}\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eJava\u003c/summary\u003e\n\n```java\nimport de.nilsdruyen.snappy.Snappy;\nimport de.nilsdruyen.snappy.models.SnappyConfig;\nimport de.nilsdruyen.snappy.models.SnappyResult;\n\nclass Activity {\n\n  // setup snappy activity result launcher\n  private ActivityResultLauncher\u003cSnappyConfig\u003e snappy = registerForActivityResult(new Snappy(), (result) -\u003e {\n    if (result instanceof SnappyResult.Success) {\n      List\u003cUri\u003e images = ((SnappyResult.Success) result).component1();\n\n    }\n  });\n\n  // launch snappy activity\n  private void launch() {\n    snappy.launch(new SnappyConfig(new File(\"path\"), true, true));\n  }\n}\n```\n\n\u003c/details\u003e\n\n## Screenshots\n\nSingle snapshot mode\n\n| Single snapshot mode                                                                                                     |\n|--------------------------------------------------------------------------------------------------------------------------|\n| \u003cimg src=\"https://raw.githubusercontent.com/nilsjr/snappy/gh-pages/images/snappy_single.jpg\" alt=\"drawing\" width=\"200\"/\u003e |\n\nMultiple snapshot mode\n| No images | With images | Image gallery |\n| --- | --- | --- |\n| \u003cimg src=\"https://raw.githubusercontent.com/nilsjr/snappy/gh-pages/images/snappy_multi_no_image.jpg\" alt=\"drawing\" width=\"200\"/\u003e | \u003cimg src=\"https://raw.githubusercontent.com/nilsjr/snappy/gh-pages/images/snappy_multi_images.jpg\" alt=\"drawing\" width=\"200\"/\u003e | \u003cimg src=\"https://raw.githubusercontent.com/nilsjr/snappy/gh-pages/images/snappy_multi_gallery.jpg\" alt=\"drawing\" width=\"200\"/\u003e |\n\n## Contributing\n\nSee [CONTRIBUTING](CONTRIBUTING.md)\n\n## License\n\n    The MIT License (MIT)\n\n    Copyright (C) 2022 Nils Druyen\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and\n    associated documentation files (the \"Software\"), to deal in the Software without restriction,\n    including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,\n    and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,\n    subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all copies or substantial\n    portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n    LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT\n    OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsjr%2FSnappy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilsjr%2FSnappy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsjr%2FSnappy/lists"}