Fix tests for KitKat
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 21 KiB |
@@ -17,7 +17,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.isoron.uhabits.pebble;
|
package org.isoron.uhabits.receivers;
|
||||||
|
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.support.annotation.*;
|
import android.support.annotation.*;
|
||||||
@@ -29,12 +29,11 @@ import com.getpebble.android.kit.util.*;
|
|||||||
|
|
||||||
import org.isoron.uhabits.*;
|
import org.isoron.uhabits.*;
|
||||||
import org.isoron.uhabits.core.models.*;
|
import org.isoron.uhabits.core.models.*;
|
||||||
import org.isoron.uhabits.receivers.*;
|
|
||||||
import org.json.*;
|
import org.json.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
import org.junit.runner.*;
|
import org.junit.runner.*;
|
||||||
|
|
||||||
import static com.getpebble.android.kit.Constants.*;
|
import static com.getpebble.android.kit.Constants.MSG_DATA;
|
||||||
import static org.hamcrest.MatcherAssert.*;
|
import static org.hamcrest.MatcherAssert.*;
|
||||||
import static org.hamcrest.core.IsEqual.*;
|
import static org.hamcrest.core.IsEqual.*;
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import java.util.*;
|
|||||||
|
|
||||||
import javax.annotation.concurrent.*;
|
import javax.annotation.concurrent.*;
|
||||||
|
|
||||||
|
import static java.lang.Math.min;
|
||||||
import static org.isoron.uhabits.core.models.Checkmark.CHECKED_EXPLICITLY;
|
import static org.isoron.uhabits.core.models.Checkmark.CHECKED_EXPLICITLY;
|
||||||
import static org.isoron.uhabits.core.models.Checkmark.CHECKED_IMPLICITLY;
|
import static org.isoron.uhabits.core.models.Checkmark.CHECKED_IMPLICITLY;
|
||||||
import static org.isoron.uhabits.core.models.Checkmark.UNCHECKED;
|
import static org.isoron.uhabits.core.models.Checkmark.UNCHECKED;
|
||||||
@@ -60,8 +61,7 @@ public abstract class CheckmarkList
|
|||||||
long today = DateUtils.getStartOfToday();
|
long today = DateUtils.getStartOfToday();
|
||||||
|
|
||||||
long begin = reps[0].getTimestamp();
|
long begin = reps[0].getTimestamp();
|
||||||
if (intervals.size() > 0)
|
if (intervals.size() > 0) begin = min(begin, intervals.get(0).begin);
|
||||||
begin = Long.min(begin, intervals.get(0).begin);
|
|
||||||
|
|
||||||
int nDays = (int) ((today - begin) / day) + 1;
|
int nDays = (int) ((today - begin) / day) + 1;
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ public abstract class CheckmarkList
|
|||||||
final long today = DateUtils.getStartOfToday();
|
final long today = DateUtils.getStartOfToday();
|
||||||
|
|
||||||
Checkmark newest = getNewestComputed();
|
Checkmark newest = getNewestComputed();
|
||||||
if(newest != null && newest.getTimestamp() == today) return;
|
if (newest != null && newest.getTimestamp() == today) return;
|
||||||
invalidateNewerThan(0);
|
invalidateNewerThan(0);
|
||||||
|
|
||||||
Repetition oldestRep = habit.getRepetitions().getOldest();
|
Repetition oldestRep = habit.getRepetitions().getOldest();
|
||||||
|
|||||||