Add shake-to-toggle flashlight app#1
Open
And1zle wants to merge 3 commits into
Open
Conversation
Creates FlashlightPage with DeviceMotionEvent shake detection and MediaDevices torch API control. Wires the new 'flashlight' view into App.tsx and adds a Flashlight entry to the Sidebar nav. https://claude.ai/code/session_01TSrwuBdcTknYazHcemzwdx
Full Kotlin/Android project under android/ — targets API 23+ (all Android 6.0+ devices with a rear flash). Key features: - CameraManager.setTorchMode() for instant torch control, no camera preview required. TorchCallback keeps UI in sync if another app steals the camera. - SensorManager + TYPE_ACCELEROMETER for shake detection: 20 Hz sampling, √(Δx²+Δy²+Δz²) > 13 m/s² with 700 ms cooldown triggers a toggle. - First accelerometer reading used as baseline to prevent false-shake on startup. - Torch turns off automatically on onPause() so the battery isn't drained when the app is backgrounded. - Pulsing ObjectAnimator on the button while torch is ON. - Clean dark UI matching the eBayOS colour palette. https://claude.ai/code/session_01TSrwuBdcTknYazHcemzwdx
Triggers on push to the flashlight branch (or manually from the Actions tab). Builds with Gradle 8.4 + JDK 17 and uploads the APK as a 14-day artifact so it can be downloaded directly on-device. https://claude.ai/code/session_01TSrwuBdcTknYazHcemzwdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creates FlashlightPage with DeviceMotionEvent shake detection and
MediaDevices torch API control. Wires the new 'flashlight' view into
App.tsx and adds a Flashlight entry to the Sidebar nav.
https://claude.ai/code/session_01TSrwuBdcTknYazHcemzwdx