// Path: src/main/java/at/maui/cheapcast/fragment/AboutFragment.java
// public class AboutFragment extends RoboSherlockFragment {
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         return inflater.inflate(R.layout.fragment_about, null);
//     }
// }
// 
// Path: src/main/java/at/maui/cheapcast/fragment/ChangelogFragment.java
// public class ChangelogFragment extends HtmlAssetFragment {
//     @Override
//     public String getAssetPath() {
//         return "changelog.html";
//     }
// }
// 
// Path: src/main/java/at/maui/cheapcast/fragment/ExtLibrariesFragment.java
// public class ExtLibrariesFragment extends HtmlAssetFragment {
// 
//     @Override
//     public String getAssetPath() {
//         return "third_party.html";  //To change body of implemented methods use File | Settings | File Templates.
//     }
// }


import com.viewpagerindicator.TitlePageIndicator;
import roboguice.inject.InjectView;
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.util.Log;
import at.maui.cheapcast.App;
import at.maui.cheapcast.R;
import at.maui.cheapcast.fragment.AboutFragment;
import at.maui.cheapcast.fragment.ChangelogFragment;
import at.maui.cheapcast.fragment.ExtLibrariesFragment;
import com.actionbarsherlock.view.MenuItem;
import com.github.rtyley.android.sherlock.roboguice.activity.RoboSherlockFragmentActivity;

        mViewPagerAdapter = new AboutPagerAdapter(this, getSupportFragmentManager());
        mViewPager.setAdapter(mViewPagerAdapter);
        mIndicator.setViewPager(mViewPager);
    }

    private void trackViewPagerPage(int position) {
        Log.d(LOG_TAG, "trackViewPagerPage()");
        App.getInstance().getTracker().sendView(String.format("/About/%s", getResources().getStringArray(R.array.about_tabs)[position]));
    }

    @Override
    protected void onStart() {
        super.onStart();
        App.getInstance().getTracker().sendView("/About");
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        if(item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public class AboutPagerAdapter extends FragmentStatePagerAdapter {
        private Context mContext;


// Path: src/main/java/at/maui/cheapcast/fragment/AboutFragment.java
// public class AboutFragment extends RoboSherlockFragment {
// 
//     @Override
//     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//         return inflater.inflate(R.layout.fragment_about, null);
//     }
// }
// 
// Path: src/main/java/at/maui/cheapcast/fragment/ChangelogFragment.java
// public class ChangelogFragment extends HtmlAssetFragment {
//     @Override
//     public String getAssetPath() {
//         return "changelog.html";
//     }
// }
// 
// Path: src/main/java/at/maui/cheapcast/fragment/ExtLibrariesFragment.java
// public class ExtLibrariesFragment extends HtmlAssetFragment {
// 
//     @Override
//     public String getAssetPath() {
//         return "third_party.html";  //To change body of implemented methods use File | Settings | File Templates.
//     }
// }


// Path: src/main/java/at/maui/cheapcast/activity/AboutActivity.java
import com.viewpagerindicator.TitlePageIndicator;
import roboguice.inject.InjectView;
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.util.Log;
import at.maui.cheapcast.App;
import at.maui.cheapcast.R;
import at.maui.cheapcast.fragment.AboutFragment;
import at.maui.cheapcast.fragment.ChangelogFragment;
import at.maui.cheapcast.fragment.ExtLibrariesFragment;
import com.actionbarsherlock.view.MenuItem;
import com.github.rtyley.android.sherlock.roboguice.activity.RoboSherlockFragmentActivity;

        mViewPagerAdapter = new AboutPagerAdapter(this, getSupportFragmentManager());
        mViewPager.setAdapter(mViewPagerAdapter);
        mIndicator.setViewPager(mViewPager);
    }

    private void trackViewPagerPage(int position) {
        Log.d(LOG_TAG, "trackViewPagerPage()");
        App.getInstance().getTracker().sendView(String.format("/About/%s", getResources().getStringArray(R.array.about_tabs)[position]));
    }

    @Override
    protected void onStart() {
        super.onStart();
        App.getInstance().getTracker().sendView("/About");
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        if(item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    public class AboutPagerAdapter extends FragmentStatePagerAdapter {
        private Context mContext;


        public AboutPagerAdapter(Context ctx, FragmentManager fm) {
