// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/RecentMediaActivity.java
// public class RecentMediaActivity extends AppActivity {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, RecentMediaActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Fragment newFragment = RecentMediaListFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// 
//     @Override
//     public boolean onPrepareOptionsMenu(Menu menu) {
//         boolean show = super.onPrepareOptionsMenu(menu);
//         if (!show)
//             return show;
// 
//         MenuItem item = menu.findItem(R.id.action_recent);
//         if (item != null)
//             item.setVisible(false);
// 
//         return true;
//     }
// }
// 
// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/SampleMediaActivity.java
// public class SampleMediaActivity extends AppActivity  {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, SampleMediaActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Fragment newFragment = SampleMediaListFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// 
//     @Override
//     public boolean onPrepareOptionsMenu(Menu menu) {
//         boolean show = super.onPrepareOptionsMenu(menu);
//         if (!show)
//             return show;
// 
//         MenuItem item = menu.findItem(R.id.action_recent);
//         if (item != null)
//             item.setVisible(false);
// 
//         return true;
//     }
// }
// 
// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/SettingsActivity.java
// public class SettingsActivity extends AppCompatActivity {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, SettingsActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_app);
// 
//         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//         setSupportActionBar(toolbar);
// 
//         Fragment newFragment = SettingsFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// }


import tv.danmaku.ijk.media.example.activities.SettingsActivity;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import tv.danmaku.ijk.media.example.R;
import tv.danmaku.ijk.media.example.activities.RecentMediaActivity;
import tv.danmaku.ijk.media.example.activities.SampleMediaActivity;
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
        switch (requestCode) {
            case MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE: {
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    // permission was granted, yay! Do the task you need to do.
                } else {
                    // permission denied, boo! Disable the functionality that depends on this permission.
                }
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_app, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            SettingsActivity.intentTo(this);
            return true;
        } else if (id == R.id.action_recent) {
            RecentMediaActivity.intentTo(this);
        } else if (id == R.id.action_sample) {
// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/RecentMediaActivity.java
// public class RecentMediaActivity extends AppActivity {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, RecentMediaActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Fragment newFragment = RecentMediaListFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// 
//     @Override
//     public boolean onPrepareOptionsMenu(Menu menu) {
//         boolean show = super.onPrepareOptionsMenu(menu);
//         if (!show)
//             return show;
// 
//         MenuItem item = menu.findItem(R.id.action_recent);
//         if (item != null)
//             item.setVisible(false);
// 
//         return true;
//     }
// }
// 
// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/SampleMediaActivity.java
// public class SampleMediaActivity extends AppActivity  {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, SampleMediaActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Fragment newFragment = SampleMediaListFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
// 
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// 
//     @Override
//     public boolean onPrepareOptionsMenu(Menu menu) {
//         boolean show = super.onPrepareOptionsMenu(menu);
//         if (!show)
//             return show;
// 
//         MenuItem item = menu.findItem(R.id.action_recent);
//         if (item != null)
//             item.setVisible(false);
// 
//         return true;
//     }
// }
// 
// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/activities/SettingsActivity.java
// public class SettingsActivity extends AppCompatActivity {
//     public static Intent newIntent(Context context) {
//         Intent intent = new Intent(context, SettingsActivity.class);
//         return intent;
//     }
// 
//     public static void intentTo(Context context) {
//         context.startActivity(newIntent(context));
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_app);
// 
//         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
//         setSupportActionBar(toolbar);
// 
//         Fragment newFragment = SettingsFragment.newInstance();
//         FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
//         transaction.replace(R.id.body, newFragment);
//         transaction.commit();
//     }
// }


// Path: android/ijkplayer/ijkplayer-example/src/main/java/tv/danmaku/ijk/media/example/application/AppActivity.java
import tv.danmaku.ijk.media.example.activities.SettingsActivity;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import tv.danmaku.ijk.media.example.R;
import tv.danmaku.ijk.media.example.activities.RecentMediaActivity;
import tv.danmaku.ijk.media.example.activities.SampleMediaActivity;

    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
        switch (requestCode) {
            case MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE: {
                if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                    // permission was granted, yay! Do the task you need to do.
                } else {
                    // permission denied, boo! Disable the functionality that depends on this permission.
                }
            }
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_app, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            SettingsActivity.intentTo(this);
            return true;
        } else if (id == R.id.action_recent) {
            RecentMediaActivity.intentTo(this);
        } else if (id == R.id.action_sample) {
            SampleMediaActivity.intentTo(this);