Skip to content

Commit

Permalink
Fixed overlapping Exercise names.
Browse files Browse the repository at this point in the history
Changed app name and german translation.
Added default sets to database.
  • Loading branch information
Kamuno committed Oct 15, 2019
1 parent 66f8e3e commit bf1a2e2
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 94 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "org.secuso.aktivpause"
minSdkVersion 21
targetSdkVersion 28
versionCode 4
versionName "0.4"
versionCode 5
versionName "0.5"
vectorDrawables.useSupportLibrary = true
}
lintOptions {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</activity>
<activity
android:name="org.secuso.aktivpause.activities.TimerActivity"
android:label="@string/activity_title_break_reminder"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
Expand Down
Binary file modified app/src/main/assets/databases/exercises.sqlite
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ protected void onCreate(Bundle savedInstanceState) {
overridePendingTransition(0, 0);
setupActionBar();

TextView t1 = (TextView) findViewById(R.id.githubURL);
TextView t1 = findViewById(R.id.githubURL);
t1.setMovementMethod(LinkMovementMethod.getInstance());

TextView t2 = (TextView) findViewById(R.id.secusoWebsite);
TextView t2 = findViewById(R.id.secusoWebsite);
t2.setMovementMethod(LinkMovementMethod.getInstance());

TextView authors = (TextView) findViewById(R.id.textFieldAuthorNames);
TextView t3 = findViewById(R.id.about_graphics_names);
t3.setMovementMethod(LinkMovementMethod.getInstance());

TextView authors = findViewById(R.id.textFieldAuthorNames);
authors.setText(getString(R.string.about_author_contributors, getString(R.string.about_author_names)));

((TextView)findViewById(R.id.textFieldVersionName)).setText(BuildConfig.VERSION_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,61 +120,4 @@ private void createNotificationChannels() {
notificationManager.createNotificationChannel(timerRunningChannel);
notificationManager.createNotificationChannel(timerDoneChannel);
}

private void loadInitialExerciseSets() {

Cursor setCursor = dbHandler.getExerciseSetsCursor();

if(setCursor != null && setCursor.getCount() > 0) {
List<Integer> setList = new ArrayList<>();

while(setCursor.moveToNext()) {
setList.add(setCursor.getInt(setCursor.getColumnIndex(ExerciseSetColumns._ID)));
}

setCursor.close();

for(Integer id : setList) {
dbHandler.clearExercisesFromSet(id);
dbHandler.deleteExerciseSet(id);
}
}

long id5 = dbHandler.addDefaultExerciseSet(context.getString(R.string.set_default_5));
long id4 = dbHandler.addDefaultExerciseSet(context.getString(R.string.set_default_4));
long id3 = dbHandler.addDefaultExerciseSet(context.getString(R.string.set_default_3));
long id2 = dbHandler.addDefaultExerciseSet(context.getString(R.string.set_default_2));
long id1 = dbHandler.addDefaultExerciseSet(context.getString(R.string.set_default_1));

dbHandler.addExerciseToExerciseSet((int) id1, 1);
dbHandler.addExerciseToExerciseSet((int) id1, 2);
dbHandler.addExerciseToExerciseSet((int) id1, 3);
dbHandler.addExerciseToExerciseSet((int) id1, 4);
dbHandler.addExerciseToExerciseSet((int) id1, 5);

dbHandler.addExerciseToExerciseSet((int) id2, 6);
dbHandler.addExerciseToExerciseSet((int) id2, 7);
dbHandler.addExerciseToExerciseSet((int) id2, 11);
dbHandler.addExerciseToExerciseSet((int) id2, 13);
dbHandler.addExerciseToExerciseSet((int) id2, 17);

dbHandler.addExerciseToExerciseSet((int) id3, 16);
dbHandler.addExerciseToExerciseSet((int) id3, 20);
dbHandler.addExerciseToExerciseSet((int) id3, 25);
dbHandler.addExerciseToExerciseSet((int) id3, 26);
dbHandler.addExerciseToExerciseSet((int) id3, 34);

dbHandler.addExerciseToExerciseSet((int) id4, 27);
dbHandler.addExerciseToExerciseSet((int) id4, 31);
dbHandler.addExerciseToExerciseSet((int) id4, 33);
dbHandler.addExerciseToExerciseSet((int) id4, 35);
dbHandler.addExerciseToExerciseSet((int) id4, 36);

dbHandler.addExerciseToExerciseSet((int) id5, 27);
dbHandler.addExerciseToExerciseSet((int) id5, 28);
dbHandler.addExerciseToExerciseSet((int) id5, 29);
dbHandler.addExerciseToExerciseSet((int) id5, 36);
dbHandler.addExerciseToExerciseSet((int) id5, 39);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public synchronized Cursor getExerciseCursorForSet(int setId, String language) {
"LEFT OUTER JOIN "+ExerciseLocalColumns.TABLE_NAME+" L\n" +
"\tON E."+ExerciseColumns._ID+" = L."+ExerciseLocalColumns.EXERCISE_ID+"\n" +
"WHERE ES."+ExerciseSetColumns._ID+" = ? AND L."+ExerciseLocalColumns.LANGUAGE+" = ?\n" +
"ORDER BY ESE."+ExerciseColumns._ID+" ASC";
"ORDER BY ESE.exercise_order ASC";

return database.rawQuery(sql, new String[]{String.valueOf(setId), language});
}
Expand Down Expand Up @@ -296,7 +296,6 @@ private String buildQuery(int sectionCheck) {
}
}


sqlQuery.append("ORDER BY E.");
sqlQuery.append(ExerciseColumns._ID);
sqlQuery.append(" ASC");
Expand Down
29 changes: 15 additions & 14 deletions app/src/main/res/layout/dialog_exercise.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
android:id="@+id/exercise_image"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
Expand All @@ -27,34 +25,38 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="0dp"
android:text="@string/execution"
android:textStyle="bold"
android:visibility="invisible"
app:layout_constraintLeft_toRightOf="parent"
app:layout_constraintTop_toTopOf="@+id/section_card" />

<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Name of exercise"
android:textSize="16sp"
android:textStyle="bold"
android:text="Name of exercise"
app:layout_constraintTop_toTopOf="parent"
android:visibility="visible"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/section_card"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
android:visibility="visible"/>
app:layout_constraintTop_toTopOf="parent"
tools:text="Name of a very long exercise that can maybe wrap around" />

<TextView
android:id="@+id/execution"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="268dp"
android:text="sitting or standing"
android:visibility="invisible"
app:layout_constraintEnd_toStartOf="@+id/execution_title"
app:layout_constraintTop_toBottomOf="@+id/execution_title"
android:visibility="invisible"/>
app:layout_constraintTop_toBottomOf="@+id/execution_title" />

<TextView
android:id="@+id/description_title"
Expand Down Expand Up @@ -88,23 +90,22 @@
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
app:cardBackgroundColor="@color/colorLightAccent"
app:cardCornerRadius="12dp"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toRightOf="@+id/execution"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toTopOf="@+id/name">

<TextView
android:id="@+id/section"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="4dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="4dp"
android:gravity="center"
android:text="Neck, Arms"
android:textColor="@color/white" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/nav_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:text="@string/app_name"
android:text="@string/app_name_short"
android:textColor="@color/colorPrimary"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/nav_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<item
android:id="@+id/nav_timer"
android:icon="@drawable/ic_alarm_black"
android:title="@string/activity_title_break_reminder" />
android:title="@string/app_name_short" />
<item
android:id="@+id/nav_manage_exercise_sets"
android:icon="@drawable/ic_list_black_24px"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Aktivepause</string>
<string name="app_name">Aktivpause to Go</string>
<string name="app_name_short">Aktivpause</string>

<!-- Tutorial -->
<string name="slide1_heading">Willkommen</string>
<string name="slide1_text">Willkommen bei der Privacy Friendly Aktive Pause App. Diese App erinnert Sie daran, regelmäßig während der Arbeit Pausen einzulegen. Zusätzlich können Sie sich Übungen aussuchen, mit denen Sie Ihre Pause aktiv gestalten können.</string>
<string name="slide1_text">Willkommen bei der Privacy Friendly Aktivpause to Go App. Diese App erinnert Sie daran, regelmäßig während der Arbeit Pausen einzulegen. Zusätzlich können Sie sich Übungen aussuchen, mit denen Sie Ihre Pause aktiv gestalten können.</string>

<string name="slide2_heading">Übungsset erstellen</string>
<string name="slide2_text">
Expand Down Expand Up @@ -44,11 +45,10 @@
<string name="exercise_section_shoulder">Schulter</string>
<string name="exercise_section_back">Rücken</string>
<string name="exercise_section_face">Gesicht</string>
<string name="exercise_section_body">Körper</string>
<string name="exercise_section_body">Ganzkörper</string>
<string name="exercise_section_other">Sonstiges</string>

<string name="activity_edit_no_empty_name">Bitte geben Sie einen Namen an.</string>
<string name="activity_title_break_reminder">@string/app_name</string>
<string name="dialog_add_exercise_set_title">Neues Übungsset hinzufügen</string>
<string name="title_activity_settings">Einstellungen</string>
<string name="activity_edit_exercise_set_name_hint">Geben Sie einen Namen ein…</string>
Expand Down Expand Up @@ -93,7 +93,7 @@
<!-- About -->
<string name="about">Über</string>
<string name="about_author">Autoren: </string>
<string name="about_graphics_by">Grafiken und Bilder:</string>
<string name="about_graphics_by">Grafiken und Beschreibungen:</string>
<string name="about_author_contributors">%s und Mitwirkende</string>
<string name="about_affiliation">In Zusammenarbeit mit</string>
<string name="more_info">Mehr Information finden Sie hier:</string>
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<resources>
<string name="app_name">Aktivpause</string>
<string name="app_name">Aktivpause to Go</string>
<string name="app_name_short">Aktivpause</string>
<string name="navigation_drawer_open" translatable="false">Open navigation drawer</string>
<string name="navigation_drawer_close" translatable="false">Close navigation drawer</string>

<!-- Tutorial -->
<string name="slide1_heading">Welcome to Privacy Friendly Pausing Healthily!</string>
<string name="slide1_heading">Welcome to Aktivpause to Go!</string>
<string name="slide1_text">This app reminds you to regularly take breaks during your work. Additionally, you can choose from a set of exercises, that can help you to spend your break more active.</string>

<string name="slide2_heading">Create Exercise Sets</string>
Expand Down Expand Up @@ -62,7 +63,6 @@
<string name="activity_title_manage_exercise_sets">Exercise Sets</string>
<string name="activity_title_edit_exercise_set">Edit Exercise Set</string>
<string name="dialog_add_exercise_set_title">Add New Exercise Set</string>
<string name="activity_title_break_reminder">Pausing Healthily</string>
<string name="dialog_add_exercise_set_name">Exercise Set Name</string>
<string name="dialog_discard_confirmation">Are you sure you want to discard the changes?</string>
<string name="title_activity_tutorial">Tutorial</string>
Expand All @@ -85,14 +85,14 @@

<!-- About -->
<string name="about">About</string>
<string name="app_name_long" translatable="false">Privacy Friendly Pausing Healthily</string>
<string name="app_name_long" translatable="false">Privacy Friendly Aktivpause to Go</string>
<string name="version_number" translatable="false">Version</string>
<string name="about_author">Authors: </string>
<string name="about_author_names" translatable="false">Christopher Beckmann, Eduardo Fontao</string>
<string name="about_author_contributors">%s and contributors.</string>
<string name="about_affiliation">In affiliation with</string>
<string name="more_info">More Information can be found on:</string>
<string name="github" translatable="false"><a href="https://github.com/SecUSo/privacy-friendly-pausing-healthily">Github-Repo</a></string>
<string name="github" translatable="false"><a href="https://github.com/SecUSo/Aktivpause">Github-Repo</a></string>
<string name="url" translatable="false"><a href="https://www.secuso.org/pfa">SECUSO-Website</a></string>
<string name="privacy_friendly">This application belongs to the group of Privacy Friendly Apps developed by the Karlsruhe Institute of Technology (KIT). Sourcecode licensed under GPLv3. Images copyright KIT and Google Inc.</string>

Expand Down Expand Up @@ -135,8 +135,8 @@
<string name="no">No</string>
<string name="keep_editing">keep editing</string>
<string name="discard">discard</string>
<string name="about_graphics_by">Graphics &amp; images:</string>
<string name="about_graphics_names" translatable="false">Tatjana Albrandt</string>
<string name="about_graphics_by">Graphics &amp; Descriptions:</string>
<string name="about_graphics_names" translatable="false"><a href="https://kitsc.de">KIT Sport Club 2010 e.V.</a></string>


<!-- default set names -->
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down

0 comments on commit bf1a2e2

Please sign in to comment.