Skip to content

Commit

Permalink
1.upload library to 0.2.0 version.add setListener() method
Browse files Browse the repository at this point in the history
  • Loading branch information
caikaidev committed Oct 20, 2016
1 parent 1ea8a90 commit 42a9dfd
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
Gradle:

```
compile 'com.kcode.github:autoScrollViewPager:0.1.0'
compile 'com.kcode.github:autoScrollViewPager:0.1.0'
```

##Usage
Expand Down
4 changes: 3 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.2.0'
testCompile 'junit:junit:4.12'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.kcode.github:autoScrollViewPager:0.1.0'
compile 'com.kcode.github:autoScrollViewPager:0.1.0',{
exclude group: 'com.android.support', module:'appcompat-v7'
}
}
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
android:layout_height="220dp">

</com.kcode.autoscrollviewpager.view.AutoScrollViewPager>

</RelativeLayout>
2 changes: 1 addition & 1 deletion autoScrollViewPager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

// This is the library version used when deploying the artifact
version = "0.1.0"
version = "0.2.0"

android {
compileSdkVersion 24
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ private void init(Context context){
public AutoViewPager getViewPager() {
return mViewPager;
}

public void initPointView(int size){

layout = new LinearLayout(mContext);
Expand All @@ -70,6 +69,7 @@ public void initPointView(int size){
addView(layout);
}


public void updatePointView(int position) {
int size = layout.getChildCount();
for (int i = 0; i < size; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class AutoViewPager extends ViewPager {
private Timer mTimer;
private AutoTask mTask;

private boolean isFirst = true;

public AutoViewPager(Context context) {
super(context);
}
Expand All @@ -45,7 +43,6 @@ public void start(){
private Runnable runnable = new Runnable() {
@Override
public void run() {
Log.i(TAG,"move");
currentItem = getCurrentItem();
if(currentItem == getAdapter().getCount() - 1){
currentItem = 0 ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public BaseViewPagerAdapter(Context context, List<T> data,AutoViewPager viewPage
mView.updatePointView(getRealCount());
}

public void setListener(OnAutoViewPagerItemClickListener listener) {
this.listener = listener;
}

public void add(T t){
data.add(t);
notifyDataSetChanged();
Expand Down

0 comments on commit 42a9dfd

Please sign in to comment.