Compare commits
134 Commits
directions
...
follow-rou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2c320dd14 | ||
|
|
ce264d78bc | ||
|
|
f8acc35c5b | ||
|
|
e5e0916555 | ||
|
|
c738deab23 | ||
|
|
223e77cdc8 | ||
|
|
7c9dc07c3d | ||
|
|
187f45b770 | ||
|
|
04487b77a7 | ||
|
|
d67d78b385 | ||
|
|
fb2f7e8a66 | ||
|
|
c412f36e6c | ||
|
|
2d9dfe9c0e | ||
|
|
b31ba7023e | ||
|
|
7ba87b71b0 | ||
|
|
edfc125427 | ||
|
|
6d3a092298 | ||
|
|
15608bed2b | ||
|
|
deb4bd5a19 | ||
|
|
05c8951f2c | ||
|
|
a27ebfc0c3 | ||
|
|
dabe3cfb99 | ||
|
|
f806015963 | ||
|
|
fcec6e1ecd | ||
|
|
7284b66c13 | ||
|
|
6266705c3e | ||
|
|
e90582b539 | ||
|
|
68f2855a66 | ||
|
|
d018b83490 | ||
|
|
1aee93cd0c | ||
|
|
216f48cc0f | ||
|
|
8a758f1d8d | ||
|
|
bd623a3f1d | ||
|
|
1760f510c6 | ||
|
|
ba9569b5a8 | ||
|
|
ca8d291262 | ||
|
|
98eeba4de1 | ||
|
|
f0ef9512a0 | ||
|
|
f0f87af42b | ||
|
|
192f1a4c64 | ||
|
|
391792a5e2 | ||
|
|
1cf973da9b | ||
|
|
21c479076d | ||
|
|
0ed16ee069 | ||
|
|
1f53890a4b | ||
|
|
09ced99654 | ||
|
|
86bc0f0c19 | ||
|
|
deb599db25 | ||
|
|
9be5ba27ab | ||
|
|
926a984c71 | ||
|
|
f5da1c8a83 | ||
|
|
525d4b776d | ||
|
|
0e63bff0f1 | ||
|
|
5e76ced998 | ||
|
|
da2a9e43bc | ||
|
|
3d1cfd244b | ||
|
|
40e3ca3d51 | ||
|
|
6dd2f5de40 | ||
|
|
f6af7ae80b | ||
|
|
d4cfa17fda | ||
|
|
abc58d3606 | ||
|
|
399652c2ce | ||
|
|
d9a6e1eff0 | ||
|
|
1877a693d0 | ||
|
|
80764591ad | ||
|
|
738a733b72 | ||
|
|
00d306631b | ||
|
|
20c09c3458 | ||
|
|
587380fd89 | ||
|
|
f7a2a79d00 | ||
|
|
faa79b5553 | ||
|
|
e71c195573 | ||
|
|
1834aec01b | ||
|
|
d4d452e723 | ||
|
|
f381a29274 | ||
|
|
062739ac7b | ||
|
|
360198e784 | ||
|
|
16bd30f785 | ||
|
|
fe5a5b6dfd | ||
|
|
7e0b888974 | ||
|
|
804bdddbef | ||
|
|
e1636c6bec | ||
|
|
77a6226c1d | ||
|
|
2e5f57aa23 | ||
|
|
c6b33f2663 | ||
|
|
ba83d69c9f | ||
|
|
08902472a3 | ||
|
|
fbf8cbe1c5 | ||
|
|
e36e853875 | ||
|
|
aae67f53ec | ||
|
|
356ee55375 | ||
|
|
bc8b83e4f6 | ||
|
|
65d2f31e3f | ||
|
|
40331f3135 | ||
|
|
f5f077db0f | ||
|
|
3b363b3f33 | ||
|
|
89902a5962 | ||
|
|
d53f63a6d7 | ||
|
|
a0d35caeb5 | ||
|
|
e8af38981f | ||
|
|
d3cab8c70d | ||
|
|
d63b150275 | ||
|
|
f236067706 | ||
|
|
a75b81033f | ||
|
|
bcd9eb6378 | ||
|
|
a12493972a | ||
|
|
678b179e04 | ||
|
|
1b770020ed | ||
|
|
29b3623ab5 | ||
|
|
da45a0a40e | ||
|
|
e761dd80e5 | ||
|
|
79e24621e2 | ||
|
|
1549fc7a59 | ||
|
|
edcfd2ff0a | ||
|
|
547d676a68 | ||
|
|
d96a54863c | ||
|
|
7b9ca656aa | ||
|
|
2118336815 | ||
|
|
36eb28ce07 | ||
|
|
eea66fd153 | ||
|
|
ff32eefab0 | ||
|
|
e2bccb6e76 | ||
|
|
c355f64d38 | ||
|
|
91c0435e55 | ||
|
|
9ca3b12d71 | ||
|
|
08d9543e3b | ||
|
|
70a9878b06 | ||
|
|
294814dea8 | ||
|
|
6b197c4742 | ||
|
|
a3d8bdfd77 | ||
|
|
6f10444126 | ||
|
|
1f7cd49a90 | ||
|
|
aba26f3211 | ||
|
|
6c923d27b2 |
@@ -53,6 +53,14 @@ dependencies {
|
|||||||
//osm bonus pack
|
//osm bonus pack
|
||||||
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
|
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
|
||||||
|
|
||||||
|
//BeforeEach
|
||||||
|
testImplementation(platform('org.junit:junit-bom:5.7.0'))
|
||||||
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||||
|
testImplementation 'org.mockito:mockito-core:2.7.22'
|
||||||
|
androidTestImplementation 'com.21buttons:fragment-test-rule:2.0.1'
|
||||||
|
androidTestImplementation 'androidx.test:rules:1.3.0-beta01'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0-alpha02'
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.espresso.Root;
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.espresso.matcher.RootMatchers;
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.CouponFragment;
|
||||||
|
import com.a1.nextlocation.fragments.LocationFragment;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.onView;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.click;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isChecked;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isClickable;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
||||||
|
|
||||||
|
public class CouponFragmentTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickBackButton() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the statisticsFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new CouponFragment()).commit();
|
||||||
|
onView(withId(R.id.coupon_back_button)).perform(click());
|
||||||
|
onView(withId(R.id.statisticsFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickDetailButton() throws Exception{
|
||||||
|
//Here we click a coupon and then a popup dialog shows, we press the "activeren" button in it and if the next dialog with the code and with
|
||||||
|
//the button "Klaar" is shown then the test works
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new CouponFragment()).commit();
|
||||||
|
onView(withId(R.id.coupon_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
|
||||||
|
onView(withText("activeren")).inRoot(RootMatchers.isDialog()).perform(click());
|
||||||
|
onView(withText("Klaar")).inRoot(RootMatchers.isDialog()).check(matches(isDisplayed()));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.CouponFragment;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.onView;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.click;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||||
|
|
||||||
|
public class LocationDetailFragment {
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickBackButton() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the locationFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new com.a1.nextlocation.fragments.LocationDetailFragment()).commit();
|
||||||
|
onView(withId(R.id.detail_location_back_button)).perform(click());
|
||||||
|
onView(withId(R.id.locationFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.LocationFragment;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.*;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.*;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.*;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.*;
|
||||||
|
|
||||||
|
|
||||||
|
public class LocationFragmentTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickBackButton() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the homeFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new LocationFragment()).commit();
|
||||||
|
onView(withId(R.id.location_back_button)).perform(click());
|
||||||
|
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickDetailButton() throws Exception{
|
||||||
|
//Here we click an item in the recyclerview and then check if the routeDetailFragment is called
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new LocationFragment()).commit();
|
||||||
|
onView(withId(R.id.location_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
|
||||||
|
onView(withId(R.id.locationDetailFragment)).check(matches(isDisplayed()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import android.app.LauncherActivity;
|
||||||
|
import android.widget.Button;
|
||||||
|
|
||||||
|
import androidx.test.espresso.contrib.NavigationViewActions;
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.espresso.matcher.RootMatchers;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.CouponFragment;
|
||||||
|
import com.google.android.material.bottomnavigation.BottomNavigationItemView;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.onView;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.click;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withText;
|
||||||
|
|
||||||
|
public class MainActivityTest {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickLocationsNavBar() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the statisticsFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
|
||||||
|
onView(withId(R.id.locations)).perform(click());
|
||||||
|
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickRouteNavBar() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the statisticsFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
|
||||||
|
onView(withId(R.id.routes)).perform((click()));
|
||||||
|
onView(withId(R.id.routeFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickStatisticsNavBar() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the statisticsFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
|
||||||
|
onView(withId(R.id.statistics)).perform(click());
|
||||||
|
onView(withId(R.id.statisticsFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickSettingNavBar() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the statisticsFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
|
||||||
|
onView(withId(R.id.settings)).perform(click());
|
||||||
|
onView(withId(R.id.settingFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.LocationFragment;
|
||||||
|
import com.a1.nextlocation.fragments.RouteFragment;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.onView;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.click;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||||
|
|
||||||
|
public class RouteFragmentTest {
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickBackButton() throws Exception{
|
||||||
|
//Here we click the back button and then we check if the homeFragment is shown
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new RouteFragment()).commit();
|
||||||
|
onView(withId(R.id.route_back_button)).perform(click());
|
||||||
|
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clickDetailButton() throws Exception{
|
||||||
|
//Here we click an item in the recyclerview and then check if the routeDetailFragment is called
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new RouteFragment()).commit();
|
||||||
|
onView(withId(R.id.route_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));
|
||||||
|
onView(withId(R.id.routeDetailFragment)).check(matches(isDisplayed()));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.espresso.action.ViewActions;
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.espresso.matcher.RootMatchers;
|
||||||
|
import androidx.test.espresso.matcher.ViewMatchers;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.LocationFragment;
|
||||||
|
import com.a1.nextlocation.fragments.SettingsFragment;
|
||||||
|
import com.a1.nextlocation.fragments.StatisticFragment;
|
||||||
|
|
||||||
|
import org.hamcrest.core.AllOf;
|
||||||
|
import org.hamcrest.core.Is;
|
||||||
|
import org.hamcrest.core.IsInstanceOf;
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.*;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.*;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.*;
|
||||||
|
import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.*;
|
||||||
|
import static org.hamcrest.Matchers.allOf;
|
||||||
|
import static org.hamcrest.Matchers.*;
|
||||||
|
import static org.hamcrest.Matchers.is;
|
||||||
|
|
||||||
|
public class SettingsFragmentTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
//Tests if the back button sends you back home
|
||||||
|
@Test
|
||||||
|
public void clickBackButton() throws Exception{
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
|
||||||
|
onView(withId(R.id.settings_back_button)).perform(click());
|
||||||
|
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Checks if the dropdown is clickable, and checks if it has children
|
||||||
|
@Test
|
||||||
|
public void dropdownTest(){
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
|
||||||
|
onView(withId(R.id.dropdown_menu_Settings)).check(matches(isClickable()));
|
||||||
|
onView(withId(R.id.dropdown_menu_Settings)).check(matches(hasMinimumChildCount(1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Tests if all buttons are clickable, and if they get checked after being clicked.
|
||||||
|
@Test
|
||||||
|
public void buttonTest(){
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
|
||||||
|
onView(withId(R.id.settingsImperialButton)).check(matches(isClickable()));
|
||||||
|
onView(withId(R.id.settingsOldButton)).check(matches(isClickable()));
|
||||||
|
onView(withId(R.id.settingsEyesButton)).check(matches(isClickable()));
|
||||||
|
|
||||||
|
onView(withId(R.id.settingsImperialButton)).perform(click());
|
||||||
|
onView(withId(R.id.settingsImperialButton)).check(matches(isChecked()));
|
||||||
|
|
||||||
|
onView(withId(R.id.settingsOldButton)).perform(click());
|
||||||
|
onView(withId(R.id.settingsOldButton)).check(matches(isChecked()));
|
||||||
|
|
||||||
|
onView(withId(R.id.settingsEyesButton)).perform(click());
|
||||||
|
onView(withId(R.id.settingsEyesButton)).check(matches(isChecked()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
|
import androidx.test.espresso.contrib.RecyclerViewActions;
|
||||||
|
import androidx.test.rule.ActivityTestRule;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.fragments.LocationFragment;
|
||||||
|
import com.a1.nextlocation.fragments.StatisticFragment;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static androidx.test.espresso.Espresso.*;
|
||||||
|
import static androidx.test.espresso.action.ViewActions.*;
|
||||||
|
import static androidx.test.espresso.assertion.ViewAssertions.*;
|
||||||
|
import static androidx.test.espresso.matcher.ViewMatchers.*;
|
||||||
|
|
||||||
|
public class StatisticFragmentTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||||
|
|
||||||
|
//Tests to see if all boxes get created
|
||||||
|
@Test
|
||||||
|
public void checkText() throws Exception{
|
||||||
|
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new StatisticFragment()).commit();
|
||||||
|
onView(withId(R.id.textView)).check(matches(isDisplayed()));
|
||||||
|
onView(withId(R.id.name_box)).check(matches(isDisplayed()));
|
||||||
|
onView(withId(R.id.Box2)).check(matches(isDisplayed()));
|
||||||
|
onView(withId(R.id.Box3)).check(matches(isDisplayed()));
|
||||||
|
onView(withId(R.id.Box4)).check(matches(isDisplayed()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,14 +6,17 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@drawable/next_location_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@drawable/next_location_icon"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.NextLocation">
|
android:theme="@style/Theme.NextLocation"
|
||||||
|
android:hardwareAccelerated="false">
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"code": "2345",
|
"code": "KROKET10",
|
||||||
"reward": "fdasfasdf"
|
"reward": "Gratis 2e kroket bij Kees Kroket™"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": "654",
|
||||||
|
"reward": ",juygly"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,135 +1,135 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name":"McDonald's Breda Karnemelkstraat",
|
"name":"McDonald's Breda Karnemelkstraat",
|
||||||
"coordinates":"51.58596318905295,4.77586651481887",
|
"coordinates":"51.586062613842245, 4.77579695141302",
|
||||||
"description":"McDonald's restaurant",
|
"description":"Wist je dat McDonald’s de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen. Wil je meer weten over McDonald’s? Lees verder op: https://www.mcdonalds.com/nl/nl-nl/over-ons.html!",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"mc_donalds"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||||
"coordinates":"51.58632782568612,4.775219531501114",
|
"coordinates":"51.58604142340411, 4.7751359436675545",
|
||||||
"description":"4811 KJ Breda",
|
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"subway"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Wok To Go Halstraat 40",
|
"name":"Wok To Go Halstraat 40",
|
||||||
"coordinates":"51.58650312572897,4.777467069592386",
|
"coordinates":"51.586464146477574, 4.777606887874218",
|
||||||
"description":"4811HX Breda",
|
"description":"Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken – met een kleine hoeveelheid olie – op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een ‘Wokki box’ voor een gezonde levensstijl.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"wok_to_go"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"De Boterhal Grote Markt 19",
|
"name":"De Boterhal Grote Markt 19",
|
||||||
"coordinates":"51.588069667604756,4.7762685632180695",
|
"coordinates":"51.58798747205394, 4.776265846483903",
|
||||||
"description":"4811XL Breda",
|
"description":"De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"de_boter_hal"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Gauchos Grote Markt 33",
|
"name":"Gauchos Grote Markt 33",
|
||||||
"coordinates":"51.58859328857082,4.77601349563689",
|
"coordinates":"51.588449106286255, 4.77604936398091",
|
||||||
"description":"4811XP Breda",
|
"description":"De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"gauchos"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||||
"coordinates":"51.58905632735254,4.780729463841719",
|
"coordinates":"51.588922458012384, 4.7804923888638",
|
||||||
"description":"4811GR Breda",
|
"description":"Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granola’s / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"the_tosti_club"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||||
"coordinates":"51.58741730235298,4.779832967540571",
|
"coordinates":"51.587223367256605, 4.779547820326475",
|
||||||
"description":"4811HS Breda",
|
"description":"Welkom bij Coffee & Lunch 4 you! Onze sfeervolle lunchroom is gelegen in het centrum van Breda, in de directe nabijheid van de parkeergarage en de fietsenstalling.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"coffee_and_lunch"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"t Zusje Breda Vismarktstraat 28",
|
"name":"t Zusje Breda Vismarktstraat 28",
|
||||||
"coordinates":"51.590133292554434,4.773911506170458",
|
"coordinates":"51.589820093624986, 4.773333478675191",
|
||||||
"description":"4811WE Breda",
|
"description":"Dat is een avond bij ’t Zusje. Gezellig samenzijn in een huiselijke sfeer en genieten van onze kleine gerechtjes, die je de hele avond kunt bestellen. Bij ‘t Zusje ben je thuis: jij bepaalt zelf de invulling van de avond.\nWe horen graag wat je wensen zijn, vinden het leuk je te verrassen met bijzondere gerechtjes en zetten graag die extra stap. We bieden je een avond uit, zoals wij die zelf ook graag zien. Avondvullend Bourgondisch genieten? In het prachtige pand van ons Zusje in Breda beleef je een gezellige avond met avondvullend tapas eten voor 31,80.\nBel snel en reserveer!",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"t_zusje_breda"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"VR-World Nassaustraat 2",
|
"name":"VR-World Nassaustraat 2",
|
||||||
"coordinates":"51.5913566342086,4.786256804321071",
|
"coordinates":"51.5915020518371, 4.786101713659277",
|
||||||
"description":"4811DD Breda",
|
"description":"Virtual Reality is hét uitje van dit moment. Zombies verslaan, vuurballen schieten of met laserzwaarden vechten, met Virtual Reality is niks te gek. Bij VR World zijn we elke dag opzoek naar de nieuwste experiences voor jullie.\n\nWat dacht je bijvoorbeeld van een Escape Room, maar dan in Virtual Reality? Bij VR World bieden wij de nieuwste Escapes aan op het gebied van Virtual Reality. Ontsnap bijvoorbeeld uit een Piramide of ontmantel een raket. Durf jij deze uitdaging aan?\n\nVR World is gelegen op een unieke locatie, namelijk de koepelgevangenis van Breda. Deze gevangenis was tot 2016 nog in werking en daarna hebben bedrijven er hun intrek genomen, zo ook VR World.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"vr_world"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Kees Kroket Houtmarkt 9",
|
"name":"Kees Kroket Houtmarkt 9",
|
||||||
"coordinates":"51.58647180329833,4.77741809637617",
|
"coordinates":"51.58628401688983, 4.776977039420005",
|
||||||
"description":"KEEEEES KROKET!",
|
"description":"KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk ‘Verantwoord Frituren’ gebruik mogen maken.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"kees_kroket"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Prison Escape Kloosterlaan 168",
|
"name":"Prison Escape Kloosterlaan 168",
|
||||||
"coordinates":"51.59073795635181,4.784917104321059",
|
"coordinates":"51.59062116889821, 4.784611234825872",
|
||||||
"description":"4811EE Breda",
|
"description":"Prison Escape duurt in het totaal 3 uur en je hebt als doel om te ontsnappen uit de zwaarbewaakte gevangenis. Een cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om een weg naar buiten te vinden. In de gevangenis zijn verschillende objecten verstopt die het wellicht makkelijker zouden kunnen maken om de weg naar buiten te realiseren.\n\nWees op je hoede, kijk goed om je heen, vertrouw (bijna) niemand en stap op mensen af..\nDe klok tikt en jij hebt 1 doel: de weg naar de vrijheid vinden.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"prison_escape_room"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||||
"coordinates":"51.590431588532105,4.786756741648511",
|
"coordinates":"51.59010624820322, 4.788301630342321",
|
||||||
"description":"4811HP Breda",
|
"description":"n groepen word je onder begeleiding van een van onze gidsen rondgeleid langs de meest unieke en mooiste monumentale plekken in en rondom de Koepel!\n\u200B\n\nDe gids zal hierbij op de verschillende locaties toelichting geven over het roemruchte verleden. De rondleiding over het gevangenisterrein brengt u onder andere langs de koepel, de authentieke kapel, vrouwengevangenis, verschillende luchtplaatsen en het oude gerechtsgebouw.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"de_koepel_future_events"
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
"coordinates":"51.59096347875923, 4.783722665161644",
|
||||||
"description":"4811GK Breda",
|
"description":"Escaping Breda is een nieuwe moderne locatie en heeft op dit moment 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar nog 2 extra escape rooms bij. \n\nOntsnap uit de spannende escape room Let’s Rob The Bank, een kamer geschikt voor volwassenen én kinderen. Ontsnap je liever uit een escape room met een hoger spannings- en spelniveau? Kies dan voor Patient X.\n\nOp onze locatie in Breda hebben we ook een gezellig boardgame café. Combineer je ontsnapping met een drankje, hapje en alle gratis boardgames.\n\nEscaping Breda is de perfecte plek voor een uitje met je familie, vrienden of collega’s.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"escaping_room"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"MEZZ Breda Keizerstraat 101",
|
"name":"MEZZ Breda Keizerstraat 101",
|
||||||
"coordinates":"51.58394697737321,4.779757901349616",
|
"coordinates":"51.58361639477683, 4.778550518987883",
|
||||||
"description":"4811HL Breda",
|
"description":"MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"mezz_breda"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||||
"coordinates":"51.58775443759389,4.765568874365066",
|
"coordinates":"51.587727575660196, 4.7649956643240525",
|
||||||
"description":"4811VN Breda",
|
"description":"In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda”. \nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"het_klooster_breda"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||||
"coordinates":"51.59212977605884,4.774043765582372",
|
"coordinates":"51.59138317151629, 4.771525073666575",
|
||||||
"description":"4811VC Breda",
|
"description":"Beach & Lounge Club Spider staat bekent om zijn immens populaire locatie in Bergen op Zoom. Sinds 2020 heeft deze hoog segment lounge club een tweede locatie geopend in Breda genaamd Beach & Lounge Club Spider Rooftop Bar.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"beach_and_lounge_club"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
"name":"Koningin Wilhelmina Paviljoen, Kraanstraat 4b, Breda",
|
||||||
"coordinates":"51.590645369292396,4.776045124415531",
|
"coordinates":"51.590380346954696, 4.775770191566508",
|
||||||
"description":"4811XV Breda",
|
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"koningin_wilhelimna_paviljoen"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Hercules en de Nemeïsche leeuw",
|
"name":"Hercules en de Nemeïsche leeuw",
|
||||||
"coordinates":"51.59130522182325,4.778161739135078",
|
"coordinates":"51.591204052421965, 4.777900596046037",
|
||||||
"description":"4811XJ Breda",
|
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"hercules_park_valkenburg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||||
"coordinates":"51.592530636759136,4.780278353833301",
|
"coordinates":"51.592530636759136,4.780278353833301",
|
||||||
"description":"4811AM Breda",
|
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"nassau_baroniemonument"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||||
"coordinates":"51.59569850758307,4.780295549958155",
|
"coordinates":"51.5924883160154, 4.779744240625213",
|
||||||
"description":"4815CA Breda",
|
"description":"Station Breda is het centrale spoorwegstation van de Nederlandse stad Breda. Het bevindt zich ten noorden van het centrum van de stad. Omliggende wijken zijn Stationskwartier en Drie Hoefijzers aan de zuidkant, en aan de noordzijde Belcrum, Doornbos-Linie en Havenkwartier.\n\nHet eerste station in Breda werd geopend op 1 mei 1855, toen de Spoorlijn Roosendaal - Breda werd geopend. Dit station werd in 1863 door een nieuw gebouw vervangen, toen de lijn naar Tilburg werd geopend. Omdat Breda toen nog een vesting was en het station onder de beperkingen van de Vestingwet viel, was het zodanig uitgevoerd dat het in tijden van oorlog snel gesloopt zou kunnen worden.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"station_breda"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"Belcrum Beach Veilingkade 12a",
|
"name":"Belcrum Beach Veilingkade 12a",
|
||||||
"coordinates":"51.599434239284726,4.76632797992092",
|
"coordinates":"51.59960126665085, 4.765433657156298",
|
||||||
"description":"4815HC Breda",
|
"description":"Belcrum Beach is HET stadsstrand van Breda, gelegen op het Haveneiland in de wijk Belcrum. Wij zijn begonnen in 2013 op deze unieke lokatie in Breda. Het strand werkt met drie beheerders en een groot aantal vrijwilligers voor bar, onderhoud, programmering, sponsoring en tuin. Een plek om te relaxen met een drankje en een hapje, genietend van de zon, gezellig kletsen met je vrienden, luisterend naar muziek van een band of DJ, soms in een festival setting. Kinderen die kunnen spelen in het zand of mee kunnen doen aan speciale kinderactiviteiten. Belcrum Beach is ook een unieke lokatie voor een feestje of om je verjaardag te vieren, trouwen op het strand of een trouwfeest behoren ook tot de mogelijkheden.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"belcrum_beach"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||||
"coordinates":"51.60135351009892,4.7705765989322755",
|
"coordinates":"51.60051284129074, 4.7689723624007",
|
||||||
"description":"4815CJ Breda",
|
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.",
|
||||||
"imageUrl":"NULL"
|
"imageUrl":"belcrum_watertoren"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -3,12 +3,74 @@
|
|||||||
"name": "rondje stad",
|
"name": "rondje stad",
|
||||||
"locations": [
|
"locations": [
|
||||||
{
|
{
|
||||||
"name": "kees kroket",
|
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||||
"coordinates": "2.4654645,6.2342323",
|
"coordinates":"51.59096518753322, 4.783727736123234",
|
||||||
"description": "lekkere patatjes"
|
"description":"4811GK Breda",
|
||||||
|
"imageUrl":"NULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Prison Escape Kloosterlaan 168",
|
||||||
|
"coordinates":"51.59058740778487, 4.784723144974098",
|
||||||
|
"description":"4811EE Breda",
|
||||||
|
"imageUrl":"NULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||||
|
"coordinates":"51.59025697138579, 4.787354025225596",
|
||||||
|
"description":"4811HP Breda",
|
||||||
|
"imageUrl":"NULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"MEZZ Breda Keizerstraat 101",
|
||||||
|
"coordinates":"51.5837840024532, 4.779037836841554",
|
||||||
|
"description":"4811HL Breda",
|
||||||
|
"imageUrl":"NULL"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||||
|
"coordinates":"51.58765659148822, 4.764801414019652",
|
||||||
|
"description":"4811VN Breda",
|
||||||
|
"imageUrl":"NULL"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"totalDistance": 2.3434,
|
"totalDistance": 1073.0,
|
||||||
|
"totalTime": 342342
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Obesi Route",
|
||||||
|
"locations": [
|
||||||
|
{
|
||||||
|
"name": "McDonald's Breda Karnemelkstraat",
|
||||||
|
"coordinates": "51.586062613842245, 4.777606887874218",
|
||||||
|
"description": "Wist je dat McDonald’s de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen. Wil je meer weten over McDonald’s? Lees verder op: https://www.mcdonalds.com/nl/nl-nl/over-ons.html!"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Kees Kroket Houtmarkt 9",
|
||||||
|
"coordinates": "51.58628401688983, 4.77579695141302",
|
||||||
|
"description": "lekkere patatjes"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Wok To Go Halstraat 40",
|
||||||
|
"coordinates": "51.586464146477574, 4.777606887874218",
|
||||||
|
"description": "Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken – met een kleine hoeveelheid olie – op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een ‘Wokki box’ voor een gezonde levensstijl."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "The Tosti Club Breda A4, Vlaszak 2",
|
||||||
|
"coordinates": "51.588922458012384, 4.7804923888638",
|
||||||
|
"description": "Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granola’s / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Gauchos Grote Markt 33",
|
||||||
|
"coordinates": "51.588449106286255, 4.77604936398091",
|
||||||
|
"description": "De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "De Boterhal Grote Markt 19",
|
||||||
|
"coordinates": "51.58798747205394, 4.776265846483903",
|
||||||
|
"description": "De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"totalDistance": 955.0,
|
||||||
"totalTime": 342342
|
"totalTime": 342342
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
BIN
app/src/main/icon-playstore.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
@@ -1,25 +1,29 @@
|
|||||||
package com.a1.nextlocation;
|
package com.a1.nextlocation;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
|
||||||
import com.a1.nextlocation.fragments.HomeFragment;
|
import com.a1.nextlocation.fragments.HomeFragment;
|
||||||
|
import com.a1.nextlocation.fragments.Refreshable;
|
||||||
import com.a1.nextlocation.fragments.RouteFragment;
|
import com.a1.nextlocation.fragments.RouteFragment;
|
||||||
import com.a1.nextlocation.fragments.SettingsFragment;
|
import com.a1.nextlocation.fragments.SettingsFragment;
|
||||||
import com.a1.nextlocation.fragments.StatisticFragment;
|
import com.a1.nextlocation.fragments.StatisticFragment;
|
||||||
import com.a1.nextlocation.network.ApiHandler;
|
|
||||||
import com.a1.nextlocation.recyclerview.CouponListManager;
|
import com.a1.nextlocation.recyclerview.CouponListManager;
|
||||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||||
import com.a1.nextlocation.recyclerview.RouteListManager;
|
import com.a1.nextlocation.recyclerview.RouteListManager;
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity {
|
import java.util.Locale;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||||
|
private static final String TAG = MainActivity.class.getName();
|
||||||
|
private BottomNavigationView bottomNav;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* onCreate method that creates the main activity
|
* onCreate method that creates the main activity
|
||||||
* @param savedInstanceState the saved instance state of the app
|
* @param savedInstanceState the saved instance state of the app
|
||||||
@@ -27,11 +31,19 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
|
||||||
|
|
||||||
BottomNavigationView bottomNav = findViewById(R.id.navbar);
|
// initialize saved language from sharedPreferences
|
||||||
|
setLocale(loadLocale());
|
||||||
|
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
bottomNav = findViewById(R.id.navigation_bar);
|
||||||
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
||||||
|
|
||||||
|
/*System.out.println(Arrays.toString(getFilesDir().listFiles()));
|
||||||
|
FileIO<Route> fileIO = new FileIO<>();
|
||||||
|
fileIO.writeFileData(new Route("TERSTSET"), getApplicationContext());
|
||||||
|
Log.d(TAG, "onCreate: " + "FILE GESCHREVENN!!!!!");*/
|
||||||
|
|
||||||
LocationListManager.INSTANCE.setContext(this);
|
LocationListManager.INSTANCE.setContext(this);
|
||||||
LocationListManager.INSTANCE.load();
|
LocationListManager.INSTANCE.load();
|
||||||
CouponListManager.INSTANCE.setContext(this);
|
CouponListManager.INSTANCE.setContext(this);
|
||||||
@@ -39,8 +51,31 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
RouteListManager.INSTANCE.setContext(this);
|
RouteListManager.INSTANCE.setContext(this);
|
||||||
RouteListManager.INSTANCE.load();
|
RouteListManager.INSTANCE.load();
|
||||||
|
|
||||||
|
if (savedInstanceState == null) {
|
||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* loads the saved language from SharedPreferences
|
||||||
|
* @return the language as string
|
||||||
|
*/
|
||||||
|
private String loadLocale(){
|
||||||
|
SharedPreferences sharedPreferences = getSharedPreferences("Settings", Activity.MODE_PRIVATE);
|
||||||
|
return sharedPreferences.getString("Language", "nl");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sets the language of the application to the desired one
|
||||||
|
* @param language the desired language
|
||||||
|
*/
|
||||||
|
private void setLocale(String language){
|
||||||
|
Locale locale = new Locale(language);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
Configuration configuration = new Configuration();
|
||||||
|
configuration.setLocale(locale);
|
||||||
|
getBaseContext().getResources().updateConfiguration(configuration, getBaseContext().getResources().getDisplayMetrics());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private BottomNavigationView.OnNavigationItemSelectedListener navListener = item -> {
|
private BottomNavigationView.OnNavigationItemSelectedListener navListener = item -> {
|
||||||
@@ -64,4 +99,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit();
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* refreshes bottom navigation
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void refresh() {
|
||||||
|
bottomNav.getMenu().clear();
|
||||||
|
bottomNav.inflateMenu(R.menu.navmenu);
|
||||||
|
bottomNav.setSelectedItemId(R.id.settings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,17 +2,26 @@ package com.a1.nextlocation.data;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
|
import android.os.Environment;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.io.Reader;
|
import java.io.Reader;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
@@ -50,7 +59,45 @@ public class FileIO<T> {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeFileData(T objectToWrite) {
|
// public void writeFileData(T objectToWrite, Context context) {
|
||||||
//TODO make
|
// //TODO make
|
||||||
}
|
// //object naar jsonobject
|
||||||
|
// //jsonarray toevoegen/maken
|
||||||
|
// //filewriter naar file
|
||||||
|
//
|
||||||
|
// String filename = "";
|
||||||
|
// if (objectToWrite instanceof Coupon){
|
||||||
|
// filename = "coupons.json";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (objectToWrite instanceof Route){
|
||||||
|
// filename = "routes.json";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (objectToWrite instanceof Location){
|
||||||
|
// filename = "locations.json";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// try (FileOutputStream fileOutputStream = context.openFileOutput(filename, Context.MODE_PRIVATE)){
|
||||||
|
// String json = new Gson().toJson(objectToWrite);
|
||||||
|
//
|
||||||
|
// fileOutputStream.write(json.getBytes(StandardCharsets.UTF_8));
|
||||||
|
//
|
||||||
|
// } catch (FileNotFoundException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /*try (FileWriter fileWriter = new FileWriter(filename)){
|
||||||
|
//
|
||||||
|
// String json = new Gson().toJson(objectToWrite);
|
||||||
|
//
|
||||||
|
// fileWriter.append(json);
|
||||||
|
// fileWriter.flush();
|
||||||
|
//
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }*/
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.a1.nextlocation.data;
|
package com.a1.nextlocation.data;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.osmdroid.util.GeoPoint;
|
import org.osmdroid.util.GeoPoint;
|
||||||
|
|
||||||
public class Location {
|
public class Location implements Parcelable {
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String name;
|
private String name;
|
||||||
@@ -32,6 +35,29 @@ public class Location {
|
|||||||
this(name,getStringFromCoordinates(latCoord,longCoord),description,imageUrl);
|
this(name,getStringFromCoordinates(latCoord,longCoord),description,imageUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location(String name, android.location.Location loc, String description, String imageUrl) {
|
||||||
|
this(name,getStringFromCoordinates(loc.getLatitude(),loc.getLongitude()),description,imageUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Location(Parcel in) {
|
||||||
|
name = in.readString();
|
||||||
|
coordinates = in.readString();
|
||||||
|
description = in.readString();
|
||||||
|
imageUrl = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<Location> CREATOR = new Creator<Location>() {
|
||||||
|
@Override
|
||||||
|
public Location createFromParcel(Parcel in) {
|
||||||
|
return new Location(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Location[] newArray(int size) {
|
||||||
|
return new Location[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
@@ -68,8 +94,8 @@ public class Location {
|
|||||||
|
|
||||||
public double[] getCoordinatesAsDoubles() {
|
public double[] getCoordinatesAsDoubles() {
|
||||||
double[] res = new double[2];
|
double[] res = new double[2];
|
||||||
res[0] = getLat();
|
res[1] = getLat();
|
||||||
res[1] = getLong();
|
res[0] = getLong();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -83,11 +109,60 @@ public class Location {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getStringFromCoordinates(double lat1, double long1) {
|
public static String getStringFromCoordinates(double lat1, double long1) {
|
||||||
return lat1 + "," + long1;
|
return long1 + "," + lat1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* calculates the distance between two coordinates
|
||||||
|
* @param lat1 the first latitude
|
||||||
|
* @param lon1 the first longitude
|
||||||
|
* @param lat2 the second latitude
|
||||||
|
* @param lon2 the second longitude
|
||||||
|
* @return the distance between the coordinates in meters
|
||||||
|
*/
|
||||||
|
public static double getDistance(double lat1, double lon1, double lat2, double lon2) {
|
||||||
|
lat1 = Math.toRadians(lat1);
|
||||||
|
lat2 = Math.toRadians(lat2);
|
||||||
|
lon1 = Math.toRadians(lon1);
|
||||||
|
lon2 = Math.toRadians(lon2);
|
||||||
|
|
||||||
|
double dlon = lon2 - lon1;
|
||||||
|
double dlat = lat2 - lat1;
|
||||||
|
double a = Math.pow(Math.sin(dlat / 2), 2)
|
||||||
|
+ Math.cos(lat1) * Math.cos(lat2)
|
||||||
|
* Math.pow(Math.sin(dlon / 2),2);
|
||||||
|
|
||||||
|
double c = 2 * Math.asin(Math.sqrt(a));
|
||||||
|
|
||||||
|
// Radius of earth in kilometers. Use 3956
|
||||||
|
// for miles
|
||||||
|
// if(miles) {
|
||||||
|
// double r = 3956;
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
double r = 6371;
|
||||||
|
// }
|
||||||
|
// calculate the result
|
||||||
|
double distance = c * r;
|
||||||
|
|
||||||
|
distance *= 1000;
|
||||||
|
return Math.floor(distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeoPoint convertToGeoPoint() {
|
public GeoPoint convertToGeoPoint() {
|
||||||
return new GeoPoint(this.getLat(),this.getLong());
|
return new GeoPoint(this.getLat(),this.getLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel parcel, int i) {
|
||||||
|
parcel.writeString(name);
|
||||||
|
parcel.writeString(coordinates);
|
||||||
|
parcel.writeString(description);
|
||||||
|
parcel.writeString(imageUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.a1.nextlocation.data;
|
package com.a1.nextlocation.data;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -7,28 +10,40 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Route {
|
public class Route implements Parcelable {
|
||||||
|
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
private String name;
|
private String name;
|
||||||
|
private String description;
|
||||||
|
|
||||||
private List<Location> locations;
|
private List<Location> locations;
|
||||||
|
|
||||||
|
|
||||||
private float totalDistance;
|
private float totalDistance;
|
||||||
|
|
||||||
|
|
||||||
private int totalTime;
|
private int totalTime;
|
||||||
|
|
||||||
public Route(@NotNull String name) {
|
public Route(@NotNull String name) {
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.locations = new ArrayList<>();
|
this.locations = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected Route(Parcel in) {
|
||||||
|
this.name = in.readString();
|
||||||
|
this.locations = in.createTypedArrayList(Location.CREATOR);
|
||||||
|
this.totalDistance = in.readFloat();
|
||||||
|
this.totalTime = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<Route> CREATOR = new Creator<Route>() {
|
||||||
|
@Override
|
||||||
|
public Route createFromParcel(Parcel in) {
|
||||||
|
return new Route(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Route[] newArray(int size) {
|
||||||
|
return new Route[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
public void addLocation(Location location) {
|
public void addLocation(Location location) {
|
||||||
this.locations.add(location);
|
this.locations.add(location);
|
||||||
}
|
}
|
||||||
@@ -51,7 +66,6 @@ public class Route {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float getTotalDistance() {
|
public float getTotalDistance() {
|
||||||
//TODO calculate total distance according to all locations in list
|
|
||||||
return totalDistance;
|
return totalDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,4 +83,24 @@ public class Route {
|
|||||||
this.totalTime = totalTime;
|
this.totalTime = totalTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel parcel, int i) {
|
||||||
|
parcel.writeString(name);
|
||||||
|
parcel.writeTypedList(locations);
|
||||||
|
parcel.writeFloat(totalDistance);
|
||||||
|
parcel.writeInt(totalTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
80
app/src/main/java/com/a1/nextlocation/data/RouteHandler.java
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
package com.a1.nextlocation.data;
|
||||||
|
|
||||||
|
import org.osmdroid.views.overlay.Polyline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* singleton to track the current route that is being followed
|
||||||
|
*/
|
||||||
|
public enum RouteHandler {
|
||||||
|
INSTANCE;
|
||||||
|
|
||||||
|
private boolean isFollowingRoute = false;
|
||||||
|
private Route currentRoute;
|
||||||
|
private int stepCount = 0;
|
||||||
|
private RouteFinishedListener routeFinishedListener;
|
||||||
|
private long startedTime;
|
||||||
|
|
||||||
|
private Polyline currentRouteLine;
|
||||||
|
|
||||||
|
public void setCurrentRouteLine(Polyline currentRouteLine) {
|
||||||
|
this.currentRouteLine = currentRouteLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Polyline getCurrentRouteLine() {
|
||||||
|
return currentRouteLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRouteFinishedListener(RouteFinishedListener routeFinishedListener) {
|
||||||
|
this.routeFinishedListener = routeFinishedListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RouteFinishedListener getRouteFinishedListener() {
|
||||||
|
return routeFinishedListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStepCount() {
|
||||||
|
return stepCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addStep() {
|
||||||
|
stepCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void finishRoute() {
|
||||||
|
stepCount = 0;
|
||||||
|
isFollowingRoute = false;
|
||||||
|
currentRoute = null;
|
||||||
|
currentRouteLine = null;
|
||||||
|
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
|
||||||
|
startedTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void followRoute(Route route) {
|
||||||
|
if (isFollowingRoute) {
|
||||||
|
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
|
||||||
|
}
|
||||||
|
this.currentRoute = route;
|
||||||
|
setFollowingRoute(true);
|
||||||
|
startedTime = System.currentTimeMillis();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFollowingRoute(Route route) {
|
||||||
|
return isFollowingRoute && route.equals(currentRoute);
|
||||||
|
}
|
||||||
|
public void setFollowingRoute(boolean followingRoute) {
|
||||||
|
isFollowingRoute = followingRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isFollowingRoute() {
|
||||||
|
return isFollowingRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Route getCurrentRoute() {
|
||||||
|
return currentRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
|
public interface RouteFinishedListener {
|
||||||
|
void onRouteFinish();
|
||||||
|
}
|
||||||
|
}
|
||||||
55
app/src/main/java/com/a1/nextlocation/data/StaticData.java
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
package com.a1.nextlocation.data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* singleton to keep track of different global data
|
||||||
|
*/
|
||||||
|
public enum StaticData {
|
||||||
|
INSTANCE;
|
||||||
|
private double distanceTraveled = 0;
|
||||||
|
private int locationsVisited = 0;
|
||||||
|
private long timeWalked = 0;
|
||||||
|
private double zoom = 0;
|
||||||
|
|
||||||
|
public double getZoom() {
|
||||||
|
return zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setZoom(double zoom) {
|
||||||
|
this.zoom = zoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<String> visitedNames = new ArrayList<>();
|
||||||
|
|
||||||
|
public void addDistance(double d) {
|
||||||
|
distanceTraveled += d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getTimeWalked() {
|
||||||
|
return timeWalked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addTimeWalked(long time) {
|
||||||
|
timeWalked += time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public double getDistanceTraveled() {
|
||||||
|
return distanceTraveled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void visitLocation(Location location) {
|
||||||
|
if (!visitedNames.contains(location.getName())) {
|
||||||
|
locationsVisited++;
|
||||||
|
visitedNames.add(location.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLocationsVisited() {
|
||||||
|
return locationsVisited;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,26 +1,80 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Coupon;
|
||||||
|
import com.a1.nextlocation.recyclerview.CouponAdapter;
|
||||||
|
import com.a1.nextlocation.recyclerview.CouponListManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CouponFragment extends Fragment {
|
public class CouponFragment extends Fragment {
|
||||||
|
|
||||||
|
private RecyclerView couponRecyclerView;
|
||||||
|
private RecyclerView.LayoutManager layoutManager;
|
||||||
|
private List<Coupon> couponList;
|
||||||
|
private CouponAdapter couponAdapter;
|
||||||
|
private ImageButton imageButton;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
View view = inflater.inflate(R.layout.fragment_coupon, container, false);
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_coupon, container, false);
|
this.couponRecyclerView = view.findViewById(R.id.coupon_recyclerview);
|
||||||
|
this.couponRecyclerView.setHasFixedSize(true);
|
||||||
|
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||||
|
|
||||||
|
CouponListManager.INSTANCE.setContext(this.getContext());
|
||||||
|
CouponListManager.INSTANCE.load();
|
||||||
|
this.couponList = CouponListManager.INSTANCE.getCouponList();
|
||||||
|
|
||||||
|
this.couponAdapter = new CouponAdapter(this.getContext(), this.couponList, clickedPosition -> showPopup(this.couponList.get(clickedPosition)));
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.coupon_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
StatisticFragment statisticFragment = new StatisticFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.couponRecyclerView.setLayoutManager(this.layoutManager);
|
||||||
|
this.couponRecyclerView.setAdapter(this.couponAdapter);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showPopup(Coupon coupon) {
|
||||||
|
AlertDialog.Builder activateBuilder = new AlertDialog.Builder(getContext());
|
||||||
|
AlertDialog.Builder couponCodeBuilder = new AlertDialog.Builder(getContext());
|
||||||
|
activateBuilder.setMessage(getResources().getString(R.string.activate_question));
|
||||||
|
activateBuilder.setCancelable(true);
|
||||||
|
activateBuilder.setPositiveButton(R.string.activate, (dialog, which) -> {
|
||||||
|
dialog.cancel();
|
||||||
|
couponCodeBuilder.setMessage("Code: " + coupon.getCode());
|
||||||
|
couponCodeBuilder.setPositiveButton(R.string.done, (dialog1, which1) -> {
|
||||||
|
dialog.cancel();
|
||||||
|
});
|
||||||
|
AlertDialog couponCodePopup = couponCodeBuilder.create();
|
||||||
|
couponCodePopup.show();
|
||||||
|
});
|
||||||
|
activateBuilder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.cancel());
|
||||||
|
AlertDialog couponPopup = activateBuilder.create();
|
||||||
|
couponPopup.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,51 +1,70 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
import com.a1.nextlocation.data.Route;
|
import com.a1.nextlocation.data.RouteHandler;
|
||||||
import com.a1.nextlocation.recyclerview.CouponListManager;
|
import com.a1.nextlocation.data.StaticData;
|
||||||
import com.a1.nextlocation.recyclerview.CustomOverlay;
|
import com.a1.nextlocation.json.DirectionsResult;
|
||||||
|
import com.a1.nextlocation.network.ApiHandler;
|
||||||
|
import com.a1.nextlocation.network.DirectionsListener;
|
||||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||||
import com.a1.nextlocation.recyclerview.RouteListManager;
|
|
||||||
|
|
||||||
import org.osmdroid.api.IMapController;
|
import org.osmdroid.api.IMapController;
|
||||||
import org.osmdroid.config.Configuration;
|
import org.osmdroid.config.Configuration;
|
||||||
import org.osmdroid.util.GeoPoint;
|
import org.osmdroid.util.GeoPoint;
|
||||||
|
import org.osmdroid.views.CustomZoomButtonsController;
|
||||||
import org.osmdroid.views.MapView;
|
import org.osmdroid.views.MapView;
|
||||||
|
import org.osmdroid.views.overlay.ItemizedIconOverlay;
|
||||||
import org.osmdroid.views.overlay.Overlay;
|
import org.osmdroid.views.overlay.Overlay;
|
||||||
import org.osmdroid.views.overlay.OverlayItem;
|
import org.osmdroid.views.overlay.OverlayItem;
|
||||||
|
import org.osmdroid.views.overlay.Polyline;
|
||||||
import org.osmdroid.views.overlay.compass.CompassOverlay;
|
import org.osmdroid.views.overlay.compass.CompassOverlay;
|
||||||
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider;
|
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider;
|
||||||
import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider;
|
import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider;
|
||||||
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay;
|
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment implements LocationListener {
|
||||||
private final String userAgent = "com.ai.nextlocation.fragments";
|
private final String userAgent = "com.ai.nextlocation.fragments";
|
||||||
|
|
||||||
|
private ImageButton imageButton;
|
||||||
|
private ImageButton stopButton;
|
||||||
private MapView mapView;
|
private MapView mapView;
|
||||||
|
|
||||||
private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
|
private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
|
||||||
private final String TAG = HomeFragment.class.getCanonicalName();
|
private final String TAG = HomeFragment.class.getCanonicalName();
|
||||||
|
|
||||||
|
private Polyline roadOverlay;
|
||||||
|
private int color;
|
||||||
|
private Location currentLocation;
|
||||||
|
private Overlay allLocationsOverlay;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -55,14 +74,70 @@ public class HomeFragment extends Fragment {
|
|||||||
// WRITE_EXTERNAL_STORAGE is required in order to show the map
|
// WRITE_EXTERNAL_STORAGE is required in order to show the map
|
||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
|
|
||||||
|
color = requireContext().getColor(R.color.red);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_home, container, false);
|
|
||||||
|
|
||||||
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
|
||||||
|
// set up the location list button
|
||||||
|
this.imageButton = view.findViewById(R.id.location_list_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
LocationFragment locationFragment = new LocationFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
// set up the route stop button
|
||||||
|
stopButton = view.findViewById(R.id.home_stop_route_button);
|
||||||
|
stopButton.setOnClickListener(v -> {
|
||||||
|
stopRoute();
|
||||||
|
});
|
||||||
|
|
||||||
|
// show or hide the stop route button based on if we are following a route
|
||||||
|
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||||
|
stopButton.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
stopButton.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//register as a listener for a result of the API
|
||||||
|
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stops the current route
|
||||||
|
*/
|
||||||
|
private void stopRoute() {
|
||||||
|
Log.d(TAG, "stopRoute: STOPPING ROUTE" );
|
||||||
|
RouteHandler.INSTANCE.finishRoute();
|
||||||
|
stopButton.setVisibility(View.GONE);
|
||||||
|
Toast.makeText(requireContext(), getResources().getString(R.string.route_stop_toast), Toast.LENGTH_SHORT).show();
|
||||||
|
mapView.getOverlays().remove(roadOverlay);
|
||||||
|
mapView.getOverlays().remove(allLocationsOverlay);
|
||||||
|
addLocations();
|
||||||
|
mapView.invalidate();
|
||||||
|
roadOverlay = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* callback method that gets called when there are new directions available in the form of a {@link DirectionsResult} object.
|
||||||
|
*
|
||||||
|
* @param directionsResult the directions received from the api
|
||||||
|
*/
|
||||||
|
private void onDirectionsAvailable(DirectionsResult directionsResult) {
|
||||||
|
Log.d(TAG, "onDirectionsAvailable: got result! " + directionsResult);
|
||||||
|
ArrayList<GeoPoint> geoPoints = directionsResult.getGeoPoints();
|
||||||
|
roadOverlay = new Polyline();
|
||||||
|
roadOverlay.setPoints(geoPoints);
|
||||||
|
roadOverlay.setColor(color);
|
||||||
|
|
||||||
|
// pass the line to the route handler
|
||||||
|
RouteHandler.INSTANCE.setCurrentRouteLine(roadOverlay);
|
||||||
|
Log.d(TAG, "onDirectionsAvailable: successfully added road!");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,12 +148,17 @@ public class HomeFragment extends Fragment {
|
|||||||
initMap(view);
|
initMap(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method initializes the map and all the things it needs
|
||||||
|
*
|
||||||
|
* @param view the view the map is on
|
||||||
|
*/
|
||||||
private void initMap(@NonNull View view) {
|
private void initMap(@NonNull View view) {
|
||||||
// set the user agent
|
// set the user agent
|
||||||
Configuration.getInstance().setUserAgentValue(userAgent);
|
Configuration.getInstance().setUserAgentValue(userAgent);
|
||||||
|
|
||||||
// create the map view
|
// create the map view
|
||||||
mapView = view.findViewById(R.id.mapView);
|
mapView = view.findViewById(R.id.map_view);
|
||||||
mapView.setDestroyMode(false);
|
mapView.setDestroyMode(false);
|
||||||
mapView.setTag("mapView");
|
mapView.setTag("mapView");
|
||||||
mapView.setMultiTouchControls(true);
|
mapView.setMultiTouchControls(true);
|
||||||
@@ -91,37 +171,39 @@ public class HomeFragment extends Fragment {
|
|||||||
compassOverlay.enableCompass();
|
compassOverlay.enableCompass();
|
||||||
mapView.getOverlays().add(compassOverlay);
|
mapView.getOverlays().add(compassOverlay);
|
||||||
|
|
||||||
|
addLocations();
|
||||||
|
|
||||||
// add the location overlay
|
// add the location overlay
|
||||||
MyLocationNewOverlay mLocationOverlay = new MyLocationNewOverlay(gpsMyLocationProvider, mapView);
|
MyLocationNewOverlay mLocationOverlay = new MyLocationNewOverlay(gpsMyLocationProvider, mapView);
|
||||||
mLocationOverlay.enableFollowLocation();
|
mLocationOverlay.enableFollowLocation();
|
||||||
mLocationOverlay.enableMyLocation();
|
mLocationOverlay.enableMyLocation();
|
||||||
mapView.getOverlays().add(mLocationOverlay);
|
mapView.getOverlays().add(mLocationOverlay);
|
||||||
|
|
||||||
CustomOverlay customOverlay = new CustomOverlay(getResources().getDrawable(R.drawable.ic_baseline_location_on_24),mapView);
|
|
||||||
|
|
||||||
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
|
|
||||||
GeoPoint p = new GeoPoint(l.getLat(), l.getLong());
|
|
||||||
OverlayItem overlayItem = new OverlayItem(l.getName(),l.getDescription(), p);
|
|
||||||
|
|
||||||
customOverlay.addOverlayItem(overlayItem);
|
|
||||||
Log.d(TAG, "initMap: " + "succes");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
mapView.getOverlays().add(customOverlay);
|
|
||||||
|
|
||||||
// add the zoom controller
|
// add the zoom controller
|
||||||
IMapController mapController = mapView.getController();
|
IMapController mapController = mapView.getController();
|
||||||
mapController.setZoom(15.0);
|
if (StaticData.INSTANCE.getZoom() == 0) {
|
||||||
|
StaticData.INSTANCE.setZoom(15.0);
|
||||||
|
}
|
||||||
|
mapController.setZoom(StaticData.INSTANCE.getZoom());
|
||||||
|
|
||||||
// add location manager and set the start point
|
// add location manager and set the start point
|
||||||
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// request location updates for the distance checking
|
||||||
|
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
|
||||||
|
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
|
||||||
|
|
||||||
|
// get the current location and set it as center
|
||||||
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
||||||
GeoPoint startPoint = new GeoPoint(location.getLatitude(), location.getLongitude());
|
if (currentLocation == null) currentLocation = location;
|
||||||
mapController.setCenter(startPoint);
|
|
||||||
|
if (location != null) {
|
||||||
|
GeoPoint start = new GeoPoint(location.getLatitude(), location.getLongitude());
|
||||||
|
mapController.setCenter(start);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
Log.d(TAG, "onViewCreated: exception while getting location: " + e.getLocalizedMessage());
|
Log.d(TAG, "onViewCreated: exception while getting location: " + e.getLocalizedMessage());
|
||||||
@@ -134,7 +216,100 @@ public class HomeFragment extends Fragment {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
displayRoute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* displays the route that is currently being followed as a red line
|
||||||
|
*/
|
||||||
|
private void displayRoute() {
|
||||||
|
|
||||||
|
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||||
|
Log.d(TAG, "displayRoute: WE ARE FOLLOWING A ROUTE");
|
||||||
|
if (roadOverlay == null) {
|
||||||
|
if (RouteHandler.INSTANCE.getCurrentRouteLine() != null) {
|
||||||
|
roadOverlay = RouteHandler.INSTANCE.getCurrentRouteLine();
|
||||||
|
mapView.getOverlays().add(roadOverlay);
|
||||||
|
mapView.invalidate();
|
||||||
|
Log.d(TAG, "initMap: successfully added road!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mapView.getOverlays().add(roadOverlay);
|
||||||
|
mapView.invalidate();
|
||||||
|
Log.d(TAG, "initMap: successfully added road!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds the locations of the current route to the map. If there is no current route, show all locations
|
||||||
|
*/
|
||||||
|
private void addLocations() {
|
||||||
|
// get the locations of the current route or all locations
|
||||||
|
List<com.a1.nextlocation.data.Location> locations = RouteHandler.INSTANCE.isFollowingRoute() ? RouteHandler.INSTANCE.getCurrentRoute().getLocations() : LocationListManager.INSTANCE.getLocationList();
|
||||||
|
final ArrayList<OverlayItem> items = new ArrayList<>(locations.size());
|
||||||
|
// marker icon
|
||||||
|
Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24);
|
||||||
|
marker.setAlpha(255);
|
||||||
|
marker.setTint(getResources().getColor(R.color.primaryColour));
|
||||||
|
|
||||||
|
// add all locations to the overlay itemss
|
||||||
|
for (com.a1.nextlocation.data.Location location : locations) {
|
||||||
|
OverlayItem item = new OverlayItem(location.getName(), location.getDescription(), location.convertToGeoPoint());
|
||||||
|
item.setMarker(marker);
|
||||||
|
items.add(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
// create the overlay that will hold all locations and add listeners
|
||||||
|
allLocationsOverlay = new ItemizedIconOverlay<OverlayItem>(items,
|
||||||
|
new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
|
||||||
|
/**
|
||||||
|
* on sinlge click, navigate to that location's detail fragment
|
||||||
|
* @param index the index in the location list
|
||||||
|
* @param item the item that was clicked
|
||||||
|
* @return true
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean onItemSingleTapUp(int index, OverlayItem item) {
|
||||||
|
com.a1.nextlocation.data.Location clicked = locations.get(index);
|
||||||
|
requireActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new LocationDetailFragment(clicked)).commit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* on item long press, show that location's name in a toast message
|
||||||
|
* @param index the index in the location list
|
||||||
|
* @param item the item that was clicked
|
||||||
|
* @return true
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean onItemLongPress(int index, OverlayItem item) {
|
||||||
|
com.a1.nextlocation.data.Location clicked = locations.get(index);
|
||||||
|
Toast.makeText(requireContext(), clicked.getName(), Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
// create a route to the clicked location, didn't work and didn't have enough time to make it work ¯\_(ツ)_/¯
|
||||||
|
|
||||||
|
// Route route = new Route("Route to " + clicked.getName());
|
||||||
|
// route.addLocation(new com.a1.nextlocation.data.Location("Current location",currentLocation.getLatitude(),currentLocation.getLongitude(),"your location",null));
|
||||||
|
// route.addLocation(clicked);
|
||||||
|
// ApiHandler.INSTANCE.getDirections(route);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}, requireContext());
|
||||||
|
|
||||||
|
// add the overlay to the map
|
||||||
|
mapView.getOverlays().add(allLocationsOverlay);
|
||||||
|
Log.d(TAG, "addLocations: successfully added locations");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param permissions tbe permissions we want to ask
|
||||||
|
* @author Ricky
|
||||||
|
* request the permissions needed for location and network, made by Ricky
|
||||||
|
*/
|
||||||
private void requestPermissionsIfNecessary(String... permissions) {
|
private void requestPermissionsIfNecessary(String... permissions) {
|
||||||
ArrayList<String> permissionsToRequest = new ArrayList<>();
|
ArrayList<String> permissionsToRequest = new ArrayList<>();
|
||||||
if (this.getContext() != null)
|
if (this.getContext() != null)
|
||||||
@@ -152,4 +327,80 @@ public class HomeFragment extends Fragment {
|
|||||||
REQUEST_PERMISSIONS_REQUEST_CODE);
|
REQUEST_PERMISSIONS_REQUEST_CODE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* location callback that gets called each time the location is updated. It is used for updating the distance walked and checking if there are locations you have visited
|
||||||
|
*
|
||||||
|
* @param location the new location
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(@NonNull Location location) {
|
||||||
|
// calculate the distance walked
|
||||||
|
|
||||||
|
if (currentLocation != null) {
|
||||||
|
double distance = currentLocation.distanceTo(location); // in meters
|
||||||
|
// can't walk 100 meters in a few seconds
|
||||||
|
if (distance < 100)
|
||||||
|
StaticData.INSTANCE.addDistance(distance);
|
||||||
|
}
|
||||||
|
currentLocation = location;
|
||||||
|
|
||||||
|
|
||||||
|
//new thread because we don't want the main thread to hang, this method gets called a lot
|
||||||
|
Thread t = new Thread(() -> {
|
||||||
|
com.a1.nextlocation.data.Location last = null;
|
||||||
|
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||||
|
List<com.a1.nextlocation.data.Location> locs = RouteHandler.INSTANCE.getCurrentRoute().getLocations();
|
||||||
|
last = locs.get(locs.size()-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||||
|
// mark the location visited if we are less than 20 meters away
|
||||||
|
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 20) {
|
||||||
|
StaticData.INSTANCE.visitLocation(l);
|
||||||
|
if (l.equals(last)) stopRoute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StaticData.INSTANCE.setZoom(mapView.getZoomLevelDouble());
|
||||||
|
});
|
||||||
|
|
||||||
|
t.start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// empty override methods for the LocationListener
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderEnabled(@NonNull String provider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderDisabled(@NonNull String provider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method that gets called when the app gets paused
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
mapView.onPause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* method that gets called when the app gets resumed
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
mapView.onResume();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,75 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Location;
|
||||||
|
|
||||||
public class LocationDetailFragment extends Fragment {
|
public class LocationDetailFragment extends Fragment {
|
||||||
|
private static final String TAG = LocationDetailFragment.class.getCanonicalName();
|
||||||
|
|
||||||
|
private ImageButton imageButton;
|
||||||
|
private Location location;
|
||||||
|
private TextView titelText;
|
||||||
|
private TextView detailText;
|
||||||
|
private ImageView locationImage;
|
||||||
|
|
||||||
|
public LocationDetailFragment() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public LocationDetailFragment(Location location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
|
||||||
// Inflate the layout for this fragment
|
View view = inflater.inflate(R.layout.fragment_location_detail, container, false);
|
||||||
return inflater.inflate(R.layout.fragment_location_detail, container, false);
|
|
||||||
|
this.titelText = view.findViewById(R.id.detail_location_name);
|
||||||
|
this.titelText.setText(location.getName());
|
||||||
|
|
||||||
|
this.detailText = view.findViewById(R.id.detail_location_text);
|
||||||
|
this.detailText.setText(location.getDescription());
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.detail_location_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
LocationFragment locationFragment = new LocationFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (location != null) {
|
||||||
|
Log.d(TAG, "onCreateView: the location has a name of: " + location.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.locationImage = view.findViewById(R.id.detail_location_image);
|
||||||
|
Context context = this.locationImage.getContext();
|
||||||
|
int id = context.getResources().getIdentifier(this.location.getImageUrl(), "drawable", context.getPackageName());
|
||||||
|
this.locationImage.setImageResource(id);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocation(Location location) {
|
||||||
|
this.location = location;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,68 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
import android.media.Image;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Location;
|
||||||
|
import com.a1.nextlocation.recyclerview.LocationAdapter;
|
||||||
|
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class LocationFragment extends Fragment {
|
public class LocationFragment extends Fragment {
|
||||||
|
private RecyclerView locationRecyclerView;
|
||||||
|
private LocationAdapter locationAdapter;
|
||||||
|
private RecyclerView.LayoutManager layoutManager;
|
||||||
|
private List<Location> locationList;
|
||||||
|
private ImageButton imageButton;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
|
||||||
// Inflate the layout for this fragment
|
View view = inflater.inflate(R.layout.fragment_location, container, false);
|
||||||
return inflater.inflate(R.layout.fragment_location, container, false);
|
|
||||||
|
this.locationRecyclerView = view.findViewById(R.id.location_recyclerview);
|
||||||
|
this.locationRecyclerView.setHasFixedSize(true);
|
||||||
|
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.location_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
LocationListManager.INSTANCE.setContext(this.getContext());
|
||||||
|
LocationListManager.INSTANCE.load();
|
||||||
|
this.locationList = LocationListManager.INSTANCE.getLocationList();
|
||||||
|
|
||||||
|
this.locationAdapter = new LocationAdapter(this.getContext(), this.locationList, clickedPosition -> {
|
||||||
|
LocationDetailFragment locationDetailFragment = new LocationDetailFragment();
|
||||||
|
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
|
||||||
|
Bundle locationBundle = new Bundle();
|
||||||
|
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
|
||||||
|
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
|
||||||
|
locationDetailFragment.setArguments(locationBundle);
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.locationRecyclerView.setLayoutManager(this.layoutManager);
|
||||||
|
this.locationRecyclerView.setAdapter(this.locationAdapter);
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
public interface Refreshable {
|
||||||
|
void refresh();
|
||||||
|
}
|
||||||
@@ -1,27 +1,104 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Location;
|
||||||
|
import com.a1.nextlocation.data.Route;
|
||||||
|
import com.a1.nextlocation.data.RouteHandler;
|
||||||
|
import com.a1.nextlocation.network.ApiHandler;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class RouteDetailFragment extends Fragment {
|
public class RouteDetailFragment extends Fragment {
|
||||||
|
|
||||||
|
private Route route;
|
||||||
|
private TextView routeDetailText;
|
||||||
|
private TextView routeName;
|
||||||
|
private TextView totalDistance;
|
||||||
|
private ImageButton imageButton;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||||
// Inflate the layout for this fragment
|
if(getArguments().getParcelable("route") != null) {
|
||||||
return inflater.inflate(R.layout.fragment_route_detail, container, false);
|
this.route = getArguments().getParcelable("route");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.routeName = view.findViewById(R.id.route_title);
|
||||||
|
this.routeName.setText(this.route.getName());
|
||||||
|
|
||||||
|
this.routeDetailText = view.findViewById(R.id.reoute_detail_tekst);
|
||||||
|
this.routeDetailText.setText(this.route.getDescription());
|
||||||
|
|
||||||
|
this.totalDistance = view.findViewById(R.id.total_distance);
|
||||||
|
String distance_tekst = getResources().getString(R.string.total_distance_route);
|
||||||
|
this.totalDistance.setText(distance_tekst + " " + calculateRoute(this.route.getLocations()) + "m");
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.route_detail_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
RouteFragment routeFragment = new RouteFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
Button startButton = view.findViewById(R.id.start_route_button);
|
||||||
|
startButton.setOnClickListener(this::startRoute);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Button onclick method that starts the route that is being viewed.
|
||||||
|
* @param view the button
|
||||||
|
*/
|
||||||
|
public void startRoute(View view) {
|
||||||
|
ApiHandler.INSTANCE.getDirections(route);
|
||||||
|
RouteHandler.INSTANCE.followRoute(route);
|
||||||
|
Toast.makeText(requireContext(),"Route started!",Toast.LENGTH_SHORT).show();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).addToBackStack(null).commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the distance between points
|
||||||
|
* @param route the route that is calculated
|
||||||
|
* @return the total distance of a route
|
||||||
|
*/
|
||||||
|
public double calculateRoute(List<Location> route){
|
||||||
|
ArrayList<Location> routeArraylist = new ArrayList<>(route);
|
||||||
|
double totalDistance = 0;
|
||||||
|
Location firstLocation;
|
||||||
|
Location secondLocation;
|
||||||
|
System.out.println("Total locations: " + routeArraylist.size());
|
||||||
|
//Cycles through the arraylist
|
||||||
|
for(int i = 0; i < routeArraylist.size() - 1; i++) {
|
||||||
|
firstLocation = routeArraylist.get(i);
|
||||||
|
secondLocation = routeArraylist.get(i+1);
|
||||||
|
System.out.println("locations distance calculated: " + (i+1) + " and " + (i+2) + "\nThe added distance is: " + Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong()));
|
||||||
|
//Calculates the distance between points
|
||||||
|
totalDistance += Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong());
|
||||||
|
}
|
||||||
|
System.out.println("Total Distance: " + totalDistance);
|
||||||
|
return totalDistance;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,22 @@ import android.os.Bundle;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Route;
|
||||||
|
import com.a1.nextlocation.recyclerview.RouteAdapter;
|
||||||
|
import com.a1.nextlocation.recyclerview.RouteListManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import com.a1.nextlocation.data.Location;
|
import com.a1.nextlocation.data.Location;
|
||||||
import com.a1.nextlocation.data.Route;
|
import com.a1.nextlocation.data.Route;
|
||||||
import com.a1.nextlocation.json.DirectionsResult;
|
import com.a1.nextlocation.json.DirectionsResult;
|
||||||
@@ -21,34 +30,63 @@ import com.a1.nextlocation.network.DirectionsListener;
|
|||||||
public class RouteFragment extends Fragment {
|
public class RouteFragment extends Fragment {
|
||||||
private static final String TAG = RouteFragment.class.getCanonicalName();
|
private static final String TAG = RouteFragment.class.getCanonicalName();
|
||||||
|
|
||||||
|
private RecyclerView routeRecyclerView;
|
||||||
|
private RecyclerView.LayoutManager layoutManager;
|
||||||
|
private List<Route> routeList;
|
||||||
|
private RouteAdapter routeAdapter;
|
||||||
|
private ImageButton imageButton;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
View view = inflater.inflate(R.layout.fragment_route, container, false);
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_route, container, false);
|
this.routeRecyclerView = view.findViewById(R.id.route_recyclerview);
|
||||||
|
this.routeRecyclerView.setHasFixedSize(true);
|
||||||
|
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||||
|
|
||||||
|
RouteListManager.INSTANCE.setContext(this.getContext());
|
||||||
|
RouteListManager.INSTANCE.load();
|
||||||
|
this.routeList = RouteListManager.INSTANCE.getRouteList();
|
||||||
|
|
||||||
|
this.routeAdapter = new RouteAdapter(this.getContext(), this.routeList, clickedPosition -> {
|
||||||
|
RouteDetailFragment routeDetailFragment = new RouteDetailFragment();
|
||||||
|
Bundle routeBundle = new Bundle();
|
||||||
|
routeBundle.putParcelable("route", this.routeList.get(clickedPosition));
|
||||||
|
routeDetailFragment.setArguments(routeBundle);
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.route_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.routeRecyclerView.setLayoutManager(this.layoutManager);
|
||||||
|
this.routeRecyclerView.setAdapter(this.routeAdapter);
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
// ApiHandler.INSTANCE.getDirections(8.681436,49.41461,8.687872,49.420318);
|
// ApiHandler.INSTANCE.getDirections(51.49017262451581, 4.289038164073164,51.47337383133509, 4.303535222390562);
|
||||||
Route r = new Route("test");
|
// Route r = new Route("test");
|
||||||
r.addLocation(new Location("test",8.681436,49.41461,"route",null));
|
// r.addLocation(new Location("test",51.574473766034046, 4.7628379328055175,"route",null));
|
||||||
r.addLocation(new Location("test",8.687872,49.420318,"route",null));
|
// r.addLocation(new Location("test",51.577354223919876, 4.771120593941968,"route",null));
|
||||||
ApiHandler.INSTANCE.getDirections(r);
|
// r.addLocation(new Location("test",51.573033468635174, 4.782750651807139,"route",null));
|
||||||
}
|
// r.addLocation(new Location("test",51.56519104881196, 4.748246716295709,"route",null));
|
||||||
|
// r.addLocation(new Location("test",51.57367360644676, 4.74404101271347,"route",null));
|
||||||
public void onDirectionsAvailable(DirectionsResult result) {
|
// r.addLocation(new Location("test",51.57852769146427, 4.739878224473907,"route",null));
|
||||||
Log.d(TAG, "onDirectionsAvailable: got result! " + result);
|
//// r.addLocation(new Location("test",51.489063681658145, 4.289596063527951,"route",null));
|
||||||
|
//// r.addLocation(new Location("test",51.483012677667766, 4.28003245468457,"route",null));
|
||||||
|
// ApiHandler.INSTANCE.getDirections(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,44 +1,178 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
package com.a1.nextlocation.fragments;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.appcompat.widget.SwitchCompat;
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
import com.a1.nextlocation.MainActivity;
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class SettingsFragment extends Fragment {
|
public class SettingsFragment extends Fragment {
|
||||||
|
|
||||||
|
private SharedPreferences.Editor editor;
|
||||||
|
private ImageView imageButton;
|
||||||
|
SwitchCompat fontChanger;
|
||||||
|
private Refreshable refreshable;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAttach(@NotNull Context context) {
|
||||||
|
super.onAttach(context);
|
||||||
|
refreshable = (Refreshable) context;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
editor = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).edit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
return inflater.inflate(R.layout.fragment_settings, container, false);
|
View view = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||||
|
|
||||||
|
initializeLanguageDropdown(view);
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.settings_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
fontChanger = view.findViewById(R.id.BigFont);
|
||||||
|
|
||||||
|
SharedPreferences sharedPreferences = requireActivity().getSharedPreferences("com.a1.nextlocation",0);
|
||||||
|
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||||
|
fontChanger.setChecked(sharedPreferences.getBoolean("switch", false));
|
||||||
|
|
||||||
|
if (fontChanger.isChecked()){
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||||
|
}else if (!fontChanger.isChecked()){
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
fontChanger.setOnClickListener(view1 -> {
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
if(fontChanger.isChecked())
|
||||||
super.onViewCreated(view, savedInstanceState);
|
{
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||||
|
editor.putBoolean("switch",true);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
if(!fontChanger.isChecked())
|
||||||
|
{
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
|
editor.putBoolean("switch",false);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
editor.commit();
|
||||||
|
});
|
||||||
|
|
||||||
// Inflate the layout for this fragment
|
return view;
|
||||||
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
}
|
||||||
|
|
||||||
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
|
private void initializeLanguageDropdown(View view) {
|
||||||
|
Spinner languageDropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
||||||
|
String[] items = new String[]{getResources().getString(R.string.Dutch), getResources().getString(R.string.English), getResources().getString(R.string.Chinese)};
|
||||||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||||
|
languageDropdown.setAdapter(arrayAdapter);
|
||||||
|
|
||||||
dropdown.setAdapter(arrayAdapter);
|
// set the language dropdown on the currently selected language stored in the sharedPreferences
|
||||||
|
languageDropdown.setSelection(languageToDropdownPosition(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "")));
|
||||||
|
|
||||||
|
long previousID = languageDropdown.getSelectedItemId();
|
||||||
|
languageDropdown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
setLocale(dropdownPositionToLanguage(id));
|
||||||
|
// refresh fragment on language change
|
||||||
|
if (id != previousID) {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parent) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* converts the languageDropdown position to the belonging language
|
||||||
|
*
|
||||||
|
* @param id desired position to convert
|
||||||
|
* @return the language belonging to the position of the languageDropdown
|
||||||
|
*/
|
||||||
|
private String dropdownPositionToLanguage(long id) {
|
||||||
|
switch ((int) id) {
|
||||||
|
case 0:
|
||||||
|
return "nl";
|
||||||
|
case 1:
|
||||||
|
return "en";
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* converts language to the languageDropdown position
|
||||||
|
*
|
||||||
|
* @param language desired language to convert
|
||||||
|
* @return the position of the language in the languageDropdown
|
||||||
|
*/
|
||||||
|
private int languageToDropdownPosition(String language) {
|
||||||
|
switch (language) {
|
||||||
|
case "nl":
|
||||||
|
return 0;
|
||||||
|
case "en":
|
||||||
|
return 1;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* reloads the fragment
|
||||||
|
*/
|
||||||
|
private void refresh() {
|
||||||
|
Fragment currentFragment = getActivity().getSupportFragmentManager().findFragmentById(R.id.fragment_layout);
|
||||||
|
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
||||||
|
fragmentTransaction.detach(currentFragment);
|
||||||
|
fragmentTransaction.attach(currentFragment);
|
||||||
|
fragmentTransaction.commit();
|
||||||
|
|
||||||
|
refreshable.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* changes the current language to the desired language and saves this setting in SharedPreferences
|
||||||
|
*
|
||||||
|
* @param language the desired language to translate to
|
||||||
|
*/
|
||||||
|
private void setLocale(String language) {
|
||||||
|
Locale locale = new Locale(language);
|
||||||
|
Locale.setDefault(locale);
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
config.setLocale(locale);
|
||||||
|
getContext().getResources().updateConfiguration(config, getContext().getResources().getDisplayMetrics());
|
||||||
|
editor.putString("Language", language);
|
||||||
|
editor.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,26 +2,78 @@ package com.a1.nextlocation.fragments;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Coupon;
|
||||||
|
import com.a1.nextlocation.data.StaticData;
|
||||||
|
import com.a1.nextlocation.recyclerview.CouponAdapter;
|
||||||
|
import com.a1.nextlocation.recyclerview.CouponListManager;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class StatisticFragment extends Fragment {
|
public class StatisticFragment extends Fragment {
|
||||||
|
|
||||||
|
private List<Coupon> couponList;
|
||||||
|
private ImageView imageButton;
|
||||||
|
private ImageView couponButton;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
Bundle savedInstanceState) {
|
View view = inflater.inflate(R.layout.fragment_statistic, container, false);
|
||||||
// Inflate the layout for this fragment
|
|
||||||
return inflater.inflate(R.layout.fragment_statistic, container, false);
|
TextView distance = view.findViewById(R.id.statistics_km);
|
||||||
|
TextView locs = view.findViewById(R.id.statistics_locations_visited);
|
||||||
|
TextView timeText = view.findViewById(R.id.statistics_time_value);
|
||||||
|
double dist = StaticData.INSTANCE.getDistanceTraveled()/1000;
|
||||||
|
distance.setText("" + String.format("%.1f",dist) + " km");
|
||||||
|
locs.setText("" + StaticData.INSTANCE.getLocationsVisited());
|
||||||
|
|
||||||
|
long seconds = StaticData.INSTANCE.getTimeWalked() / 1000;
|
||||||
|
long p1 = seconds % 60;
|
||||||
|
long p2 = seconds / 60;
|
||||||
|
long p3 = p2 % 60;
|
||||||
|
p2 = p2 / 60;
|
||||||
|
timeText.setText(p2 + ":" + p3 + ":" + p1);
|
||||||
|
|
||||||
|
|
||||||
|
this.couponList = CouponListManager.INSTANCE.getCouponList();
|
||||||
|
CouponAdapter adapter = new CouponAdapter(this.getContext(), this.couponList);
|
||||||
|
TextView couponNumber = view.findViewById(R.id.couponAmount);
|
||||||
|
couponNumber.setText(String.valueOf(adapter.getItemCount()));
|
||||||
|
|
||||||
|
|
||||||
|
this.imageButton = view.findViewById(R.id.statistics_back_button);
|
||||||
|
this.imageButton.setOnClickListener(v -> {
|
||||||
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.couponButton = view.findViewById(R.id.coupon_button);
|
||||||
|
this.couponButton.setOnClickListener(v -> {
|
||||||
|
CouponFragment couponFragment = new CouponFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
|
||||||
|
ConstraintLayout constraintLayout = view.findViewById(R.id.Box4);
|
||||||
|
constraintLayout.setOnClickListener(v -> {
|
||||||
|
CouponFragment couponFragment = new CouponFragment();
|
||||||
|
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||||
|
});
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ import org.osmdroid.util.GeoPoint;
|
|||||||
|
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class DirectionsResult {
|
public class DirectionsResult {
|
||||||
@@ -23,6 +24,7 @@ public class DirectionsResult {
|
|||||||
private double distance;
|
private double distance;
|
||||||
private double duration;
|
private double duration;
|
||||||
private double[][] wayPointCoordinates;
|
private double[][] wayPointCoordinates;
|
||||||
|
private GeoPoint[] startAndEndPoint = new GeoPoint[2];
|
||||||
|
|
||||||
public List<DirectionsStep> getSteps() {
|
public List<DirectionsStep> getSteps() {
|
||||||
return steps;
|
return steps;
|
||||||
@@ -52,8 +54,31 @@ public class DirectionsResult {
|
|||||||
this.steps.add(step);
|
this.steps.add(step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GeoPoint[] getStartAndEndPoint() {
|
||||||
|
return startAndEndPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* converts all the geopoints in all the steps into an arraylist to display it on the map
|
||||||
|
* @return the list of geopoints
|
||||||
|
*/
|
||||||
|
public ArrayList<GeoPoint> getGeoPoints() {
|
||||||
|
int size = 0;
|
||||||
|
// we'll have a lot of waypoints, so calculate the size first so that the list won't have to be extended (o p t i m i z e)
|
||||||
|
for (int i = 0; i < this.getSteps().size(); i++) {
|
||||||
|
size += this.getSteps().get(i).getWaypoints().length;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<GeoPoint> res = new ArrayList<>(size);
|
||||||
|
for (DirectionsStep step : this.getSteps()) {
|
||||||
|
Collections.addAll(res, step.getWaypoints());
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* parses a given json string into this object. It gets all the waypoints and steps and combines them so that every step also has the correct coordinates associated with it
|
* parses a given json string into this object. It gets all the waypoints and steps and combines them so that every step also has the correct coordinates associated with it
|
||||||
|
*
|
||||||
* @param json the json string to parse.
|
* @param json the json string to parse.
|
||||||
*/
|
*/
|
||||||
public void parse(String json) {
|
public void parse(String json) {
|
||||||
@@ -76,34 +101,17 @@ public class DirectionsResult {
|
|||||||
|
|
||||||
JsonArray segments = properties.getAsJsonArray("segments");
|
JsonArray segments = properties.getAsJsonArray("segments");
|
||||||
|
|
||||||
for (JsonElement element : segments) {
|
parseSegments(segments,gson);
|
||||||
JsonObject segment = element.getAsJsonObject();
|
|
||||||
|
|
||||||
setDistance(segment.get("distance").getAsDouble());
|
startAndEndPoint[0] = this.getSteps().get(0).getWaypoints()[0];
|
||||||
setDuration(segment.get("duration").getAsDouble());
|
startAndEndPoint[1] = this.getSteps().get(this.getSteps().size()-1).getWaypoints()[1];
|
||||||
|
|
||||||
JsonArray steps = segment.getAsJsonArray("steps");
|
|
||||||
|
|
||||||
for (JsonElement j : steps) {
|
|
||||||
|
|
||||||
DirectionsStep step = gson.fromJson(j,DirectionsStep.class);
|
|
||||||
double lat;
|
|
||||||
double longl;
|
|
||||||
|
|
||||||
// kinda stinky but it works
|
|
||||||
for (int i = 0; i < 2; i++) {
|
|
||||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
|
||||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
|
||||||
step.getWaypoints()[i] = new GeoPoint(lat,longl);
|
|
||||||
}
|
|
||||||
|
|
||||||
addStep(step);
|
|
||||||
Log.d(TAG, "parse: added step" + step);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parses the given json string into this object. This method is used for when you have requested directions from the API for a {@link com.a1.nextlocation.data.Route route object}
|
||||||
|
* @param json the json string
|
||||||
|
*/
|
||||||
public void parseRoute(String json) {
|
public void parseRoute(String json) {
|
||||||
|
|
||||||
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
Gson gson = new GsonBuilder().setPrettyPrinting().create();
|
||||||
@@ -130,6 +138,20 @@ public class DirectionsResult {
|
|||||||
|
|
||||||
JsonArray segments = route.getAsJsonArray("segments");
|
JsonArray segments = route.getAsJsonArray("segments");
|
||||||
|
|
||||||
|
parseSegments(segments,gson);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parses different segments, and the steps in it using {@link DirectionsResult#parseSteps(JsonArray, Gson) the method for parsing steps}
|
||||||
|
* @param segments the segments to parse
|
||||||
|
* @param gson the gson object to use
|
||||||
|
*/
|
||||||
|
private void parseSegments(JsonArray segments, Gson gson) {
|
||||||
|
//unfold the individual segments
|
||||||
for (JsonElement e : segments) {
|
for (JsonElement e : segments) {
|
||||||
JsonObject segment = e.getAsJsonObject();
|
JsonObject segment = e.getAsJsonObject();
|
||||||
|
|
||||||
@@ -138,8 +160,19 @@ public class DirectionsResult {
|
|||||||
|
|
||||||
JsonArray steps = segment.getAsJsonArray("steps");
|
JsonArray steps = segment.getAsJsonArray("steps");
|
||||||
|
|
||||||
|
parseSteps(steps,gson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parses the given steps into this object, transforms them into a {@link DirectionsStep} object.
|
||||||
|
* @param steps the steps to parse
|
||||||
|
* @param gson the gson object to use
|
||||||
|
*/
|
||||||
|
private void parseSteps(JsonArray steps, Gson gson) {
|
||||||
for (JsonElement j : steps) {
|
for (JsonElement j : steps) {
|
||||||
|
|
||||||
|
// parse everything into a directionsstep
|
||||||
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
|
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
|
||||||
double lat;
|
double lat;
|
||||||
double longl;
|
double longl;
|
||||||
@@ -154,11 +187,5 @@ public class DirectionsResult {
|
|||||||
addStep(step);
|
addStep(step);
|
||||||
Log.d(TAG, "parse: added step" + step);
|
Log.d(TAG, "parse: added step" + step);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,43 +20,72 @@ import okhttp3.Request;
|
|||||||
import okhttp3.RequestBody;
|
import okhttp3.RequestBody;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Singleton that handles all API calls
|
||||||
|
*/
|
||||||
public enum ApiHandler {
|
public enum ApiHandler {
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
|
|
||||||
private static String TAG = ApiHandler.class.getCanonicalName();
|
private static String TAG = ApiHandler.class.getCanonicalName();
|
||||||
|
|
||||||
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
||||||
private final String BASE_URL = "https://api.openrouteservice.org/v2/directions/";
|
private final String BASE_URL = "https://api.openrouteservice.org/v2/directions/";
|
||||||
private final String API_KEY = "5b3ce3597851110001cf6248d4eee2099f724255918adc71cc502b2a";
|
private final String API_KEY = "5b3ce3597851110001cf6248d4eee2099f724255918adc71cc502b2a";
|
||||||
private final String DIRECTIONS_MODE = "foot-walking";
|
private final String DIRECTIONS_MODE = "foot-walking";
|
||||||
|
|
||||||
private List<DirectionsListener> listeners = new ArrayList<>();
|
private List<DirectionsListener> listeners = new ArrayList<>();
|
||||||
|
|
||||||
private OkHttpClient client = new OkHttpClient();
|
private OkHttpClient client = new OkHttpClient();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets directions from the start location to the end location
|
||||||
|
* @param startLocation the start location
|
||||||
|
* @param endLocation the end location
|
||||||
|
*/
|
||||||
public void getDirections(Location startLocation, Location endLocation) {
|
public void getDirections(Location startLocation, Location endLocation) {
|
||||||
getDirections(startLocation.getCoordinates(),endLocation.getCoordinates());
|
getDirections(startLocation.getCoordinates(),endLocation.getCoordinates());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets directions from the start location latitude and longitude and the end location latitude and longitude
|
||||||
|
* @param startLat the start latitude
|
||||||
|
* @param startLong the start longitude
|
||||||
|
* @param endLat the end latitude
|
||||||
|
* @param endLong the end longitude
|
||||||
|
*/
|
||||||
public void getDirections(double startLat, double startLong, double endLat, double endLong) {
|
public void getDirections(double startLat, double startLong, double endLat, double endLong) {
|
||||||
getDirections(startLat + "," + startLong, endLat + "," + endLong);
|
getDirections(startLong + "," + startLat, endLong + "," + endLat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the directions from the start location to the end location. An example location would be "3.543543,5.7675765"
|
||||||
|
* @param startLocation the start location represented as <i>startlat,startlong</i>
|
||||||
|
* @param endLocation the end location represented as <i>endlat,endlong</i>
|
||||||
|
*/
|
||||||
public void getDirections(String startLocation, String endLocation) {
|
public void getDirections(String startLocation, String endLocation) {
|
||||||
|
|
||||||
|
// build the url
|
||||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" +startLocation + "&end=" + endLocation;
|
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" +startLocation + "&end=" + endLocation;
|
||||||
|
|
||||||
|
// start a new thread to do the request, because we don't want to be networking on our main thread
|
||||||
Thread t = new Thread(() -> {
|
Thread t = new Thread(() -> {
|
||||||
|
|
||||||
|
// build a request from the url
|
||||||
Request request = new Request.Builder().url(requestUrl).build();
|
Request request = new Request.Builder().url(requestUrl).build();
|
||||||
|
|
||||||
|
// try to get the response
|
||||||
try (Response response = client.newCall(request).execute()) {
|
try (Response response = client.newCall(request).execute()) {
|
||||||
if (response.body() != null) {
|
if (response.body() != null) {
|
||||||
String responseString = Objects.requireNonNull(response.body()).string();
|
String responseString = Objects.requireNonNull(response.body()).string();
|
||||||
Log.d(TAG, "getDirections: got response: " + responseString);
|
Log.d(TAG, "getDirections: got response: " + responseString);
|
||||||
|
|
||||||
|
// convert the response into a result object
|
||||||
DirectionsResult result = new DirectionsResult();
|
DirectionsResult result = new DirectionsResult();
|
||||||
result.parse(responseString);
|
result.parse(responseString);
|
||||||
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
||||||
|
|
||||||
|
// notify the listeners
|
||||||
for (DirectionsListener listener : listeners) {
|
for (DirectionsListener listener : listeners) {
|
||||||
listener.onDirectionsAvailable(result);
|
listener.onDirectionsAvailable(result);
|
||||||
}
|
}
|
||||||
@@ -69,31 +98,43 @@ public enum ApiHandler {
|
|||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// t.join();
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a listener for when a result of an api call is available
|
||||||
|
* @param listener the new listener
|
||||||
|
*/
|
||||||
public void addListener(DirectionsListener listener) {
|
public void addListener(DirectionsListener listener) {
|
||||||
this.listeners.add(listener);
|
this.listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gets directions for the given {@link Route}
|
||||||
|
* @param route the route to get directions for
|
||||||
|
*/
|
||||||
public void getDirections(Route route) {
|
public void getDirections(Route route) {
|
||||||
// for (int i = 0; i < route.getLocations().size()-1; i+= 2) {
|
|
||||||
// Location start = route.getLocations().get(i);
|
|
||||||
// Location end = route.getLocations().get(i+1);
|
|
||||||
// getDirections(start,end);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
// add the coordinates to the list
|
||||||
ArrayList<double[]> allCoords = new ArrayList<>();
|
ArrayList<double[]> allCoords = new ArrayList<>();
|
||||||
for (Location location : route.getLocations()) {
|
for (Location location : route.getLocations()) {
|
||||||
allCoords.add(location.getCoordinatesAsDoubles());
|
allCoords.add(location.getCoordinatesAsDoubles());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// convert it to a json string
|
||||||
String body = "{\"coordinates\":" + new Gson().toJson(allCoords) + "}";
|
String body = "{\"coordinates\":" + new Gson().toJson(allCoords) + "}";
|
||||||
|
|
||||||
|
|
||||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY;
|
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY;
|
||||||
|
|
||||||
|
// new thread, because we don't want to be networking on our main thread
|
||||||
Thread t = new Thread(() -> {
|
Thread t = new Thread(() -> {
|
||||||
|
|
||||||
|
// add the body to the request
|
||||||
RequestBody requestBody = RequestBody.create(body,JSON);
|
RequestBody requestBody = RequestBody.create(body,JSON);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(requestUrl)
|
.url(requestUrl)
|
||||||
@@ -105,10 +146,18 @@ public enum ApiHandler {
|
|||||||
String responseString = Objects.requireNonNull(response.body()).string();
|
String responseString = Objects.requireNonNull(response.body()).string();
|
||||||
Log.d(TAG, "getDirections: got response: " + responseString);
|
Log.d(TAG, "getDirections: got response: " + responseString);
|
||||||
|
|
||||||
|
// kinda lazy, but we had time pressure
|
||||||
|
if (responseString.startsWith("{\"error")) {
|
||||||
|
Log.e(TAG, "getDirections: ERROR IN REQUEST!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert the result into a DirectionsResult
|
||||||
DirectionsResult result = new DirectionsResult();
|
DirectionsResult result = new DirectionsResult();
|
||||||
result.parseRoute(responseString);
|
result.parseRoute(responseString);
|
||||||
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
||||||
|
|
||||||
|
//notify the listeners
|
||||||
for (DirectionsListener listener : listeners) {
|
for (DirectionsListener listener : listeners) {
|
||||||
listener.onDirectionsAvailable(result);
|
listener.onDirectionsAvailable(result);
|
||||||
}
|
}
|
||||||
@@ -117,10 +166,18 @@ public enum ApiHandler {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.d(TAG, "getDirections: caught exception: " + e.getLocalizedMessage());
|
Log.d(TAG, "getDirections: caught exception: " + e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
t.start();
|
t.start();
|
||||||
|
|
||||||
|
// wait for when we have a result from the api until we can continue, otherwise the route will be drawn before we get the result
|
||||||
|
try {
|
||||||
|
t.join();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,13 @@ package com.a1.nextlocation.recyclerview;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.R;
|
||||||
import com.a1.nextlocation.data.Coupon;
|
import com.a1.nextlocation.data.Coupon;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -23,31 +26,49 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
|
|||||||
|
|
||||||
class CouponViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
class CouponViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
|
|
||||||
|
private TextView couponCode;
|
||||||
|
private TextView couponReward;
|
||||||
|
|
||||||
public CouponViewHolder(@NonNull View itemView) {
|
public CouponViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
itemView.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setTextViewName(String text){
|
||||||
|
this.couponReward = itemView.findViewById(R.id.coupon_name);
|
||||||
|
this.couponReward.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View v) {
|
||||||
clickListener.onItemClick(getAdapterPosition());
|
clickListener.onItemClick(getAdapterPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener){
|
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener){
|
||||||
appContext = context;
|
this.appContext = context;
|
||||||
couponList = coupon;
|
this.couponList = coupon;
|
||||||
clickListener = listener;
|
this.clickListener = listener;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public CouponAdapter(Context context, List<Coupon> coupon) {
|
||||||
|
this.appContext = context;
|
||||||
|
this.couponList = coupon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return null;
|
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.coupon_item, parent, false);
|
||||||
|
return new CouponViewHolder(itemView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
|
||||||
|
Coupon coupon = couponList.get(position);
|
||||||
|
holder.setTextViewName(coupon.getReward());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -55,7 +76,4 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
|
|||||||
return couponList.size();
|
return couponList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ import android.util.Log;
|
|||||||
|
|
||||||
import com.a1.nextlocation.data.Coupon;
|
import com.a1.nextlocation.data.Coupon;
|
||||||
import com.a1.nextlocation.data.FileIO;
|
import com.a1.nextlocation.data.FileIO;
|
||||||
import com.a1.nextlocation.data.Location;
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CouponLoader implements Loader<List<Coupon>> {
|
public class CouponLoader implements Loader<List<Coupon>> {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.content.Context;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
@@ -18,7 +19,7 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
|||||||
|
|
||||||
private Context appContext;
|
private Context appContext;
|
||||||
private List<Location> locationList;
|
private List<Location> locationList;
|
||||||
private CouponAdapter.OnItemClickListener clickListener;
|
private OnItemClickListener clickListener;
|
||||||
|
|
||||||
public interface OnItemClickListener {
|
public interface OnItemClickListener {
|
||||||
void onItemClick(int clickedPosition);
|
void onItemClick(int clickedPosition);
|
||||||
@@ -27,10 +28,13 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
|||||||
class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
|
|
||||||
private TextView locationName;
|
private TextView locationName;
|
||||||
|
private ImageView locationImage;
|
||||||
|
|
||||||
public LocationViewHolder(@NonNull View itemView) {
|
public LocationViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
this.locationName = itemView.findViewById(R.id.location_name);
|
this.locationName = itemView.findViewById(R.id.location_name);
|
||||||
|
this.locationImage = itemView.findViewById(R.id.location_image);
|
||||||
|
itemView.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,11 +43,19 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setTextViewText(String text){
|
public void setTextViewText(String text){
|
||||||
|
this.locationName = itemView.findViewById(R.id.location_name);
|
||||||
locationName.setText(text);
|
locationName.setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setImageViewImage(String text){
|
||||||
|
this.locationImage = itemView.findViewById(R.id.location_image);
|
||||||
|
Context context = locationImage.getContext();
|
||||||
|
int id = context.getResources().getIdentifier(text, "drawable", context.getPackageName());
|
||||||
|
locationImage.setImageResource(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocationAdapter(Context context, List<Location> location, CouponAdapter.OnItemClickListener listener){
|
public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener){
|
||||||
this.appContext = context;
|
this.appContext = context;
|
||||||
this.locationList = location;
|
this.locationList = location;
|
||||||
this.clickListener = listener;
|
this.clickListener = listener;
|
||||||
@@ -52,15 +64,15 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public LocationAdapter.LocationViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public LocationAdapter.LocationViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_location, parent, false);
|
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.location_item, parent, false);
|
||||||
LocationViewHolder viewHolder = new LocationViewHolder(itemView);
|
return new LocationViewHolder(itemView);
|
||||||
return viewHolder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
|
||||||
Location location = locationList.get(position);
|
Location location = locationList.get(position);
|
||||||
holder.setTextViewText(location.getName());
|
holder.setTextViewText(location.getName());
|
||||||
|
holder.setImageViewImage(location.getImageUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package com.a1.nextlocation.recyclerview;
|
package com.a1.nextlocation.recyclerview;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.R;
|
||||||
|
import com.a1.nextlocation.data.Location;
|
||||||
import com.a1.nextlocation.data.Route;
|
import com.a1.nextlocation.data.Route;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -23,14 +28,23 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
|
|||||||
|
|
||||||
class RouteViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
class RouteViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||||
|
|
||||||
|
private TextView routeName;
|
||||||
|
|
||||||
public RouteViewHolder(@NonNull View itemView) {
|
public RouteViewHolder(@NonNull View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
this.routeName = itemView.findViewById(R.id.route_name);
|
||||||
|
itemView.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
clickListener.onItemClick(getAdapterPosition());
|
clickListener.onItemClick(getAdapterPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setTextViewText(String text){
|
||||||
|
this.routeName = itemView.findViewById(R.id.route_name);
|
||||||
|
this.routeName.setText(text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public RouteAdapter(Context context, List<Route> route, CouponAdapter.OnItemClickListener listener){
|
public RouteAdapter(Context context, List<Route> route, CouponAdapter.OnItemClickListener listener){
|
||||||
@@ -42,12 +56,14 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
|
|||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RouteAdapter.RouteViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RouteAdapter.RouteViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return null;
|
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.route_item, parent, false);
|
||||||
|
return new RouteViewHolder(itemView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBindViewHolder(@NonNull RouteAdapter.RouteViewHolder holder, int position) {
|
public void onBindViewHolder(@NonNull RouteAdapter.RouteViewHolder holder, int position) {
|
||||||
|
Route route = routeList.get(position);
|
||||||
|
holder.setTextViewText(route.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
12
app/src/main/res/drawable-anydpi/ic_stop_icon.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="#333333"
|
||||||
|
android:alpha="0.6">
|
||||||
|
<path
|
||||||
|
android:fillColor="@android:color/white"
|
||||||
|
android:pathData="M8,16h8V8H8V16zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2L12,2z"
|
||||||
|
android:fillType="evenOdd"/>
|
||||||
|
</vector>
|
||||||
BIN
app/src/main/res/drawable-hdpi/ic_stop_icon.png
Normal file
|
After Width: | Height: | Size: 318 B |
BIN
app/src/main/res/drawable-mdpi/ic_stop_icon.png
Normal file
|
After Width: | Height: | Size: 213 B |
BIN
app/src/main/res/drawable-xhdpi/ic_stop_icon.png
Normal file
|
After Width: | Height: | Size: 416 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_stop_icon.png
Normal file
|
After Width: | Height: | Size: 552 B |
BIN
app/src/main/res/drawable/beach_and_lounge_club.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
app/src/main/res/drawable/belcrum_beach.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
app/src/main/res/drawable/belcrum_watertoren.png
Normal file
|
After Width: | Height: | Size: 780 KiB |
BIN
app/src/main/res/drawable/coffee_and_lunch.png
Normal file
|
After Width: | Height: | Size: 981 KiB |
BIN
app/src/main/res/drawable/de_boter_hal.png
Normal file
|
After Width: | Height: | Size: 3.8 MiB |
BIN
app/src/main/res/drawable/de_koepel_future_events.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
BIN
app/src/main/res/drawable/escaping_room.png
Normal file
|
After Width: | Height: | Size: 619 KiB |
BIN
app/src/main/res/drawable/gauchos.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
app/src/main/res/drawable/hercules_park_valkenburg.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
app/src/main/res/drawable/het_klooster_breda.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
74
app/src/main/res/drawable/icon_background.xml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector
|
||||||
|
android:height="108dp"
|
||||||
|
android:width="108dp"
|
||||||
|
android:viewportHeight="108"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#3DDC84"
|
||||||
|
android:pathData="M0,0h108v108h-108z"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||||
|
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||||
|
</vector>
|
||||||
BIN
app/src/main/res/drawable/kees_kroket.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
app/src/main/res/drawable/koningin_wilhelimna_paviljoen.png
Normal file
|
After Width: | Height: | Size: 145 KiB |
BIN
app/src/main/res/drawable/mc_donalds.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
app/src/main/res/drawable/mezz_breda.png
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
app/src/main/res/drawable/nassau_baroniemonument.png
Normal file
|
After Width: | Height: | Size: 432 KiB |
BIN
app/src/main/res/drawable/next_location_icon.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
app/src/main/res/drawable/prison_escape_room.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
app/src/main/res/drawable/station_breda.png
Normal file
|
After Width: | Height: | Size: 502 KiB |
BIN
app/src/main/res/drawable/stop_icon.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
app/src/main/res/drawable/subway.png
Normal file
|
After Width: | Height: | Size: 648 KiB |
BIN
app/src/main/res/drawable/t_zusje_breda.png
Normal file
|
After Width: | Height: | Size: 3.4 MiB |
BIN
app/src/main/res/drawable/the_tosti_club.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
app/src/main/res/drawable/vr_world.png
Normal file
|
After Width: | Height: | Size: 324 KiB |
BIN
app/src/main/res/drawable/wok_to_go.png
Normal file
|
After Width: | Height: | Size: 264 KiB |
@@ -1,284 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:background="@color/primaryColour"
|
|
||||||
tools:context=".fragments.CouponFragment">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:backgroundTint="@color/primaryColour"
|
|
||||||
android:src="@drawable/ic_back_button_24"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:text="@string/coupons"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:textSize="30sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Code"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Waarde"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="FRISDRANKJE20"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk2"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Frisdrank"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box3"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CHOCOMEL30"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk3"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Chocomel"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box4"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box5"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="FRISTI200"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk4"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="2x Fristi"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box5"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="50dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/ButtonActivate"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box4"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="OLA30"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk5"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk5"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Waterijsje"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk5"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/ButtonActivate"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:backgroundTint="@color/buttonColour"
|
|
||||||
android:text="Activate"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box5"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="Locatie detail"
|
android:text=""
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_height="283dp"
|
android:layout_height="283dp"
|
||||||
android:layout_marginEnd="30dp"
|
android:layout_marginEnd="30dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
android:text="Detail tekst"
|
android:text=""
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />
|
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />
|
||||||
|
|||||||
@@ -7,32 +7,46 @@
|
|||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
tools:context=".fragments.RouteDetailFragment">
|
tools:context=".fragments.RouteDetailFragment">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/start_route_button2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="@color/secondaryColour"
|
||||||
|
android:text="@string/start_route"
|
||||||
|
android:textColor="@color/buttonColour"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/reoute_detail_tekst"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/reoute_detail_tekst"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
|
||||||
|
app:layout_constraintVertical_bias="0.873" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/routeDetailBackButton"
|
android:id="@+id/routeDetailBackButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/routeTitle"
|
app:layout_constraintBottom_toBottomOf="@+id/route_title"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/routeTitle"
|
app:layout_constraintTop_toTopOf="@+id/route_title"
|
||||||
app:layout_constraintEnd_toStartOf="@id/routeTitle"
|
app:layout_constraintEnd_toStartOf="@id/route_title"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/routeTitle"
|
android:id="@+id/route_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="250dp"
|
android:layout_marginEnd="250dp"
|
||||||
android:text="titel"
|
android:text="titel"
|
||||||
android:textSize="20sp"
|
android:textColor="@color/white"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
|
android:textSize="30sp"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/routeDetailText"
|
app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/reoute_detail_tekst"
|
||||||
app:layout_constraintStart_toEndOf="@id/routeDetailBackButton"
|
app:layout_constraintStart_toEndOf="@id/routeDetailBackButton"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/routeDetailImage"
|
android:id="@+id/route_detail_image"
|
||||||
android:layout_width="250dp"
|
android:layout_width="250dp"
|
||||||
android:layout_height="250dp"
|
android:layout_height="250dp"
|
||||||
android:layout_marginEnd="350dp"
|
android:layout_marginEnd="350dp"
|
||||||
@@ -42,7 +56,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/routeDetailText"
|
android:id="@+id/reoute_detail_tekst"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="10dp"
|
android:layout_height="10dp"
|
||||||
android:layout_marginStart="50dp"
|
android:layout_marginStart="50dp"
|
||||||
@@ -51,33 +65,7 @@
|
|||||||
android:text=""
|
android:text=""
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/routeDetailImage"
|
app:layout_constraintStart_toEndOf="@id/route_detail_image"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/startRouteButton"
|
|
||||||
android:src="@drawable/ic_baseline_play_arrow_24"
|
|
||||||
android:backgroundTint="@color/primaryColour"
|
|
||||||
android:scaleX="5"
|
|
||||||
android:scaleY="5"
|
|
||||||
android:layout_width="70dp"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_marginStart="350dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/startRouteText"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/startRouteText"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/startRouteText" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/startRouteText"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginBottom="20dp"
|
|
||||||
android:text="@string/start_route"
|
|
||||||
android:textSize="50sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/startRouteButton"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" />
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -4,21 +4,22 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/mainActivity"
|
||||||
tools:context=".MainActivity">
|
tools:context=".MainActivity">
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/fragment_layout"
|
android:id="@+id/fragment_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/top_bar"
|
||||||
app:layout_constraintBottom_toTopOf="@id/navbar"
|
app:layout_constraintBottom_toTopOf="@id/navigation_bar"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
android:showAsAction="always|withText"
|
android:showAsAction="always|withText"
|
||||||
android:id="@+id/navbar"
|
android:id="@+id/navigation_bar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
@@ -31,10 +32,9 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/topBar"
|
android:id="@+id/top_bar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginTop="50dp"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/fragment_layout"
|
app:layout_constraintBottom_toTopOf="@id/fragment_layout"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -42,27 +42,27 @@
|
|||||||
android:background="@color/primaryColour"/>
|
android:background="@color/primaryColour"/>
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/infoButton"
|
android:id="@+id/info_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_baseline_info_24"
|
android:src="@drawable/ic_baseline_info_24"
|
||||||
android:backgroundTint="@color/primaryColour"
|
android:backgroundTint="@color/primaryColour"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/topBar"
|
app:layout_constraintTop_toTopOf="@id/top_bar"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/topBar"
|
app:layout_constraintBottom_toBottomOf="@id/top_bar"
|
||||||
android:tint="@color/secondaryColour"
|
android:tint="@color/secondaryColour"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/text_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintStart_toEndOf="@id/infoButton"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/topBar"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/topBar"
|
|
||||||
android:text="@string/app_name"
|
android:text="@string/app_name"
|
||||||
android:textSize="25dp"
|
|
||||||
android:textColor="@color/secondaryColour"
|
android:textColor="@color/secondaryColour"
|
||||||
/>
|
android:textSize="25sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/top_bar"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/info_button"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/top_bar" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
38
app/src/main/res/layout/coupon_item.xml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:id="@+id/couponItem"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/name_box"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.4"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/coupon_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="20sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,284 +1,41 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
tools:context=".fragments.CouponFragment">
|
android:id="@+id/couponFragment"
|
||||||
|
tools:context=".fragments.LocationFragment">
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:backgroundTint="@color/primaryColour"
|
|
||||||
android:src="@drawable/ic_back_button_24"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/coupon_RV"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_margin="9dp"
|
||||||
android:text="@string/coupons"
|
android:layout_marginTop="20dp"
|
||||||
android:textColor="@color/white"
|
android:text="@string/statistics"
|
||||||
android:textSize="30sp"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box1"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Code"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintStart_toEndOf="@id/coupon_back_button"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<View
|
<ImageButton
|
||||||
android:id="@+id/Balk"
|
android:id="@+id/coupon_back_button"
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Waarde"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box2"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="FRISDRANKJE20"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk2"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Frisdrank"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box3"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="CHOCOMEL30"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk3"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Chocomel"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box4"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box5"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="FRISTI200"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk4"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="2x Fristi"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
|
||||||
android:id="@+id/Box5"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/ButtonActivate"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box4"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="OLA30"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk5"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/Balk5"
|
|
||||||
android:layout_width="1dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/black"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="1x Waterijsje"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk5"
|
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/ButtonActivate"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:backgroundTint="@color/buttonColour"
|
android:backgroundTint="@color/buttonColour"
|
||||||
android:text="Activate"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:id="@+id/coupon_recyclerview"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box5"
|
app:layout_constraintTop_toBottomOf="@+id/coupon_back_button" />
|
||||||
/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,14 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/homeFragment"
|
||||||
tools:context=".fragments.HomeFragment">
|
tools:context=".fragments.HomeFragment">
|
||||||
|
|
||||||
|
|
||||||
<org.osmdroid.views.MapView
|
<org.osmdroid.views.MapView
|
||||||
android:id="@+id/mapView"
|
android:id="@+id/map_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</org.osmdroid.views.MapView>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/location_list_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:backgroundTint="@color/secondaryColour"
|
||||||
|
android:src="@drawable/ic_baseline_outlined_flag_24"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/home_stop_route_button"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/location_list_button"
|
||||||
|
android:backgroundTint="@color/secondaryColour"
|
||||||
|
android:src="@drawable/ic_stop_icon"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/locationFragment"
|
||||||
tools:context=".fragments.LocationFragment">
|
tools:context=".fragments.LocationFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -12,27 +13,30 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="9dp"
|
android:layout_margin="9dp"
|
||||||
android:text="Locations"
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/locations"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintStart_toEndOf="@id/routeBackButton"
|
app:layout_constraintStart_toEndOf="@id/location_back_button"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/routeBackButton"
|
android:id="@+id/location_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:backgroundTint="@color/buttonColour"
|
android:backgroundTint="@color/buttonColour"
|
||||||
android:text="Back"
|
|
||||||
android:layout_margin="10dp"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:layout_width="0dp"
|
android:id="@+id/location_recyclerview"
|
||||||
android:layout_height="0dp"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="60dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/routeBackButton" />
|
app:layout_constraintTop_toBottomOf="@+id/location_RV" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -5,16 +5,18 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/locationDetailFragment"
|
||||||
tools:context=".fragments.LocationDetailFragment">
|
tools:context=".fragments.LocationDetailFragment">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_location_name"
|
android:id="@+id/detail_location_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="300dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text="Locatie detail"
|
android:text=""
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
|
android:gravity="center"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -29,26 +31,36 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
|
app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
|
||||||
tools:src="@tools:sample/avatars" />
|
tools:src="@tools:sample/avatars" />
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
|
android:text=""
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/detail_location_image">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/detail_location_text"
|
android:id="@+id/detail_location_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_margin="20dp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
android:text="Detail tekst"
|
android:text=""
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
/>
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
</ScrollView>
|
||||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_image" />
|
|
||||||
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/detail_location_back_button"
|
android:id="@+id/detail_location_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_back_button_24"
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
android:backgroundTint="@color/primaryColour"
|
android:backgroundTint="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/detail_location_name"
|
android:src="@drawable/ic_back_button_24"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/detail_location_name"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/detail_location_name" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -5,36 +5,36 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/routeFragment"
|
||||||
tools:context=".fragments.RouteFragment">
|
tools:context=".fragments.RouteFragment">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/routeBackButton"
|
android:id="@+id/route_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:text="Back"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/routeTitle"
|
android:id="@+id/route_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="9dp"
|
android:layout_margin="9dp"
|
||||||
android:text="titel"
|
android:text="@string/routes"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintStart_toEndOf="@id/routeBackButton"
|
app:layout_constraintStart_toEndOf="@id/route_back_button"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/routeListRV"
|
android:id="@+id/route_recyclerview"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/routeBackButton" />
|
app:layout_constraintTop_toBottomOf="@+id/route_back_button" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -5,26 +5,27 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/routeDetailFragment"
|
||||||
tools:context=".fragments.RouteDetailFragment">
|
tools:context=".fragments.RouteDetailFragment">
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/routeDetailBackButton"
|
android:id="@+id/route_detail_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="100dp"
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/routeTitle"
|
|
||||||
app:layout_constraintEnd_toStartOf="@id/routeTitle"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/routeTitle" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/routeTitle"
|
android:id="@+id/route_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="titel"
|
android:textColor="@color/white"
|
||||||
android:textSize="20sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
|
app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
|
||||||
|
android:text=""
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -33,49 +34,50 @@
|
|||||||
android:layout_width="250dp"
|
android:layout_width="250dp"
|
||||||
android:layout_height="250dp"
|
android:layout_height="250dp"
|
||||||
android:layout_margin="40dp"
|
android:layout_margin="40dp"
|
||||||
android:id="@+id/routeDetailImage"
|
android:id="@+id/route_detail_image"
|
||||||
app:layout_constraintTop_toBottomOf="@id/routeDetailBackButton"
|
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@id/routeDetailText"
|
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst" />
|
||||||
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/routeDetailText"
|
android:id="@+id/reoute_detail_tekst"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:layout_marginBottom="100dp"
|
android:layout_marginTop="56dp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/startRouteText"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.6"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" />
|
app:layout_constraintTop_toBottomOf="@id/route_detail_image" />
|
||||||
|
|
||||||
<ImageButton
|
<Button
|
||||||
android:id="@+id/startRouteButton"
|
android:id="@+id/start_route_button"
|
||||||
android:backgroundTint="@color/primaryColour"
|
|
||||||
android:scaleX="5"
|
|
||||||
android:scaleY="5"
|
|
||||||
android:layout_width="70dp"
|
|
||||||
android:layout_height="70dp"
|
|
||||||
android:layout_margin="20dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/startRouteText"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/startRouteText"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/startRouteText"
|
|
||||||
android:src="@drawable/ic_baseline_play_arrow_24"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/startRouteText"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="20dp"
|
android:layout_marginBottom="30dp"
|
||||||
|
android:backgroundTint="@color/secondaryColour"
|
||||||
android:text="@string/start_route"
|
android:text="@string/start_route"
|
||||||
android:textSize="50sp"
|
android:textColor="@color/buttonColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/startRouteButton"
|
app:layout_constraintHorizontal_bias="0.498"
|
||||||
app:layout_constraintTop_toBottomOf="@id/routeDetailText" />
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/total_distance" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/total_distance"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="141dp"
|
||||||
|
android:layout_marginBottom="19dp"
|
||||||
|
android:text="@string/total_distance"
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
|
android:textColor="@color/buttonColour"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
tools:layout_editor_absoluteX="169dp" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -5,17 +5,19 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/settingFragment"
|
||||||
tools:context=".fragments.SettingsFragment">
|
tools:context=".fragments.SettingsFragment">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
|
android:id="@+id/settings_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
android:backgroundTint="@color/primaryColour"
|
android:backgroundTint="@color/primaryColour"
|
||||||
android:src="@drawable/ic_back_button_24"
|
android:src="@drawable/ic_back_button_24"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView"
|
||||||
@@ -30,7 +32,7 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box1"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/taal"
|
android:text="@string/language"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -86,14 +88,14 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
app:layout_constraintTop_toBottomOf="@id/name_box"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/imperiaal_systeem"
|
android:text="@string/imperial_system"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -113,6 +115,7 @@
|
|||||||
app:layout_constraintVertical_bias="0.0" />
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/settingsImperialButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -138,7 +141,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/_65_stand"
|
android:text="@string/_65_mode"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -159,6 +162,7 @@
|
|||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/BigFont"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||||
@@ -183,7 +187,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/kleurenblind"
|
android:text="@string/colorblind"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -203,6 +207,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<androidx.appcompat.widget.SwitchCompat
|
<androidx.appcompat.widget.SwitchCompat
|
||||||
|
android:id="@+id/settingsEyesButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -1,28 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
|
android:id="@+id/statisticsFragment"
|
||||||
tools:context=".fragments.StatisticFragment">
|
tools:context=".fragments.StatisticFragment">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:backgroundTint="@color/primaryColour"
|
|
||||||
android:src="@drawable/ic_back_button_24"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/statistieken"
|
android:text="@string/statistics"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -30,22 +21,22 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box1"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/totale_afstand"
|
android:text="@string/total_distance"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -61,13 +52,13 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/statistics_km"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=" km"
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -87,14 +78,14 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
app:layout_constraintTop_toBottomOf="@id/name_box"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/bezochte_locaties"
|
android:text="@string/visited_locations"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -113,9 +104,10 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/statistics_locations_visited"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="GETAL"
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -135,13 +127,12 @@
|
|||||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
app:layout_constraintTop_toBottomOf="@id/Box2">
|
||||||
>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/totale_tijd"
|
android:text="@string/total_time"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -160,9 +151,10 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/statistics_time_value"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=" minuten"
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -177,19 +169,19 @@
|
|||||||
android:id="@+id/Box4"
|
android:id="@+id/Box4"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="0.85"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
|
||||||
android:background="@color/secondaryColour"
|
|
||||||
android:layout_marginHorizontal="20dp"
|
|
||||||
|
|
||||||
>
|
app:layout_constraintTop_toBottomOf="@id/Box3">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/coupons_gespaard"
|
android:text="@string/coupons_collected"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -205,13 +197,13 @@
|
|||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/couponAmount"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="GETAL"
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -219,6 +211,29 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
app:layout_constraintStart_toStartOf="@id/Balk4"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<ImageButton
|
||||||
|
android:id="@+id/coupon_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="20dp"
|
||||||
|
android:background="@drawable/ic_back_button_24"
|
||||||
|
android:scaleX="-1"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/couponAmount"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/couponAmount" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<ImageButton
|
||||||
|
android:id="@+id/statistics_back_button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:background="@drawable/ic_back_button_24"
|
||||||
|
android:backgroundTint="@color/buttonColour"
|
||||||
|
android:src="@drawable/ic_back_button_24"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,26 +1,34 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
|
android:id="@+id/locationItem"
|
||||||
android:layout_margin="20dp">
|
android:layout_margin="20dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/location_image"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:id="@+id/location_image"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
app:layout_constraintEnd_toStartOf="@id/location_name"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="1.0" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/location_name"
|
android:id="@+id/location_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="321dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="47dp"
|
||||||
android:gravity="center"
|
android:gravity="left"
|
||||||
android:text="location"
|
android:text=""
|
||||||
android:textSize="20dp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintStart_toEndOf="@+id/routeImage" />
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHorizontal_bias="1.0"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias="0.0" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -1,27 +1,30 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
|
android:id="@+id/routeItem"
|
||||||
android:layout_margin="20dp">
|
android:layout_margin="20dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:id="@+id/routeImage"
|
android:id="@+id/route_Image"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/route_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/routeName"
|
|
||||||
android:text="test text"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textSize="20dp"
|
android:text=""
|
||||||
app:layout_constraintStart_toEndOf="@+id/routeImage"
|
android:textSize="20sp"
|
||||||
/>
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/route_Image"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
5
app/src/main/res/mipmap-anydpi-v26/icon.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/icon_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
5
app/src/main/res/mipmap-anydpi-v26/icon_round.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/icon_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||||
|
</adaptive-icon>
|
||||||
BIN
app/src/main/res/mipmap-hdpi/icon.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
27
app/src/main/res/values-nl/strings.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<string name="app_name" translatable="false">Next Location</string>
|
||||||
|
<string name="locations">Locaties</string>
|
||||||
|
<string name="routes">Routes</string>
|
||||||
|
<string name="statistics">Statistieken</string>
|
||||||
|
<string name="settings">Instellingen</string>
|
||||||
|
<string name="language">Taal</string>
|
||||||
|
<string name="imperial_system">Imperiaal systeem</string>
|
||||||
|
<string name="_65_mode">65+ stand</string>
|
||||||
|
<string name="colorblind">Kleurenblind</string>
|
||||||
|
<string name="total_distance">Totale afstand:</string>
|
||||||
|
<string name="visited_locations">Bezochte locaties:</string>
|
||||||
|
<string name="total_time">Totale tijd:</string>
|
||||||
|
<string name="coupons_collected">Coupons gespaard:</string>
|
||||||
|
<string name="coupons">Coupons</string>
|
||||||
|
<string name="start_route">Start Route</string>
|
||||||
|
<string name="activate_question">Weet je zeker dat je deze coupon wilt activeren?</string>
|
||||||
|
<string name="activate">activeren</string>
|
||||||
|
<string name="done">Klaar</string>
|
||||||
|
<string name="total_distance_route">De totale afstand van de route is: </string>
|
||||||
|
<string name="cancel">annuleren</string>
|
||||||
|
<string name="English">Engels</string>
|
||||||
|
<string name="Dutch">Nederlands</string>
|
||||||
|
<string name="Chinese">Chinees</string>
|
||||||
|
</resources>
|
||||||
@@ -10,4 +10,5 @@
|
|||||||
<color name="primaryColour">#FF115571</color>
|
<color name="primaryColour">#FF115571</color>
|
||||||
<color name="secondaryColour">#FF31AFB4</color>
|
<color name="secondaryColour">#FF31AFB4</color>
|
||||||
<color name="buttonColour">#FF14212D</color>
|
<color name="buttonColour">#FF14212D</color>
|
||||||
|
<color name="red">#FF0000</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,20 +1,26 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Next Location</string>
|
<string name="app_name" translatable="false">Next Location</string>
|
||||||
<!-- TODO: Remove or change this placeholder text -->
|
<string name="locations">Location</string>
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
|
||||||
<string name="locations">Locaties</string>
|
|
||||||
<string name="routes">Routes</string>
|
<string name="routes">Routes</string>
|
||||||
<string name="statistics">Statistieken</string>
|
<string name="statistics">Statistics</string>
|
||||||
<string name="settings">Instellingen</string>
|
<string name="settings">Settings</string>
|
||||||
<string name="taal">Taal</string>
|
<string name="language">Language</string>
|
||||||
<string name="imperiaal_systeem">Imperiaal systeem</string>
|
<string name="imperial_system">Imperial system</string>
|
||||||
<string name="_65_stand">65+ stand</string>
|
<string name="_65_mode">65+ mode</string>
|
||||||
<string name="kleurenblind">Kleurenblind</string>
|
<string name="colorblind">Colorblind</string>
|
||||||
<string name="statistieken">Statistieken</string>
|
<string name="total_distance">Total distance:</string>
|
||||||
<string name="totale_afstand">Totale afstand:</string>
|
<string name="visited_locations">Visited locations:</string>
|
||||||
<string name="bezochte_locaties">Bezochte locaties:</string>
|
<string name="total_time">Total time:</string>
|
||||||
<string name="totale_tijd">Totale tijd:</string>
|
<string name="coupons_collected">Coupons collected:</string>
|
||||||
<string name="coupons_gespaard">Coupons gespaard:</string>
|
|
||||||
<string name="coupons">Coupons</string>
|
<string name="coupons">Coupons</string>
|
||||||
<string name="start_route">Start Route</string>
|
<string name="start_route">Start Route</string>
|
||||||
|
<string name="activate_question">Are you sure you want to activate this coupon?</string>
|
||||||
|
<string name="activate">activate</string>
|
||||||
|
<string name="done">Done</string>
|
||||||
|
<string name="cancel">cancel</string>
|
||||||
|
<string name="total_distance_route">The total distance of the route is:</string>
|
||||||
|
<string name="route_stop_toast">Route stopped!</string>
|
||||||
|
<string name="Dutch">Dutch</string>
|
||||||
|
<string name="English">English</string>
|
||||||
|
<string name="Chinese">Chinese</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -7,5 +7,16 @@
|
|||||||
<item name="colorSecondary">@color/secondaryColour</item>
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorButtonNormal">@color/buttonColour</item>
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
|
<item name="android:textSize">16sp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/primaryColour</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
|
<item name="android:textSize">24sp</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||