Merge branch 'dev' into llunak/custom_snooze

This commit is contained in:
2017-09-28 07:00:51 -05:00
13 changed files with 53 additions and 21 deletions

View File

@@ -171,6 +171,8 @@ public class EditHabitDialog extends AppCompatDialogFragment
if (type == Habit.NUMBER_HABIT && !targetPanel.validate()) return;
Habit habit = modelFactory.buildHabit();
if( originalHabit != null )
habit.copyFrom(originalHabit);
habit.setName(namePanel.getName());
habit.setDescription(namePanel.getDescription());
habit.setColor(namePanel.getColor());

View File

@@ -21,8 +21,8 @@ package org.isoron.uhabits.notifications
import android.app.*
import android.content.*
import android.graphics.*
import android.graphics.BitmapFactory.*
import android.graphics.Color
import android.support.v4.app.*
import android.support.v4.app.NotificationCompat.*
import org.isoron.androidbase.*
@@ -85,13 +85,13 @@ class AndroidNotificationTray
.setWhen(reminderTime)
.setShowWhen(true)
.setOngoing(preferences.shouldMakeNotificationsSticky())
if (preferences.shouldMakeNotificationsLed())
builder.setLights(Color.RED, 1000, 1000)
val notification = builder.build()
builder.setLights(Color.RED, 1000, 1000)
val notificationManager = context.getSystemService(
Activity.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.notify(notificationId, notification)
notificationManager.notify(notificationId, builder.build())
}
}

View File

@@ -92,7 +92,7 @@ public abstract class DatabaseUtils
throws IOException
{
SimpleDateFormat dateFormat = DateFormats.getBackupDateFormat();
String date = dateFormat.format(DateUtils.getStartOfToday());
String date = dateFormat.format(DateUtils.getLocalTime());
String format = "%s/Loop Habits Backup %s.db";
String filename = String.format(format, dir.getAbsolutePath(), date);

View File

@@ -166,7 +166,7 @@
<string name="pure_black_description">Replaces gray backgrounds with pure black in night mode. Reduces battery usage in phones with AMOLED display.</string>
<string name="interface_preferences">Interface</string>
<string name="reverse_days">Reverse order of days</string>
<string name="reverse_days_description">Show days in reverse order on the main screen</string>
<string name="reverse_days_description">Show days in reverse order on the main screen.</string>
<string name="day">Day</string>
<string name="week">Week</string>
@@ -191,8 +191,8 @@
<string name="sticky_notifications">Make notifications sticky</string>
<string name="sticky_notifications_description">Prevents notifications from being swiped away.</string>
<string name="led_notifications">LED</string>
<string name="led_notifications_description">Notifications blinking light.</string>
<string name="led_notifications">Notification light</string>
<string name="led_notifications_description">Shows a blinking light for reminders. Only available in phones with LED notification lights.</string>
<string name="repair_database">Repair database</string>
<string name="database_repaired">Database repaired.</string>