A small library to show a menu on Android by shaking your phone
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
images
kunstmaan-shaker-menu
.gitignore
CHANGELOG.md
LICENSE
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
publish.gradle
settings.gradle

README.md

Kunstmaan Shaker Menu

Features

  • shake your phone to show a menu with custom entries

Example project integrating this in the Android build process can be found here

Installation

in the build.gradle of your app, put:

implementation 'be.kunstmaan.android:kunstmaan-shaker-menu:1.0.0'
// implementationDebug if needed only for debugging purposes

Usage

  • initialize ShakerMenu:

In your Application class add the following:

new KunstmaanShakerMenu.Builder(application)
    .setTitle("My menu")
    .setSensitivity(KunstmaanShakerMenu.Sensitivity.LIGHT)
    .addItem("Title A", new Runnable() {
                        @Override
                        public void run() {
                            // put your code here
                        }
                    })
    .addItem("Title B", new Runnable() {
                        @Override
                        public void run() {
                            // put your code here
                        }
                    })
    .build();

Credits

https://github.com/square/seismic is used for the shaking detection, in compliance with the Apache License, Version 2.0.