From 25c5df56880ebe490e8b40f000a7aa3e1c1ea603 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 20 Jul 2025 20:00:19 -0700 Subject: [PATCH 1/6] Add a description of the project. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6ff2dda..c1f4936 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # android-45-minute-rule +Provide a list of alarm suggestions based on a bedtime and tiredness rating. From 1f3745d294a41911295bba242bcbdaa2d1b89e67 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sun, 20 Jul 2025 20:00:43 -0700 Subject: [PATCH 2/6] Increment the version and prepare to begin testing for newer versions of Android. --- app/build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 34bb9ea..7c4c614 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 28 + compileSdkVersion 36 buildToolsVersion '28.0.3' defaultConfig { applicationId "com.hyperling.apps.the45minuterule" - minSdkVersion 15 - targetSdkVersion 28 - versionCode 7 - versionName "1.06" + minSdkVersion 14 + targetSdkVersion 36 + versionCode 8 + versionName "1.07" } buildTypes { release { From 0dd5485080bdc729bccb916550f76eb879ce6e8c Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 21 Jul 2025 19:46:20 -0700 Subject: [PATCH 3/6] Grade version fixes. --- build.gradle | 13 ++++++++++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index ae9fbaf..bfc1796 100755 --- a/build.gradle +++ b/build.gradle @@ -2,11 +2,18 @@ buildscript { repositories { - jcenter() + mavenCentral() + maven { + url 'https://jitpack.io' + } google() + maven { + url 'https://maven.google.com/' + name 'Google' + } } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:8.11.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -15,7 +22,7 @@ buildscript { allprojects { repositories { - jcenter() + mavenCentral() google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 647bf39..bf42fb6 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Jan 12 07:07:15 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip From 96455107599664a8043d3b03a2399897237ed337 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 21 Jul 2025 19:47:45 -0700 Subject: [PATCH 4/6] Changes to allow project to compile on newer versions, including removing ad code and adding a margin to the top of layouts so the UI is below the action bar. --- app/build.gradle | 4 +- app/src/main/AndroidManifest.xml | 10 +--- .../apps/the45minuterule/MainActivity.java | 50 ------------------- app/src/main/res/layout/activity_main.xml | 13 +---- app/src/main/res/layout/activity_tips.xml | 1 + app/src/main/res/menu/menu_main.xml | 7 --- gradle.properties | 5 +- 7 files changed, 9 insertions(+), 81 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 7c4c614..f7ecde4 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 36 buildToolsVersion '28.0.3' - + namespace "com.hyperling.apps.the45minuterule" defaultConfig { applicationId "com.hyperling.apps.the45minuterule" minSdkVersion 14 @@ -24,6 +24,4 @@ dependencies { 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/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index df39e66..36199ac 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,13 +17,9 @@ android:theme="@style/AppTheme" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"> - - - @@ -31,10 +27,6 @@ - - diff --git a/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java b/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java index a541f4c..ffd96c9 100755 --- a/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java +++ b/app/src/main/java/com/hyperling/apps/the45minuterule/MainActivity.java @@ -1,8 +1,5 @@ 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; @@ -150,35 +147,12 @@ public class MainActivity extends AppCompatActivity { }); //////////////////////////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////////////////////////// - // 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; } @@ -194,30 +168,6 @@ public class MainActivity extends AppCompatActivity { 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; diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 4b6fd0f..bf75811 100755 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -7,23 +7,14 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" + android:layout_marginTop="?android:actionBarSize" tools:context="com.hyperling.apps.the45minuterule.MainActivity"> - - - diff --git a/app/src/main/res/layout/activity_tips.xml b/app/src/main/res/layout/activity_tips.xml index 801c1d6..8b0baba 100755 --- a/app/src/main/res/layout/activity_tips.xml +++ b/app/src/main/res/layout/activity_tips.xml @@ -7,6 +7,7 @@ android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" + android:layout_marginTop="?android:actionBarSize" tools:context="com.hyperling.apps.the45minuterule.Tips"> - - Date: Mon, 21 Jul 2025 19:48:05 -0700 Subject: [PATCH 5/6] Delete unused files. --- .../apps/the45minuterule/ApplicationTest.java | 13 ------------- .../apps/the45minuterule/ExampleUnitTest.java | 15 --------------- 2 files changed, 28 deletions(-) delete mode 100755 app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java delete mode 100755 app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java diff --git a/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java b/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java deleted file mode 100755 index 375ab29..0000000 --- a/app/src/androidTest/java/com/hyperling/apps/the45minuterule/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -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/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java b/app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java deleted file mode 100755 index 1775b76..0000000 --- a/app/src/test/java/com/hyperling/apps/the45minuterule/ExampleUnitTest.java +++ /dev/null @@ -1,15 +0,0 @@ -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 From ae7474effd3b15e41f57f2160ee9f8ca22218480 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 22 Jul 2025 16:17:57 -0700 Subject: [PATCH 6/6] Remove unnecessary build tools version. --- app/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index f7ecde4..1b2ca7b 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.application' android { compileSdkVersion 36 - buildToolsVersion '28.0.3' namespace "com.hyperling.apps.the45minuterule" defaultConfig { applicationId "com.hyperling.apps.the45minuterule"