Giter Site home page Giter Site logo

shaky-android's Introduction

Shaky

Build Status

Shake-to-feedback plugin for Android.

Shaky dialog prompt

Inspired by Google Maps' Shake to feedback and based on Square's seismic.

Download

Download the latest .aar via Maven:

	<dependency>
	  <groupId>com.linkedin.shaky</groupId>
	  <artifactId>shaky</artifactId>
	  <version>3.0.4</version>
	</dependency>

or Gradle:

	implementation 'com.linkedin.shaky:shaky:3.0.4'

Getting Started

Add the following to your AndroidManifest.xml application tag:

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/filepaths"/>
    </provider>

Create the corresponding res/xml/filepaths.xml resource:

<paths>
    <files-path name="files" path="."/>
</paths>

This allows files captured by Shaky to be shared with external apps. In this case, whatever app picks up the email Intent. Note: you only need these xml permissions to share files with external apps. For more information see FileProvider.

In your Application subclass:

    public class ShakyApplication extends Application {
        @Override
        public void onCreate() {
            super.onCreate();
            Shaky.with(this, new EmailShakeDelegate("[email protected]"));
        }
    }

For a complete example, see the demo app.

Advanced Usage

Your app can define custom behavior by subclassing ShakeDelegate and implementing the void submit(Activity, FeedbackResult) method (e.g. to send the data to a custom server endpoint).

In addition, you can implement the Bundle collectData() to collect extra app data including device logs, user data, etc. You will also need to handle how to send the extra data collected in your submit method.

If you want to programmatically trigger the feedback collection flow, rather than listening for shake events, you can call Shaky#startFeedbackFlow() on the object returned by Shaky.with(). See the demo app for a full example of how to do this.

Snapshots

You can use snapshot builds to test the latest unreleased changes. A new snapshot is published after every merge to the main branch by the Deploy Snapshot Github Action workflow.

Just add the Sonatype snapshot repository to your Gradle scripts:

repositories {
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
}

You can find the latest snapshot version to use in the gradle.properties file.

shaky-android's People

Contributors

kahrendsen-li avatar kkoser avatar csv8674xn avatar li-advait avatar drewhannay avatar nickav avatar tesiawu avatar cckroets avatar nhibner avatar chao2zhang avatar build3r avatar mockitoguy avatar tianleisun avatar xizzhu avatar akalra avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.