public class TutorialActivity
extends android.support.v7.app.AppCompatActivity
implements android.support.v4.view.ViewPager.OnPageChangeListener
Modifier and Type | Class and Description |
---|---|
static class |
TutorialActivity.TutorialPagerAdapter
The adapter for the pages of the tutorial
|
Modifier and Type | Field and Description |
---|---|
private ArgbEvaluator |
argbEvaluator |
private Button |
endButton |
(package private) ImageButton |
nextButton |
private TutorialActivity.TutorialPagerAdapter |
pagerAdapter |
private Button |
skipButton |
private static java.lang.String |
TAG |
private android.support.v4.view.ViewPager |
vpager |
Constructor and Description |
---|
TutorialActivity() |
Modifier and Type | Method and Description |
---|---|
private void |
changeStatusBarColor(int position,
float positionOffset,
int nextColorPosition)
sets the status bar color
|
private int |
getPageColor(int position)
This method chooses the color to set to the page, using the actual position on the tutorial
|
private int |
getStatusBarColor(int position)
This method chooses the color to set to the status bar, using the actual position on the tutorial
|
void |
onBackPressed()
Manages the back press event.
|
protected void |
onCreate(Bundle savedInstanceState) |
void |
onPageScrolled(int position,
float positionOffset,
int positionOffsetPixels)
manages the scrolling through the pages of the tutorial, setting the right colors and the button's text
|
void |
onPageScrollStateChanged(int state) |
void |
onPageSelected(int position) |
void |
onWindowFocusChanged(boolean hasFocus) |
addContentView, dispatchKeyEvent, findViewById, getDelegate, getDrawerToggleDelegate, getMenuInflater, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onDestroy, onMenuItemSelected, onMenuOpened, onPanelClosed, onPostCreate, onPostResume, onPrepareSupportNavigateUpTaskStack, onSaveInstanceState, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, onWindowStartingSupportActionMode, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask
dump, getLastCustomNonConfigurationInstance, getSupportFragmentManager, getSupportLoaderManager, getSupportMediaController, onActivityResult, onAttachFragment, onCreatePanelMenu, onKeyDown, onLowMemory, onNewIntent, onPause, onPrepareOptionsPanel, onPreparePanel, onRequestPermissionsResult, onResume, onResumeFragments, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, onStart, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, setSupportMediaController, startActivityForResult, startActivityFromFragment, startActivityFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode
private static final java.lang.String TAG
private android.support.v4.view.ViewPager vpager
private Button skipButton
private Button endButton
ImageButton nextButton
private TutorialActivity.TutorialPagerAdapter pagerAdapter
private ArgbEvaluator argbEvaluator
public void onWindowFocusChanged(boolean hasFocus)
protected void onCreate(Bundle savedInstanceState)
onCreate
in class android.support.v7.app.AppCompatActivity
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels)
onPageScrolled
in interface android.support.v4.view.ViewPager.OnPageChangeListener
changeStatusBarColor(int, float, int)
private void changeStatusBarColor(int position, float positionOffset, int nextColorPosition)
getStatusBarColor(int)
private int getStatusBarColor(int position)
position
- The page of the tutorial selectedprivate int getPageColor(int position)
position
- The page of the tutorial selectedpublic void onPageSelected(int position)
onPageSelected
in interface android.support.v4.view.ViewPager.OnPageChangeListener
public void onPageScrollStateChanged(int state)
onPageScrollStateChanged
in interface android.support.v4.view.ViewPager.OnPageChangeListener
public void onBackPressed()
onBackPressed
in class android.support.v4.app.FragmentActivity