-
Notifications
You must be signed in to change notification settings - Fork 9
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
20 changed files
with
294 additions
and
53 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
40 changes: 40 additions & 0 deletions
40
src/androidTest/java/de/avalax/fitbuddy/runner/BottomNavigationMatcher.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,40 @@ | ||
package de.avalax.fitbuddy.runner; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.support.design.internal.BottomNavigationItemView; | ||
import android.support.test.espresso.matcher.BoundedMatcher; | ||
import android.view.View; | ||
|
||
import org.hamcrest.Description; | ||
import org.hamcrest.Matcher; | ||
|
||
public class BottomNavigationMatcher { | ||
public static Matcher<View> bottomNavItemIsChecked() { | ||
return withBottomNavItemCheckedStatus(true); | ||
} | ||
|
||
public static Matcher<View> bottomNavItemIsNotChecked() { | ||
return withBottomNavItemCheckedStatus(false); | ||
} | ||
|
||
private static Matcher<View> withBottomNavItemCheckedStatus(final boolean isChecked) { | ||
return new BoundedMatcher<View, BottomNavigationItemView>(BottomNavigationItemView.class) { | ||
boolean triedMatching; | ||
|
||
@Override | ||
public void describeTo(Description description) { | ||
if (triedMatching) { | ||
description.appendText("with BottomNavigationItem check status: " + String.valueOf(isChecked)); | ||
description.appendText("But was: " + String.valueOf(!isChecked)); | ||
} | ||
} | ||
|
||
@SuppressLint("RestrictedApi") | ||
@Override | ||
protected boolean matchesSafely(BottomNavigationItemView item) { | ||
triedMatching = true; | ||
return item.getItemData().isChecked() == isChecked; | ||
} | ||
}; | ||
} | ||
} |
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
21 changes: 13 additions & 8 deletions
21
src/main/java/de/avalax/fitbuddy/presentation/MainActivity.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 |
---|---|---|
@@ -1,23 +1,28 @@ | ||
package de.avalax.fitbuddy.presentation; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.support.v4.app.FragmentActivity; | ||
import android.view.View; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.support.v7.widget.Toolbar; | ||
import android.view.Menu; | ||
|
||
import de.avalax.fitbuddy.R; | ||
import de.avalax.fitbuddy.presentation.workout.WorkoutActivity; | ||
|
||
public class MainActivity extends FragmentActivity { | ||
public class MainActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
Toolbar toolbar = findViewById(R.id.app_bar); | ||
setSupportActionBar(toolbar); | ||
} | ||
|
||
public void continueWorkout(View view) { | ||
Intent intent = new Intent(this, WorkoutActivity.class); | ||
startActivity(intent); | ||
// Menu icons are inflated just as they were with actionbar | ||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.menu_main, menu); | ||
return true; | ||
} | ||
} |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M4,6L2,6v14c0,1.1 0.9,2 2,2h14v-2L4,20L4,6zM20,2L8,2c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,12l-2.5,-1.5L15,12L15,4h5v8z"/> | ||
</vector> |
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,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FFFFFFFF" | ||
android:pathData="M11,17h2v-1h1c0.55,0 1,-0.45 1,-1v-3c0,-0.55 -0.45,-1 -1,-1h-3v-1h4L15,8h-2L13,7h-2v1h-1c-0.55,0 -1,0.45 -1,1v3c0,0.55 0.45,1 1,1h3v1L9,14v2h2v1zM20,4L4,4c-1.11,0 -1.99,0.89 -1.99,2L2,18c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,6c0,-1.11 -0.89,-2 -2,-2zM20,18L4,18L4,6h16v12z"/> | ||
</vector> |
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,17 @@ | ||
<vector android:height="24dp" android:viewportHeight="442.0" | ||
android:viewportWidth="459.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M111.4,44.9c-5.4,3.9 -7.1,6 -8.9,11 -1.3,3.8 -1.5,23.4 -1.5,164.1 0,177.4 -0.5,164.8 6.7,172.2 6.2,6.4 9.3,7 31.6,6.6l19.5,-0.3 4.4,-3c5,-3.6 8.4,-8.2 9.8,-13.6 0.7,-2.4 0.9,-58.4 0.8,-164.1l-0.3,-160.3 -2.8,-4.8c-1.6,-2.6 -4.7,-6.1 -6.9,-7.7l-4.1,-3 -22.2,0 -22.2,0 -3.9,2.9z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M293.8,45.3c-2.4,1.8 -5.4,5.3 -6.8,7.7l-2.5,4.5 -0.3,159.5c-0.2,118.5 0,160.9 0.8,164.9 1,4.3 2.2,6.3 6,10.2 2.9,2.9 6.3,5.2 8.6,5.8 2.2,0.6 12,1.1 21.9,1.1 20.2,0 23.2,-0.8 29.2,-7.1 6.7,-7.1 6.3,4.5 6.3,-171.9 0,-140.7 -0.2,-160.3 -1.5,-164.1 -1.8,-5 -3.5,-7.1 -8.9,-11l-3.9,-2.9 -22.3,0 -22.2,0 -4.4,3.3z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M38.3,85.1c-3.7,1.1 -9,6.1 -10.5,9.8 -0.6,1.7 -0.9,47.2 -1,125.3 0,137.2 -0.5,127.4 7.1,132.3 6.1,4 11.4,4.7 31.8,4.3 20,-0.4 22.3,-0.9 28.1,-6.2 5.5,-4.9 5.2,2.1 5.2,-130 0,-84.3 -0.3,-123.3 -1.1,-125.3 -1.5,-4 -4.8,-7.3 -9.4,-9.4 -3.5,-1.6 -6.6,-1.8 -25.5,-1.8 -11.8,0 -22.9,0.5 -24.7,1z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M371.5,84.7c-3.1,0.8 -9.4,6.2 -11.1,9.4 -1.3,2.5 -1.4,18.7 -1.4,126 0,136.2 -0.5,125.9 6.7,131.8 5,4.2 10.6,5.1 30.2,5.1 20.2,0 24.8,-1.1 30.6,-7l4,-4.1 0.5,-61.2c0.3,-33.7 0.3,-90.2 0,-125.7l-0.5,-64.5 -2.3,-3.1c-5,-6.6 -6.3,-6.9 -31.7,-7.1 -12.6,-0.1 -23.9,0.1 -25,0.4z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M175.6,192.6c-0.3,2.6 -0.6,16.5 -0.6,30.9 0,24.1 0.1,26.3 1.8,27.8 1.7,1.5 6.8,1.7 52.4,1.7 48.4,0 50.6,-0.1 52.2,-1.9 1.6,-1.7 1.7,-4.6 1.4,-31.3 -0.2,-16.1 -0.7,-29.9 -1.1,-30.6 -0.6,-0.9 -12.4,-1.2 -53.1,-1.2l-52.3,0 -0.7,4.6z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M6.7,199.8c-1.5,1.6 -1.7,4.5 -1.7,20.4 0,21.9 0,21.8 9.8,21.8 5.4,0 6.3,-0.3 8.1,-2.6 1.9,-2.5 2.1,-4 2.1,-19.6 0,-16.6 0,-16.9 -2.5,-19.3 -2,-2.1 -3.4,-2.5 -8.3,-2.5 -4.4,0 -6.3,0.5 -7.5,1.8z" android:strokeColor="#00000000"/> | ||
<path android:fillColor="#FFFFFF" | ||
android:pathData="M435.5,200.5c-2.5,2.4 -2.5,2.7 -2.5,19.3 0,15.6 0.2,17.1 2.1,19.6 1.8,2.3 2.7,2.6 8.3,2.6 9.6,0 9.6,0 9.6,-22.2 0,-21.8 0,-21.8 -9.4,-21.8 -4.7,0 -6.1,0.4 -8.1,2.5z" android:strokeColor="#00000000"/> | ||
</vector> |
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,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item | ||
android:state_enabled="true" | ||
android:color="@color/primary_background" /> | ||
<item | ||
android:state_enabled="false" | ||
android:color="@color/secondary_background" /> | ||
</selector> |
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 |
---|---|---|
@@ -1,14 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/fragment_container" | ||
android:orientation="vertical" | ||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".presentation.MainActivity"> | ||
android:layout_height="match_parent"> | ||
|
||
<fragment | ||
android:id="@+id/toolbar_fragment" | ||
android:name="de.avalax.fitbuddy.presentation.welcome_screen.WelcomeScreenFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" /> | ||
</LinearLayout> | ||
|
||
<android.support.design.widget.AppBarLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/app_bar" | ||
android:layout_width="match_parent" | ||
android:layout_height="?attr/actionBarSize" | ||
android:background="@color/primary_background" | ||
app:layout_collapseMode="pin" | ||
app:titleTextColor="@color/main_text" /> | ||
|
||
</android.support.design.widget.AppBarLayout> | ||
|
||
<android.support.design.widget.BottomNavigationView | ||
android:id="@+id/bottom_navigation" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom" | ||
android:background="@color/main_text" | ||
app:itemBackground="@color/main_text" | ||
app:itemIconTint="@drawable/navigation_colors" | ||
app:itemTextColor="@drawable/navigation_colors" | ||
app:menu="@menu/navigation_menu" /> | ||
</android.support.design.widget.CoordinatorLayout> |
Oops, something went wrong.