diff --git a/.gitignore b/.gitignore
index a8b0d1d..2d410d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,3 +33,44 @@ google-services.json
# Android Profiling
*.hprof
+## Suggested ^^
+
+## From TicTacToe project for good measure. vv
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Log/OS Files
+*.log
+
+# Android Studio generated files and folders
+captures/
+.externalNativeBuild/
+.cxx/
+*.apk
+output.json
+
+# IntelliJ
+*.iml
+.idea/
+misc.xml
+deploymentTargetDropDown.xml
+render.experimental.xml
+
+# Keystore files
+*.jks
+*.keystore
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+# Android Profiling
+*.hprof
+/app/debug/output-metadata.json
+
+# Ha!
+keystore/*
+release
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100755
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 100755
index 0000000..34bb9ea
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,29 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 28
+ buildToolsVersion '28.0.3'
+
+ defaultConfig {
+ applicationId "com.hyperling.apps.the45minuterule"
+ minSdkVersion 15
+ targetSdkVersion 28
+ versionCode 7
+ versionName "1.06"
+ }
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ //compile fileTree(dir: 'libs', include: ['*.jar'])
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ testImplementation 'junit:junit:4.12'
+ implementation group: 'com.android.support', name: 'appcompat-v7', version: '28.0.0'
+ //compile 'com.google.android.gms:play-services-ads:17.1.2'
+ implementation group: 'com.google.android.gms', name: 'play-services-ads', version: '17.1.2'
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100755
index 0000000..675df9e
--- /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 /home/ling/WDBlue/Programming/Java/Android/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 *;
+#}
diff --git a/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java b/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java
new file mode 100755
index 0000000..375ab29
--- /dev/null
+++ b/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java
@@ -0,0 +1,13 @@
+package com.hyperling.apps.the45minuterule;
+
+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 100755
index 0000000..df39e66
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java b/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java
new file mode 100755
index 0000000..a541f4c
--- /dev/null
+++ b/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java
@@ -0,0 +1,483 @@
+package com.hyperling.apps.the45minuterule;
+
+import com.google.android.gms.ads.AdRequest;
+import com.google.android.gms.ads.AdView;
+
+import android.app.Dialog;
+import android.app.TimePickerDialog;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Resources;
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
+import android.text.format.DateFormat;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TableLayout;
+import android.widget.TableRow;
+import android.widget.TextView;
+import android.widget.TimePicker;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class MainActivity extends AppCompatActivity {
+
+ // Primitive
+ boolean debug, alarmSet, adsEnabled;
+ int alarmHour, alarmMinute, currentHour, currentMinute;
+ final int TIME_PICKER_DIALOG = 0;
+ String TAG;
+
+ // Java
+ Timer timer;
+ TimerTask timerTask;
+
+ // Android
+ Resources recs;
+
+ // Shared Preferences
+ private SharedPreferences sharedPreferences;
+ private String keySharedPreferences, keyAdsEnabled;
+
+ // Views
+ Button btnTime;
+ RadioGroup radioGroup;
+ RadioButton rb1, rb2, rb3;
+ TextView digitalClockHeader;
+ TableLayout layClocks;
+ ArrayList clocks;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ // Set up variables
+ recs = getResources();
+
+ debug = recs.getString(R.string.debug).toLowerCase().equals("true");
+
+ alarmSet = false;
+
+ updateCurrentTime();
+
+ alarmHour = currentHour;
+ alarmMinute = currentMinute;
+
+ // Strings
+ TAG = recs.getString(R.string.TAG);
+ keySharedPreferences = recs.getString(R.string.keySharedPreferences);
+ keyAdsEnabled = recs.getString(R.string.keyAdsEnabled);
+
+ // Shared Preferences
+ sharedPreferences = getSharedPreferences(keySharedPreferences, MODE_PRIVATE);
+
+ adsEnabled = sharedPreferences.getBoolean(keyAdsEnabled, false);
+ ////////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ // Get the Views
+ btnTime = (Button) findViewById(R.id.btnTime);
+
+ radioGroup = (RadioGroup) findViewById(R.id.rgTired);
+
+ rb1 = (RadioButton) findViewById(R.id.rb1);
+ rb2 = (RadioButton) findViewById(R.id.rb2);
+ rb3 = (RadioButton) findViewById(R.id.rb3);
+
+ digitalClockHeader = (TextView) findViewById(R.id.tvDigitalClocksHeader);
+
+ layClocks = (TableLayout) findViewById(R.id.layClocks);
+ ////////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ // Start manipulating stuff!
+ btnTime.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ // Check if the time is already being shown
+ showDialog(TIME_PICKER_DIALOG);
+ }
+ });
+
+ rb2.setChecked(true);
+
+ radioGroup.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (debug) System.out.println("Radio group was clicked");
+ startCheckTime(false);
+ }
+ });
+
+ rb1.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (debug) System.out.println("Radio 1 was clicked");
+ startCheckTime(false);
+ }
+ });
+
+ rb2.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (debug) System.out.println("Radio 2 was clicked");
+ startCheckTime(false);
+ }
+ });
+
+ rb3.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (debug) System.out.println("Radio 3 was clicked");
+ startCheckTime(false);
+ }
+ });
+ ////////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////////
+ // Finally, load ads >:)
+ if ( adsEnabled) {
+ if (Build.VERSION.SDK_INT >= 9) {
+ // Load an ad into the AdMob banner view.
+ AdView adView = (AdView) findViewById(R.id.adView);
+ AdRequest adRequest = new AdRequest.Builder()
+ .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
+ .addTestDevice("C6A494DC6E7C9AC29102694D48487084") // Nexus 7
+ .addTestDevice("B8B7561B850A9AB24E0D5B560FC50628") // Moto G
+ .addTestDevice("") // Cappy, even though it doesn't support ads
+ .setRequestAgent("android_studio:ad_template")
+ .build();
+ adView.loadAd(adRequest);
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////////////////////
+
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.menu_main, menu);
+
+ MenuItem checkForNewArticles = menu.findItem(R.id.action_enable_ads);
+ checkForNewArticles.setChecked(adsEnabled);
+
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ if (id == R.id.action_tips) {
+ startActivity(new Intent(MainActivity.this, Tips.class));
+ return false;
+ }
+
+ if (id == R.id.action_enable_ads) {
+ if (debug) Log.d(TAG, "MainActivity.onOptionsItemSelected: Before! adsEnabled=" + adsEnabled);
+ adsEnabled = !adsEnabled;
+ if (debug) Log.d(TAG, "MainActivity.onOptionsItemSelected: After! adsEnabled=" + adsEnabled);
+ SharedPreferences.Editor editor = sharedPreferences.edit();
+ editor.putBoolean(keyAdsEnabled, adsEnabled);
+ editor.commit();
+
+ if (adsEnabled){
+ Toast.makeText(this, "Thank you!", Toast.LENGTH_LONG).show();
+ }
+ else{
+ Toast.makeText(this, "Disabled ads", Toast.LENGTH_LONG).show();
+ }
+
+ item.setChecked(adsEnabled);
+
+ Intent intent = new Intent(MainActivity.this, MainActivity.class);
+ startActivity(intent);
+ finish();
+
+ return false;
+ }
+
+ if (id == R.id.action_settings) {
+ Toast.makeText(this, "I can't do that, Jim", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+
+ if (id == R.id.action_about) {
+ Toast.makeText(this, "I can't do that, Jim", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+
+ if (id == R.id.action_help) {
+ Toast.makeText(this, "I can't do that, Jim", Toast.LENGTH_SHORT).show();
+ return false;
+ }
+
+ if (id == R.id.action_exit) {
+ finish();
+ return false;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ protected Dialog onCreateDialog(int id){
+
+ switch(id){
+ case TIME_PICKER_DIALOG:
+ if (debug) System.out.println("Showing time picker");
+
+ TimePickerDialog.OnTimeSetListener timeSetListener = new TimePickerDialog.OnTimeSetListener() {
+ @Override
+ public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
+ if (debug) System.out.println("Time chosen is " + getTimeString(hourOfDay, minute));
+
+ alarmHour = hourOfDay;
+ alarmMinute = minute;
+
+ btnTime.setText(getTimeString(alarmHour, alarmMinute));
+ alarmSet = true;
+ startCheckTime(true);
+ }
+ };
+
+ TimePickerDialog timePickerDialog = new TimePickerDialog(this, timeSetListener, alarmHour, alarmMinute, DateFormat.is24HourFormat(getApplicationContext()));
+
+ return timePickerDialog;
+ }
+
+ if (debug) System.out.println("Returning null, id was " + id);
+ return null;
+ }
+
+ private void calculateTimes(){
+ if (debug) System.out.println("Calculating times");
+ if (alarmHour == currentHour && alarmMinute == currentMinute){
+ if (debug) System.out.println("Alarm time not set");
+ return;
+ }
+ else{
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // Get how long we have until the alarm rings
+ int hourDifference, minuteDifference, minutesUntilAlarm, sleepiness;
+
+ hourDifference = alarmHour;
+ minuteDifference = alarmMinute;
+
+ if(alarmMinute < currentMinute){
+ minuteDifference += 60;
+ hourDifference -= 1;
+ }
+
+ if (alarmHour < currentHour){
+ hourDifference += 24;
+ }
+
+ hourDifference -= currentHour;
+ minuteDifference -= currentMinute;
+
+ minutesUntilAlarm = (60*hourDifference) + minuteDifference;
+ if (debug) System.out.println("Number of minutes until the alarm rings: " + minutesUntilAlarm);
+ ////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // Get sleepiness of the user
+ switch(radioGroup.getCheckedRadioButtonId()){
+ case R.id.rb1:
+ sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt1_value));
+ break;
+ case R.id.rb2:
+ sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt2_value));
+ break;
+ case R.id.rb3:
+ sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt3_value));
+ break;
+ default:
+ sleepiness = 0;
+ }
+ if (debug) System.out.println("Sleepiness is " + sleepiness);
+ ////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // Do math and set the clocks
+ int bedHour, bedMinute, remainder;
+
+ bedHour = currentHour;
+ bedMinute = currentMinute;
+
+ minutesUntilAlarm -= sleepiness;
+
+ clocks = new ArrayList();
+ if ((minutesUntilAlarm) > 0){
+ remainder = (minutesUntilAlarm%45);
+
+ if (remainder < 0){
+ remainder += 45;
+ }
+
+ bedMinute += remainder;
+ while (minutesUntilAlarm >= 45) {
+
+ if (bedMinute >= 60) {
+ bedMinute -= 60;
+ bedHour += 1;
+ if (bedHour >= 24) {
+ bedHour -= 24;
+ }
+ }
+
+ TextView newClock = new TextView(this);
+ newClock.setText(getTimeString(bedHour, bedMinute));
+
+ clocks.add(newClock);
+
+ minutesUntilAlarm -= 45;
+ bedMinute += 45;
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ////////////////////////////////////////////////////////////////////////////////////////
+ // Lay out the text views
+ TableRow.LayoutParams params = new TableRow.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1);
+
+ int loop = 0;
+ TableRow newRow = new TableRow(this);
+
+ layClocks.removeAllViews();
+
+ if (clocks.size() > 0) {
+ for (TextView clock : clocks) {
+ if (loop % 3 == 0) {
+ newRow = new TableRow(this);
+ layClocks.addView(newRow);
+ }
+
+ params.column = (loop % 3) + 1;
+
+ clock.setLayoutParams(params);
+ clock.setTextSize(18);
+ clock.setGravity(Gravity.CENTER);
+
+ newRow.addView(clock);
+
+ loop++;
+ }
+
+ while (loop % 3 != 0){
+ TextView blankClock = new TextView(this);
+
+ params.column = (loop % 3) + 1;
+
+ blankClock.setLayoutParams(params);
+ blankClock.setText(recs.getString(R.string.blank));
+ blankClock.setTextSize(18);
+ blankClock.setGravity(Gravity.CENTER);
+
+ newRow.addView(blankClock);
+
+ loop++;
+ }
+
+ // TODO: Remove temp string
+ String temp = recs.getString(R.string.main_bedtimes_header) + ". Refreshed at " + getTimeString(currentHour, currentMinute);
+ digitalClockHeader.setText(temp);
+ }
+ else{
+ digitalClockHeader.setText(recs.getString(R.string.main_bedtimes_header_too_close));
+ }
+ ////////////////////////////////////////////////////////////////////////////////////////
+ }
+
+ return;
+ }
+
+ public void startCheckTime(boolean setTimer){
+ if (debug) System.out.println("Checking time");
+
+ updateCurrentTime();
+ calculateTimes();
+
+ if (setTimer) {
+ timerTask = new TimerTask() {
+ @Override
+ public void run() {
+ startCheckTime(true);
+ }
+ };
+
+ timer = new Timer();
+
+ // TODO: Fix timer
+ //timer.schedule(timerTask, 5000); // Recalculate time every 5 seconds
+ }
+
+ return;
+ }
+
+ private void updateCurrentTime(){
+ Calendar now = Calendar.getInstance();
+
+ currentHour = now.get(Calendar.HOUR_OF_DAY);
+ currentMinute = now.get(Calendar.MINUTE);
+
+ currentMinute = now.get(Calendar.MINUTE);
+ currentHour = now.get(Calendar.HOUR_OF_DAY);
+ if (debug) System.out.println("Current time is " + getTimeString(currentHour, currentMinute));
+ }
+
+ private String getTimeString(int hour, int minute){
+ String time, hours, minutes, meridian;
+
+ if (minute < 10){
+ minutes = "0" + Integer.toString(minute);
+ }
+ else{
+ minutes = Integer.toString(minute);
+ }
+
+ if (DateFormat.is24HourFormat(getApplicationContext())){
+ hours = (hour < 10 ? "0"+Integer.toString(hour) : Integer.toString(hour));
+
+ time = hours + ":" + minutes;
+ }
+ else {
+ if (hour > 12){
+ hour -= 12;
+ meridian = "PM";
+ }
+ else{
+ meridian = "AM";
+ }
+
+ hours = (hour == 0 ? "12" : Integer.toString(hour));
+
+ time = hours + ":" + minutes + meridian;
+ }
+ return time;
+ }
+}
diff --git a/app/src/main/java/com/hyperling/apps/the45minuterule/Tips.java b/app/src/main/java/com/hyperling/apps/the45minuterule/Tips.java
new file mode 100755
index 0000000..ad6f011
--- /dev/null
+++ b/app/src/main/java/com/hyperling/apps/the45minuterule/Tips.java
@@ -0,0 +1,44 @@
+package com.hyperling.apps.the45minuterule;
+
+import android.content.res.Resources;
+import android.graphics.Color;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+public class Tips extends AppCompatActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_tips);
+
+ Resources recs = getResources();
+
+ String[] tips = recs.getStringArray(R.array.tips_tips_array);
+
+ LinearLayout layout = (LinearLayout) findViewById(R.id.layTipsArray);
+
+ int colorCounter = 0;
+ for (String tip : tips){
+ TextView newTip = new TextView(this);
+
+ newTip.setText(tip);
+
+ newTip.setPadding(8,8,0,4);
+
+ if (colorCounter % 2 == 0){
+ newTip.setTextColor(recs.getColor(R.color.colorAccent));
+ }
+ else{
+ newTip.setTextColor(recs.getColor(R.color.colorPrimaryDark));
+ }
+
+ layout.addView(newTip);
+
+ colorCounter++;
+ }
+ }
+}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
new file mode 100755
index 0000000..4b6fd0f
--- /dev/null
+++ b/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_tips.xml b/app/src/main/res/layout/activity_tips.xml
new file mode 100755
index 0000000..801c1d6
--- /dev/null
+++ b/app/src/main/res/layout/activity_tips.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml
new file mode 100755
index 0000000..26f63e5
--- /dev/null
+++ b/app/src/main/res/menu/menu_main.xml
@@ -0,0 +1,46 @@
+
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100755
index 0000000..cde69bc
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100755
index 0000000..c133a0c
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100755
index 0000000..bfa42f0
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100755
index 0000000..324e72c
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100755
index 0000000..aee44e1
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_001.png b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_001.png
new file mode 100755
index 0000000..43286fc
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_001.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_002.png b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_002.png
new file mode 100755
index 0000000..f28acd2
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_002.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_003.png b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_003.png
new file mode 100755
index 0000000..daf8fc8
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/t45mr_icon_003.png differ
diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml
new file mode 100755
index 0000000..dd348a7
--- /dev/null
+++ b/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,10 @@
+>
+
+
+
diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml
new file mode 100755
index 0000000..63fc816
--- /dev/null
+++ b/app/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 64dp
+
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100755
index 0000000..cc30b49
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #FF9900
+ #333333
+ #330066
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100755
index 0000000..812cb7b
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,6 @@
+
+
+ 16dp
+ 16dp
+ 16dp
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100755
index 0000000..cd55a36
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,65 @@
+
+
+
+ The 45 Minute Rule
+
+ com.hyperling.apps.the45minuterule
+
+ Sleep Tips
+ Settings
+ About
+ Help
+ Exit
+ Enable Ads?
+
+
+ true
+
+
+
+
+ Morning alarm time:
+
+ Click me!
+
+ How tired are you?
+
+ Very Tired (Fall asleep in 5 minutes)
+ 5
+ Tired (Fall asleep in less than 20 minutes)
+ 20
+ Alert (Hopefully fall asleep in 30 or 40 minutes)
+ 35
+
+ Times you could go to bed
+ Alarm is too soon, no valid times to sleep.
+
+
+ t45mr
+ AdsEnabled
+
+
+
+
+
+ Tips for a good night sleep:
+
+
+ - Use a program like f.lux (or Twilight on Android) to reduce screen brightness at night.
+ -
+ Eat a high carbohydrate meal for dinner. Carbohydrates help you fall asleep faster and are necessary for your body to repair itself.
+ Dr. Neal Barnard recommends eating two pieces of bread if you can\'t fall asleep.
+
+ - Plan aerobic activity in your daily routine. Twenty minutes of walking can be very effective when done between dinner and bedtime.
+
+
+
+
+
+
+ ca-app-pub-9712416021907617/8586703280
+ BlankTest
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100755
index 0000000..9ee4d8b
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java b/app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java
new file mode 100755
index 0000000..1775b76
--- /dev/null
+++ b/app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java
@@ -0,0 +1,15 @@
+package com.hyperling.apps.the45minuterule;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * To work on unit tests, switch the Test Artifact in the Build Variants view.
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
new file mode 100755
index 0000000..ae9fbaf
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,25 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ repositories {
+ jcenter()
+ google()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.2.1'
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ jcenter()
+ google()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100755
index 0000000..1d3591c
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,18 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+# Default value: -Xmx10248m -XX:MaxPermSize=256m
+# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100755
index 0000000..05ef575
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100755
index 0000000..647bf39
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sat Jan 12 07:07:15 CST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..9d82f78
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100755
index 0000000..aec9973
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/media/banner/banner001.xcf b/media/banner/banner001.xcf
new file mode 100755
index 0000000..ec250e5
Binary files /dev/null and b/media/banner/banner001.xcf differ
diff --git a/media/banner/banner_001.png b/media/banner/banner_001.png
new file mode 100755
index 0000000..fab5fea
Binary files /dev/null and b/media/banner/banner_001.png differ
diff --git a/media/icon/t45mr.png b/media/icon/t45mr.png
new file mode 100755
index 0000000..1126a38
Binary files /dev/null and b/media/icon/t45mr.png differ
diff --git a/media/icon/t45mr_icon_001.png b/media/icon/t45mr_icon_001.png
new file mode 100755
index 0000000..43286fc
Binary files /dev/null and b/media/icon/t45mr_icon_001.png differ
diff --git a/media/icon/t45mr_icon_001.xcf b/media/icon/t45mr_icon_001.xcf
new file mode 100755
index 0000000..d239b1a
Binary files /dev/null and b/media/icon/t45mr_icon_001.xcf differ
diff --git a/media/icon/t45mr_icon_002.png b/media/icon/t45mr_icon_002.png
new file mode 100755
index 0000000..f28acd2
Binary files /dev/null and b/media/icon/t45mr_icon_002.png differ
diff --git a/media/icon/t45mr_icon_002.xcf b/media/icon/t45mr_icon_002.xcf
new file mode 100755
index 0000000..d61c831
Binary files /dev/null and b/media/icon/t45mr_icon_002.xcf differ
diff --git a/media/icon/t45mr_icon_003.png b/media/icon/t45mr_icon_003.png
new file mode 100755
index 0000000..daf8fc8
Binary files /dev/null and b/media/icon/t45mr_icon_003.png differ
diff --git a/media/icon/t45mr_icon_003.xcf b/media/icon/t45mr_icon_003.xcf
new file mode 100755
index 0000000..e44dac3
Binary files /dev/null and b/media/icon/t45mr_icon_003.xcf differ
diff --git a/media/icon/t45mr_icon_003_512.png b/media/icon/t45mr_icon_003_512.png
new file mode 100755
index 0000000..6d76ab1
Binary files /dev/null and b/media/icon/t45mr_icon_003_512.png differ
diff --git a/media/screenshots/motoG_01.png b/media/screenshots/motoG_01.png
new file mode 100755
index 0000000..53e3bba
Binary files /dev/null and b/media/screenshots/motoG_01.png differ
diff --git a/media/screenshots/motoG_02.png b/media/screenshots/motoG_02.png
new file mode 100755
index 0000000..e9adb04
Binary files /dev/null and b/media/screenshots/motoG_02.png differ
diff --git a/media/screenshots/motoG_03.png b/media/screenshots/motoG_03.png
new file mode 100755
index 0000000..10715d4
Binary files /dev/null and b/media/screenshots/motoG_03.png differ
diff --git a/media/screenshots/nexus7_01.png b/media/screenshots/nexus7_01.png
new file mode 100755
index 0000000..3e246fa
Binary files /dev/null and b/media/screenshots/nexus7_01.png differ
diff --git a/media/screenshots/nexus7_02.png b/media/screenshots/nexus7_02.png
new file mode 100755
index 0000000..edb44b4
Binary files /dev/null and b/media/screenshots/nexus7_02.png differ
diff --git a/media/screenshots/nexus7_03.png b/media/screenshots/nexus7_03.png
new file mode 100755
index 0000000..efe4658
Binary files /dev/null and b/media/screenshots/nexus7_03.png differ
diff --git a/settings.gradle b/settings.gradle
new file mode 100755
index 0000000..e7b4def
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+include ':app'