Skip to content

Commit

Permalink
Merge pull request #11 from zTrap/v2.1
Browse files Browse the repository at this point in the history
Fix Javadocs, sources and logs
  • Loading branch information
mancj committed Jan 24, 2017
2 parents b27c180 + cbd2bde commit b9ad1a5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
27 changes: 24 additions & 3 deletions library/build.gradle
Expand Up @@ -23,9 +23,30 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
// exclude group: 'com.android.support', module: 'support-annotations'
// })
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
}

// build a jar with source files
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
28 changes: 14 additions & 14 deletions library/src/main/java/com/mancj/slideup/SlideUp.java
Expand Up @@ -100,7 +100,7 @@ public State[] newArray(int size) {
public interface Listener {

/**
* @param percent percents of complete slide <b>(100 = HIDDEN, 0 = SHOWED)</b>
* @param percent percents of complete slide <b color="#FFEE58">(100 = HIDDEN, 0 = SHOWED)</b>
* */
void onSlide(float percent);

Expand Down Expand Up @@ -143,7 +143,7 @@ public Builder(@NonNull T sliderView){
/**
* <p>Define a start state on screen</p>
*
* @param startState <b>(default - {@link State#HIDDEN})</b>
* @param startState <b>(default - <b color="#FFEE58">{@link State#HIDDEN}</b>)</b>
* */
public Builder withStartState(@NonNull State startState){
this.startState = startState;
Expand All @@ -153,7 +153,7 @@ public Builder withStartState(@NonNull State startState){
/**
* <p>Define a start gravity, <b>this parameter affects the motion vector slider</b></p>
*
* @param gravity <b>(default - {@link android.view.Gravity#BOTTOM})</b>
* @param gravity <b>(default - <b color="#FFEE58">{@link android.view.Gravity#BOTTOM}</b>)</b>
* */
public Builder withStartGravity(@StartVector int gravity){
startGravity = gravity;
Expand Down Expand Up @@ -184,7 +184,7 @@ public Builder withListeners(@NonNull Listener... listeners){
/**
* <p>Turning on/off debug logging for all handled events</p>
*
* @param enabled <b>(default - false)</b>
* @param enabled <b>(default - <b color="#FFEE58">false</b>)</b>
* */
public Builder withLoggingEnabled(boolean enabled){
debug = enabled;
Expand All @@ -194,7 +194,7 @@ public Builder withLoggingEnabled(boolean enabled){
/**
* <p>Define duration of animation (when you using {@link #hide()} or {@link #show()} methods)</p>
*
* @param duration <b>(default - 300)</b>
* @param duration <b>(default - <b color="#FFEE58">300</b>)</b>
* */
public Builder withAutoSlideDuration(int duration){
autoSlideDuration = duration;
Expand All @@ -204,7 +204,7 @@ public Builder withAutoSlideDuration(int duration){
/**
* <p>Define touchable area <b>(in dp)</b> for interaction</p>
*
* @param area <b>(default - 300dp)</b>
* @param area <b>(default - <b color="#FFEE58">300dp</b>)</b>
* */
public Builder withTouchableArea(float area){
touchableArea = area * density;
Expand All @@ -214,7 +214,7 @@ public Builder withTouchableArea(float area){
/**
* <p>Turning on/off sliding on touch event</p>
*
* @param enabled <b>(default - true)</b>
* @param enabled <b>(default - <b color="#FFEE58">true</b>)</b>
* */
public Builder withGesturesEnabled(boolean enabled){
gesturesEnabled = enabled;
Expand All @@ -223,7 +223,7 @@ public Builder withGesturesEnabled(boolean enabled){

/**
* <p>
* <b>WARNING:</b>
* <b color="#FFEE58">WARNING:</b>
* If you want to restore saved parameters, place this method at the end of builder
* </p>
* @param savedState parameters will be restored from this bundle, if it contains them
Expand Down Expand Up @@ -262,7 +262,7 @@ private SlideUp(Builder<T> builder){
density = builder.density;
touchableArea = builder.touchableArea;
autoSlideDuration = builder.autoSlideDuration;
debug = BuildConfig.DEBUG && builder.debug;
debug = builder.debug;
isRTL = builder.isRTL;
gesturesEnabled = builder.gesturesEnabled;
init();
Expand Down Expand Up @@ -338,7 +338,7 @@ public T getSliderView() {
/**
* <p>Set duration of animation (when you using {@link #hide()} or {@link #show()} methods)</p>
*
* @param autoSlideDuration <b>(default - 300)</b>
* @param autoSlideDuration <b>(default - <b color="#FFEE58">300</b>)</b>
* */
public void setAutoSlideDuration(int autoSlideDuration) {
this.autoSlideDuration = autoSlideDuration;
Expand All @@ -354,7 +354,7 @@ public float getAutoSlideDuration(){
/**
* <p>Set touchable area <b>(in dp)</b> for interaction</p>
*
* @param touchableArea <b>(default - 300dp)</b>
* @param touchableArea <b>(default - <b color="#FFEE58">300dp</b>)</b>
* */
public void setTouchableArea(float touchableArea) {
this.touchableArea = touchableArea * density;
Expand Down Expand Up @@ -407,10 +407,10 @@ public void showImmediately() {
/**
* <p>Turning on/off debug logging</p>
*
* @param enabled <b>(default - false)</b>
* @param enabled <b>(default - <b color="#FFEE58">false</b>)</b>
* */
public void setLoggingEnabled(boolean enabled){
debug = BuildConfig.DEBUG && enabled;
debug = enabled;
}

/**
Expand All @@ -423,7 +423,7 @@ public boolean isLoggingEnabled(){
/**
* <p>Turning on/off gestures</p>
*
* @param enabled <b>(default - true)</b>
* @param enabled <b>(default - <b color="#FFEE58">true</b>)</b>
* */
public void setGesturesEnabled(boolean enabled) {
this.gesturesEnabled = gesturesEnabled;
Expand Down

0 comments on commit b9ad1a5

Please sign in to comment.