diff --git a/.gitignore b/.gitignore index a4102d5..7468e14 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ mirror/ # Local configuration file (sdk path, etc) local.properties gradle.properties +deploy.properties # Proguard folder generated by Eclipse proguard/ diff --git a/build.gradle b/build.gradle index e93f285..52103ac 100644 --- a/build.gradle +++ b/build.gradle @@ -14,28 +14,22 @@ * limitations under the License. */ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files } } +plugins { + id "com.jfrog.bintray" version "1.7" +} + allprojects { repositories { jcenter() } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/library/.gitignore b/faboptions/.gitignore similarity index 100% rename from library/.gitignore rename to faboptions/.gitignore diff --git a/library/build.gradle b/faboptions/build.gradle similarity index 81% rename from library/build.gradle rename to faboptions/build.gradle index 9618958..cb3ad2f 100644 --- a/library/build.gradle +++ b/faboptions/build.gradle @@ -15,13 +15,8 @@ */ apply plugin: 'com.android.library' - - -ext { - PUBLISH_GROUP_ID = 'com.joaquimley' - PUBLISH_ARTIFACT_ID = 'FabOptions' - PUBLISH_VERSION = '1.0' -} +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' android { compileSdkVersion 25 @@ -30,8 +25,8 @@ android { defaultConfig { minSdkVersion 21 targetSdkVersion 25 - versionCode 3 - versionName "1.0" + versionCode 4 + versionName "1.0.1" vectorDrawables.useSupportLibrary = true } @@ -45,6 +40,8 @@ android { dependencies { final DESIGN_LIBRARY_VERSION = '25.0.1' + + compile fileTree(dir: 'libs', include: ['*.jar']) compile "com.android.support:design:$DESIGN_LIBRARY_VERSION" } -apply from: 'https://raw.githubusercontent.com/JoaquimLey/jcenter-configs/master/android-release-aar.gradle' \ No newline at end of file +apply from: 'deploy.gradle' \ No newline at end of file diff --git a/faboptions/deploy.gradle b/faboptions/deploy.gradle new file mode 100644 index 0000000..85757ba --- /dev/null +++ b/faboptions/deploy.gradle @@ -0,0 +1,108 @@ +/* + * Copyright (c) Joaquim Ley 2016. All Rights Reserved. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Properties properties = new Properties() +properties.load(file('deploy.properties').newDataInputStream()) + +group = properties.getProperty('group') +version = properties.getProperty('version') + +bintray { + user = properties.getProperty('bintray.user') + key = properties.getProperty('bintray.apikey') + configurations = ['archives'] //When uploading configuration files + pkg { + repo = properties.getProperty('repo') + name = properties.getProperty('name') + userOrg = properties.getProperty('userOrg') + desc = properties.getProperty('description') + websiteUrl = properties.getProperty('websiteUrl') + issueTrackerUrl = properties.getProperty('issueTrackerUrl') + vcsUrl = properties.getProperty('vcsUrl') + licenses = [properties.getProperty('license')] + labels = properties.getProperty('labels') + publicDownloadNumbers = properties.getProperty('publicDownloadNumbers') + version { + name = properties.getProperty('versionName') + released = new Date() + desc = properties.getProperty('versionDescription') + vcsTag = properties.getProperty('vcsTag') + gpg { + //Determines whether to GPG sign the files. The default is false + sign = properties.getProperty('gpgSign') + passphrase = properties.getProperty("gpgPassphrase") + //Optional. The passphrase for GPG signing' + } + } + } +} + +install { + repositories.mavenInstaller { + pom { + project { + packaging properties.getProperty('pomPackaging') + name properties.getProperty('pomName') + artifactId properties.getProperty('pomArtifactId') + url properties.getProperty('websiteUrl') + licenses { + license { + name properties.getProperty('pomLicenseName') + url properties.getProperty('pomLicenseUrl') + } + } + + developers { + developer { + id properties.getProperty('pomDeveloperId') + name properties.getProperty('pomDeveloperName') + email properties.getProperty('pomDeveloperEmail') + } + } + scm { + connection properties.getProperty('vcsUrl') + developerConnection properties.getProperty('vcsUrl') + url properties.getProperty('websiteUrl') + + } + } + } + } +} + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives javadocJar + archives sourcesJar +} + +task findConventions << { + println project.getConvention() +} \ No newline at end of file diff --git a/faboptions/deploy.properties b/faboptions/deploy.properties new file mode 100644 index 0000000..317af6a --- /dev/null +++ b/faboptions/deploy.properties @@ -0,0 +1,40 @@ +bintray.user = JoaquimLey +bintray.apikey = bbe66f1a7bb6f4a7111e49ba788391892e315624 + +bintray.oss.user=joaquimley +bintray.gpg.password=James2k2k +bintray.oss.password=Calimero2k2k + +group = com.github.joaquimley +version = 0.0.5 + +repo = opensource +name = faboptions +userOrg = joaquimleyapps +description = A multi-functional FAB component with customizable options + +websiteUrl = https://joaquimley.com/FabOptions +vcsUrl = https://github.com/JoaquimLey/FabOptions.git +issueTrackerUrl = https://github.com/JoaquimLey/FabOptions/issues +license = Apache-2.0 +labels = ['fab', 'component', 'ui'] +publicDownloadNumbers = true + + +versionName = 0.0.5 +versionDescription = First public release +vcsTag = 0.0.5 + +gpgSign = true +gpgPassphrase = James2k2k + +pomPackaging = aar +pomName = A multi-functional FAB component with customizable options +pomArtifactId = faboptions + +pomDeveloperId = joaquimley +pomDeveloperName = Joaquim Ley +pomDeveloperEmail = joaquimley@gmail.com + +pomLicenseName = The Apache Software License, Version 2.0 +pomLicenseUrl = http://www.apache.org/licenses/LICENSE-2.0.txt \ No newline at end of file diff --git a/library/proguard-rules.pro b/faboptions/proguard-rules.pro similarity index 100% rename from library/proguard-rules.pro rename to faboptions/proguard-rules.pro diff --git a/library/src/main/AndroidManifest.xml b/faboptions/src/main/AndroidManifest.xml similarity index 75% rename from library/src/main/AndroidManifest.xml rename to faboptions/src/main/AndroidManifest.xml index 11fcc31..d5880f7 100644 --- a/library/src/main/AndroidManifest.xml +++ b/faboptions/src/main/AndroidManifest.xml @@ -14,13 +14,6 @@ ~ limitations under the License. --> - - - - - - + + diff --git a/library/src/main/java/com/joaquimley/faboptions/FabOptions.java b/faboptions/src/main/java/com/joaquimley/faboptions/FabOptions.java similarity index 100% rename from library/src/main/java/com/joaquimley/faboptions/FabOptions.java rename to faboptions/src/main/java/com/joaquimley/faboptions/FabOptions.java diff --git a/library/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java b/faboptions/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java similarity index 80% rename from library/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java rename to faboptions/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java index 91f9e14..f7b2537 100644 --- a/library/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java +++ b/faboptions/src/main/java/com/joaquimley/faboptions/FabOptionsBehavior.java @@ -21,10 +21,10 @@ import android.view.View; /** - * FabOptions component {@link CoordinatorLayout.Behavior} to react to {@link Snackbar} + * FabOptions component default CoordinatorLayout.Behavior to react Snackbar */ -class FabOptionsBehavior extends CoordinatorLayout.Behavior { +public class FabOptionsBehavior extends CoordinatorLayout.Behavior { @Override public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { @@ -35,7 +35,8 @@ public boolean layoutDependsOn(CoordinatorLayout parent, View child, View depend public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) { float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight()); child.setTranslationY(translationY); - // TODO: 21/11/2016 handle the instanceof Bottomsheetnav + // TODO: 21/11/2016 Handle instanceof Bottomsheetnav & others return true; } + //FabOptions component default {@link CoordinatorLayout.Behavior} to react to {@link Snackbar} } \ No newline at end of file diff --git a/library/src/main/java/com/joaquimley/faboptions/FabOptionsButtonContainer.java b/faboptions/src/main/java/com/joaquimley/faboptions/FabOptionsButtonContainer.java similarity index 100% rename from library/src/main/java/com/joaquimley/faboptions/FabOptionsButtonContainer.java rename to faboptions/src/main/java/com/joaquimley/faboptions/FabOptionsButtonContainer.java diff --git a/library/src/main/res/animator/close_to_overflow.xml b/faboptions/src/main/res/animator/close_to_overflow.xml similarity index 100% rename from library/src/main/res/animator/close_to_overflow.xml rename to faboptions/src/main/res/animator/close_to_overflow.xml diff --git a/library/src/main/res/animator/overflow_to_close.xml b/faboptions/src/main/res/animator/overflow_to_close.xml similarity index 100% rename from library/src/main/res/animator/overflow_to_close.xml rename to faboptions/src/main/res/animator/overflow_to_close.xml diff --git a/library/src/main/res/drawable-anydpi/faboptions_ic_close.xml b/faboptions/src/main/res/drawable-anydpi/faboptions_ic_close.xml similarity index 100% rename from library/src/main/res/drawable-anydpi/faboptions_ic_close.xml rename to faboptions/src/main/res/drawable-anydpi/faboptions_ic_close.xml diff --git a/library/src/main/res/drawable-anydpi/faboptions_ic_overflow.xml b/faboptions/src/main/res/drawable-anydpi/faboptions_ic_overflow.xml similarity index 100% rename from library/src/main/res/drawable-anydpi/faboptions_ic_overflow.xml rename to faboptions/src/main/res/drawable-anydpi/faboptions_ic_overflow.xml diff --git a/library/src/main/res/drawable/faboptions_background.xml b/faboptions/src/main/res/drawable/faboptions_background.xml similarity index 100% rename from library/src/main/res/drawable/faboptions_background.xml rename to faboptions/src/main/res/drawable/faboptions_background.xml diff --git a/library/src/main/res/drawable/faboptions_ic_close_animatable.xml b/faboptions/src/main/res/drawable/faboptions_ic_close_animatable.xml similarity index 100% rename from library/src/main/res/drawable/faboptions_ic_close_animatable.xml rename to faboptions/src/main/res/drawable/faboptions_ic_close_animatable.xml diff --git a/library/src/main/res/drawable/faboptions_ic_menu_animatable.xml b/faboptions/src/main/res/drawable/faboptions_ic_menu_animatable.xml similarity index 100% rename from library/src/main/res/drawable/faboptions_ic_menu_animatable.xml rename to faboptions/src/main/res/drawable/faboptions_ic_menu_animatable.xml diff --git a/library/src/main/res/layout/faboptions_button.xml b/faboptions/src/main/res/layout/faboptions_button.xml similarity index 100% rename from library/src/main/res/layout/faboptions_button.xml rename to faboptions/src/main/res/layout/faboptions_button.xml diff --git a/library/src/main/res/layout/faboptions_layout.xml b/faboptions/src/main/res/layout/faboptions_layout.xml similarity index 100% rename from library/src/main/res/layout/faboptions_layout.xml rename to faboptions/src/main/res/layout/faboptions_layout.xml diff --git a/library/src/main/res/layout/faboptions_separator.xml b/faboptions/src/main/res/layout/faboptions_separator.xml similarity index 100% rename from library/src/main/res/layout/faboptions_separator.xml rename to faboptions/src/main/res/layout/faboptions_separator.xml diff --git a/library/src/main/res/values/attrs.xml b/faboptions/src/main/res/values/attrs.xml similarity index 100% rename from library/src/main/res/values/attrs.xml rename to faboptions/src/main/res/values/attrs.xml diff --git a/library/src/main/res/values/dimens.xml b/faboptions/src/main/res/values/dimens.xml similarity index 100% rename from library/src/main/res/values/dimens.xml rename to faboptions/src/main/res/values/dimens.xml diff --git a/library/src/main/res/values/strings.xml b/faboptions/src/main/res/values/strings.xml similarity index 100% rename from library/src/main/res/values/strings.xml rename to faboptions/src/main/res/values/strings.xml diff --git a/sample/build.gradle b/sample/build.gradle index f0fba70..d8a10fb 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -38,8 +38,11 @@ android { dependencies { final DESIGN_LIBRARY_VERSION = '25.0.1' - final FABOPTIONS_VERSION = '1.0' + final FABOPTIONS_VERSION = '0.0.5' compile "com.android.support:design:$DESIGN_LIBRARY_VERSION" - compile "com.joaquimley:FabOptions:$FABOPTIONS_VERSION" +// compile "com.github.joaquimley:faboptions:$FABOPTIONS_VERSION" + compile 'com.github.joaquimley:faboptions:0.0.5' +// compile 'com.github.joaquimley:faboptions:0.0.5' +// compile project(':faboptions') } diff --git a/sample/src/main/java/com/joaquimley/sample/JavaSampleActivity.java b/sample/src/main/java/com/joaquimley/sample/JavaSampleActivity.java index e6bd85f..cd1ec4d 100644 --- a/sample/src/main/java/com/joaquimley/sample/JavaSampleActivity.java +++ b/sample/src/main/java/com/joaquimley/sample/JavaSampleActivity.java @@ -34,8 +34,9 @@ import static com.joaquimley.faboptions.sample.R.id.toolbar; /** - * Faboptions sample via Java {@see FabOptions#setButtonMenu} + * Faboptions sample via Java {@see FabOptions#setButtonMenu()} */ +w public class JavaSampleActivity extends AppCompatActivity implements View.OnClickListener { private Toolbar mToolbar; diff --git a/sample/src/main/res/layout/activity_sample_xml.xml b/sample/src/main/res/layout/activity_sample_xml.xml index 3b0cdd8..19b1e6a 100644 --- a/sample/src/main/res/layout/activity_sample_xml.xml +++ b/sample/src/main/res/layout/activity_sample_xml.xml @@ -1,5 +1,4 @@ - -