Back to project page openaccessbutton.
The source code is released under:
MIT License
If you think the Android project openaccessbutton listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.openaccessbutton.openaccessbutton.intro; /*from ww w. j av a2 s.c o m*/ import android.app.Activity; import android.app.Fragment; import android.app.FragmentManager; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v13.app.FragmentStatePagerAdapter; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v13.app.FragmentPagerAdapter; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.TextView; import com.viewpagerindicator.CirclePageIndicator; import org.openaccessbutton.openaccessbutton.MainActivity; import org.openaccessbutton.openaccessbutton.R; import org.openaccessbutton.openaccessbutton.preferences.AppPreferencesActivity; /** * Take the user through some introductory pages they swipe through before launching * the app for the first time */ public class IntroActivity extends Activity { private ViewPager mPager; private PagerAdapter mPagerAdapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_intro); // Instantiate a ViewPager and a PagerAdapter. mPager = (ViewPager) findViewById(R.id.pager); mPagerAdapter = new ScreenSlidePagerAdapter(getFragmentManager()); mPager.setAdapter(mPagerAdapter); // Circle pager indicator to show the user visually they can swipe between pages CirclePageIndicator pageIndicator = (CirclePageIndicator) findViewById(R.id.circles); pageIndicator.setViewPager(mPager); // Bind signup button TextView signupButton = (TextView) findViewById(R.id.globalSignupEmailButton); signupButton.setOnClickListener(new SignupEmailButtonClickListener(this)); } private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter { public ScreenSlidePagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int position) { return ScreenSlidePageFragment.create(position); } @Override public int getCount() { return ScreenSlidePageFragment.numberPages(getApplicationContext()); } } }