Skip to content

Commit

Permalink
Split side planks (#56)
Browse files Browse the repository at this point in the history
* Fix gradle error

This is the error which is fixed by this change:
Error:(47, 69) Cannot access 'getStartWorkoutButtonText':
it is private in 'HomeViewPresenter'

* Fix `unresolved reference` errors

* Split side planks into separate exercises

This allows users to track each side independently. Fixes #55.

* Add mirrored right side plank video for left side

* Keep original side plank exercise id

This prevents historical side plank data from being lost.
  • Loading branch information
annawoodard authored and mazurio committed Jan 7, 2017
1 parent 02903b5 commit e93141a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ class MainActivityTest : ActivityInstrumentationTestCase2<MainActivity>(MainActi
}

fun testExerciseSetup() {
onView(withId(R.id.toolbar_exercise_title))
onView(withId(R.id.title))
.check(matches(withText("Shoulder Rolls")))
onView(withId(R.id.toolbar_section_title))
.check(matches(withText("Dynamic Stretches")))
onView(withId(R.id.toolbar_exercise_description))
onView(withId(R.id.description))
.check(matches(withText("1x(5-10)")))

onView(withId(R.id.prev_exercise_button))
Expand All @@ -31,11 +29,9 @@ class MainActivityTest : ActivityInstrumentationTestCase2<MainActivity>(MainActi

onView(withId(R.id.next_exercise_button)).perform(click())

onView(withId(R.id.toolbar_exercise_title))
onView(withId(R.id.title))
.check(matches(withText("Scapular Shrugs")))
onView(withId(R.id.toolbar_section_title))
.check(matches(withText("Dynamic Stretches")))
onView(withId(R.id.toolbar_exercise_description))
onView(withId(R.id.description))
.check(matches(withText("1x(5-10)")))

onView(withId(R.id.prev_exercise_button))
Expand All @@ -49,11 +45,9 @@ class MainActivityTest : ActivityInstrumentationTestCase2<MainActivity>(MainActi
onView(withId(R.id.next_exercise_button)).perform(click())
onView(withId(R.id.next_exercise_button)).perform(click())

onView(withId(R.id.toolbar_exercise_title))
.check(matches(withText("Front and Side Leg Swings")))
onView(withId(R.id.toolbar_section_title))
.check(matches(withText("Dynamic Stretches")))
onView(withId(R.id.toolbar_exercise_description))
onView(withId(R.id.title))
.check(matches(withText("Front Leg Swings")))
onView(withId(R.id.description))
.check(matches(withText("1x(5-10)")))

onView(withId(R.id.prev_exercise_button))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class HomeViewPresenter : AbstractPresenter() {
view.setNumberOfWorkoutsLast30Days("$last30Days ${getNumberOfWorkoutsPostfix(last30Days)}")
}

private fun getStartWorkoutButtonText(repositoryRoutineForTodayExists: Boolean, isRoutineCompleted: Boolean): String {
public fun getStartWorkoutButtonText(repositoryRoutineForTodayExists: Boolean, isRoutineCompleted: Boolean): String {
if (repositoryRoutineForTodayExists) {
if (isRoutineCompleted) {
return "Review Workout"
Expand Down
Binary file not shown.
13 changes: 11 additions & 2 deletions app/src/main/res/raw/bodyweight_fitness_recommended_routine.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,20 @@
},
{
"exerciseId": "exercise8",
"title": "Side Plank (Both Sides)",
"title": "Left Side Plank",
"description": "1x(10-60s) hold",
"type": "exercise",
"youTubeId": "xIFWxQgFMiE",
"videoId": "bodyweight_fitness_side_plank",
"videoId": "bodyweight_fitness_left_side_plank",
"defaultSet": "timed"
},
{
"exerciseId": "f4f27acd-fd69-40f8-a459-a9f02c56ed03",
"title": "Right Side Plank",
"description": "1x(10-60s) hold",
"type": "exercise",
"youTubeId": "xIFWxQgFMiE",
"videoId": "bodyweight_fitness_right_side_plank",
"defaultSet": "timed"
},
{
Expand Down

0 comments on commit e93141a

Please sign in to comment.