Skip to content

Commit

Permalink
添加点击事件
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnjson committed Aug 28, 2019
1 parent cb4951e commit d3e5bd2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// implementation project(path: ':libs:guide_lib')
implementation 'com.github.Johnjson:GuideActivity:1.0.0'
implementation project(path: ':libs:guide_lib')
// implementation 'com.github.Johnjson:GuideActivity:1.0.0'
}
4 changes: 4 additions & 0 deletions app/src/main/java/com/click/guide/activity/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public void callSlidingLast() {
Log.e("callSlidingLast", "滑动到最后一个callSlidingLast");
}

@Override
public void onClickLastListener() {
Log.e("callSlidingLast", "点击最后一个view");
}
@Override
protected void onDestroy() {
super.onDestroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public void onPageSelected(int i) {
if (callBack != null) {
callBack.callSlidingPosition(i);
if (i == pageSize - 1) {
mPageViews.get(pageSize - 1).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
callBack.onClickLastListener();
}
});
callBack.callSlidingLast();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ public interface CallBack {

// 滑动到最后一个
void callSlidingLast();

// 点击最后一个
void onClickLastListener();
}
3 changes: 1 addition & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include ':app'
//, ':libs:guide_lib'
include ':app' , ':libs:guide_lib'

0 comments on commit d3e5bd2

Please # to comment.