Skip to content

Commit 0a43f30

Browse files
committed
Merge branch 'release-2.5.4'
* release-2.5.4: build: Prepend project name to APK name Italian translation (#105) Translations: Squashed commit of the following: Notification: use 'taken' instead of 'take' to better reflect user action Add keystore.properties symlink for easier management Remove med alerts before removing med RoutineCreateOrEditFrag: Force using RadialTimePicker with SDK<21 MedicinesActivity: don't wait for layout inflation before starting search MedicinesActivity: avoid re-launching search activity when this activity is GCd Schedules: Don't show pill dose pickers for presentations other than pills Add icon asset folder link to the contributing guidelines Add drug presentation icon sources to the repo MedicineCreateOrEditFragm: don't hardcode tag for presentations Fix medicine activity tests with new presentation layout Presentation: simplify icon retrieval Add new medicine presentations. Fixes #54 and #98 Properly format 24h times Add default strings for new presentations build: update Kotlin version to 1.2.30 build: Update versionCode and versionName
2 parents c476575 + 4050147 commit 0a43f30

File tree

63 files changed

+6430
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+6430
-450
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Local configuration file (sdk path, etc)
22
/local.properties
3-
/keystore.properties
43
/.idea/workspace.xml
54
.DS_Store
65

@@ -43,6 +42,8 @@ libraries/*.iml
4342
Calendula/google-services/
4443
Calendula/google-services.json
4544

45+
Calendula/keystore
46+
4647
# captures
4748
captures/
4849

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Non-code contributions are also welcome!. You can do a lot of things:
3333

3434
* Comment on a issue or start your own to suggest ideas or give your opinion.
3535
* Fix typos, comments or clarify language to improve the quality of the app.
36-
* Propose an icon, a better drawable for an specific action, or even a new material app logo ;-).
36+
* Propose [an icon](assets/icons), a better drawable for an specific action, or even a new material app logo ;-).
3737
* Be a member of the testing community by joining the testing group on Google Groups. You will automatically receive the updates from the BETA channel like normal updates from Google Play. This helps us find bugs before the public release!
3838

3939
> Join the BETA channel: [click here!](https://play.google.com/apps/testing/es.usc.citius.servando.calendula)
@@ -50,4 +50,3 @@ Alternatively, you can contribute translations via pull request:
5050
* Send a pull request.
5151

5252
You can also improve an existing `strings_translatable.xml` file and make a PR with that!
53-

Calendula/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ android {
7777
defaultConfig {
7878
minSdkVersion 16
7979
targetSdkVersion 25
80-
versionCode 34
81-
versionName "2.5.3"
80+
versionCode 35
81+
versionName "2.5.4"
8282
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
8383
applicationId "es.usc.citius.servando.calendula"
8484
multiDexEnabled true
@@ -153,7 +153,7 @@ android {
153153

154154
applicationVariants.all { variant ->
155155
variant.outputs.all {
156-
outputFileName = "${variant.name}-${variant.versionName}.apk"
156+
outputFileName = "${project.name}-${variant.name}-${variant.versionName}.apk"
157157
}
158158
}
159159
compileOptions.incremental = false

Calendula/src/androidTest/java/es/usc/citius/servando/calendula/activities/MedicinesActivityCreateTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import android.support.test.espresso.action.ViewActions;
2323
import android.test.ActivityInstrumentationTestCase2;
2424

25+
import org.hamcrest.BaseMatcher;
26+
import org.hamcrest.Description;
2527
import org.junit.Before;
2628
import org.junit.Test;
2729

@@ -38,6 +40,7 @@
3840
import static android.support.test.espresso.action.ViewActions.click;
3941
import static android.support.test.espresso.action.ViewActions.typeText;
4042
import static android.support.test.espresso.matcher.ViewMatchers.withId;
43+
import static android.support.test.espresso.matcher.ViewMatchers.withTagValue;
4144
import static android.support.test.espresso.matcher.ViewMatchers.withText;
4245

4346
public class MedicinesActivityCreateTest extends ActivityInstrumentationTestCase2<MedicinesActivity> {
@@ -97,8 +100,9 @@ public void testCreateMedicine() {
97100
.perform(click());
98101

99102
// select capsules presentation
100-
onView(withId(R.id.med_presentation_2))
103+
onView(withTagValue(new PresentationTagMatcher(Presentation.CAPSULES)))
101104
.perform(click());
105+
102106
// click save
103107
onView(withId(R.id.add_button))
104108
.perform(click());

Calendula/src/androidTest/java/es/usc/citius/servando/calendula/activities/MedicinesActivityEditTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.junit.Before;
2626
import org.junit.Test;
2727

28-
import es.usc.citius.servando.calendula.BuildConfig;
2928
import es.usc.citius.servando.calendula.CalendulaApp;
3029
import es.usc.citius.servando.calendula.R;
3130
import es.usc.citius.servando.calendula.database.DB;
@@ -36,6 +35,7 @@
3635
import static android.support.test.espresso.Espresso.onView;
3736
import static android.support.test.espresso.action.ViewActions.click;
3837
import static android.support.test.espresso.matcher.ViewMatchers.withId;
38+
import static android.support.test.espresso.matcher.ViewMatchers.withTagValue;
3939

4040

4141
public class MedicinesActivityEditTest extends ActivityInstrumentationTestCase2<MedicinesActivity> {
@@ -85,7 +85,7 @@ public void testEditMedicine() {
8585

8686
TestUtils.sleep(1500);
8787
// select capsules presentation
88-
onView(withId(R.id.med_presentation_2))
88+
onView(withTagValue(new PresentationTagMatcher(Presentation.CAPSULES)))
8989
.perform(click());
9090
TestUtils.sleep(200);
9191

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Calendula - An assistant for personal medication management.
3+
* Copyright (C) 2014-2018 CiTIUS - University of Santiago de Compostela
4+
*
5+
* Calendula is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
19+
package es.usc.citius.servando.calendula.activities;
20+
21+
import org.hamcrest.BaseMatcher;
22+
import org.hamcrest.Description;
23+
24+
import es.usc.citius.servando.calendula.persistence.Presentation;
25+
26+
class PresentationTagMatcher extends BaseMatcher {
27+
28+
Presentation p;
29+
30+
public PresentationTagMatcher(Presentation p) {
31+
this.p = p;
32+
}
33+
34+
@Override
35+
public boolean matches(Object item) {
36+
return item != null && item.equals(p);
37+
}
38+
39+
@Override
40+
public void describeTo(Description description) {
41+
42+
}
43+
}
Binary file not shown.

Calendula/src/main/java/es/usc/citius/servando/calendula/DailyAgendaRecyclerAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ public void onBindEmptyItemViewHolder(EmptyItemViewHolder viewHolder, DailyAgend
190190
if (expanded) {
191191
LocalDate d = viewHolder.stub.date;
192192
if (d.equals(DateTime.now().toLocalDate())) {
193-
viewHolder.hourText.setText(item.time != null ? item.time.toString("kk:mm") : "--");
193+
viewHolder.hourText.setText(item.time != null ? item.time.toString("HH:mm") : "--");
194194
} else {
195-
viewHolder.hourText.setText(item.dateTime().toString("kk:mm"));
195+
viewHolder.hourText.setText(item.dateTime().toString("HH:mm"));
196196
}
197197
}
198198
viewHolder.itemView.setVisibility(expanded ? View.VISIBLE : View.GONE);

Calendula/src/main/java/es/usc/citius/servando/calendula/activities/ConfirmActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public class ConfirmActivity extends CalendulaActivity {
134134
private boolean stateChanged = false;
135135
private ConfirmItemAdapter itemAdapter;
136136
private DateTimeFormatter dateFormatter = DateTimeFormat.forPattern("dd/MM/YYYY");
137-
private DateTimeFormatter timeFormatter = DateTimeFormat.forPattern("kk:mm");
137+
private DateTimeFormatter timeFormatter = DateTimeFormat.forPattern("HH:mm");
138138
private IconicsDrawable checkedIcon;
139139
private IconicsDrawable uncheckedIcon;
140140
private int color;
@@ -676,7 +676,7 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
676676

677677
String status = getString(R.string.med_not_taken);
678678
if (i.getTimeTaken() != null) {
679-
status = (i.getTakenToday() ? getString(R.string.med_taken_at) : getString(R.string.med_cancelled_at)) + " " + i.getTimeTaken().toString("kk:mm") + "h";
679+
status = (i.getTakenToday() ? getString(R.string.med_taken_at) : getString(R.string.med_cancelled_at)) + " " + i.getTimeTaken().toString("HH:mm") + "h";
680680
}
681681

682682
h.med.setText(m.getName());

Calendula/src/main/java/es/usc/citius/servando/calendula/activities/ConfirmSchedulesActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public void updateSchedule(final Schedule s, final Schedule current, List<Schedu
250250
LogUtil.d(TAG, "Saving daily schedule item..."
251251
+ dsi.getId()
252252
+ " timeToday: "
253-
+ timeToday.toString("kk:mm"));
253+
+ timeToday.toString("HH:mm"));
254254
}
255255
}
256256
// save and fire event

0 commit comments

Comments
 (0)