-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated compatibility Added Styles utils Updated WheelScroller
- Loading branch information
1 parent
740352e
commit fdf2bde
Showing
13 changed files
with
209 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
library/src/androidTest/java/com/github/mathieudebrito/utils/ApplicationTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
library/src/main/java/com/github/mathieudebrito/utils/Styles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.github.mathieudebrito.utils; | ||
|
||
import android.content.res.TypedArray; | ||
import android.graphics.drawable.Drawable; | ||
|
||
public class Styles { | ||
|
||
public static Drawable getDrawable(TypedArray arr, int res) { | ||
if (arr.hasValue(res)) { | ||
return arr.getDrawable(res); | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
public static String getString(TypedArray arr, int res) { | ||
if (arr.hasValue(res)) { | ||
return arr.getString(res); | ||
} else { | ||
return null; | ||
} | ||
} | ||
public static boolean getBoolean(TypedArray arr, int res) { | ||
if (arr.hasValue(res)) { | ||
return arr.getBoolean(res, false); | ||
} else { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
apply plugin: 'maven' | ||
apply plugin: 'signing' | ||
|
||
//https://github.com/chrisbanes/gradle-mvn-push/issues/44 | ||
|
||
def sonatypeRepositoryUrl | ||
if (isReleaseBuild()) { | ||
println 'RELEASE BUILD' | ||
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
} else { | ||
println 'DEBUG BUILD' | ||
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
|
||
def getRepositoryUsername() { | ||
return hasProperty('nexusUsername') ? nexusUsername : "" | ||
} | ||
|
||
def getRepositoryPassword() { | ||
return hasProperty('nexusPassword') ? nexusPassword : "" | ||
} | ||
|
||
def isReleaseBuild() { | ||
return version.contains("SNAPSHOT") == false | ||
} | ||
|
||
afterEvaluate { project -> | ||
uploadArchives { | ||
repositories { | ||
mavenDeployer { | ||
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } | ||
|
||
pom.groupId = GROUP | ||
pom.artifactId = POM_ARTIFACT_ID | ||
pom.version = VERSION_NAME | ||
|
||
repository(url: sonatypeRepositoryUrl) { | ||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) | ||
} | ||
|
||
pom.project { | ||
name POM_NAME | ||
packaging POM_PACKAGING | ||
description POM_DESCRIPTION | ||
url POM_URL | ||
|
||
scm { | ||
url POM_SCM_URL | ||
connection POM_SCM_CONNECTION | ||
developerConnection POM_SCM_DEV_CONNECTION | ||
} | ||
|
||
licenses { | ||
license { | ||
name POM_LICENCE_NAME | ||
url POM_LICENCE_URL | ||
distribution POM_LICENCE_DIST | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id POM_DEVELOPER_ID | ||
name POM_DEVELOPER_NAME | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } | ||
sign configurations.archives | ||
} | ||
|
||
task androidJavadocs(type: Javadoc) { | ||
androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath | ||
} | ||
|
||
task androidJavadocsJar(type: Jar) { | ||
classifier = 'javadoc' | ||
//basename = artifact_id | ||
from androidJavadocs.destinationDir | ||
} | ||
|
||
task androidSourcesJar(type: Jar) { | ||
classifier = 'sources' | ||
//basename = artifact_id | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
artifacts { | ||
//archives packageReleaseJar | ||
archives androidSourcesJar | ||
archives androidJavadocsJar | ||
} | ||
} |
Oops, something went wrong.