Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AccessRobot/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ dependencies {
compile fileTree(dir: 'libs', include: 'Parse-*.jar')
compile(name: 'MaterialDesign-md_ready-release', ext:'aar')
compile 'com.ogaclejapan.smarttablayout:library:1.2.1@aar'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
Binary file added AccessRobot/app/libs/YouTubeAndroidPlayerApi.jar
Binary file not shown.
36 changes: 20 additions & 16 deletions AccessRobot/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ksmaragh.c4q.nyc.accessrobot">
package="ksmaragh.c4q.nyc.accessrobot" >

<supports-screens android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="600"
/>
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:requiresSmallestWidthDp="600"
android:smallScreens="false"
android:xlargeScreens="true" />

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand All @@ -22,10 +22,10 @@
android:icon="@mipmap/ic_launcher"
android:label="Mozi"
android:theme="@style/AppTheme"
tools:replace="android:label">
tools:replace="android:label" >
<activity
android:name=".DemoActivity"
android:label="@string/app_name"></activity>
android:label="@string/app_name" />
<activity
android:name=".BluetoothActivity"
android:label=""
Expand All @@ -46,14 +46,14 @@
<activity
android:name=".MoziActivity"
android:label=""
android:screenOrientation="portrait"></activity>
android:screenOrientation="portrait" />
<activity
android:name=".DeviceListActivity"
android:label="Device List" />
<activity
android:name=".LearnActivity"
android:label=""
android:screenOrientation="portrait">
android:screenOrientation="portrait" >
<intent-filter>
<action android:name=".LearnActivity" />

Expand All @@ -63,7 +63,7 @@
<activity
android:name=".MainActivity"
android:label=""
android:screenOrientation="portrait"></activity>
android:screenOrientation="portrait" />
<activity
android:name=".OnboardingActivity"
android:screenOrientation="portrait" />
Expand All @@ -78,14 +78,14 @@
<activity
android:name=".LoginActivity"
android:label=""
android:screenOrientation="portrait"></activity>
android:screenOrientation="portrait" />
<activity
android:name=".SignupActivity"
android:label=""
android:screenOrientation="portrait"></activity>
android:screenOrientation="portrait" />
<activity
android:name=".SplashActivity"
android:label="@string/app_name">
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -94,7 +94,11 @@
</activity>
<activity
android:name=".MyProgramsActivity"
android:label=""></activity>
android:label="" />
<activity
android:name=".VideoPlayerActivity"
android:label="@string/title_activity_video_player" >
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ksmaragh.c4q.nyc.accessrobot;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
Expand Down Expand Up @@ -109,9 +108,8 @@ private void startPartsActivity() {
}

private void playMoziAssemblyVideo() {
String videoId = "DXpl0H1tLcU";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:" + videoId));
intent.putExtra("force_fullscreen", true);
Intent intent = new Intent(this, VideoPlayerActivity.class);
//intent.putExtra("force_fullscreen", true);
startActivity(intent);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package ksmaragh.c4q.nyc.accessrobot;

import android.os.Bundle;
import android.widget.Toast;

import com.google.android.youtube.player.YouTubeBaseActivity;
import com.google.android.youtube.player.YouTubeInitializationResult;
import com.google.android.youtube.player.YouTubePlayer;
import com.google.android.youtube.player.YouTubePlayer.Provider;
import com.google.android.youtube.player.YouTubePlayerView;

public class VideoPlayerActivity extends YouTubeBaseActivity implements YouTubePlayer.OnInitializedListener{

public static final String API_KEY = "AIzaSyCe6tORd9Ch4lx-9Ku5SQ476uS9OtZYsWA";
public static final String VIDEO_ID = "DXpl0H1tLcU";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_player);

YouTubePlayerView youTubePlayerView = (YouTubePlayerView)findViewById(R.id.youtubeplayerview);
youTubePlayerView.initialize(API_KEY, this);
}

@Override
public void onInitializationFailure(Provider provider,
YouTubeInitializationResult result) {
Toast.makeText(getApplicationContext(),
"onInitializationFailure()",
Toast.LENGTH_LONG).show();
}

@Override
public void onInitializationSuccess(Provider provider, YouTubePlayer player,
boolean wasRestored) {
if (!wasRestored) {
player.cueVideo(VIDEO_ID);
}
}

}
38 changes: 38 additions & 0 deletions AccessRobot/app/src/main/res/layout/activity_video_player.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:orientation="vertical">


<LinearLayout
android:orientation="vertical"
android:background="#ffffff"
android:layout_width="fill_parent"
android:layout_marginBottom="24dp"
android:layout_height="wrap_content">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:gravity="center_horizontal|top"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:background="#ffffff"
android:src="@drawable/mozi_header_multi"/>

</LinearLayout>

<LinearLayout
android:orientation="vertical"
android:background="#ffffff"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.youtube.player.YouTubePlayerView
android:id="@+id/youtubeplayerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
7 changes: 7 additions & 0 deletions AccessRobot/app/src/main/res/menu/menu_video_player.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="ksmaragh.c4q.nyc.accessrobot.VideoPlayerActivity">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
1 change: 1 addition & 0 deletions AccessRobot/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@
<string name="interface_type_serial">Serial cable</string>

<string name="hello_world">Hello world!</string>
<string name="title_activity_video_player">VideoPlayerActivity</string>

</resources>