// Path: challenge-nine/app/src/main/java/com/reoky/crackme/challengenine/adaptors/ChallengePagerAdapter.java
// public class ChallengePagerAdapter extends FragmentPagerAdapter {
// 
//     public ChallengePagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         switch (position) {
//             case 0:
//                 return new ChallengeNineFragment();
//             case 1:
//                 return new HintFragment();
//             default:
//                 return new AboutFragment();
//         }
//     }
// 
//     @Override
//     public int getCount() {
//         return 3;
//     }
// }
// 
// Path: challenge-nine/app/src/main/java/com/reoky/crackme/challengenine/listeners/ChallengeActivityOnPageChangeListener.java
// public class ChallengeActivityOnPageChangeListener extends ViewPager.SimpleOnPageChangeListener {
// 
//     ActionBar actionBar;
// 
//     public ChallengeActivityOnPageChangeListener(ActionBar actionBar){
//         this.actionBar = actionBar;
//     }
// 
//     @Override
//     public void onPageSelected(int position) {
//         actionBar.setSelectedNavigationItem(position);
//     }
// }


import android.app.FragmentTransaction;
import android.os.Bundle;
import android.app.ActionBar;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import com.reoky.crackme.challengenine.R;
import com.reoky.crackme.challengenine.adaptors.ChallengePagerAdapter;
import com.reoky.crackme.challengenine.listeners.ChallengeActivityOnPageChangeListener;
package com.reoky.crackme.challengenine.activities;



public class ChallengeActivity extends FragmentActivity implements ActionBar.TabListener {

    ChallengePagerAdapter mChallengePagerAdapter;
    ViewPager mViewPager;
    ActionBar actionBar;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_challenge);

        mChallengePagerAdapter = new ChallengePagerAdapter(getSupportFragmentManager());
        actionBar = getActionBar();

        // Configure the action barW
        actionBar.setHomeButtonEnabled(false);
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

        // Configure the ViewPager and attach a
        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(mChallengePagerAdapter);
// Path: challenge-nine/app/src/main/java/com/reoky/crackme/challengenine/adaptors/ChallengePagerAdapter.java
// public class ChallengePagerAdapter extends FragmentPagerAdapter {
// 
//     public ChallengePagerAdapter(FragmentManager fm) {
//         super(fm);
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         switch (position) {
//             case 0:
//                 return new ChallengeNineFragment();
//             case 1:
//                 return new HintFragment();
//             default:
//                 return new AboutFragment();
//         }
//     }
// 
//     @Override
//     public int getCount() {
//         return 3;
//     }
// }
// 
// Path: challenge-nine/app/src/main/java/com/reoky/crackme/challengenine/listeners/ChallengeActivityOnPageChangeListener.java
// public class ChallengeActivityOnPageChangeListener extends ViewPager.SimpleOnPageChangeListener {
// 
//     ActionBar actionBar;
// 
//     public ChallengeActivityOnPageChangeListener(ActionBar actionBar){
//         this.actionBar = actionBar;
//     }
// 
//     @Override
//     public void onPageSelected(int position) {
//         actionBar.setSelectedNavigationItem(position);
//     }
// }


// Path: challenge-nine/app/src/main/java/com/reoky/crackme/challengenine/activities/ChallengeActivity.java
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.app.ActionBar;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import com.reoky.crackme.challengenine.R;
import com.reoky.crackme.challengenine.adaptors.ChallengePagerAdapter;
import com.reoky.crackme.challengenine.listeners.ChallengeActivityOnPageChangeListener;

package com.reoky.crackme.challengenine.activities;



public class ChallengeActivity extends FragmentActivity implements ActionBar.TabListener {

    ChallengePagerAdapter mChallengePagerAdapter;
    ViewPager mViewPager;
    ActionBar actionBar;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_challenge);

        mChallengePagerAdapter = new ChallengePagerAdapter(getSupportFragmentManager());
        actionBar = getActionBar();

        // Configure the action barW
        actionBar.setHomeButtonEnabled(false);
        actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

        // Configure the ViewPager and attach a
        mViewPager = (ViewPager) findViewById(R.id.container);
        mViewPager.setAdapter(mChallengePagerAdapter);
        mViewPager.setOnPageChangeListener(new ChallengeActivityOnPageChangeListener(actionBar));