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 app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
27 changes: 27 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.fiona.personalcodingproject"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
}
17 changes: 17 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\Fiona\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.fiona.personalcodingproject;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
11 changes: 11 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package= "com.fiona.personalcodingproject" >

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:label="@string/app_name"
android:theme="@style/AppTheme" />

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package com.fiona.personalcodingproject;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.view.View.OnClickListener;

public class LaughingActivity extends Activity {
// reference to buttons
Button button;

@Override
// store or save information to the button
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// connect to laughing_fullscreen XML file
setContentView(R.layout.laughing_fullscreen);
addListenerOnButton1();
addListenerOnButton2();
addListenerOnButton3();
addListenerOnButton4();
addListenerOnButton5();
addListenerOnButton6();

}

public void addListenerOnButton1() {
final Context context = this;
// connect the button to the Rapunzel Image Button
button = (ImageButton)findViewById(R.id.RapunzelButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});

}
public void addListenerOnButton2() {
final Context context = this;
// connect the button to the LionKing Image Button
button = (ImageButton) findViewById(R.id.LionKingButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});
}

public void addListenerOnButton3() {
final Context context = this;
// connect the button to the Elsa Image Button
button = (ImageButton) findViewById(R.id.ElsaButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});
}

public void addListenerOnButton4() {
final Context context = this;
// connect the button to the Aladdin Image Button
button = (ImageButton) findViewById(R.id.AladdinButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});
}

public void addListenerOnButton5() {
final Context context = this;
// connect the button to the Mulan Image Button
button = (ImageButton) findViewById(R.id.MulanButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});
}

public void addListenerOnButton6() {
final Context context = this;
// connect the button to the Pocahontas Image Button
button = (ImageButton) findViewById(R.id.PocahontasButton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect main class to the LaughingActivity class (main class activated after LaughingActivity class)
public void onClick(View v) {
Intent intent = new Intent(context, main.class);
startActivity(intent);
}
});
}
}
42 changes: 42 additions & 0 deletions app/src/main/java/com/fiona/personalcodingproject/main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.fiona.personalcodingproject;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.widget.MediaController;
import android.support.v7.app.AppCompatActivity;
import android.widget.VideoView;


public class main extends Activity {
// references to button
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// connect to activity_play_video XML file
setContentView(R.layout.activity_play_video);
}
}
// Rapunzel video
public class main2 extends AppCompatActivity {
@Override
// content view is set
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.laughing_fullscreen);
// connect to videoView XML layout
VideoView videoView = (VideoView)findViewById(R.id.videoView);
MediaController mediaController=new MediaController(this);
mediaController.setAnchorView(videoView);
// stream video (Rapunzel Youtube Video)
Uri uri=Uri.parse("rtsp://r13---sn-vgqs7ner.googlevideo.com/Cj0LENy73wIaNAlIBfErgNgqRxMYDSANFC0Z82FXMOCoAUIASARgtdjU2NCE9btPigELRWxtS3N2ZHdDN00M/35338A718972CBCCF0C6F3E86A99F7CC7DB64B5C.50242B3E06D30B98C682E6F92F1A9C2018BB5A65/yt6/1/video.3gp");
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.requestFocus();
// start video
videoView.start();
}
}

36 changes: 36 additions & 0 deletions app/src/main/java/com/fiona/personalcodingproject/openpic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.fiona.personalcodingproject;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class OpenPic extends Activity {
// reference button
Button button;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// connect to starting XML file
setContentView(R.layout.starting);
addListenerOnButton();
}

public void addListenerOnButton() {
final Context context = this;
// connect to imagebutton id from the starting XML file
button = (Button)findViewById(R.id.imagebutton);
button.setOnClickListener(new View.OnClickListener() {
@Override
// connect openpic class to the pic class (pic class activated after openpic class)
public void onClick(View v) {
Intent intent = new Intent(context, pic.class);
startActivity(intent);
}
});
}
}
20 changes: 20 additions & 0 deletions app/src/main/java/com/fiona/personalcodingproject/pic.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.fiona.personalcodingproject;

import android.os.Bundle;
import android.widget.Button;


public class pic extends OpenPic {
// reference to button
Button button;

@Override
// save information to the activity of the selected button
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//connect to image XML file
setContentView(R.layout.image);
// when press back, will go back to previous screen
onBackPressed();
}
}
21 changes: 21 additions & 0 deletions app/src/main/res/layout/activity_play_video.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.fiona.personalcodingproject.main">


<VideoView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/videoView"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

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

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_gravity="center_horizontal"
android:background="@drawable/relaxingphoto"/>
</LinearLayout>
62 changes: 62 additions & 0 deletions app/src/main/res/layout/laughing_fullscreen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0099cc"
tools:context="com.fiona.personalcodingproject.LaughingActivity">

// Rapunzel Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/RapunzelButton"
android:layout_gravity="left|top"
android:background="@drawable/rapunzel"
android:onClick="RVideo"/>

// Lion King Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/LionKingButton"
android:layout_gravity="right|top"
android:background="@drawable/lionking"
android:onClick="LKVideo"/>

// Elsa Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/ElsaButton"
android:layout_gravity="left|center_vertical"
android:background="@drawable/elsa"
android:onClick="EVideo"/>

// Aladdin Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/AladdinButton"
android:layout_gravity="right|center_vertical"
android:background="@drawable/Aladdin"
android:onClick="EVideo"/>

// Mulan Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/MulanButton"
android:layout_gravity="left|bottom"
android:background="@drawable/mulan"
android:onClick="MVideo"/>

// Pocahontas Button
<ImageButton
android:layout_width="205dp"
android:layout_height="200dp"
android:id="@+id/PocahontasButton"
android:layout_gravity="right|bottom"
android:background="@drawable/pocahontas"
android:onClick="PVideo"/>

</FrameLayout>
Loading