diff --git a/.idea/dictionaries/Lu_Ying.xml b/.idea/dictionaries/Lu_Ying.xml new file mode 100644 index 0000000..d4762e5 --- /dev/null +++ b/.idea/dictionaries/Lu_Ying.xml @@ -0,0 +1,8 @@ + + + + dnce + yiruma + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..51bdc2d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,42 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..3b31283 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md index 5f15d6d..cacbc1f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,13 @@ # ICS4U Personal Coding Project -## Objective -State the objective of the project +## PCP Learning Log +Complete a learning log entry whenever you work on acquiring skills for this project. This could be: -## Technical Requirements -### Knowledge -### Hardware -### Required Software +- exploring documentation online (wikis, other github pages, package libraries) +- reviewing technical books +- online interactive tutorials (i.e Codecademy) +- watching educational youtube videos +- reviewing documentation around development environment setup -## Install and Set Up -Outline the steps required to install and run your project - -## Usage -Outline anything the user needs to know to use your application +https://docs.google.com/a/ycdsbk12.ca/forms/d/135YiNzNhBMmPK3avR3NajFtbc7VtXma4-zLXcpYa7DI/viewform diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..a1d2bf3 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + applicationId "com.app.bonnie.bliss_countdown" + minSdkVersion 10 + 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' +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..c959123 --- /dev/null +++ b/app/proguard-rules.pro @@ -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\Lu Ying\.AndroidStudio2.1/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 *; +#} diff --git a/app/src/androidTest/java/com/app/bonnie/bliss_countdown/ApplicationTest.java b/app/src/androidTest/java/com/app/bonnie/bliss_countdown/ApplicationTest.java new file mode 100644 index 0000000..4db2d84 --- /dev/null +++ b/app/src/androidTest/java/com/app/bonnie/bliss_countdown/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.app.bonnie.bliss_countdown; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..f71e0b7 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/Countdown.java b/app/src/main/java/com/app/bonnie/bliss_countdown/Countdown.java new file mode 100644 index 0000000..063f7db --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/Countdown.java @@ -0,0 +1,108 @@ +package com.app.bonnie.bliss_countdown; + +// import useful android items +import android.os.Handler; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; + + +public class Countdown extends AppCompatActivity { + + // reference variables from elsewhere in the program + public TextView show_days, show_hours, show_minutes, show_seconds, done_pic; + public Handler handler; + protected Runnable runnable; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.countdown_screen); + + // set needed variables for later use + show_days = (TextView) findViewById(R.id.show_days); + show_hours = (TextView) findViewById(R.id.show_hours); + show_minutes = (TextView) findViewById(R.id.show_minutes); + show_seconds = (TextView) findViewById(R.id.show_seconds); + done_pic = (TextView) findViewById(R.id.done_pic); + + //call countdown + countDownStart(); + } + + public void countDownStart() { + + // create an instance of Handler and Runnable + handler = new Handler(); + runnable = new Runnable() { + @Override + public void run() { + // keep running method/countdown + handler.postDelayed(this, 1000); + try { + // create new instance of a simple date + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CANADA); + + // set date summer starts + Date futureDate = dateFormat.parse("2016-06-30"); + + // get current date + Date currentDate = new Date(); + + // calculate the number of days, hours, minutes, seconds until summer + if (!currentDate.after(futureDate)) { + long diff = futureDate.getTime() - currentDate.getTime(); + + //convert the difference in dates to days + long days = diff / (24 * 60 * 60 * 1000); + diff -= days * (24 * 60 * 60 * 1000); + + //convert the difference in dates to hours + long hours = diff / (60 * 60 * 1000); + diff -= hours * (60 * 60 * 1000); + + //convert the difference in dates to minutes + long minutes = diff / (60 * 1000); + diff -= minutes * (60 * 1000); + + //convert the difference in dates to seconds + long seconds = diff / 1000; + + // display the days, hours, minutes, seconds on screen + show_days.setText(String.valueOf(days)); + show_hours.setText(String.valueOf(hours)); + show_minutes.setText(String.valueOf(minutes)); + show_seconds.setText(String.valueOf(seconds)); + + + + } else { + + // if summer is already here (June 30th has passed) display that on screen + textViewGone(); + done_pic.setVisibility(View.VISIBLE); + + + } + } catch (Exception e) { + e.printStackTrace(); + } + } + }; + handler.postDelayed(runnable, 1000); + } + public void textViewGone() { + // if summer is here, do not show the boxes meant to display days, hours, minutes, seconds + findViewById(R.id.LinearLayout10).setVisibility(View.GONE); + findViewById(R.id.LinearLayout11).setVisibility(View.GONE); + findViewById(R.id.LinearLayout12).setVisibility(View.GONE); + findViewById(R.id.LinearLayout13).setVisibility(View.GONE); + findViewById(R.id.days_left).setVisibility(View.GONE); + findViewById(R.id.bottom_line).setVisibility(View.GONE); + findViewById(R.id.top_line).setVisibility(View.GONE); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/HomeScreen.java b/app/src/main/java/com/app/bonnie/bliss_countdown/HomeScreen.java new file mode 100644 index 0000000..404dfc3 --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/HomeScreen.java @@ -0,0 +1,48 @@ +package com.app.bonnie.bliss_countdown; + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.Button; + +public class HomeScreen extends AppCompatActivity { + + public android.widget.Button countdown_button, youtube_button,soothing_songs; + + public void init() { + countdown_button = (Button) findViewById(R.id.countdown_button); + youtube_button = (Button) findViewById(R.id.youtube_button); + soothing_songs = (Button) findViewById(R.id.soothing_songs); + + countdown_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_countdown = new Intent(HomeScreen.this, Countdown.class); + startActivity(open_countdown); + } + }); + + youtube_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_youtube = new Intent(HomeScreen.this, YoutubeSongs.class); + startActivity(open_youtube); + } + }); + + soothing_songs.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_piano = new Intent(HomeScreen.this, PlaySongs.class); + startActivity(open_piano); + } + }); + } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.home_screen); + init(); + } +} diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/PlayBeloved.java b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayBeloved.java new file mode 100644 index 0000000..c4033b9 --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayBeloved.java @@ -0,0 +1,30 @@ +package com.app.bonnie.bliss_countdown; + +import android.media.MediaPlayer; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class PlayBeloved extends AppCompatActivity { + + MediaPlayer mySound; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.nature_screen); + mySound = MediaPlayer.create(this,R.raw.beloved); + } + + public void playNature(View view) { + mySound.start(); + } + + public void pauseNature(View view) { + mySound.pause(); + } + + public void stopNature(View view) { + mySound.stop(); + } +} diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRain.java b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRain.java new file mode 100644 index 0000000..d0fe370 --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRain.java @@ -0,0 +1,31 @@ +package com.app.bonnie.bliss_countdown; + +import android.media.MediaPlayer; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + + +public class PlayRain extends AppCompatActivity { + + MediaPlayer mySound; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.rain_screen); + mySound = MediaPlayer.create(this,R.raw.kiss_rain); + } + + public void playRain(View view) { + mySound.start(); + } + + public void pauseRain(View view) { + mySound.pause(); + } + + public void stopRain(View view) { + mySound.stop(); + } +} diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRiver.java b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRiver.java new file mode 100644 index 0000000..d67645d --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/PlayRiver.java @@ -0,0 +1,31 @@ +package com.app.bonnie.bliss_countdown; + +import android.media.MediaPlayer; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + + +public class PlayRiver extends AppCompatActivity{ + + MediaPlayer mySound; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.river_screen); + mySound = MediaPlayer.create(this,R.raw.river); + } + + public void playMusic(View view) { + mySound.start(); + } + + public void pauseMusic(View view) { + mySound.pause(); + } + + public void stopMusic(View view) { + mySound.stop(); + } +} diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/PlaySongs.java b/app/src/main/java/com/app/bonnie/bliss_countdown/PlaySongs.java new file mode 100644 index 0000000..bd3737f --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/PlaySongs.java @@ -0,0 +1,50 @@ +package com.app.bonnie.bliss_countdown; + + +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.ImageButton; + +public class PlaySongs extends AppCompatActivity { + + public android.widget.ImageButton river_button, rain_button, nature_button; + + public void init() { + river_button = (ImageButton) findViewById(R.id.river_button); + rain_button = (ImageButton) findViewById(R.id.rain_button); + nature_button = (ImageButton) findViewById(R.id.waves_button); + + river_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_flows = new Intent(PlaySongs.this, PlayRiver.class); + startActivity(open_flows); + } + }); + + rain_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_kiss = new Intent(PlaySongs.this, PlayRain.class); + startActivity(open_kiss); + } + }); + + nature_button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent open_waves = new Intent(PlaySongs.this, PlayBeloved.class); + startActivity(open_waves); + } + }); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.play_songs); + init(); + } +} diff --git a/app/src/main/java/com/app/bonnie/bliss_countdown/YoutubeSongs.java b/app/src/main/java/com/app/bonnie/bliss_countdown/YoutubeSongs.java new file mode 100644 index 0000000..3eaf38f --- /dev/null +++ b/app/src/main/java/com/app/bonnie/bliss_countdown/YoutubeSongs.java @@ -0,0 +1,68 @@ +package com.app.bonnie.bliss_countdown; + + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.ImageButton; + + +public class YoutubeSongs extends AppCompatActivity { + + public android.widget.ImageButton CH_button, Olaf_button, DNCE_button; + public void init() { + CH_button = (ImageButton) findViewById(R.id.CH); + Olaf_button = (ImageButton) findViewById(R.id.olaf); + DNCE_button = (ImageButton) findViewById(R.id.DNCE); + + // set Calvin Harris Song + CH_button.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + + Uri uri = Uri.parse("https://www.youtube.com/watch?v=ebXbLfLACGM"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + } + }); + + // set Olaf Song + Olaf_button.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + + Uri uri = Uri.parse("https://www.youtube.com/watch?v=UFatVn1hP3o"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + + } + }); + + // set DNCE Song + DNCE_button.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + + Uri uri = Uri.parse("https://www.youtube.com/watch?v=vWaRiD5ym74"); + Intent intent = new Intent(Intent.ACTION_VIEW, uri); + startActivity(intent); + + } + }); + + + } + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.youtube_songs); + init(); + + + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable/background.jpg b/app/src/main/res/drawable/background.jpg new file mode 100644 index 0000000..030c646 Binary files /dev/null and b/app/src/main/res/drawable/background.jpg differ diff --git a/app/src/main/res/drawable/background3.jpg b/app/src/main/res/drawable/background3.jpg new file mode 100644 index 0000000..1dd2597 Binary files /dev/null and b/app/src/main/res/drawable/background3.jpg differ diff --git a/app/src/main/res/drawable/beach.jpg b/app/src/main/res/drawable/beach.jpg new file mode 100644 index 0000000..0f259c5 Binary files /dev/null and b/app/src/main/res/drawable/beach.jpg differ diff --git a/app/src/main/res/drawable/beach6.jpg b/app/src/main/res/drawable/beach6.jpg new file mode 100644 index 0000000..a17ed32 Binary files /dev/null and b/app/src/main/res/drawable/beach6.jpg differ diff --git a/app/src/main/res/drawable/beach9.jpg b/app/src/main/res/drawable/beach9.jpg new file mode 100644 index 0000000..0bc7594 Binary files /dev/null and b/app/src/main/res/drawable/beach9.jpg differ diff --git a/app/src/main/res/drawable/black.jpg b/app/src/main/res/drawable/black.jpg new file mode 100644 index 0000000..c0ec327 Binary files /dev/null and b/app/src/main/res/drawable/black.jpg differ diff --git a/app/src/main/res/drawable/bliss.png b/app/src/main/res/drawable/bliss.png new file mode 100644 index 0000000..73cbcf2 Binary files /dev/null and b/app/src/main/res/drawable/bliss.png differ diff --git a/app/src/main/res/drawable/cake.jpg b/app/src/main/res/drawable/cake.jpg new file mode 100644 index 0000000..8627649 Binary files /dev/null and b/app/src/main/res/drawable/cake.jpg differ diff --git a/app/src/main/res/drawable/calm.jpg b/app/src/main/res/drawable/calm.jpg new file mode 100644 index 0000000..327c85e Binary files /dev/null and b/app/src/main/res/drawable/calm.jpg differ diff --git a/app/src/main/res/drawable/calm2.jpg b/app/src/main/res/drawable/calm2.jpg new file mode 100644 index 0000000..1294e11 Binary files /dev/null and b/app/src/main/res/drawable/calm2.jpg differ diff --git a/app/src/main/res/drawable/calm3.jpg b/app/src/main/res/drawable/calm3.jpg new file mode 100644 index 0000000..693bdbe Binary files /dev/null and b/app/src/main/res/drawable/calm3.jpg differ diff --git a/app/src/main/res/drawable/calvin.jpg b/app/src/main/res/drawable/calvin.jpg new file mode 100644 index 0000000..2fbbac6 Binary files /dev/null and b/app/src/main/res/drawable/calvin.jpg differ diff --git a/app/src/main/res/drawable/counter.png b/app/src/main/res/drawable/counter.png new file mode 100644 index 0000000..22812cf Binary files /dev/null and b/app/src/main/res/drawable/counter.png differ diff --git a/app/src/main/res/drawable/grey.jpg b/app/src/main/res/drawable/grey.jpg new file mode 100644 index 0000000..13e8da5 Binary files /dev/null and b/app/src/main/res/drawable/grey.jpg differ diff --git a/app/src/main/res/drawable/halloween2.jpg b/app/src/main/res/drawable/halloween2.jpg new file mode 100644 index 0000000..1e913ad Binary files /dev/null and b/app/src/main/res/drawable/halloween2.jpg differ diff --git a/app/src/main/res/drawable/home_background.jpg b/app/src/main/res/drawable/home_background.jpg new file mode 100644 index 0000000..f9c3f2b Binary files /dev/null and b/app/src/main/res/drawable/home_background.jpg differ diff --git a/app/src/main/res/drawable/nature.jpg b/app/src/main/res/drawable/nature.jpg new file mode 100644 index 0000000..495dead Binary files /dev/null and b/app/src/main/res/drawable/nature.jpg differ diff --git a/app/src/main/res/drawable/nature2.jpg b/app/src/main/res/drawable/nature2.jpg new file mode 100644 index 0000000..98d598a Binary files /dev/null and b/app/src/main/res/drawable/nature2.jpg differ diff --git a/app/src/main/res/drawable/nature3.jpg b/app/src/main/res/drawable/nature3.jpg new file mode 100644 index 0000000..d64e345 Binary files /dev/null and b/app/src/main/res/drawable/nature3.jpg differ diff --git a/app/src/main/res/drawable/olaf.jpg b/app/src/main/res/drawable/olaf.jpg new file mode 100644 index 0000000..37ad7ce Binary files /dev/null and b/app/src/main/res/drawable/olaf.jpg differ diff --git a/app/src/main/res/drawable/pretty_beach.jpg b/app/src/main/res/drawable/pretty_beach.jpg new file mode 100644 index 0000000..4e8fcc7 Binary files /dev/null and b/app/src/main/res/drawable/pretty_beach.jpg differ diff --git a/app/src/main/res/drawable/rain.jpg b/app/src/main/res/drawable/rain.jpg new file mode 100644 index 0000000..409c128 Binary files /dev/null and b/app/src/main/res/drawable/rain.jpg differ diff --git a/app/src/main/res/drawable/river.jpg b/app/src/main/res/drawable/river.jpg new file mode 100644 index 0000000..c4ed7d2 Binary files /dev/null and b/app/src/main/res/drawable/river.jpg differ diff --git a/app/src/main/res/drawable/summer_here.jpg b/app/src/main/res/drawable/summer_here.jpg new file mode 100644 index 0000000..8469a0b Binary files /dev/null and b/app/src/main/res/drawable/summer_here.jpg differ diff --git a/app/src/main/res/drawable/white_square.png b/app/src/main/res/drawable/white_square.png new file mode 100644 index 0000000..dcaee28 Binary files /dev/null and b/app/src/main/res/drawable/white_square.png differ diff --git a/app/src/main/res/layout/countdown_screen.xml b/app/src/main/res/layout/countdown_screen.xml new file mode 100644 index 0000000..4384127 --- /dev/null +++ b/app/src/main/res/layout/countdown_screen.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/home_screen.xml b/app/src/main/res/layout/home_screen.xml new file mode 100644 index 0000000..f956020 --- /dev/null +++ b/app/src/main/res/layout/home_screen.xml @@ -0,0 +1,61 @@ + + + + + + + + + +