Skip to content

Commit

Permalink
version 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
firdausmaulan committed Apr 12, 2019
1 parent 068523b commit 6af369d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
ext.min_sdk_version = 14
ext.target_sdk_version = 28
ext.support_version = '28.0.0'
ext.glide_version = '4.8.0'
ext.glide_slider_version = '1.3.2'
ext.glide_version = '4.9.0'
ext.glide_slider_version = '1.4.1'
repositories {
google()
jcenter()
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion rootProject.ext.min_sdk_version as Integer
targetSdkVersion rootProject.ext.target_sdk_version as Integer
versionCode 17
versionName "1.4.0"
versionCode 18
versionName "1.4.1"
}
buildTypes {
release {
Expand Down
13 changes: 10 additions & 3 deletions library/src/main/java/com/glide/slider/library/SliderLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public class SliderLayout extends RelativeLayout {

private boolean mAutoCycle;

private boolean mStopCyclingWhenTouch = true;

/**
* the duration between animation.
*/
Expand Down Expand Up @@ -189,7 +191,7 @@ public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_UP:
recoverCycle();
if (mStopCyclingWhenTouch) recoverCycle();
break;
}
return false;
Expand Down Expand Up @@ -347,7 +349,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
int action = ev.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
pauseAutoCycle();
if (mStopCyclingWhenTouch) pauseAutoCycle();
break;
}
return false;
Expand Down Expand Up @@ -658,11 +660,12 @@ public void removeAllSliders() {

/**
* Get number of slider inside the SliderAdapter
*
* @return
*/
public int getSliderImageCount() {
SliderAdapter adapter = getRealAdapter();
if(adapter != null) {
if (adapter != null) {
return adapter.getCount();
} else {
return 0;
Expand Down Expand Up @@ -718,4 +721,8 @@ public void moveNextPosition(boolean smooth) {
public void moveNextPosition() {
moveNextPosition(true);
}

public void stopCyclingWhenTouch(boolean isStopCyclingWhenTouch) {
mStopCyclingWhenTouch = isStopCyclingWhenTouch;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
Expand All @@ -34,7 +35,7 @@ public abstract class BaseSliderView {
private String mUrl;
private File mFile;
private int mRes;
private Glide mGlideUrl;
private GlideUrl mGlideUrl;

public OnSliderClickListener mOnSliderClickListener;

Expand Down Expand Up @@ -113,7 +114,7 @@ public BaseSliderView image(int res) {
* @param glideUrl
* @return
*/
public BaseSliderView image(Glide glideUrl) {
public BaseSliderView image(GlideUrl glideUrl) {
if (mUrl != null || mFile != null || mRes != 0) {
throw new IllegalStateException("Call multi image function," +
"you only have permission to call it once");
Expand Down

0 comments on commit 6af369d

Please sign in to comment.