Learn how to implement a popup menu on views using these PopupMenu libraries.

1. QuickActionView

View that shows quick actions when long pressed, inspired by Pinterest.

QuickActionView is a View that shows quick actions when long pressed, inspired by Pinterest.

Popup Menu Tutorial

Below is a demo GIF:

Popup Menu Tutorial

Follow these steps to use it in your project:

Step 1: Add as a Gradle Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
    repositories {
        maven { url "https://jitpack.io" }

Then, add the library to your project build.gradle

dependencies {
    implementation 'com.github.Commit451:QuickActionView:latest.release.here'

Step 2: Basic Usage

See the sample app for usage within a normal layout, as well as within a list using RecyclerView. In the most basic usage:

View view = findViewById(R.id.your_view);

You can also create Actions at runtime:

Drawable icon = ContextCompat.getDrawable(this, R.drawable.ic_favorite_24dp);
String title = getString(R.string.action_favorite);
Action action = new Action(1337, icon, title);
        //more configuring

Step 3: Configuring the QuickActionView

QuickActionView can be customized globally, or on a per Action basis.


Step 4: Configuring Action Items

Use the QuickActionConfig builder to create custom configurations for each action item you create.

//Give one of the quick actions custom colors
Action.Config actionConfig = new Action.Config()

        //the custom Action.Cofig will only apply to the addToCart action
        .setActionConfig(actionConfig, R.id.action_add_to_cart)

Listening for Events

You can hook into the interesting events a QuickActionView has:



|2.|Read more here.|
|3.|Follow code author here.|