├── app ├── .gitignore ├── proguard-sqlite.pro ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── icon_outline.png │ │ │ │ ├── widget_preview.png │ │ │ │ ├── bucket_widget_preview.png │ │ │ │ ├── custom_values_widget_preview.png │ │ │ │ ├── ic_add_black_24dp.xml │ │ │ │ ├── ic_create_black_24dp.xml │ │ │ │ ├── ic_save_black_24dp.xml │ │ │ │ ├── ic_event_note_black_24dp.xml │ │ │ │ ├── ic_help_outline_black_24dp.xml │ │ │ │ ├── ic_snooze_black_24dp.xml │ │ │ │ ├── ic_settings_black_24dp.xml │ │ │ │ ├── bucket_night.xml │ │ │ │ ├── bucket_evening.xml │ │ │ │ ├── bucket_morning.xml │ │ │ │ └── bucket_noon.xml │ │ │ ├── drawable-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── menu │ │ │ │ └── main_menu.xml │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── xml │ │ │ │ ├── bucket_widget_info.xml │ │ │ │ ├── custom_values_widget_info.xml │ │ │ │ ├── widget_info.xml │ │ │ │ └── shortcuts.xml │ │ │ └── layout │ │ │ │ ├── reminder_edition_activity.xml │ │ │ │ ├── quick_widget_layout.xml │ │ │ │ ├── bucket_widget_layout.xml │ │ │ │ ├── custom_alarm_time_fragment.xml │ │ │ │ ├── custom_values_widget_layout.xml │ │ │ │ ├── quick_widget_item_layout.xml │ │ │ │ ├── reminder_edition_dialog.xml │ │ │ │ ├── info_activity.xml │ │ │ │ ├── custom_values_widget_configuration_activity.xml │ │ │ │ ├── quick_widget_configuration_activity.xml │ │ │ │ ├── main_activity.xml │ │ │ │ └── bucket_widget_configuration_activity.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── sickmartian │ │ │ │ └── quickreminderwidget │ │ │ │ ├── ReminderEditionActivityForShortcut.java │ │ │ │ ├── ReminderIntentionData.java │ │ │ │ ├── data │ │ │ │ ├── DBHelper.java │ │ │ │ └── Provider.java │ │ │ │ ├── EditionModeToggleReceiver.java │ │ │ │ ├── SnoozeService.java │ │ │ │ ├── TimeFieldHandler.java │ │ │ │ ├── InfoActivity.java │ │ │ │ ├── CustomAlarmTimeValue.java │ │ │ │ ├── TimeSyncReceiver.java │ │ │ │ ├── ReminderIntentionReceiver.java │ │ │ │ ├── BucketWidgetProvider.java │ │ │ │ ├── CustomValuesWidgetConfigurationActivity.java │ │ │ │ ├── CalculateAndScheduleNextAlarmReceiver.java │ │ │ │ ├── CustomValuesWidgetProvider.java │ │ │ │ ├── QuickReminderWidgetProvider.java │ │ │ │ ├── QuickReminderWidgetConfigurationActivity.java │ │ │ │ ├── Utils.java │ │ │ │ ├── BucketWidgetConfigurationActivity.java │ │ │ │ ├── CustomAlarmTimeFragment.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── NotificationReceiver.java │ │ └── AndroidManifest.xml │ └── test │ │ └── java │ │ └── com │ │ └── sickmartian │ │ └── quickreminderwidget │ │ └── UtilsTest.java ├── proguard-joda-time.pro ├── release │ └── output.json ├── proguard-facebook-stetho.pro ├── fabric.properties ├── proguard-crashlytics.pro ├── proguard-support-v7-appcompat.pro ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── .gitignore ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/proguard-sqlite.pro: -------------------------------------------------------------------------------- 1 | -keep class org.sqlite.** { *; } 2 | -keep class org.sqlite.database.** { *; } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable/icon_outline.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/widget_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable/widget_preview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bucket_widget_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable/bucket_widget_preview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_values_widget_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/HEAD/app/src/main/res/drawable/custom_values_widget_preview.png -------------------------------------------------------------------------------- /app/proguard-joda-time.pro: -------------------------------------------------------------------------------- 1 | ## Joda Time 2.3 2 | 3 | -dontwarn org.joda.convert.** 4 | -dontwarn org.joda.time.** 5 | -keep class org.joda.time.** { *; } 6 | -keep interface org.joda.time.** { *; } -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":18},"path":"app-release.apk","properties":{"packageId":"com.sickmartian.quickreminderwidget","split":"","minSdkVersion":"15"}}] -------------------------------------------------------------------------------- /app/proguard-facebook-stetho.pro: -------------------------------------------------------------------------------- 1 | # Updated as of Stetho 1.1.1 2 | # 3 | # Note: Doesn't include Javascript console lines. See https://github.com/facebook/stetho/tree/master/stetho-js-rhino#proguard 4 | -keep class com.facebook.stetho.** { *; } 5 | -------------------------------------------------------------------------------- /app/fabric.properties: -------------------------------------------------------------------------------- 1 | #Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. 2 | #Mon Aug 15 16:20:23 GMT-03:00 2016 3 | apiSecret=68bca9b4e1823a958257c0f6bcd091dff92b792e007d754456867e8589421daf 4 | -------------------------------------------------------------------------------- /app/proguard-crashlytics.pro: -------------------------------------------------------------------------------- 1 | # Crashlytics 1.+ 2 | 3 | -keep class com.crashlytics.** { *; } 4 | -dontwarn com.crashlytics.** 5 | -keep class com.crashlytics.android.** 6 | -keepattributes SourceFile,LineNumberTable,Annotation 7 | -keep public class * extends java.lang.Exception -------------------------------------------------------------------------------- /app/src/main/java/com/sickmartian/quickreminderwidget/ReminderEditionActivityForShortcut.java: -------------------------------------------------------------------------------- 1 | package com.sickmartian.quickreminderwidget; 2 | 3 | /** 4 | * Created by sickmartian on 8/14/16. 5 | */ 6 | public class ReminderEditionActivityForShortcut extends ReminderEditionActivity {} 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Sep 22 12:24:00 ART 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /app/proguard-support-v7-appcompat.pro: -------------------------------------------------------------------------------- 1 | -keep public class android.support.v7.widget.** { *; } 2 | -keep public class android.support.v7.internal.widget.** { *; } 3 | -keep public class android.support.v7.internal.view.menu.** { *; } 4 | 5 | -keep public class * extends android.support.v4.view.ActionProvider { 6 | public (android.content.Context); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_create_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_event_note_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_help_outline_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_snooze_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #607D8B 4 | #455A64 5 | #00BCD4 6 | 7 | #FFFFFF 8 | #18FFFF 9 | 10 | #BDBDBD 11 | #FFFFFF 12 | 13 | #FF5555 14 | 15 | #FFFFFF 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/xml/bucket_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/custom_values_widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/widget_info.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/xml/shortcuts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/reminder_edition_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 15 | 16 | 20 | 21 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Windows thumbnail db 24 | Thumbs.db 25 | 26 | # OSX files 27 | .DS_Store 28 | 29 | # Eclipse project files 30 | .classpath 31 | .project 32 | 33 | # Android Studio 34 | *.iml 35 | .idea 36 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 37 | .gradle 38 | keystore.properties 39 | build 40 | # Proguard folder generated by Eclipse 41 | proguard/ 42 | 43 | # Log Files 44 | *.log 45 | 46 | # Android Studio Navigation editor temp files 47 | .navigation/ 48 | 49 | # Android Studio captures folder 50 | captures/ 51 | 52 | # Intellij 53 | *.iml 54 | .idea/workspace.xml 55 | 56 | # Keystore files 57 | *.jks 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quick Reminder Widgets 2 | This is a small collection of widgets to easily set reminders. 3 | 4 | **Reminder List** is the central point to create and edit reminders. 5 | 6 | 7 | 8 | **Time of Day** allows creation of reminders at predefined hours of the day. 9 | 10 | 11 | 12 | **Pronto** allows creation of reminders in the near future. 13 | 14 | 15 | 16 | ## Contributing 17 | All contributions are welcome, just try to stay in the spirit of the project: 18 | * Widgets should be customizable 19 | * Widgets should be resizeable to the minimum of the grid when possible 20 | * No more than one notification for an specified time 21 | 22 | ## License 23 | [This is under GPLv3.](https://raw.githubusercontent.com/sickmartian/QuickReminderWidget/master/LICENSE) 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_settings_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in ~/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Parcelable: 20 | -keepclassmembers class * implements android.os.Parcelable { 21 | public static final android.os.Parcelable$Creator *; 22 | } 23 | -keep interface org.parceler.Parcel 24 | -keep @org.parceler.Parcel class * { *; } 25 | -keep class **$$Parcelable { *; } 26 | -keep class org.parceler.Parceler$$Parcels 27 | -keep interface org.parceler.** 28 | 29 | # Google Analytics: 30 | -keep public class com.google.** {*;} 31 | 32 | # Apache opencsv 33 | -dontwarn com.opencsv.bean.** 34 | 35 | # Animations 36 | -keep class com.sickmartian.calendartracker.animations.* {*;} -------------------------------------------------------------------------------- /app/src/main/res/drawable/bucket_night.xml: -------------------------------------------------------------------------------- 1 | 6 | 13 | 16 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0dp 4 | 110dp 5 | 220dp 6 | 40dp 7 | 110dp 8 | 180dp 9 | 10 | 60dp 11 | 16dp 12 | 4dp 13 | 24dp 14 | 15 | 16sp 16 | 48dp 17 | 72dp 18 | 19 | 16dp 20 | 16dp 21 | 16dp 22 | 16dp 23 | 16dp 24 | 25 | 8dp 26 | 16dp 27 | 40dp 28 | 40dp 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/sickmartian/quickreminderwidget/ReminderIntentionData.java: -------------------------------------------------------------------------------- 1 | package com.sickmartian.quickreminderwidget; 2 | 3 | import com.sickmartian.quickreminderwidget.data.model.Alarm; 4 | 5 | import org.joda.time.Duration; 6 | import org.joda.time.LocalDateTime; 7 | import org.parceler.Parcel; 8 | 9 | import java.io.Serializable; 10 | 11 | /** 12 | * Created by sickmartian on 8/13/16. 13 | */ 14 | @Parcel 15 | public class ReminderIntentionData { 16 | Serializable timeObject; 17 | Alarm alarm; 18 | 19 | public ReminderIntentionData() { } 20 | 21 | public ReminderIntentionData(Serializable timeObject, Alarm alarm) { 22 | this.timeObject = timeObject; 23 | this.alarm = alarm; 24 | } 25 | 26 | public Alarm getAlarm() { 27 | return alarm; 28 | } 29 | 30 | public Serializable getTimeObject() { 31 | return timeObject; 32 | } 33 | 34 | public Duration getDuration() { 35 | return timeObject instanceof Duration ? (Duration) timeObject : null; 36 | } 37 | 38 | public LocalDateTime getTime() { 39 | return timeObject instanceof LocalDateTime ? (LocalDateTime) timeObject : null; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "ReminderIntentionData{" + 45 | "timeObject=" + timeObject + 46 | ", alarm=" + alarm + 47 | '}'; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sickmartian/quickreminderwidget/data/DBHelper.java: -------------------------------------------------------------------------------- 1 | package com.sickmartian.quickreminderwidget.data; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | import com.sickmartian.quickreminderwidget.data.model.Alarm; 8 | 9 | /** 10 | * Created by sickmartian on 8/12/16. 11 | */ 12 | public class DBHelper extends SQLiteOpenHelper { 13 | public static final String DATABASE_NAME = "qaw.db"; 14 | public static final int CURRENT_VERSION = 1; 15 | public DBHelper(Context context) { 16 | super(context, DATABASE_NAME, null, CURRENT_VERSION); 17 | } 18 | 19 | @Override 20 | public void onCreate(SQLiteDatabase db) { 21 | db.execSQL("PRAGMA foreign_keys = ON;"); 22 | 23 | final String SQL_CREATE_ALARM_TABLE = "CREATE TABLE " + Alarm.TABLE_NAME + " (" + 24 | Alarm.Fields.ALARM_DATE_TIME + " TEXT NOT NULL UNIQUE, " + 25 | Alarm.Fields.ALARM_CREATION_DATE_TIME + " TEXT NOT NULL, " + 26 | Alarm.Fields.ALARM_NOTE + " TEXT, " + 27 | Alarm.Fields.SOURCE_WIDGET_ID + " INTEGER " + 28 | ");"; 29 | 30 | db.execSQL(SQL_CREATE_ALARM_TABLE); 31 | } 32 | 33 | @Override 34 | public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/sickmartian/quickreminderwidget/EditionModeToggleReceiver.java: -------------------------------------------------------------------------------- 1 | package com.sickmartian.quickreminderwidget; 2 | 3 | import android.appwidget.AppWidgetManager; 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.SharedPreferences; 8 | 9 | /** 10 | * Created by sickmartian on 8/12/16. 11 | */ 12 | public class EditionModeToggleReceiver extends BroadcastReceiver { 13 | private static final String CURRENT_EDITION_MODE = "CURRENT_EDITION_MODE"; 14 | 15 | @Override 16 | public void onReceive(Context context, Intent intent) { 17 | int widgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); 18 | boolean currentEditionMode = intent.getBooleanExtra(CURRENT_EDITION_MODE, false); 19 | SharedPreferences widgetPrefs = App.getWidgetSharedPref(widgetId); 20 | widgetPrefs 21 | .edit() 22 | .putBoolean(QuickReminderWidgetProvider.EDITION_MODE, !currentEditionMode) 23 | .commit(); 24 | App.updateQuickReminderWidget(widgetId); 25 | } 26 | 27 | public static Intent getIntent(int widgetId, boolean currentEditionMode) { 28 | Intent intent = new Intent(App.getAppContext(), EditionModeToggleReceiver.class); 29 | intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, widgetId); 30 | intent.putExtra(CURRENT_EDITION_MODE, currentEditionMode); 31 | return intent; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/test/java/com/sickmartian/quickreminderwidget/UtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.sickmartian.quickreminderwidget; 2 | 3 | import junit.framework.Assert; 4 | 5 | import org.joda.time.DateTimeUtils; 6 | import org.joda.time.DateTimeZone; 7 | import org.joda.time.Duration; 8 | import org.joda.time.LocalDateTime; 9 | import org.junit.Test; 10 | 11 | public class UtilsTest { 12 | 13 | @Test 14 | public void saneNowPlusDurationForAlarms() { 15 | DateTimeZone.setDefault(DateTimeZone.forID("America/Los_Angeles")); 16 | DateTimeUtils.setCurrentMillisFixed(LocalDateTime.parse("2018-03-11T01:34:00") 17 | .toDateTime(DateTimeZone.getDefault()).getMillis()); 18 | 19 | Assert.assertEquals(LocalDateTime.parse("2018-03-11T03:04:00"), 20 | Utils.saneNowPlusDurationForAlarms(Duration.standardMinutes(30))); 21 | 22 | DateTimeUtils.setCurrentMillisOffset(0L); 23 | } 24 | 25 | @Test 26 | public void convertLocalToDTSafely() { 27 | DateTimeZone.setDefault(DateTimeZone.forID("America/Los_Angeles")); 28 | 29 | Assert.assertEquals(LocalDateTime.parse("2018-03-11T03:04:00").toDateTime(DateTimeZone.getDefault()), 30 | Utils.convertLocalToDTSafely(LocalDateTime.parse("2018-03-11T02:04:00"))); 31 | 32 | Assert.assertEquals(LocalDateTime.parse("2018-03-11T03:04:00").toDateTime(DateTimeZone.getDefault()), 33 | Utils.convertLocalToDTSafely(LocalDateTime.parse("2018-03-11T02:04:00"))); 34 | 35 | Assert.assertEquals(LocalDateTime.parse("2018-03-11T03:04:00").toDateTime(DateTimeZone.getDefault()), 36 | Utils.convertLocalToDTSafely(LocalDateTime.parse("2018-03-11T02:34:00"))); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/quick_widget_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 13 | 21 | 29 | 30 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/bucket_widget_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 16 | 24 | 32 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/custom_alarm_time_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 |