Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
youth5201314 committed Sep 9, 2016
1 parent 0fb0cea commit 4139435
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_banner_senior.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
app:title_textcolor="@color/main_color"
app:title_textsize="15sp"
app:image_scale_type="fit_xy"
app:delay_time="5000"/>
app:delay_time="3000"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion banner/banner-banner.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":banner" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.youth.banner" external.system.module.version="1.2.9_bate" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":banner" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="com.youth.banner" external.system.module.version="1.2.9_bate3" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand Down
6 changes: 3 additions & 3 deletions banner/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "1.2.9_bate"
version = "1.2.9_bate3"

android {
compileSdkVersion 23
Expand All @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 11
targetSdkVersion 23
versionCode 24
versionName "1.2.9_bate"
versionCode 26
versionName "1.2.9_bate3"
}
buildTypes {
release {
Expand Down
13 changes: 6 additions & 7 deletions banner/src/main/java/com/youth/banner/Banner.java
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ private void setData() {
viewPager.addOnPageChangeListener(this);
if (gravity != -1)
indicator.setGravity(gravity);
startAutoPlay();
if (isAutoPlay)
startAutoPlay();
}

private void initViewPagerScroll() {
Expand All @@ -358,9 +359,7 @@ private void initViewPagerScroll() {
}
}
private void startAutoPlay() {
if (isAutoPlay) {
stopAutoPlay();
}
handler.removeCallbacks(task);
handler.postDelayed(task, delayTime);
}
public void stopAutoPlay() {
Expand All @@ -370,7 +369,7 @@ public void stopAutoPlay() {

@Override
public void run() {
if (count > 1) {
if (count > 1&&isAutoPlay) {
currentItem = currentItem % (count + 1) + 1;
if (currentItem == 1) {
viewPager.setCurrentItem(currentItem, false);
Expand All @@ -387,9 +386,9 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
Log.i(tag, ev.getAction() + "--" + isAutoPlay);
int action = ev.getAction();
if (action == MotionEvent.ACTION_UP||action == MotionEvent.ACTION_CANCEL||action == MotionEvent.ACTION_OUTSIDE) {
isAutoPlay(true);
isAutoPlay=true;
} else if (action == MotionEvent.ACTION_DOWN) {
isAutoPlay(false);
isAutoPlay=false;
}
return super.dispatchTouchEvent(ev);
}
Expand Down

0 comments on commit 4139435

Please sign in to comment.