Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

Allow subclasses to attach their own interaction events #105

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.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
Expand All @@ -16,5 +16,8 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions samples/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
Expand All @@ -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:+'
}