Skip to content

Commit e129e8f

Browse files
author
Alexander Vlasov
committed
Merge pull request Cleveroad#5 from Cleveroad/develop
Develop
2 parents dcbeb6e + 021b9d0 commit e129e8f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public class CustomPresentationPagerFragment extends PresentationPagerFragment {
116116
}
117117

118118
@Override
119-
protected boolean onSkipButtonClicked() {
119+
protected boolean onSkipButtonClicked(View skipButton) {
120120
// your own behavior goes here
121121
// ...
122122
// return true to consume click event, false otherwise

lib/src/main/java/com/cleveroad/slidingtutorial/PresentationPagerFragment.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
8686
@Override
8787
public void onClick(View v) {
8888
if (v.getId() == getButtonSkipResId()) {
89-
if (!onSkipButtonClicked()) {
89+
if (!onSkipButtonClicked(v)) {
9090
removeFragmentFromScreen();
9191
}
9292
}
@@ -191,9 +191,10 @@ protected boolean isInfiniteScrollEnabled() {
191191

192192
/**
193193
* Called when user pressed Skip button. Default behavior: remove presentation fragment.
194+
* @param skipButton skip button
194195
* @return true if you consumed click listener and implemented your own behavior, false otherwise
195196
*/
196-
protected boolean onSkipButtonClicked() {
197+
protected boolean onSkipButtonClicked(View skipButton) {
197198
return false;
198199
}
199200

sample/src/main/java/com/cleveroad/slidingtutorial/sample/CustomPresentationPagerFragment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.graphics.Color;
44
import android.support.annotation.ColorInt;
55
import android.support.v4.content.ContextCompat;
6+
import android.view.View;
67
import android.widget.Toast;
78

89
import com.cleveroad.slidingtutorial.PageFragment;
@@ -44,7 +45,7 @@ protected boolean isInfiniteScrollEnabled() {
4445
}
4546

4647
@Override
47-
protected boolean onSkipButtonClicked() {
48+
protected boolean onSkipButtonClicked(View skipButton) {
4849
Toast.makeText(getContext(), "Skip button clicked", Toast.LENGTH_SHORT).show();
4950
return true;
5051
}

0 commit comments

Comments
 (0)