content: package com.fxn.arianasample;
  
  import android.content.Context;
  import android.os.Bundle;
  import android.support.v4.app.Fragment;
  import android.support.v4.app.FragmentManager;
  import android.support.v4.app.FragmentStatePagerAdapter;
  import android.support.v4.view.ViewPager;
  import android.support.v7.app.AppCompatActivity;
  import android.widget.ImageView;
  
  import com.fxn.ariana.ArianaBackgroundListener;
  
  import butterknife.BindView;
  import butterknife.ButterKnife;
  import me.relex.circleindicator.CircleIndicator;
  import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
  
  public class MainActivity extends AppCompatActivity {
  
      @BindView(R.id.viewPager)
      ViewPager viewPager;
      @BindView(R.id.imageView)
      ImageView imageView;
      private int NUM_PAGES = 7;
      private ScreenSlidePagerAdapter mPagerAdapter;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Utils.hideStatusbar(this);
          setContentView(R.layout.activity_main);
          ButterKnife.bind(this);
          mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
          viewPager.setAdapter(mPagerAdapter);
          CircleIndicator indicator = (CircleIndicator) findViewById(R.id.indicator);
          indicator.setViewPager(viewPager);
          viewPager.addOnPageChangeListener(new ArianaBackgroundListener(Utils.getColors(), imageView, viewPager));
      }
  
      @Override
      public void onBackPressed() {
          if (viewPager.getCurrentItem() == 0) {
              // If the user is currently looking at the first step, allow the system to handle the
              // Back button. This calls finish() on this activity and pops the back stack.
              super.onBackPressed();
          } else {
              // Otherwise, select the previous step.
              viewPager.setCurrentItem(viewPager.getCurrentItem() - 1);
          }
      }
  
      @Override
      protected void attachBaseContext(Context newBase) {
          super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
      }
  
      private class ScreenSlidePagerAdapter extends FragmentStatePagerAdapter {
          public ScreenSlidePagerAdapter(FragmentManager fm) {
              super(fm);
          }
  
          @Override
          public Fragment getItem(int position) {
              return ScreenSlidePageFragment.newInstance(Utils.getTexts()[position]);
          }
  
          @Override
          public int getCount() {
              return NUM_PAGES;
          }
      }
  }
  