-
Notifications
You must be signed in to change notification settings - Fork 957
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
134 changed files
with
4,864 additions
and
1,209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Copyright Notices | ||
|
||
### ActiveAndroid | ||
|
||
<https://github.com/pardom/ActiveAndroid> | ||
|
||
Copyright (C) 2010 Michael Pardo | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
### Android Open Source Project | ||
|
||
<https://source.android.com/> | ||
|
||
Copyright (C) 2013 The Android Open Source Project | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
### FontAwesome | ||
|
||
<http://fontawesome.io> | ||
|
||
Font Awesome is a full suite of 605 pictographic icons for easy scalable | ||
vector graphics on websites, created and maintained by Dave Gandy. Licensed | ||
under the SIL OFL 1.1. | ||
|
||
The goals of the Open Font License (OFL) are to stimulate worldwide | ||
development of collaborative font projects, to support the font creation | ||
efforts of academic and linguistic communities, and to provide a free and | ||
open framework in which fonts may be shared and improved in partnership | ||
with others. | ||
|
||
The OFL allows the licensed fonts to be used, studied, modified and | ||
redistributed freely as long as they are not sold by themselves. The | ||
fonts, including any derivative works, can be bundled, embedded, | ||
redistributed and/or sold with any software provided that any reserved | ||
names are not used by derivative works. The fonts and derivatives, | ||
however, cannot be released under any other type of license. The | ||
requirement for fonts to remain under this license does not apply | ||
to any document created using the fonts or their derivatives. | ||
|
||
|
||
### DragSortListView | ||
|
||
<https://github.com/bauerca/drag-sort-listview> | ||
|
||
A subclass of the Android ListView component that enables drag | ||
and drop re-ordering of list items. | ||
|
||
Copyright 2012 Carl Bauer | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
### Material Design Icons | ||
|
||
<https://github.com/google/material-design-icons> | ||
|
||
Material design icons are the official icon set from Google that are designed | ||
under the material design guidelines. Available under the Creative Common | ||
Attribution 4.0 International License (CC-BY 4.0). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
app/src/androidTest/java/org/isoron/uhabits/HabitMatchers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* Copyright (C) 2016 Álinson Santos Xavier <[email protected]> | ||
* | ||
* This file is part of Loop Habit Tracker. | ||
* | ||
* Loop Habit Tracker is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or (at your | ||
* option) any later version. | ||
* | ||
* Loop Habit Tracker is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.isoron.uhabits; | ||
|
||
import android.view.View; | ||
import android.widget.Adapter; | ||
import android.widget.AdapterView; | ||
|
||
import org.hamcrest.Description; | ||
import org.hamcrest.Matcher; | ||
import org.hamcrest.TypeSafeMatcher; | ||
import org.isoron.uhabits.models.Habit; | ||
|
||
public class HabitMatchers | ||
{ | ||
public static Matcher<Habit> withName(final String name) | ||
{ | ||
return new TypeSafeMatcher<Habit>() | ||
{ | ||
@Override | ||
public boolean matchesSafely(Habit habit) | ||
{ | ||
return habit.name.equals(name); | ||
} | ||
|
||
@Override | ||
public void describeTo(Description description) | ||
{ | ||
description.appendText("name should be ").appendText(name); | ||
} | ||
|
||
@Override | ||
public void describeMismatchSafely(Habit habit, Description description) | ||
{ | ||
description.appendText("was ").appendText(habit.name); | ||
} | ||
}; | ||
} | ||
|
||
public static Matcher<View> containsHabit(final Matcher<Habit> matcher) | ||
{ | ||
return new TypeSafeMatcher<View>() | ||
{ | ||
@Override | ||
protected boolean matchesSafely(View view) | ||
{ | ||
Adapter adapter = ((AdapterView) view).getAdapter(); | ||
for (int i = 0; i < adapter.getCount(); i++) | ||
if (matcher.matches(adapter.getItem(i))) return true; | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public void describeTo(Description description) | ||
{ | ||
description.appendText("with class name: "); | ||
matcher.describeTo(description); | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.