Implementing Undo/Redo on a textview with Accelerometer and Gyroscope.
- Android Studio 3.6+ (On Mac, Windows or Linux)
- An Android Phone running Android 6.0+ with USB Debugging enabled or an Android Virtual Device with Android 6.0+. (Use the extended control options to simulate tilt or shake).
- Download the zip or clone the git repo. Link
- Open the project in Android Studio.
- Connect an Android Phone, enable USB debugging and Run the project on the application.
- Alternatively, create a AVD with Android SDK 6.0+ and run the project.
- Tilt the phone to the left to undo a text input operation.
- Tilt the phone to the right to redo a text input operation.
- Shake the phone vigoriously to clear all the text from the text input.
- After every operation recenter your device. The progress bar will provide a visual cue of your current roll/tilt of the device.
- Code for Undo/Redo. Google Issues, Source Code
- Library for Shake implementation. Square/Seismic
- Android developer tutorial for Sensor-based Orientation. Link
- Spalshscreen Icons used from flaticon.com Link