Skip to content

Commit

Permalink
Merge branch 'release/1.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Apr 9, 2017
2 parents 967dc25 + 387930c commit 692fe32
Show file tree
Hide file tree
Showing 139 changed files with 6,578 additions and 4,860 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,3 +20,4 @@ captures/
docs/
gen/
local.properties
crowdin.yaml
16 changes: 16 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,21 @@
# Changelog

### 1.7.0 (Mar 31, 2017)

* Sort habits automatically
* Allow swiping the header to see previous days
* Import backups directly from Google Drive or Dropbox
* Refresh data automatically at midnight
* Other minor bug fixes and enhancements

### 1.6.2 (Oct 13, 2016)

* Fix crash on Android 4.1

### 1.6.1 (Oct 10, 2016)

* Fix a crash at startup when database is corrupted

### 1.6.0 (Oct 10, 2016)

* Add option to make notifications sticky
Expand Down
16 changes: 8 additions & 8 deletions app/build.gradle
Expand Up @@ -4,13 +4,13 @@ apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'jacoco'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "org.isoron.uhabits"
minSdkVersion 15
targetSdkVersion 23
targetSdkVersion 25

buildConfigField "Integer", "databaseVersion", "15"
buildConfigField "String", "databaseFilename", "\"uhabits.db\""
Expand Down Expand Up @@ -53,7 +53,7 @@ dependencies {

androidTestApt 'com.google.dagger:dagger-compiler:2.2'

androidTestCompile 'com.android.support:support-annotations:23.3.0'
androidTestCompile 'com.android.support:support-annotations:25.3.0'
androidTestCompile 'com.android.support.test:rules:0.5'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.google.auto.factory:auto-factory:1.0-beta3'
Expand All @@ -64,10 +64,10 @@ dependencies {
apt 'com.google.dagger:dagger-compiler:2.2'
apt 'com.jakewharton:butterknife-compiler:8.0.1'

compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:preference-v14:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:preference-v14:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.getpebble:pebblekit:3.0.0'
compile 'com.github.paolorotolo:appintro:3.4.0'
compile 'com.google.auto.factory:auto-factory:1.0-beta3'
Expand Down
Expand Up @@ -63,6 +63,8 @@ public class BaseAndroidTest

protected AndroidTestComponent component;

protected ModelFactory modelFactory;

@Before
public void setUp()
{
Expand All @@ -89,7 +91,7 @@ public void setUp()
taskRunner = component.getTaskRunner();
logger = component.getHabitsLogger();

ModelFactory modelFactory = component.getModelFactory();
modelFactory = component.getModelFactory();
fixtures = new HabitFixtures(modelFactory, habitList);

latch = new CountDownLatch(1);
Expand Down
Expand Up @@ -225,7 +225,7 @@ private String saveBitmap(String filename, String suffix, Bitmap bitmap)
throws IOException
{
File dir = FileUtils.getSDCardDir("test-screenshots");
if (dir == null) dir = FileUtils.getFilesDir("test-screenshots");
if (dir == null) dir = FileUtils.getFilesDir(targetContext,"test-screenshots");
if (dir == null) throw new RuntimeException(
"Could not find suitable dir for screenshots");

Expand Down
Expand Up @@ -39,12 +39,18 @@ public HabitFixtures(ModelFactory modelFactory, HabitList habitList)
}

public Habit createEmptyHabit()
{
return createEmptyHabit(null);
}

public Habit createEmptyHabit(Long id)
{
Habit habit = modelFactory.buildHabit();
habit.setName("Meditate");
habit.setDescription("Did you meditate this morning?");
habit.setColor(3);
habit.setFrequency(Frequency.DAILY);
habit.setId(id);
habitList.add(habit);
return habit;
}
Expand Down
Expand Up @@ -60,6 +60,7 @@ public void setUp()
view = new CheckmarkPanelView(targetContext);
view.setHabit(habit);
view.setCheckmarkValues(checkmarks);
view.setButtonCount(4);
view.setColor(ColorUtils.getAndroidTestColor(7));

measureView(view, dpToPixels(200), dpToPixels(200));
Expand Down
10 changes: 3 additions & 7 deletions app/src/androidTest/java/org/isoron/uhabits/io/ImportTest.java
Expand Up @@ -40,8 +40,6 @@
@MediumTest
public class ImportTest extends BaseAndroidTest
{
private File baseDir;

private Context context;

@Override
Expand All @@ -50,11 +48,8 @@ public void setUp()
{
super.setUp();
DateUtils.setFixedLocalTime(null);

fixtures.purgeHabits(habitList);
context = InstrumentationRegistry.getInstrumentation().getContext();
baseDir = FileUtils.getFilesDir("Backups");
if (baseDir == null) fail("baseDir should not be null");
}

@Test
Expand Down Expand Up @@ -149,8 +144,7 @@ private void copyAssetToFile(String assetPath, File dst) throws IOException

private void importFromFile(String assetFilename) throws IOException
{
File file =
new File(String.format("%s/%s", baseDir.getPath(), assetFilename));
File file = File.createTempFile("asset", "");
copyAssetToFile(assetFilename, file);
assertTrue(file.exists());
assertTrue(file.canRead());
Expand All @@ -159,5 +153,7 @@ private void importFromFile(String assetFilename) throws IOException
assertThat(importer.canHandle(file), is(true));

importer.importHabitsFromFile(file);

file.delete();
}
}

0 comments on commit 692fe32

Please sign in to comment.