From 7185bbd56fff8c612283a88c2cc8f3cdc664e130 Mon Sep 17 00:00:00 2001 From: Cameron White Date: Tue, 18 Sep 2018 23:32:17 -0400 Subject: [PATCH 1/3] Allow attaching different interaction events to the view FloatingActionMenu is currently bound to --- .../library/FloatingActionMenu.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/FloatingActionMenu.java b/library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/FloatingActionMenu.java index c0764fc..6f13162 100644 --- a/library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/FloatingActionMenu.java +++ b/library/src/main/java/com/oguzdev/circularfloatingactionmenu/library/FloatingActionMenu.java @@ -90,10 +90,8 @@ public FloatingActionMenu(final View mainActionView, this.stateChangeListener = stateChangeListener; - // Listen click events on the main action view - // In the future, touch and drag events could be listened to offer an alternative behaviour - this.mainActionView.setClickable(true); - this.mainActionView.setOnClickListener(new ActionViewClickListener()); + //Add default click interaction event to action view + AddInterationEvents(this.mainActionView); // Do not forget to set the menu as self to our customizable animation handler if(animationHandler != null) { @@ -145,6 +143,18 @@ public void onOrientationChanged(int orientation) { } } + /** + * Method to add interaction events to mainActionView. + * Can be overriden to attach other interaction handlers. + * @param View to attach interaction events to + */ + protected void AddInterationEvents(View v) { + // Listen click events on the main action view + // In the future, touch and drag events could be listened to offer an alternative behaviour + v.setClickable(true); + v.setOnClickListener(new ActionViewClickListener()); + } + /** * Simply opens the menu by doing necessary calculations. * @param animated if true, this action is executed by the current {@link MenuAnimationHandler} From 4ac94c64f08a3a7a210b47752a7a47e6d26fc510 Mon Sep 17 00:00:00 2001 From: Cameron White Date: Wed, 19 Sep 2018 20:55:09 -0400 Subject: [PATCH 2/3] updated library to build --- build.gradle | 5 ++++- gradle/wrapper/gradle-wrapper.properties | 4 ++-- library/build.gradle | 6 +++--- .../library/ApplicationTest.java | 13 ------------- samples/build.gradle | 8 ++++---- 5 files changed, 13 insertions(+), 23 deletions(-) delete mode 100644 library/src/androidTest/java/com/oguzdev/circularfloatingactionmenu/library/ApplicationTest.java diff --git a/build.gradle b/build.gradle index fc421de..36cfe0a 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.android.tools.build:gradle:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -16,5 +16,8 @@ buildscript { allprojects { repositories { jcenter() + maven { + url "https://maven.google.com" } } +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c44860..cca809d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Apr 10 15:27:10 PDT 2013 +#Wed Sep 19 20:53:17 EDT 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/library/build.gradle b/library/build.gradle index 47e81e1..7c884d8 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 21 - buildToolsVersion "21.1.1" + compileSdkVersion 28 + buildToolsVersion "27.0.3" defaultConfig { // applicationId "com.oguzdev.circularfloatingactionmenu.library" minSdkVersion 15 - targetSdkVersion 21 + targetSdkVersion 28 versionCode 3 versionName "1.0.2" } diff --git a/library/src/androidTest/java/com/oguzdev/circularfloatingactionmenu/library/ApplicationTest.java b/library/src/androidTest/java/com/oguzdev/circularfloatingactionmenu/library/ApplicationTest.java deleted file mode 100644 index 76973a9..0000000 --- a/library/src/androidTest/java/com/oguzdev/circularfloatingactionmenu/library/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.oguzdev.circularfloatingactionmenu.library; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/samples/build.gradle b/samples/build.gradle index 82f8e94..01bbd05 100644 --- a/samples/build.gradle +++ b/samples/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 21 - buildToolsVersion "21.1.1" + compileSdkVersion 28 + buildToolsVersion "27.0.3" defaultConfig { applicationId "com.oguzdev.circularfloatingactionmenu.samples" minSdkVersion 15 - targetSdkVersion 21 + targetSdkVersion 28 versionCode 3 versionName "1.0.2" } @@ -22,6 +22,6 @@ android { dependencies { compile project(':library') compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:support-v4:21.+' + compile 'com.android.support:support-v4:+' compile 'com.android.support:appcompat-v7:+' } From 8cdbb0605e14f679271093488cc231826bb0b7f5 Mon Sep 17 00:00:00 2001 From: Cameron White Date: Wed, 19 Sep 2018 21:29:12 -0400 Subject: [PATCH 3/3] another update to build on jitpack --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 36cfe0a..4ae5203 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0' + classpath 'com.android.tools.build:gradle:2.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -17,7 +17,7 @@ allprojects { repositories { jcenter() maven { - url "https://maven.google.com" + url "https://jitpack.io" } } }