[
  {
    "path": ".gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/app/src/release\n/build\n"
  },
  {
    "path": ".idea/.name",
    "content": "EdenYouTube"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <option name=\"DEFAULT_COMPILER\" value=\"Javac\" />\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"gradleJvm\" value=\"1.8\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectInspectionProfilesVisibleTreeState\">\n    <entry key=\"Project Default\">\n      <profile-state>\n        <expanded-state>\n          <State>\n            <id />\n          </State>\n          <State>\n            <id>Android Lint</id>\n          </State>\n          <State>\n            <id>General</id>\n          </State>\n          <State>\n            <id>Maven</id>\n          </State>\n        </expanded-state>\n        <selected-state>\n          <State>\n            <id>Abstraction issues</id>\n          </State>\n        </selected-state>\n      </profile-state>\n    </entry>\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"false\">\n    <OptionsSetting value=\"true\" id=\"Add\" />\n    <OptionsSetting value=\"true\" id=\"Remove\" />\n    <OptionsSetting value=\"true\" id=\"Checkout\" />\n    <OptionsSetting value=\"true\" id=\"Update\" />\n    <OptionsSetting value=\"true\" id=\"Status\" />\n    <OptionsSetting value=\"true\" id=\"Edit\" />\n    <ConfirmationsSetting value=\"0\" id=\"Add\" />\n    <ConfirmationsSetting value=\"0\" id=\"Remove\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>1.8</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/EdenYouTube.iml\" filepath=\"$PROJECT_DIR$/EdenYouTube.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "EdenYouTube.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\"EdenYouTube\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$\" external.system.id=\"GRADLE\" external.system.module.group=\"\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"java-gradle\" name=\"Java-Gradle\">\n      <configuration>\n        <option name=\"BUILD_FOLDER_PATH\" value=\"$MODULE_DIR$/build\" />\n        <option name=\"BUILDABLE\" value=\"false\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"true\">\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.gradle\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n  </component>\n</module>"
  },
  {
    "path": "README.md",
    "content": "EdenYouTube\n-------\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-EdenYouTube-green.svg?style=flat)](https://android-arsenal.com/details/1/2040)\n\nThe purpose of this repo is to demonstrate the functionality of the [YouTube Library](https://developers.google.com/youtube/android/player/)\nfor Android which acts as an API for the main YouTube application. You can use it as reference for implementing playback functionality within your own application.\n\nThe app covers everything from popup players:\n<br>![YouTubeStandalonePlayer](https://github.com/Glurt/EdenYouTube/blob/master/screenshots/gif1.gif)\n\nTo embedded players:\n<br>![YouTubePlayerView](https://github.com/Glurt/EdenYouTube/blob/master/screenshots/gif2.gif)\n\nHow to Get\n-------\nYou can either clone this repo or download the app from the Play Store:\n<br>https://play.google.com/store/apps/details?id=com.eden.youtubesample\n\n# Documentation\nI've written extensively about this application, it's source code and the YouTube API in a blog post that you can find here:\n<br>http://createdineden.com/blog/2015/may/12/android-tutorial-how-to-integrate-youtube-videos-into-your-app/\n\nLicense\n-------\n    The MIT License (MIT)\n\n    Copyright (c) 2015 Scott Cooper\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in\n    all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n    THE SOFTWARE.\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/src/release\n/build\n"
  },
  {
    "path": "app/app.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module external.linked.project.id=\":app\" external.linked.project.path=\"$MODULE_DIR$\" external.root.project.path=\"$MODULE_DIR$/..\" external.system.id=\"GRADLE\" external.system.module.group=\"EdenYouTube\" external.system.module.version=\"unspecified\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"FacetManager\">\n    <facet type=\"android-gradle\" name=\"Android-Gradle\">\n      <configuration>\n        <option name=\"GRADLE_PROJECT_PATH\" value=\":app\" />\n      </configuration>\n    </facet>\n    <facet type=\"android\" name=\"Android\">\n      <configuration>\n        <option name=\"SELECTED_BUILD_VARIANT\" value=\"debug\" />\n        <option name=\"SELECTED_TEST_ARTIFACT\" value=\"_android_test_\" />\n        <option name=\"ASSEMBLE_TASK_NAME\" value=\"assembleDebug\" />\n        <option name=\"COMPILE_JAVA_TASK_NAME\" value=\"compileDebugSources\" />\n        <option name=\"ASSEMBLE_TEST_TASK_NAME\" value=\"assembleDebugAndroidTest\" />\n        <option name=\"COMPILE_JAVA_TEST_TASK_NAME\" value=\"compileDebugAndroidTestSources\" />\n        <afterSyncTasks>\n          <task>generateDebugAndroidTestSources</task>\n          <task>generateDebugSources</task>\n        </afterSyncTasks>\n        <option name=\"ALLOW_USER_CONFIGURATION\" value=\"false\" />\n        <option name=\"MANIFEST_FILE_RELATIVE_PATH\" value=\"/src/main/AndroidManifest.xml\" />\n        <option name=\"RES_FOLDER_RELATIVE_PATH\" value=\"/src/main/res\" />\n        <option name=\"RES_FOLDERS_RELATIVE_PATH\" value=\"file://$MODULE_DIR$/src/main/res\" />\n        <option name=\"ASSETS_FOLDER_RELATIVE_PATH\" value=\"/src/main/assets\" />\n      </configuration>\n    </facet>\n  </component>\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_7\" inherit-compiler-output=\"false\">\n    <output url=\"file://$MODULE_DIR$/build/intermediates/classes/debug\" />\n    <output-test url=\"file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug\" />\n    <exclude-output />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/debug\" isTestSource=\"false\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/debug\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/r/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug\" isTestSource=\"true\" generated=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/debug/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/res\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/assets\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/aidl\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/jni\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/rs\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/res\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/resources\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/assets\" type=\"java-test-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/aidl\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/java\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/jni\" isTestSource=\"true\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/androidTest/rs\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/assets\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/blame\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/classes\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/debug\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dependency-cache\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/dex\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/incremental\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/jniLibs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/manifests\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/pre-dexed\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/release\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/res\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/resources\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/rs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/symbols\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/tmp\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/intermediates/transforms\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/outputs\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/build/tmp\" />\n    </content>\n    <orderEntry type=\"jdk\" jdkName=\"Android API 23 Platform\" jdkType=\"Android SDK\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-v4-23.1.1\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"YouTubeAndroidPlayerApi\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"support-annotations-23.1.1\" level=\"project\" />\n    <orderEntry type=\"library\" exported=\"\" name=\"appcompat-v7-23.1.1\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "app/build.gradle",
    "content": "buildscript {\n    repositories {\n    }\n\n    dependencies {\n    }\n}\napply plugin: 'com.android.application'\n\nrepositories {\n}\n\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"22.0.1\"\n\n    defaultConfig {\n        applicationId \"com.eden.youtubesample\"\n        minSdkVersion 8\n        targetSdkVersion 23\n        versionCode 5\n        versionName \"1.4\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:23.1.1'\n    compile 'com.android.support:support-v4:23.1.1'\n}\n"
  },
  {
    "path": "app/fabric.properties",
    "content": "#Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.\n#Fri May 01 08:56:57 BST 2015\napiSecret=8faf428a3f12ede6299512a4625ed5cea639c2100a5196e0cfbea5ede22919f3\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/Scott/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/androidTest/java/com/eden/youtubesample/ApplicationTest.java",
    "content": "package com.eden.youtubesample;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/**\n * <a href=\"http://d.android.com/tools/testing/testing_android.html\">Testing Fundamentals</a>\n */\npublic class ApplicationTest extends ApplicationTestCase<Application> {\n    public ApplicationTest() {\n        super(Application.class);\n    }\n}"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.eden.youtubesample\">\n\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n\n    <application\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\">\n        <activity\n            android:name=\".MainActivity\"\n            android:label=\"@string/app_name\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity android:name=\".YouTubeFragmentActivity\" />\n        <activity\n            android:name=\".YouTubeActivity\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:screenOrientation=\"portrait\" />\n        <activity\n            android:name=\".CustomLightboxActivity\"\n            android:configChanges=\"orientation|keyboardHidden|screenSize\"\n            android:theme=\"@style/AppTheme.Translucent\" />\n        <activity android:name=\".CustomYouTubeControlsActivity\" />\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/CustomLightboxActivity.java",
    "content": "package com.eden.youtubesample;\n\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.RelativeLayout;\nimport android.widget.Toast;\n\nimport com.google.android.youtube.player.YouTubeBaseActivity;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\nimport com.google.android.youtube.player.YouTubePlayer;\nimport com.google.android.youtube.player.YouTubePlayerView;\n\n/***********************************************************************************\n * The MIT License (MIT)\n * <p/>\n * Copyright (c) 2015 Scott Cooper\n * <p/>\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * <p/>\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * <p/>\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\n/**\n * This Activity shows how the YouTubePlayerView can be used to create a \"Lightbox\" similar to that of the\n * StandaloneYouTubePlayer. Using this method, we can improve upon it by performing transitions and allowing for\n * custom behaviour, such as closing when the user clicks anywhere outside the player\n * We manage to avoid rebuffering the video by setting some configchange flags on this activities declaration in the manifest.\n */\npublic class CustomLightboxActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {\n\n    //Keys\n    public static final String KEY_VIDEO_ID = \"KEY_VIDEO_ID\";\n    private static final String KEY_VIDEO_TIME = \"KEY_VIDEO_TIME\";\n\n    private YouTubePlayer mPlayer;\n    private boolean isFullscreen;\n\n    private int millis;\n    private String mVideoId;\n\n    @Override\n    protected void onCreate(Bundle bundle) {\n        super.onCreate(bundle);\n        setContentView(R.layout.activity_youtube_lightbox);\n\n        final RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.relativeLayout_youtube_activity);\n        relativeLayout.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                onBackPressed();\n            }\n        });\n\n        final YouTubePlayerView playerView = (YouTubePlayerView) findViewById(R.id.youTubePlayerView);\n        playerView.initialize(getString(R.string.DEVELOPER_KEY), this);\n\n        if (bundle != null) {\n            millis = bundle.getInt(KEY_VIDEO_TIME);\n        }\n\n        final Bundle extras = getIntent().getExtras();\n        if (extras != null && extras.containsKey(KEY_VIDEO_ID)) {\n            mVideoId = extras.getString(KEY_VIDEO_ID);\n        } else {\n            finish();\n        }\n    }\n\n    @Override\n    public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean wasRestored) {\n        mPlayer = youTubePlayer;\n        youTubePlayer.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);\n        youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);\n        youTubePlayer.setOnFullscreenListener(new YouTubePlayer.OnFullscreenListener() {\n            @Override\n            public void onFullscreen(boolean b) {\n                isFullscreen = b;\n            }\n        });\n\n        if (mVideoId != null && !wasRestored) {\n            youTubePlayer.loadVideo(mVideoId);\n        }\n\n        if (wasRestored) {\n            youTubePlayer.seekToMillis(millis);\n        }\n    }\n\n    @Override\n    public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {\n        Toast.makeText(this, \"Unable to load video\", Toast.LENGTH_LONG).show();\n    }\n\n    @Override\n    protected void onSaveInstanceState(Bundle outState) {\n        super.onSaveInstanceState(outState);\n\n        if (mPlayer != null) {\n            outState.putInt(KEY_VIDEO_TIME, mPlayer.getCurrentTimeMillis());\n        }\n    }\n\n    @Override\n    public void onBackPressed() {\n        //If the Player is fullscreen then the transition crashes on L when navigating back to the MainActivity\n        boolean finish = true;\n        try {\n            if (mPlayer != null) {\n                if (isFullscreen) {\n                    finish = false;\n                    mPlayer.setOnFullscreenListener(new YouTubePlayer.OnFullscreenListener() {\n                        @Override\n                        public void onFullscreen(boolean b) {\n                            //Wait until we are out of fullscreen before finishing this activity\n                            if (!b) {\n                                finish();\n                            }\n                        }\n                    });\n                    mPlayer.setFullscreen(false);\n                }\n                mPlayer.pause();\n            }\n        } catch (final IllegalStateException e) {\n            e.printStackTrace();\n        }\n\n        if (finish) {\n            super.onBackPressed();\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/CustomYouTubeControlsActivity.java",
    "content": "package com.eden.youtubesample;\n\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.CompoundButton;\nimport android.widget.RadioButton;\nimport android.widget.RadioGroup;\nimport android.widget.Toast;\n\nimport com.google.android.youtube.player.YouTubeBaseActivity;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\nimport com.google.android.youtube.player.YouTubePlayer;\nimport com.google.android.youtube.player.YouTubePlayerView;\n\n/***********************************************************************************\n * The MIT License (MIT)\n * <p/>\n * Copyright (c) 2015 Scott Cooper\n * <p/>\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * <p/>\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * <p/>\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\npublic class CustomYouTubeControlsActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener, View.OnClickListener, CompoundButton.OnCheckedChangeListener {\n\n    private static final int RECOVERY_DIALOG_REQUEST = 1;\n\n    public static final String KEY_VIDEO_ID = \"KEY_VIDEO_ID\";\n\n    private YouTubePlayer mPlayer;\n    private String mVideoId;\n    private Button playButton;\n    private Button pauseButton;\n    private RadioGroup styleRadioGroup;\n\n    @Override\n    protected void onCreate(Bundle bundle) {\n        super.onCreate(bundle);\n\n        setContentView(R.layout.activity_youtube_controls);\n\n        final Bundle arguments = getIntent().getExtras();\n        if (arguments != null && arguments.containsKey(KEY_VIDEO_ID)) {\n            mVideoId = arguments.getString(KEY_VIDEO_ID);\n        }\n\n        final YouTubePlayerView playerView = (YouTubePlayerView) findViewById(R.id.youTubePlayerView);\n        playerView.initialize(getString(R.string.DEVELOPER_KEY), this);\n\n        playButton = (Button) findViewById(R.id.play_button);\n        playButton.setOnClickListener(this);\n        pauseButton = (Button) findViewById(R.id.pause_button);\n        pauseButton.setOnClickListener(this);\n\n        styleRadioGroup = (RadioGroup) findViewById(R.id.style_radio_group);\n        ((RadioButton) findViewById(R.id.style_default)).setOnCheckedChangeListener(this);\n        ((RadioButton) findViewById(R.id.style_minimal)).setOnCheckedChangeListener(this);\n        ((RadioButton) findViewById(R.id.style_chromeless)).setOnCheckedChangeListener(this);\n\n        setControlsEnabled(false);\n    }\n\n    @Override\n    public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean restored) {\n        mPlayer = youTubePlayer;\n\n        if (mVideoId != null) {\n            if (restored) {\n                mPlayer.play();\n            } else {\n                mPlayer.loadVideo(mVideoId);\n            }\n        }\n        setControlsEnabled(true);\n    }\n\n    @Override\n    public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {\n        if (youTubeInitializationResult.isUserRecoverableError()) {\n            youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();\n        } else {\n            //Handle the failure\n            Toast.makeText(this, R.string.error_init_failure, Toast.LENGTH_LONG).show();\n        }\n    }\n\n    @Override\n    public void onClick(View v) {\n        //Null check the player\n        if (mPlayer != null) {\n            if (v == playButton) {\n                mPlayer.play();\n            } else if (v == pauseButton) {\n                mPlayer.pause();\n            }\n        }\n    }\n\n    @Override\n    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n        if (isChecked && mPlayer != null) {\n            switch (buttonView.getId()) {\n                case R.id.style_default:\n                    mPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);\n                    break;\n                case R.id.style_minimal:\n                    mPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.MINIMAL);\n                    break;\n                case R.id.style_chromeless:\n                    mPlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.CHROMELESS);\n                    break;\n            }\n        }\n    }\n\n    private void setControlsEnabled(boolean enabled) {\n        playButton.setEnabled(enabled);\n        pauseButton.setEnabled(enabled);\n        for (int i = 0; i < styleRadioGroup.getChildCount(); i++) {\n            styleRadioGroup.getChildAt(i).setEnabled(enabled);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/MainActivity.java",
    "content": "package com.eden.youtubesample;\n\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.widget.Toolbar;\n\nimport com.google.android.youtube.player.YouTubeApiServiceUtil;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\n\n/***********************************************************************************\n * The MIT License (MIT)\n * <p/>\n * Copyright (c) 2015 Scott Cooper\n * <p/>\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * <p/>\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * <p/>\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\npublic class MainActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        //Only add the toolbar if we are on Honeycomb and above\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n            final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n            setSupportActionBar(toolbar);\n        }\n\n\n        //Check for any issues\n        final YouTubeInitializationResult result = YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(this);\n\n        if (result != YouTubeInitializationResult.SUCCESS) {\n            //If there are any issues we can show an error dialog.\n            result.getErrorDialog(this, 0).show();\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/VideoListAdapter.java",
    "content": "package com.eden.youtubesample;\n\nimport android.content.Context;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.BaseAdapter;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.eden.youtubesample.content.YouTubeContent;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\nimport com.google.android.youtube.player.YouTubeThumbnailLoader;\nimport com.google.android.youtube.player.YouTubeThumbnailView;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/***********************************************************************************\n * The MIT License (MIT)\n * <p/>\n * Copyright (c) 2015 Scott Cooper\n * <p/>\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * <p/>\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * <p/>\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\npublic class VideoListAdapter extends BaseAdapter implements YouTubeThumbnailView.OnInitializedListener {\n\n    private Context mContext;\n    private Map<View, YouTubeThumbnailLoader> mLoaders;\n\n    public VideoListAdapter(final Context context) {\n        mContext = context;\n        mLoaders = new HashMap<>();\n    }\n\n    @Override\n    public int getCount() {\n        return YouTubeContent.ITEMS.size();\n    }\n\n    @Override\n    public Object getItem(int position) {\n        return YouTubeContent.ITEMS.get(position);\n    }\n\n    @Override\n    public long getItemId(int position) {\n        return position;\n    }\n\n    @Override\n    public View getView(int position, View convertView, ViewGroup parent) {\n\n        VideoHolder holder;\n\n        //The item at the current position\n        final YouTubeContent.YouTubeVideo item = YouTubeContent.ITEMS.get(position);\n\n        if (convertView == null) {\n            //Create the row\n            final LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n            convertView = inflater.inflate(R.layout.row_layout, parent, false);\n\n            //Create the video holder\n            holder = new VideoHolder();\n\n            //Set the title\n            holder.title = (TextView) convertView.findViewById(R.id.textView_title);\n            holder.title.setText(item.title);\n\n            //Initialise the thumbnail\n            holder.thumb = (YouTubeThumbnailView) convertView.findViewById(R.id.imageView_thumbnail);\n            holder.thumb.setTag(item.id);\n            holder.thumb.initialize(mContext.getString(R.string.DEVELOPER_KEY), this);\n\n            convertView.setTag(holder);\n        } else {\n            //Create it again\n            holder = (VideoHolder) convertView.getTag();\n            final YouTubeThumbnailLoader loader = mLoaders.get(holder.thumb);\n\n            if (item != null) {\n                //Set the title\n                holder.title.setText(item.title);\n\n                //Setting the video id can take a while to actually change the image\n                //in the meantime the old image is shown.\n                //Removing the image will cause the background color to show instead, not ideal\n                //but preferable to flickering images.\n                holder.thumb.setImageBitmap(null);\n\n                if (loader == null) {\n                    //Loader is currently initialising\n                    holder.thumb.setTag(item.id);\n                } else {\n                    //The loader is already initialised\n                    //Note that it's possible to get a DeadObjectException here\n                    try {\n                        loader.setVideo(item.id);\n                    } catch (IllegalStateException exception) {\n                        //If the Loader has been released then remove it from the map and re-init\n                        mLoaders.remove(holder.thumb);\n                        holder.thumb.initialize(mContext.getString(R.string.DEVELOPER_KEY), this);\n\n                    }\n                }\n\n            }\n        }\n        return convertView;\n    }\n\n\n    @Override\n    public void onInitializationSuccess(YouTubeThumbnailView view, YouTubeThumbnailLoader loader) {\n        mLoaders.put(view, loader);\n        loader.setVideo((String) view.getTag());\n    }\n\n    @Override\n    public void onInitializationFailure(YouTubeThumbnailView thumbnailView, YouTubeInitializationResult errorReason) {\n        final String errorMessage = errorReason.toString();\n        Toast.makeText(mContext, errorMessage, Toast.LENGTH_LONG).show();\n    }\n\n\n    static class VideoHolder {\n        YouTubeThumbnailView thumb;\n        TextView title;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/VideoListFragment.java",
    "content": "package com.eden.youtubesample;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.ListFragment;\nimport android.view.View;\nimport android.widget.ListView;\n\nimport com.eden.youtubesample.content.YouTubeContent;\nimport com.eden.youtubesample.fragment.YouTubeFragment;\nimport com.google.android.youtube.player.YouTubeIntents;\nimport com.google.android.youtube.player.YouTubeStandalonePlayer;\n\n/***********************************************************************************\n * The MIT License (MIT)\n\n * Copyright (c) 2015 Scott Cooper\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\npublic class VideoListFragment extends ListFragment {\n\n    /**\n     * Empty constructor\n     */\n    public VideoListFragment() {\n    }\n\n    @Override\n    public void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setListAdapter(new VideoListAdapter(getActivity()));\n    }\n\n    @Override\n    public void onViewCreated(View view, Bundle savedInstanceState) {\n        super.onViewCreated(view, savedInstanceState);\n    }\n\n    @Override\n    public void onListItemClick(ListView l, View v, int position, long id) {\n\n        final Context context = getActivity();\n        final String DEVELOPER_KEY = getString(R.string.DEVELOPER_KEY);\n        final YouTubeContent.YouTubeVideo video = YouTubeContent.ITEMS.get(position);\n\n        switch (position) {\n            case 0:\n                //Check whether we can actually open YT\n                if (YouTubeIntents.canResolvePlayVideoIntent(context)) {\n                    //Opens the video in the YouTube app\n                    startActivity(YouTubeIntents.createPlayVideoIntent(context, video.id));\n                }\n                break;\n            case 1:\n                if (YouTubeIntents.canResolvePlayVideoIntentWithOptions(context)) {\n                    //Opens in the YouTube app in fullscreen and returns to this app once the video finishes\n                    startActivity(YouTubeIntents.createPlayVideoIntentWithOptions(context, video.id, true, true));\n                }\n                break;\n            case 2:\n                //Issue #3 - Need to resolve StandalonePlayer as well\n                if (YouTubeIntents.canResolvePlayVideoIntent(context)) {\n                    //Opens in the StandAlonePlayer, defaults to fullscreen\n                    startActivity(YouTubeStandalonePlayer.createVideoIntent(getActivity(),\n                            DEVELOPER_KEY, video.id));\n                }\n                break;\n            case 3:\n                //Issue #3 - Need to resolve StandalonePlayer as well\n                if (YouTubeIntents.canResolvePlayVideoIntentWithOptions(context)) {\n                    //Opens in the StandAlonePlayer but in \"Light box\" mode\n                    startActivity(YouTubeStandalonePlayer.createVideoIntent(getActivity(),\n                            DEVELOPER_KEY, video.id, 0, true, true));\n                }\n                break;\n            case 4:\n                //Opens in the YouTubeSupportFragment\n                final YouTubeFragment fragment = YouTubeFragment.newInstance(video.id);\n                getFragmentManager().beginTransaction().replace(android.R.id.content, fragment).commit();\n                break;\n            case 5:\n                //Opens in Custom Activity\n                final Intent fragIntent = new Intent(context, YouTubeFragmentActivity.class);\n                fragIntent.putExtra(YouTubeFragmentActivity.KEY_VIDEO_ID, video.id);\n                startActivity(fragIntent);\n                break;\n            case 6:\n                //Opens in the YouTubePlayerView\n                final Intent actIntent = new Intent(context, YouTubeActivity.class);\n                actIntent.putExtra(YouTubeActivity.KEY_VIDEO_ID, video.id);\n                startActivity(actIntent);\n                break;\n            case 7:\n                //Opens in the the custom Lightbox activity\n                final Intent lightboxIntent = new Intent(context, CustomLightboxActivity.class);\n                lightboxIntent.putExtra(CustomLightboxActivity.KEY_VIDEO_ID, video.id);\n                startActivity(lightboxIntent);\n                break;\n            case 8:\n                //Custom player controls\n                final Intent controlsIntent = new Intent(context, CustomYouTubeControlsActivity.class);\n                controlsIntent.putExtra(CustomLightboxActivity.KEY_VIDEO_ID, video.id);\n                startActivity(controlsIntent);\n                break;\n\n\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/YouTubeActivity.java",
    "content": "package com.eden.youtubesample;\n\nimport android.os.Bundle;\nimport android.widget.Toast;\n\nimport com.google.android.youtube.player.YouTubeBaseActivity;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\nimport com.google.android.youtube.player.YouTubePlayer;\nimport com.google.android.youtube.player.YouTubePlayerView;\n\n/***********************************************************************************\n * The MIT License (MIT)\n\n * Copyright (c) 2015 Scott Cooper\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\n\npublic class YouTubeActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener {\n\n    private static final int RECOVERY_DIALOG_REQUEST = 1;\n\n    public static final String KEY_VIDEO_ID = \"KEY_VIDEO_ID\";\n\n    private String mVideoId;\n\n    @Override\n    protected void onCreate(Bundle bundle) {\n        super.onCreate(bundle);\n\n        setContentView(R.layout.activity_youtube);\n\n        final Bundle arguments = getIntent().getExtras();\n        if (arguments != null && arguments.containsKey(KEY_VIDEO_ID)) {\n            mVideoId = arguments.getString(KEY_VIDEO_ID);\n        }\n\n        final YouTubePlayerView playerView = (YouTubePlayerView) findViewById(R.id.youTubePlayerView);\n        playerView.initialize(getString(R.string.DEVELOPER_KEY), this);\n    }\n\n    @Override\n    public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean restored) {\n\n        //Here we can set some flags on the player\n\n        //This flag tells the player to switch to landscape when in fullscreen, it will also return to portrait\n        //when leaving fullscreen\n        youTubePlayer.setFullscreenControlFlags(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_ORIENTATION);\n\n        //This flag tells the player to automatically enter fullscreen when in landscape. Since we don't have\n        //landscape layout for this activity, this is a good way to allow the user rotate the video player.\n        youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_ALWAYS_FULLSCREEN_IN_LANDSCAPE);\n\n        //This flag controls the system UI such as the status and navigation bar, hiding and showing them\n        //alongside the player UI\n        youTubePlayer.addFullscreenControlFlag(YouTubePlayer.FULLSCREEN_FLAG_CONTROL_SYSTEM_UI);\n\n        if (mVideoId != null) {\n            if (restored) {\n                youTubePlayer.play();\n            } else {\n                youTubePlayer.loadVideo(mVideoId);\n            }\n        }\n    }\n\n    @Override\n    public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {\n        if (youTubeInitializationResult.isUserRecoverableError()) {\n            youTubeInitializationResult.getErrorDialog(this, RECOVERY_DIALOG_REQUEST).show();\n        } else {\n            //Handle the failure\n            Toast.makeText(this, R.string.error_init_failure, Toast.LENGTH_LONG).show();\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/YouTubeFragmentActivity.java",
    "content": "package com.eden.youtubesample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.ActionBarActivity;\n\nimport com.eden.youtubesample.fragment.YouTubeFragment;\n\n/***********************************************************************************\n * The MIT License (MIT)\n\n * Copyright (c) 2015 Scott Cooper\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\n/**\n * A sample Activity hosting a YouTubeFragment. You could place the Fragment anywhere in the layout.\n */\npublic class YouTubeFragmentActivity extends ActionBarActivity {\n\n    public static final String KEY_VIDEO_ID = \"KEY_VIDEO_ID\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n\n        setContentView(R.layout.activity_youtube_fragment);\n\n        final Bundle bundle = getIntent().getExtras();\n\n        if (bundle != null && bundle.containsKey(KEY_VIDEO_ID)) {\n            final String videoId = bundle.getString(KEY_VIDEO_ID);\n            final YouTubeFragment fragment = (YouTubeFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_youtube);\n            fragment.setVideoId(videoId);\n        }\n\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/content/YouTubeContent.java",
    "content": "package com.eden.youtubesample.content;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\n/***********************************************************************************\n * The MIT License (MIT)\n\n * Copyright (c) 2015 Scott Cooper\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\n\n/**\n * A Helper class for providing mock data to the app.\n * In a real world scenario you would either hard code the video ID's in the strings file or\n * retrieve them from a web service.\n */\npublic class YouTubeContent {\n\n    /**\n     * An array of YouTube videos\n     */\n    public static List<YouTubeVideo> ITEMS = new ArrayList<>();\n\n    /**\n     * A map of YouTube videos, by ID.\n     */\n    public static Map<String, YouTubeVideo> ITEM_MAP = new HashMap<>();\n\n    static {\n        addItem(new YouTubeVideo(\"tttG6SdnCd4\", \"Open in the YouTube App\"));\n        addItem(new YouTubeVideo(\"x-hH_Txxzls\", \"Open in the YouTube App in fullscreen\"));\n        addItem(new YouTubeVideo(\"TTh_qYMzSZk\", \"Open in the Standalone player in fullscreen\"));\n        addItem(new YouTubeVideo(\"tttG6SdnCd4\", \"Open in the Standalone player in \\\"Light Box\\\" mode\"));\n        addItem(new YouTubeVideo(\"x-hH_Txxzls\", \"Open in the YouTubeFragment\"));\n        addItem(new YouTubeVideo(\"TTh_qYMzSZk\", \"Hosting the YouTubeFragment in an Activity\"));\n        addItem(new YouTubeVideo(\"tttG6SdnCd4\", \"Open in the YouTubePlayerView\"));\n        addItem(new YouTubeVideo(\"x-hH_Txxzls\", \"Custom \\\"Light Box\\\" player with fullscreen handling\"));\n        addItem(new YouTubeVideo(\"TTh_qYMzSZk\", \"Custom player controls\"));\n    }\n\n    private static void addItem(final YouTubeVideo item) {\n        ITEMS.add(item);\n        ITEM_MAP.put(item.id, item);\n    }\n\n    /**\n     * A POJO representing a YouTube video\n     */\n    public static class YouTubeVideo {\n        public String id;\n        public String title;\n\n        public YouTubeVideo(String id, String content) {\n            this.id = id;\n            this.title = content;\n        }\n\n        @Override\n        public String toString() {\n            return title;\n        }\n    }\n}"
  },
  {
    "path": "app/src/main/java/com/eden/youtubesample/fragment/YouTubeFragment.java",
    "content": "package com.eden.youtubesample.fragment;\n\nimport android.os.Bundle;\nimport android.widget.Toast;\n\nimport com.eden.youtubesample.R;\nimport com.google.android.youtube.player.YouTubeInitializationResult;\nimport com.google.android.youtube.player.YouTubePlayer;\nimport com.google.android.youtube.player.YouTubePlayerSupportFragment;\n\n/***********************************************************************************\n * The MIT License (MIT)\n\n * Copyright (c) 2015 Scott Cooper\n\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n ***********************************************************************************/\n\n/**\n * A sample implementation of a fragment extending YouTubePlayerFragment.\n * This will take care of most of the work necessary to load and play a video\n */\npublic class YouTubeFragment extends YouTubePlayerSupportFragment implements YouTubePlayer.OnInitializedListener {\n\n    private static final int RECOVERY_DIALOG_REQUEST = 1;\n\n    private static final String KEY_VIDEO_ID = \"KEY_VIDEO_ID\";\n\n    private String mVideoId;\n\n    //Empty constructor\n    public YouTubeFragment() {\n    }\n\n    /**\n     * Returns a new instance of this Fragment\n     *\n     * @param videoId The ID of the video to play\n     */\n    public static YouTubeFragment newInstance(final String videoId) {\n        final YouTubeFragment youTubeFragment = new YouTubeFragment();\n        final Bundle bundle = new Bundle();\n        bundle.putString(KEY_VIDEO_ID, videoId);\n        youTubeFragment.setArguments(bundle);\n        return youTubeFragment;\n    }\n\n    @Override\n    public void onCreate(Bundle bundle) {\n        super.onCreate(bundle);\n\n        final Bundle arguments = getArguments();\n\n        if (bundle != null && bundle.containsKey(KEY_VIDEO_ID)) {\n            mVideoId = bundle.getString(KEY_VIDEO_ID);\n        } else if (arguments != null && arguments.containsKey(KEY_VIDEO_ID)) {\n            mVideoId = arguments.getString(KEY_VIDEO_ID);\n        }\n\n        initialize(getString(R.string.DEVELOPER_KEY), this);\n    }\n\n    /**\n     * Set the video id and initialize the player\n     * This can be used when including the Fragment in an XML layout\n     * @param videoId The ID of the video to play\n     */\n    public void setVideoId(final String videoId) {\n        mVideoId = videoId;\n        initialize(getString(R.string.DEVELOPER_KEY), this);\n    }\n\n    @Override\n    public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean restored) {\n\n        if (mVideoId != null) {\n            if (restored) {\n                youTubePlayer.play();\n            } else {\n                youTubePlayer.loadVideo(mVideoId);\n            }\n        }\n    }\n\n    @Override\n    public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {\n        if (youTubeInitializationResult.isUserRecoverableError()) {\n            youTubeInitializationResult.getErrorDialog(getActivity(), RECOVERY_DIALOG_REQUEST).show();\n        } else {\n            //Handle the failure\n            Toast.makeText(getActivity(), R.string.error_init_failure, Toast.LENGTH_LONG).show();\n        }\n    }\n\n    @Override\n    public void onSaveInstanceState(Bundle bundle) {\n        super.onSaveInstanceState(bundle);\n        bundle.putString(KEY_VIDEO_ID, mVideoId);\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <fragment xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:id=\"@+id/video_list\"\n        android:name=\"com.eden.youtubesample.VideoListFragment\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_marginLeft=\"16dp\"\n        android:layout_marginRight=\"16dp\"\n        tools:context=\".VideoListActivity\"\n        tools:layout=\"@android:layout/list_content\" />\n\n\n</LinearLayout>\n\n"
  },
  {
    "path": "app/src/main/res/layout/activity_youtube.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    tools:context=\"com.eden.youtubesample.YouTubeActivity\">\n\n    <com.google.android.youtube.player.YouTubePlayerView\n        android:id=\"@+id/youTubePlayerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n\n    <!-- You could put anything here -->\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center\"\n        android:padding=\"8dp\"\n        android:text=\"@string/youtube_activity_placeholder\"\n        android:textSize=\"18sp\" />\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_youtube_controls.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    tools:context=\"com.eden.youtubesample.YouTubeActivity\">\n\n    <com.google.android.youtube.player.YouTubePlayerView\n        android:id=\"@+id/youTubePlayerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:orientation=\"vertical\">\n\n        <RadioGroup\n            android:id=\"@+id/style_radio_group\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"horizontal\">\n\n            <TextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/player_style\"\n                android:textAppearance=\"@android:style/TextAppearance.Medium\" />\n\n            <RadioButton\n                android:id=\"@+id/style_default\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:checked=\"true\"\n                android:text=\"@string/def\" />\n\n            <RadioButton\n                android:id=\"@+id/style_minimal\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/minimal\" />\n\n            <RadioButton\n                android:id=\"@+id/style_chromeless\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/chromeless\" />\n\n        </RadioGroup>\n\n        <LinearLayout\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:gravity=\"center\"\n            android:orientation=\"horizontal\">\n\n            <Button\n                android:id=\"@+id/play_button\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:text=\"@string/play\" />\n\n            <Button\n                android:id=\"@+id/pause_button\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:text=\"@string/pause\" />\n\n\n        </LinearLayout>\n\n    </LinearLayout>\n\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_youtube_fragment.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <!-- YouTube Fragment -->\n    <fragment\n        android:id=\"@+id/fragment_youtube\"\n        android:name=\"com.eden.youtubesample.fragment.YouTubeFragment\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignParentTop=\"true\" />\n\n    <!-- You could put anything here -->\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\"\n        android:gravity=\"center\"\n        android:padding=\"8dp\"\n        android:text=\"@string/youtube_activity_fragment_placeholder\"\n        android:textSize=\"18sp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/activity_youtube_lightbox.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:id=\"@+id/relativeLayout_youtube_activity\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"@color/transparent_black\">\n\n    <com.google.android.youtube.player.YouTubePlayerView\n        android:id=\"@+id/youTubePlayerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_centerInParent=\"true\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/row_layout.xml",
    "content": "<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\">\n\n    <!-- Video Thumbnail -->\n    <com.google.android.youtube.player.YouTubeThumbnailView\n        android:id=\"@+id/imageView_thumbnail\"\n        android:layout_width=\"85dp\"\n        android:layout_height=\"85dp\"\n        android:layout_alignParentLeft=\"true\"\n        android:layout_margin=\"5dp\"\n        android:background=\"@color/app_primary_dark\"\n        android:scaleType=\"centerCrop\" />\n\n\n    <!-- Video Title -->\n    <TextView\n        android:id=\"@+id/textView_title\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_alignTop=\"@id/imageView_thumbnail\"\n        android:layout_toRightOf=\"@id/imageView_thumbnail\"\n        android:paddingBottom=\"5dp\"\n        android:paddingRight=\"5dp\"\n        android:text=\"@string/video_list_title\"\n        android:textColor=\"@android:color/black\"\n        android:textSize=\"15sp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/toolbar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.Toolbar xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/toolbar\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"?attr/actionBarSize\"\n    android:background=\"?attr/colorPrimary\"\n    android:layout_alignParentTop=\"true\"\n    app:popupTheme=\"@style/ThemeOverlay.AppCompat.Light\"\n    app:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\">\n\n</android.support.v7.widget.Toolbar>"
  },
  {
    "path": "app/src/main/res/layout-land/activity_youtube_controls.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"horizontal\">\n\n    <com.google.android.youtube.player.YouTubePlayerView\n        android:id=\"@+id/youTubePlayerView\"\n        android:layout_width=\"0dp\"\n        android:layout_height=\"wrap_content\"\n        android:layout_weight=\"1\" />\n\n    <LinearLayout\n        android:layout_width=\"0dp\"\n        android:layout_height=\"match_parent\"\n        android:layout_weight=\"1\"\n        android:orientation=\"vertical\">\n\n        <RadioGroup\n            android:id=\"@+id/style_radio_group\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:orientation=\"vertical\">\n\n            <TextView\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/player_style\"\n                android:textAppearance=\"@android:style/TextAppearance.Medium\" />\n\n            <RadioButton\n                android:id=\"@+id/style_default\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:checked=\"true\"\n                android:text=\"@string/def\" />\n\n            <RadioButton\n                android:id=\"@+id/style_minimal\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/minimal\" />\n\n            <RadioButton\n                android:id=\"@+id/style_chromeless\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:text=\"@string/chromeless\" />\n\n        </RadioGroup>\n\n        <LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center\"\n            android:gravity=\"center\"\n            android:orientation=\"horizontal\">\n\n            <Button\n                android:id=\"@+id/play_button\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:text=\"@string/play\" />\n\n            <Button\n                android:id=\"@+id/pause_button\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_margin=\"5dp\"\n                android:text=\"@string/pause\" />\n\n\n        </LinearLayout>\n\n    </LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout-v11/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <include layout=\"@layout/toolbar\"/>\n\n    <fragment xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        xmlns:tools=\"http://schemas.android.com/tools\"\n        android:id=\"@+id/video_list\"\n        android:name=\"com.eden.youtubesample.VideoListFragment\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:layout_marginLeft=\"16dp\"\n        android:layout_marginRight=\"16dp\"\n        tools:context=\".VideoListActivity\"\n        tools:layout=\"@android:layout/list_content\" />\n\n\n</LinearLayout>\n\n"
  },
  {
    "path": "app/src/main/res/values/apikeys.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <string name=\"DEVELOPER_KEY\">This is where you should put your API key, you can get one from https://developers.google.com/youtube/v3/getting-started</string>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <color name=\"app_primary\">#A94246</color>\n    <color name=\"app_primary_dark\">#872328</color>\n    <color name=\"app_primary_accent\">#F9B0B4</color>\n\n    <color name=\"transparent_black\">#E6000000</color>\n\n    <color name=\"black\">#000000</color>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Eden - YouTube Example</string>\n\n    <string name=\"video_list_title\">Title</string>\n    <string name=\"error_init_failure\">Initialization failure: Unable to play video</string>\n    <string name=\"youtube_activity_fragment_placeholder\">The YouTube Fragment can be placed anywhere\n        in a layout. You could use this space to describe the video, load some comments or anything else you can think of.\n    The benefit of using a Fragment is that your hosting Activity can be of any type.</string>\n    <string name=\"youtube_activity_placeholder\">If you don\\'t want to use a Fragment,\n        you can simply add a YouTubePlayerView to your layout file and handle it the same way.</string>\n    <string name=\"player_style\">Player Style</string>\n    <string name=\"def\">Default</string>\n    <string name=\"minimal\">Minimal</string>\n    <string name=\"chromeless\">Chromeless</string>\n    <string name=\"play\">PLAY</string>\n    <string name=\"pause\">PAUSE</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme.Base\" parent=\"Theme.AppCompat\">\n        <item name=\"colorPrimary\">@color/app_primary</item>\n        <item name=\"colorPrimaryDark\">@color/app_primary_dark</item>\n        <item name=\"colorAccent\">@color/app_primary_accent</item>\n    </style>\n\n    <style name=\"AppTheme\" parent=\"AppTheme.Base\"/>\n\n    <style name=\"AppTheme.Translucent\" parent=\"AppTheme.Base\">\n        <item name=\"colorPrimary\">@color/app_primary_dark</item>\n        <item name=\"colorPrimaryDark\">@color/black</item>\n        <item name=\"colorAccent\">@color/app_primary_accent</item>\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:colorBackgroundCacheHint\">@null</item>\n        <item name=\"android:windowIsTranslucent\">true</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/typefaces.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"typeface_museo_sans\">fonts/museosans_500.otf</string>\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v11/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <style name=\"AppTheme.Base\" parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/app_primary</item>\n        <item name=\"colorPrimaryDark\">@color/app_primary_dark</item>\n        <item name=\"colorAccent\">@color/app_primary_accent</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v16/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <style name=\"AppTheme\" parent=\"AppTheme.Base\">\n        <item name=\"android:textViewStyle\">@style/EdenTextView</item>\n    </style>\n\n    <style name=\"EdenTextView\" parent=\"android:Widget.TextView\">\n        <item name=\"android:fontFamily\">@string/typeface_museo_sans</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <style name=\"AppTheme\" parent=\"AppTheme.Base\">\n        <item name=\"android:windowContentTransitions\">true</item>\n        <item name=\"android:windowAllowEnterTransitionOverlap\">true</item>\n        <item name=\"android:windowAllowReturnTransitionOverlap\">true</item>\n        <item name=\"android:windowSharedElementEnterTransition\">@android:transition/move</item>\n        <item name=\"android:windowSharedElementExitTransition\">@android:transition/move</item>\n        <item name=\"android:textViewStyle\">@style/EdenTextView</item>\n        <item name=\"android:toolbarStyle\">@style/EdenToolBarView</item>\n    </style>\n\n    <style name=\"EdenToolBarView\" parent=\"android:Widget.Toolbar\">\n        <item name=\"android:fontFamily\">@string/typeface_museo_sans</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:1.5.0'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Apr 10 15:27:10 PDT 2013\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.2.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# For Cygwin, ensure paths are in UNIX format before anything is touched.\nif $cygwin ; then\n    [ -n \"$JAVA_HOME\" ] && JAVA_HOME=`cygpath --unix \"$JAVA_HOME\"`\nfi\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >&-\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >&-\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]