18 Commits
Author SHA1 Message Date
me aa1df85bd5 Merge pull request '1.0.8' (#3) from dev into main
Reviewed-on: #3
2026-11-01 08:20:52 -07:00
me 02df431dac layout, fix the app being under the main bar on newer Android versions. 2026-10-23 14:56:37 -07:00
me 09db2cb6d8 Get the project syncing and building again. 2026-10-23 14:56:07 -07:00
me 1a95d7ad94 icon, import via Android Studio so that it handles newer versions better. 2026-10-23 09:57:12 -07:00
me ae61c4f03f icon, add monochrome versions. 2026-10-23 09:56:21 -07:00
me 4c257e1033 Update Gradle. 2026-10-22 17:31:29 -07:00
me 65bdf9dd2b fdroid, add specifier to email and put the field in the app-specific section. 2026-09-29 07:16:31 -07:00
me 5cdc7653e9 Add more fdroid details while refactoring the file. 2026-07-04 14:58:40 -07:00
me 0e44eaba4f Update issue tracker to be proper HTTP link, use contact page. Change website page to go directly to the app. 2026-07-04 10:48:19 -07:00
me dd78a1259e Merge pull request 'Add manifest file for self-hosted F-Droid repo.' (#2) from dev into main
Reviewed-on: #2
2026-07-04 10:21:30 -07:00
me f7a462be22 Add manifest file for self-hosted F-Droid repo. 2026-07-04 10:16:26 -07:00
me 8f5bd9a76a Merge pull request 'Upgrade Android Version' (#1) from dev into main
Reviewed-on: #1
2025-07-22 16:21:33 -07:00
me ae7474effd Remove unnecessary build tools version. 2025-07-22 16:17:57 -07:00
me 959573a4e9 Delete unused files. 2025-07-21 19:48:05 -07:00
me 9645510759 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. 2025-07-21 19:47:45 -07:00
me 0dd5485080 Grade version fixes. 2025-07-21 19:46:20 -07:00
me 1f3745d294 Increment the version and prepare to begin testing for newer versions of Android. 2025-07-20 20:00:43 -07:00
me 25c5df5688 Add a description of the project. 2025-07-20 20:00:19 -07:00
43 changed files with 93 additions and 143 deletions

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
# android-45-minute-rule
Provide a list of alarm suggestions based on a bedtime and tiredness rating.
+10 -13
View File
@@ -1,29 +1,26 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
compileSdkVersion 36
namespace "com.hyperling.apps.the45minuterule"
defaultConfig {
applicationId "com.hyperling.apps.the45minuterule"
minSdkVersion 15
targetSdkVersion 28
versionCode 7
versionName "1.06"
minSdkVersion 23
targetSdkVersion 36
versionCode 9
versionName "1.0.8"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.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'
//implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.13.2'
implementation "androidx.appcompat:appcompat:1.8.0"
}
@@ -1,13 +0,0 @@
package com.hyperling.apps.the45minuterule;
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);
}
}
+3 -14
View File
@@ -1,9 +1,6 @@
<?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="com.hyperling.apps.the45minuterule">
<uses-sdk tools:overrideLibrary="com.google.android.gms,com.google.android.gms.ads" />
xmlns:tools="http://schemas.android.com/tools">
<!-- Include required permissions for Google Mobile Ads to run. -->
<uses-permission android:name="android.permission.INTERNET" />
@@ -11,19 +8,15 @@
<application
android:allowBackup="true"
android:icon="@mipmap/t45mr_icon_003"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize">
<!-- This meta-data tag is required to use Google Play Services. -->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -31,10 +24,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Include the AdActivity configChanges and theme. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:theme="@android:style/Theme.Translucent" />
<activity android:name=".Tips"/>
</application>
Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

@@ -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;
@@ -10,7 +7,7 @@ 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.support.v7.app.AppCompatActivity;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.Gravity;
@@ -27,6 +24,8 @@ import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Timer;
@@ -150,35 +149,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 +170,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;
@@ -304,18 +256,16 @@ public class MainActivity extends AppCompatActivity {
////////////////////////////////////////////////////////////////////////////////////////
// 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;
@SuppressWarnings("ConstantConditions")
int checkedRadioButtonId = radioGroup.getCheckedRadioButtonId();
if (checkedRadioButtonId == R.id.rb1) {
sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt1_value));
} else if (checkedRadioButtonId == R.id.rb2) {
sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt2_value));
} else if (checkedRadioButtonId == R.id.rb3) {
sleepiness = Integer.parseInt(recs.getString(R.string.rb_opt3_value));
} else {
sleepiness = 0;
}
if (debug) System.out.println("Sleepiness is " + sleepiness);
////////////////////////////////////////////////////////////////////////////////////////
@@ -2,12 +2,14 @@ package com.hyperling.apps.the45minuterule;
import android.content.res.Resources;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
//import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
public class Tips extends AppCompatActivity {
@Override
+3 -12
View File
@@ -7,23 +7,14 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.hyperling.apps.the45minuterule.MainActivity">
<!-- view for AdMob Banner Ad -->
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="@string/main_banner_ad" />
tools:context="com.hyperling.apps.the45minuterule.MainActivity"
android:fitsSystemWindows="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_above="@id/adView"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:id="@+id/scrollView">
@@ -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">
<TextView
-7
View File
@@ -9,13 +9,6 @@
android:title="@string/action_tips"
app:showAsAction="never" />
<item
android:id="@+id/action_enable_ads"
android:orderInCategory="150"
android:title="@string/action_enable_ads"
app:showAsAction="never"
android:checkable="true" />
<item
android:id="@+id/action_about"
android:orderInCategory="200"
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_monochrome"/>
</adaptive-icon>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>
@@ -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);
}
}
+11 -4
View File
@@ -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:9.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -15,11 +22,11 @@ buildscript {
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
tasks.register('clean', Delete) {
delete rootProject.buildDir
}
+16
View File
@@ -0,0 +1,16 @@
AuthorName: 'Chad Michael "Hyperling" Greenwood'
AuthorWebSite: 'https://hyperling.com/about/'
Donate: 'https://hyperling.com/donate/'
Liberapay: 'HyperVegan'
Bitcoin: 'bc1qsfe8dkvry3d34kztz449gkq67wq8fu2nkgfkh0'
Litecoin: 'ltc1qavmpu5d6ljntxsd6jj548m4yys83zwscl0dzkx'
IssueTracker: 'https://hyperling.com/contact/'
Categories:
- fdroid
- hyperling
- utilities
Name: The 45 Minute Rule
AuthorEmail: 'me+t45mr@hyperling.com'
Summary: 'Determine a good bedtime for waking during light sleep.'
SourceCode: 'https://git.hyperling.com/me/android-45-minute-rule/'
WebSite: 'https://hyperling.com/apps/#sleep'
+3
View File
@@ -16,3 +16,6 @@
# 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
# Allow switch statements on R.id values.
android.nonFinalResIds=false
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
toolchainVersion=25
+1 -1
View File
@@ -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-9.8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Binary file not shown.

After

Width:  |  Height:  |  Size: 674 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.