Skip to content

Commit 4972034

Browse files
committed
Update README.md
1 parent 34b7ab3 commit 4972034

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,31 @@ Intent intent = new Intent(this,OnboardingActivity.class);
7474
intent.putExtras(onboardingActivityBundle);
7575
startActivity(intent);
7676
```
77+
####Custom onButtonClick actions
78+
By default, clicking a button in an **Onboarding Fragment** will move to the next one in the list.
79+
If the **Onboarding Activity** is on the last **Onboarding Fragment**, it will simple `finish()` itself.
80+
81+
If you want something different to happen when the user clicks a button in an **Onboarding Fragment**, extend the **Onboarding Activitiy** and override the `onOnboardingClick` method.
82+
83+
It will pass the fragment position inside of the list that the user clicked.
84+
```
85+
public class MyOnboardingActivity extends OnboardingActivity {
86+
87+
@Override
88+
public void onOnboardingClick(int position) {
89+
Log.d("TAG", "Position is: " + position);
90+
}
91+
}
92+
```
93+
Next, simply start your **Onboarding Activity** instead of the normal one.
94+
95+
```
96+
//Start your version of the Onboarding Activity
97+
Intent intent = new Intent(this,MyOnboardingActivity.class);
98+
intent.putExtras(onboardingActivityBundle);
99+
startActivity(intent);
100+
```
101+
77102

78103
Installation
79104
=====

0 commit comments

Comments
 (0)