// Path: ARMusicKit/app/src/main/java/com/yurisuzuki/ActivityIntro.java
// public class ActivityIntro extends Activity {
//     public static final String TAG = "ActivityIntro";
//     private String type;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_intro);
// 
//         Bundle extras = getIntent().getExtras();
//         if (extras != null) {
//             type = extras.getString("type");
//         }
// 
//         showIntro();
//     }
// 
//     private void showIntro(){
//         //ActionBar actionBar = getActionBar();
//         //actionBar.hide();
// 
//         Fragment fragment = FragmentIntroBase.newInstance(type);
// 
//         getFragmentManager()
//                 .beginTransaction()
//                 .add(R.id.container, fragment,
//                         "FragmentIntroBase").commit();
//     }
// 
// 
//     public void jumpToCamera(){
//         Intent intent = new Intent(this, CameraActivity.class);
//         intent.putExtra("type", type);
//         startActivity(intent);
//         //finish();
//         //overridePendingTransition(R.anim.fade_in, R.anim.scale_out);
//     }
// 
// 
//     //@Override
//     /*
//     public boolean onCreateOptionsMenu(Menu menu) {
//         // Inflate the menu; this adds items to the action bar if it is present.
//         getMenuInflater().inflate(R.menu.menu_activity_intro, menu);
//         return true;
//     }
//     */
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         // Handle action bar item clicks here. The action bar will
//         // automatically handle clicks on the Home/Up button, so long
//         // as you specify a parent activity in AndroidManifest.xml.
// 
//         /*
//         int id = item.getItemId();
// 
//         //noinspection SimplifiableIfStatement
//         if (id == R.id.action_settings) {
//             return true;
//         }
//         */
// 
//         return super.onOptionsItemSelected(item);
//     }
// }


import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.viewpagerindicator.CirclePageIndicator;
import com.viewpagerindicator.PageIndicator;
import com.yurisuzuki.ActivityIntro;
import com.yurisuzuki.playsound.R;

     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         // Inflate the layout for this fragment
         View view = inflater.inflate(R.layout.fragment_intro_base, container, false);

         TextView titleView = (TextView)view.findViewById(R.id.inst_title);
         if(type != null){
             int title;
             if(type.equals("guitar")){
                 title = R.string.inst_title_guitar;
             }else if(type.equals("piano")){
                 title = R.string.inst_title_piano;
             }else if(type.equals("musicbox")){
                 title = R.string.inst_title_mb;
             }else if(type.equals("trace")){
                 title = R.string.inst_title_trace;
             }else{
                 title = R.string.inst_title_trace;
             }
             titleView.setText(title);
         }

         Button startButton = (Button)view.findViewById(R.id.get_started_button);

         startButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 viewPager.setCurrentItem(0);
// Path: ARMusicKit/app/src/main/java/com/yurisuzuki/ActivityIntro.java
// public class ActivityIntro extends Activity {
//     public static final String TAG = "ActivityIntro";
//     private String type;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_intro);
// 
//         Bundle extras = getIntent().getExtras();
//         if (extras != null) {
//             type = extras.getString("type");
//         }
// 
//         showIntro();
//     }
// 
//     private void showIntro(){
//         //ActionBar actionBar = getActionBar();
//         //actionBar.hide();
// 
//         Fragment fragment = FragmentIntroBase.newInstance(type);
// 
//         getFragmentManager()
//                 .beginTransaction()
//                 .add(R.id.container, fragment,
//                         "FragmentIntroBase").commit();
//     }
// 
// 
//     public void jumpToCamera(){
//         Intent intent = new Intent(this, CameraActivity.class);
//         intent.putExtra("type", type);
//         startActivity(intent);
//         //finish();
//         //overridePendingTransition(R.anim.fade_in, R.anim.scale_out);
//     }
// 
// 
//     //@Override
//     /*
//     public boolean onCreateOptionsMenu(Menu menu) {
//         // Inflate the menu; this adds items to the action bar if it is present.
//         getMenuInflater().inflate(R.menu.menu_activity_intro, menu);
//         return true;
//     }
//     */
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         // Handle action bar item clicks here. The action bar will
//         // automatically handle clicks on the Home/Up button, so long
//         // as you specify a parent activity in AndroidManifest.xml.
// 
//         /*
//         int id = item.getItemId();
// 
//         //noinspection SimplifiableIfStatement
//         if (id == R.id.action_settings) {
//             return true;
//         }
//         */
// 
//         return super.onOptionsItemSelected(item);
//     }
// }


// Path: ARMusicKit/app/src/main/java/com/yurisuzuki/fragment/FragmentIntroBase.java
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.viewpagerindicator.CirclePageIndicator;
import com.viewpagerindicator.PageIndicator;
import com.yurisuzuki.ActivityIntro;
import com.yurisuzuki.playsound.R;


     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
         // Inflate the layout for this fragment
         View view = inflater.inflate(R.layout.fragment_intro_base, container, false);

         TextView titleView = (TextView)view.findViewById(R.id.inst_title);
         if(type != null){
             int title;
             if(type.equals("guitar")){
                 title = R.string.inst_title_guitar;
             }else if(type.equals("piano")){
                 title = R.string.inst_title_piano;
             }else if(type.equals("musicbox")){
                 title = R.string.inst_title_mb;
             }else if(type.equals("trace")){
                 title = R.string.inst_title_trace;
             }else{
                 title = R.string.inst_title_trace;
             }
             titleView.setText(title);
         }

         Button startButton = (Button)view.findViewById(R.id.get_started_button);

         startButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 viewPager.setCurrentItem(0);
                 ((ActivityIntro)FragmentIntroBase.this.getActivity()).jumpToCamera();