Skip to content

Add shake-to-toggle flashlight app#1

Open
And1zle wants to merge 3 commits into
mainfrom
claude/shake-flashlight-app-r4jC6
Open

Add shake-to-toggle flashlight app#1
And1zle wants to merge 3 commits into
mainfrom
claude/shake-flashlight-app-r4jC6

Conversation

@And1zle
Copy link
Copy Markdown
Owner

@And1zle And1zle commented Apr 12, 2026

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

claude added 3 commits April 12, 2026 10:44
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants