├── .gitignore ├── README.md ├── animationZoom.gif ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── m1.png ├── m2.png ├── proguard-rules.pro ├── promotedAction.gif ├── promotedActionVideo.mov └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── savinoordine │ │ └── menuanimation │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── savinoordine │ │ └── menuanimation │ │ └── MyActivity.java │ └── res │ ├── drawable-hdpi │ ├── ic_add.png │ ├── ic_menu.png │ └── ic_menu_no_shadow.png │ ├── drawable-mdpi │ ├── ic_add.png │ ├── ic_menu.png │ └── ic_menu_no_shadow.png │ ├── drawable-xhdpi │ ├── ic_add.png │ ├── ic_menu.png │ └── ic_menu_no_shadow.png │ ├── drawable-xxhdpi │ ├── ic_add.png │ ├── ic_menu.png │ └── ic_menu_no_shadow.png │ ├── drawable-xxxhdpi │ ├── ic_add.png │ ├── ic_menu.png │ └── ic_menu_no_shadow.png │ ├── layout-land │ ├── activity_my.xml │ └── main.xml │ ├── layout │ ├── activity_my.xml │ └── main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── library ├── .gitignore ├── build.gradle ├── library.iml ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── io │ │ └── github │ │ └── onivas │ │ └── promotedactions │ │ └── ApplicationTest.java │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── io │ │ └── github │ │ └── onivas │ │ └── promotedactions │ │ └── PromotedActionsLibrary.java │ └── res │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── drawable │ ├── onivas_fab_circle.xml │ └── rounded_button_shadow.xml │ ├── layout │ ├── main_promoted_action_button.xml │ └── promoted_action_button.xml │ ├── menu │ └── library_promoted_actions.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Menu Animation 2 | ##Floating Action Button (FAB) based on Material Design 3 | 4 | By Savino Ordine - io.github.onivas.promotedactions.PromotedActionsLibrary; 5 | 6 | This is a Lib allow you to create a Promoted Action menu placed on right|bottom corner of the screen. 7 | 8 | ![Promoted Action zoom animation](https://github.com/onivas/MenuAnimation/blob/master/animationZoom.gif) 9 | ![Promoted Action animation](https://github.com/onivas/MenuAnimation/blob/master/app/promotedAction.gif) 10 | 11 | ##How it works 12 | 13 | #Import library 14 |
15 | import io.github.onivas.promotedactions.PromotedActionsLibrary;
16 | 
17 | 18 | #Steps 19 |
20 | FrameLayout frameLayout = (FrameLayout) findViewById(R.id.container);
21 | 
22 | PromotedActionsLibrary promotedActionsLibrary = new PromotedActionsLibrary();
23 | 
24 | // setup library
25 | promotedActionsLibrary.setup(getApplicationContext(), frameLayout);
26 | 
27 | // create onClickListener for each promoted action
28 | View.OnClickListener onClickListener = new View.OnClickListener() {
29 |     @Override
30 |         public void onClick(View view) {
31 |             // Do something
32 |     }
33 | };
34 | 
35 | // customize promoted actions with a drawable
36 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_menu_edit), onClickListener);
37 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_menu_send), onClickListener);
38 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_input_get), onClickListener);
39 | 
40 | // create main floating button and customize it with a drawable
41 | promotedActionsLibrary.addMainItem(getResources().getDrawable(android.R.drawable.ic_input_add));
42 | 
43 | 
44 | -------------------------------------------------------------------------------- /animationZoom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/animationZoom.gif -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 20 5 | buildToolsVersion "20.0.0" 6 | 7 | defaultConfig { 8 | applicationId "com.savinoordine.menuanimation" 9 | minSdkVersion 14 10 | targetSdkVersion 20 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | runProguard false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | compile project(':library') 25 | } 26 | -------------------------------------------------------------------------------- /app/m1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/m1.png -------------------------------------------------------------------------------- /app/m2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/m2.png -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/savino/Documents/adt-bundle-mac-x86_64-20130514/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/promotedAction.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/promotedAction.gif -------------------------------------------------------------------------------- /app/promotedActionVideo.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/promotedActionVideo.mov -------------------------------------------------------------------------------- /app/src/androidTest/java/com/savinoordine/menuanimation/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.savinoordine.menuanimation; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/savinoordine/menuanimation/MyActivity.java: -------------------------------------------------------------------------------- 1 | package com.savinoordine.menuanimation; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.FrameLayout; 7 | import android.widget.Toast; 8 | 9 | import io.github.onivas.promotedactions.PromotedActionsLibrary; 10 | 11 | public class MyActivity extends Activity { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.main); 17 | 18 | FrameLayout frameLayout = (FrameLayout) findViewById(R.id.container); 19 | 20 | PromotedActionsLibrary promotedActionsLibrary = new PromotedActionsLibrary(); 21 | 22 | promotedActionsLibrary.setup(getApplicationContext(), frameLayout); 23 | 24 | View.OnClickListener onClickListener = new View.OnClickListener() { 25 | @Override 26 | public void onClick(View view) { 27 | Toast.makeText(getApplicationContext(), "Button clicked.", Toast.LENGTH_SHORT).show(); 28 | } 29 | }; 30 | 31 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_menu_edit), onClickListener); 32 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_menu_send), onClickListener); 33 | promotedActionsLibrary.addItem(getResources().getDrawable(android.R.drawable.ic_input_get), onClickListener); 34 | 35 | promotedActionsLibrary.addMainItem(getResources().getDrawable(R.drawable.ic_add)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-hdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-hdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_no_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-hdpi/ic_menu_no_shadow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-mdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-mdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_no_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-mdpi/ic_menu_no_shadow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xhdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xhdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu_no_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xhdpi/ic_menu_no_shadow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxhdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxhdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_menu_no_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxhdpi/ic_menu_no_shadow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxxhdpi/ic_add.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxxhdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_menu_no_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onivas/MenuAnimation/61e38ebece2da1e6437765822291d4a79ba6fb72/app/src/main/res/drawable-xxxhdpi/ic_menu_no_shadow.png -------------------------------------------------------------------------------- /app/src/main/res/layout-land/activity_my.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 18 | 19 | 23 | 24 | 28 | 29 | 30 | 34 | 35 | 36 | 41 | 42 | 46 | 47 | 48 | 49 | 53 | 54 | 59 | 60 | 64 | 65 | 66 | 67 | 71 | 72 | 77 | 78 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 93 | 94 |