Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion #29

Closed
MissMyDearBear opened this issue Sep 12, 2016 · 4 comments
Closed

suggestion #29

MissMyDearBear opened this issue Sep 12, 2016 · 4 comments
Labels

Comments

@MissMyDearBear
Copy link

In my APP,I want go to next activity when selecting the last page .
This is my code: setUseAutoRemoveTutorialFragment(true)
I find the activity,include Tutirual,perform an empty page,rather than liking the skip click events.

@Iojjj
Copy link
Contributor

Iojjj commented Sep 12, 2016

Hi @MissMyDearBear,

as I understand, you want to automatically go to the next activity as soon as a user opens the last page of tutorial? I don't think it's a good user experience. User should be able to go to the next activity by pressing some button that will indicate he/she understood and completed tutorial.

If you still want to open next activity automatically, you need to set setUseAutoRemoveTutorialFragment(true) and override onPageChanged method in your TutorialFragment and do something like this:

@Override
public void onPageChanged(int position) {
    if (position == TutorialFragment.EMPTY_FRAGMENT_POSITION) {
        final Intent intent = new Intent(getContext(), NextActivity.class);
        startActivity(intent);
        getActivity().finish();
    }
}

Let me know if this helps you.

@Iojjj
Copy link
Contributor

Iojjj commented Sep 12, 2016

I've checked your comment. If you want a smooth transition from tutorial page to your content, then use single activity:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // ...
    if (savedInstanceState == null) {
        getSupportFragmentManager()
            .beginTransaction()
            // first add your content
            .add(R.id.fragment_container, ContentFragment.newInstance())
            // then add your tutorial
            .add(R.id.fragment_container, TutorialFragment.newInstance())
            .commit();
    }
    // ...
}

In this case when you set setUseAutoRemoveTutorialFragment(...) to true, you will get smooth transition from tutorial to content. Currently I don't see any option of smooth transition to the next activity.

@VishalDalve
Copy link

First of all Nice work...
I have one problem, How can i make fragment images Clickable? I want to change the fragment on click of any image aslo. For that do i have to modify "PageFragment.java" ?
Thanks you.

@Iojjj Iojjj added the question label Sep 20, 2016
@Iojjj
Copy link
Contributor

Iojjj commented Sep 27, 2016

@MissMyDearBear

reopen this ticket if you still have any questions related to it.

@Iojjj Iojjj closed this as completed Sep 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants