{"id":24582207,"url":"https://github.com/samyak2403/flashlightmine","last_synced_at":"2026-04-07T12:00:50.472Z","repository":{"id":273166096,"uuid":"918866894","full_name":"samyak2403/FlashLightmine","owner":"samyak2403","description":"FlashlightMine is an Android application that allows users to toggle their device flashlight using a button or by shaking the device. The app provides a simple and interactive UI for this purpose.","archived":false,"fork":false,"pushed_at":"2026-01-30T13:12:01.000Z","size":13243,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-30T23:09:05.213Z","etag":null,"topics":["amdroid","android","android-application","app","application","flashlig","flashlight","flashlight-app","flashlight-application","freeapps","kotlin-android","kotlin-multiplatform","samyak2403","samyakkamble"],"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/samyak2403.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-19T04:17:29.000Z","updated_at":"2026-01-30T13:12:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3e11c0b-61bf-41fa-b058-dbdf64495f66","html_url":"https://github.com/samyak2403/FlashLightmine","commit_stats":null,"previous_names":["samyak2403/flashlightmine"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/samyak2403/FlashLightmine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyak2403%2FFlashLightmine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyak2403%2FFlashLightmine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyak2403%2FFlashLightmine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyak2403%2FFlashLightmine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samyak2403","download_url":"https://codeload.github.com/samyak2403/FlashLightmine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyak2403%2FFlashLightmine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31511784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["amdroid","android","android-application","app","application","flashlig","flashlight","flashlight-app","flashlight-application","freeapps","kotlin-android","kotlin-multiplatform","samyak2403","samyakkamble"],"created_at":"2025-01-24T03:17:39.923Z","updated_at":"2026-04-07T12:00:50.467Z","avatar_url":"https://github.com/samyak2403.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlashlightMine\n\n\u003cimg src=\"https://github.com/samyak2403/FlashLightmine/blob/master/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp\" width=\"100px\"/\u003e\n\n\n[\u003cimg src=\"https://fdroid.gitlab.io/artwork/badge/get-it-on.png\" alt=\"Get it on F-Droid\" height=\"80\"\u003e](https://f-droid.org/packages/com.samyak2403.flashlightmine)\n[\u003cimg src=\"https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png\" alt=\"Get it on IzzyOnDroid\" height=\"80\"\u003e](https://apt.izzysoft.de/fdroid/index/apk/com.samyak2403.flashlightmine)\n[\u003cimg src=\"https://github.com/machiav3lli/oandbackupx/blob/034b226cea5c1b30eb4f6a6f313e4dadcbb0ece4/badge_github.png\" alt=\"Get it on GitHub\" height=\"80\"\u003e](https://github.com/samyak2403/FlashLightmine/releases/latest)\n\n\nFlashlightMine is an Android application that allows users to toggle their device flashlight using a button or by shaking the device. The app provides a simple and interactive UI for this purpose.\n\n## Features\n\n- **Flashlight Control**: Turn the flashlight ON/OFF with a button.\n- **Pull Rope Interaction**: Drag the lightbulb or line like a pull-cord switch to toggle the flashlight with realistic spring animations.\n- **Shake Detection**: Shake your device to toggle the flashlight.\n- **Interactive Tutorial**: A spotlight tutorial guides first-time users on how to use the pull-to-toggle feature.\n- **Dynamic UI**: \n  - Changes the background color and light bulb icon based on flashlight status.\n  - Updates the status bar color dynamically.\n  - Applies dynamic tint to UI elements for better visual feedback.\n- **Snackbar Notifications**: Inform users about additional functionalities.\n\n## Screenshots\n\n\u003ctable style=\"width: 100%; text-align: center; border-collapse: collapse;\"\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"images/1.png\" width=\"250px\" /\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"images/2.png\" width=\"250px\" /\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"images/preview.gif\" width=\"250px\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n \n\u003c/table\u003e\n    \n## Getting Started\n\n### Prerequisites\n\n- Android Studio installed on your computer.\n- A device with a flashlight and accelerometer sensor (or an emulator with simulated hardware).\n\n### Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/samyak2403/FlashLightmine.git\n   ```\n\n2. Open the project in Android Studio.\n3. Build and run the project on a compatible Android device or emulator.\n\n## Code Overview\n\n### MainActivity\n\nThe primary activity handles the following:\n\n1. **Flashlight Control**:\n   - Toggles the flashlight using the `CameraManager` API.\n   - Updates the UI to reflect the flashlight status.\n\n2. **Pull Rope Animation**:\n   - Implements a drag-and-release mechanic using `OnTouchListener`.\n   - Uses `SpringAnimation` for realistic bounce-back effects.\n   - Stretches the rope (`line_5`) and moves the lightbulb in sync for a fluid physics-based feel.\n\n3. **Showcase Tutorial**:\n   - Displays a feature discovery overlay using `TapTargetView` on the first launch.\n\n4. **Shake Listener**:\n   - Uses the accelerometer sensor to detect device shakes.\n   - Toggles the flashlight if a shake is detected above the threshold (2.5 G).\n\n5. **Dynamic UI Updates**:\n   - Changes background color and status dynamically.\n   - Updates the tint of decorative ellipses based on flashlight state.\n\n### Key Functions\n\n- `toggleFlashlight()`: Toggles the flashlight and updates the UI.\n- `setupPullRopeAnimation()`: Configures touch listeners and physics-based animations for the pull-cord interaction.\n- `snapBackWithSpring()`: Handles the spring snap-back animation for the rope and bulb.\n- `showTutorialIfFirstLaunch()`: Checks shared preferences to display the onboarding tutorial once.\n- `setupShakeListener()`: Registers a sensor listener to detect shakes.\n- `setEllipsesTint(isFlashlightOn: Boolean)`: Updates the tint of UI ellipses.\n\n## Dependencies\n\nThis app uses the following Android libraries:\n\n- [Material Components](https://material.io/develop/android) for Snackbar and UI design.\n- [Camera2 API](https://developer.android.com/reference/android/hardware/camera2/package-summary) for flashlight control.\n- [Dynamic Animation](https://developer.android.com/jetpack/androidx/releases/dynamicanimation) for spring physics animations.\n- [TapTargetView](https://github.com/KeepSafe/TapTargetView) for feature discovery tutorials.\n\n## Permissions\n\nAdd the following permissions in your `AndroidManifest.xml` file:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.CAMERA\" /\u003e\n\u003cuses-permission android:name=\"android.permission.FLASHLIGHT\" /\u003e\n```\n\n## How to Use\n\n1. Launch the app.\n2. **Pull the Rope**: specificially, drag the lightbulb down and release it to toggle the flashlight.\n3. Tap the ON/OFF button to toggle the flashlight.\n4. Shake your device to toggle the flashlight dynamically.\n\n## Future Enhancements\n\n- Add customization for shake sensitivity.\n- Include more dynamic animations for better user interaction.\n\n## Author\n\n[Samyak Kamble](https://github.com/samyak2403/)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2403%2Fflashlightmine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamyak2403%2Fflashlightmine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyak2403%2Fflashlightmine/lists"}