From c15125d0c2acca14e16a35416e1c6bf1cc6a8383 Mon Sep 17 00:00:00 2001 From: Bipin Date: Tue, 12 Jan 2021 10:12:17 +0100 Subject: [PATCH 01/46] Removed all soul from application :) --- .../main/res/drawable-anydpi/ic_stop_icon.xml | 2 +- app/src/main/res/layout/activity_main.xml | 4 +-- app/src/main/res/layout/coupon_item.xml | 4 +-- app/src/main/res/layout/fragment_home.xml | 4 +-- .../res/layout/fragment_location_detail.xml | 6 ++-- app/src/main/res/layout/fragment_route.xml | 1 + .../main/res/layout/fragment_route_detail.xml | 7 ++-- app/src/main/res/layout/fragment_settings.xml | 18 +++++----- .../main/res/layout/fragment_statistic.xml | 34 +++++++++---------- app/src/main/res/layout/help_popup.xml | 7 ++-- app/src/main/res/layout/location_item.xml | 3 +- app/src/main/res/layout/route_item.xml | 3 +- app/src/main/res/values/colors.xml | 6 ++-- 13 files changed, 52 insertions(+), 47 deletions(-) diff --git a/app/src/main/res/drawable-anydpi/ic_stop_icon.xml b/app/src/main/res/drawable-anydpi/ic_stop_icon.xml index addfeb0..8be9df4 100644 --- a/app/src/main/res/drawable-anydpi/ic_stop_icon.xml +++ b/app/src/main/res/drawable-anydpi/ic_stop_icon.xml @@ -6,7 +6,7 @@ android:tint="#333333" android:alpha="0.6"> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index cc1d88c..2e192cb 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -22,9 +22,9 @@ android:id="@+id/navigation_bar" android:layout_width="0dp" android:layout_height="wrap_content" - android:background="@color/white" + android:background="@color/primaryColour" app:itemIconTint="@color/secondaryColour" - app:itemTextColor="@color/primaryColour" + app:itemTextColor="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/coupon_item.xml b/app/src/main/res/layout/coupon_item.xml index 76cff35..9a9a437 100644 --- a/app/src/main/res/layout/coupon_item.xml +++ b/app/src/main/res/layout/coupon_item.xml @@ -13,7 +13,7 @@ android:layout_marginTop="16dp" android:layout_marginBottom="16dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.4" @@ -26,7 +26,7 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:text="" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index c97c363..d47b45f 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -24,7 +24,7 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:layout_marginEnd="20dp" - android:backgroundTint="@color/secondaryColour" + android:backgroundTint="@color/primaryColour" android:src="@drawable/ic_baseline_outlined_flag_24" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -37,7 +37,7 @@ android:layout_marginEnd="20dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@+id/location_list_button" - android:backgroundTint="@color/secondaryColour" + android:backgroundTint="@color/primaryColour" android:src="@drawable/ic_stop_icon"/> diff --git a/app/src/main/res/layout/fragment_location_detail.xml b/app/src/main/res/layout/fragment_location_detail.xml index a89a336..007d7ed 100644 --- a/app/src/main/res/layout/fragment_location_detail.xml +++ b/app/src/main/res/layout/fragment_location_detail.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="" - android:textColor="@color/white" + android:textColor="@color/secondaryColour" android:textSize="30sp" android:gravity="center" app:layout_constraintEnd_toEndOf="parent" @@ -35,7 +35,7 @@ android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" android:text="" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -45,7 +45,7 @@ android:id="@+id/detail_location_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" android:text="" /> diff --git a/app/src/main/res/layout/fragment_route.xml b/app/src/main/res/layout/fragment_route.xml index 3904b49..e445af1 100644 --- a/app/src/main/res/layout/fragment_route.xml +++ b/app/src/main/res/layout/fragment_route.xml @@ -19,6 +19,7 @@ @@ -48,7 +48,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/language" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk" @@ -59,7 +59,7 @@ android:id="@+id/Balk" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -84,7 +84,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toTopOf="@id/Box3" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -96,7 +96,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/imperial_system" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk2" @@ -107,7 +107,7 @@ android:id="@+id/Balk2" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/buttonColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -131,7 +131,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -142,7 +142,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/_65_mode" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk3" diff --git a/app/src/main/res/layout/fragment_statistic.xml b/app/src/main/res/layout/fragment_statistic.xml index 5172702..8662884 100644 --- a/app/src/main/res/layout/fragment_statistic.xml +++ b/app/src/main/res/layout/fragment_statistic.xml @@ -14,7 +14,7 @@ android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="@string/statistics" - android:textColor="@color/white" + android:textColor="@color/secondaryColour" android:textSize="30sp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -25,7 +25,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toTopOf="@id/Box2" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -37,7 +37,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/total_distance" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk" @@ -48,7 +48,7 @@ android:id="@+id/Balk" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -59,7 +59,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -74,7 +74,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toTopOf="@id/Box3" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -86,7 +86,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/visited_locations" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk2" @@ -97,7 +97,7 @@ android:id="@+id/Balk2" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -108,7 +108,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -123,7 +123,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toTopOf="@id/Box4" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -133,7 +133,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/total_time" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk3" @@ -144,7 +144,7 @@ android:id="@+id/Balk3" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -155,7 +155,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" @@ -170,7 +170,7 @@ android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginHorizontal="20dp" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.85" @@ -182,7 +182,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/coupons_collected" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/Balk4" @@ -193,7 +193,7 @@ android:id="@+id/Balk4" android:layout_width="1dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -204,7 +204,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" diff --git a/app/src/main/res/layout/help_popup.xml b/app/src/main/res/layout/help_popup.xml index be39f71..fda4ba9 100644 --- a/app/src/main/res/layout/help_popup.xml +++ b/app/src/main/res/layout/help_popup.xml @@ -16,9 +16,9 @@ android:layout_width="300dp" android:layout_height="50dp" android:text="@string/help" - android:textColor="@color/black" + android:textColor="@color/secondaryColour" android:textAlignment="center" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" android:paddingVertical="10dp"/> diff --git a/app/src/main/res/layout/location_item.xml b/app/src/main/res/layout/location_item.xml index 9e733b9..8e537be 100644 --- a/app/src/main/res/layout/location_item.xml +++ b/app/src/main/res/layout/location_item.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="50dp" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" android:id="@+id/locationItem" android:layout_margin="20dp"> @@ -25,6 +25,7 @@ android:layout_height="47dp" android:layout_marginStart="5dp" android:gravity="left" + android:textColor="@color/secondaryColour" android:text="" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/layout/route_item.xml b/app/src/main/res/layout/route_item.xml index eb1e951..cc3ac5e 100644 --- a/app/src/main/res/layout/route_item.xml +++ b/app/src/main/res/layout/route_item.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="50dp" xmlns:app="http://schemas.android.com/apk/res-auto" - android:background="@color/secondaryColour" + android:background="@color/primaryColour" android:id="@+id/routeItem" android:layout_margin="20dp"> @@ -21,6 +21,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" + android:textColor="@color/secondaryColour" android:text="" android:textSize="20sp" app:layout_constraintBottom_toBottomOf="parent" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a8f6080..ebfbba9 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,8 +7,8 @@ #FF018786 #FF000000 #FFFFFFFF - #FF115571 - #FF31AFB4 - #FF14212D + #FFFFFFFF + #FF000000 + #FF000000 #FF0000 \ No newline at end of file From cf650f6cf4b8b74c5facb415dbb7bab225999a84 Mon Sep 17 00:00:00 2001 From: Bipin Date: Tue, 12 Jan 2021 10:18:04 +0100 Subject: [PATCH 02/46] colourFix --- .../main/java/com/a1/nextlocation/fragments/HomeFragment.java | 2 +- app/src/main/res/drawable/ic_baseline_location_on_24.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index cf442a1..abb285f 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -249,7 +249,7 @@ public class HomeFragment extends Fragment implements LocationListener { // marker icon Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24); marker.setAlpha(255); - marker.setTint(getResources().getColor(R.color.primaryColour)); + marker.setTint(getResources().getColor(R.color.secondaryColour)); // add all locations to the overlay itemss for (com.a1.nextlocation.data.Location location : locations) { diff --git a/app/src/main/res/drawable/ic_baseline_location_on_24.xml b/app/src/main/res/drawable/ic_baseline_location_on_24.xml index 94b2681..3874b85 100644 --- a/app/src/main/res/drawable/ic_baseline_location_on_24.xml +++ b/app/src/main/res/drawable/ic_baseline_location_on_24.xml @@ -5,6 +5,6 @@ android:viewportHeight="24" android:tint="?attr/colorControlNormal"> From f3dbb2b1d1d4db84f6942cd5415defb763346646 Mon Sep 17 00:00:00 2001 From: Bipin Date: Tue, 12 Jan 2021 10:44:59 +0100 Subject: [PATCH 03/46] big bordfer --- app/src/main/res/layout/fragment_settings.xml | 93 ++++++++++++++++++- app/src/main/res/values/themes.xml | 1 + 2 files changed, 89 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 9ea800a..a421c02 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -31,6 +31,16 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 1e892a3..bc08dfa 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -8,6 +8,7 @@ @color/buttonColour @color/secondaryColour + @color/teal_700 16sp From e7f152bc009e9b4227d57d98599c87e6372e568c Mon Sep 17 00:00:00 2001 From: Bipin Date: Tue, 12 Jan 2021 11:00:44 +0100 Subject: [PATCH 04/46] WAT MOOOOOOI --- app/src/main/res/layout/fragment_settings.xml | 3 +- .../main/res/layout/fragment_statistic.xml | 44 +++++++++++++++++-- app/src/main/res/layout/location_item.xml | 18 ++++++++ app/src/main/res/layout/route_item.xml | 18 ++++++++ app/src/main/res/values/themes.xml | 6 ++- 5 files changed, 83 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index a421c02..88bc2be 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -6,7 +6,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/primaryColour" android:id="@+id/settingFragment" - tools:context=".fragments.SettingsFragment"> + tools:context=".fragments.SettingsFragment" + android:theme="@style/Theme.Switches"> + + + + + + + + + + + + + + + + @color/buttonColour @color/secondaryColour - @color/teal_700 16sp + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index ebfbba9..4cad898 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -11,4 +11,7 @@ #FF000000 #FF000000 #FF0000 + #FF115571 + #FF31AFB4 + #FF14212D \ No newline at end of file From 87403625531dfd25cf634b47ebdb86e78d6bb329 Mon Sep 17 00:00:00 2001 From: Robin Koedood Date: Tue, 12 Jan 2021 12:05:27 +0100 Subject: [PATCH 08/46] Auto stash before merge of "fuckcolours" and "origin/fuckcolours" --- .../fragments/SettingsFragment.java | 37 +++++++++---------- app/src/main/res/values/themes.xml | 3 ++ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java index c7a1131..e0a2937 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; +import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,6 +20,7 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentTransaction; +import com.a1.nextlocation.MainActivity; import com.a1.nextlocation.R; import org.jetbrains.annotations.NotNull; @@ -30,7 +32,7 @@ public class SettingsFragment extends Fragment { private SharedPreferences.Editor editor; private SwitchCompat fontSwitch; private SwitchCompat imperialSwitch; - private SwitchCompat colourblindSwitch; + private SwitchCompat colorBlindMode; private Refreshable refreshable; @Override @@ -106,28 +108,23 @@ public class SettingsFragment extends Fragment { editor.commit(); }); - //Initialises colourblind mode switchCompat - this.colourblindSwitch = view.findViewById(R.id.colourblindSwitch); - fontSwitch.setChecked(sharedPreferences.getBoolean("colourblindSwitch", false)); - - //Initial check to see what setting was last chosen - if (colourblindSwitch.isChecked()){ - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); - }else if (!colourblindSwitch.isChecked()){ - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); - } - - colourblindSwitch.setOnClickListener(view1 -> { - if (colourblindSwitch.isChecked()){ - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); - }else if (!colourblindSwitch.isChecked()){ - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); - } - editor.putBoolean("colourblindSwitch", colourblindSwitch.isChecked()); + this.colorBlindMode = view.findViewById(R.id.settingsEyesButton); + this.colorBlindMode.setOnClickListener(view1 -> { + editor.putBoolean("colorBlindModeSwitch", imperialSwitch.isChecked()); editor.apply(); editor.commit(); - }); + if (colorBlindMode.isChecked()){ + requireActivity().setTheme(R.style.Theme_NextLocation); + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + System.out.println("AAN"); + }else if (!colorBlindMode.isChecked()){ + requireActivity().setTheme(R.style.Theme_NextLocationNight); + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + System.out.println("UIT"); + } + + }); } private void initializeLanguageDropdown(View view) { diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 5306d31..d3ca57a 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -26,4 +26,7 @@ @color/secondaryColour 24sp + + + \ No newline at end of file From 4c09192f9a314097c8e879073cf73e66048977f3 Mon Sep 17 00:00:00 2001 From: Robin Koedood Date: Tue, 12 Jan 2021 12:09:30 +0100 Subject: [PATCH 09/46] YEP --- app/src/main/java/com/a1/nextlocation/MainActivity.java | 1 - .../com/a1/nextlocation/fragments/SettingsFragment.java | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/a1/nextlocation/MainActivity.java b/app/src/main/java/com/a1/nextlocation/MainActivity.java index 500ccbe..209e51d 100644 --- a/app/src/main/java/com/a1/nextlocation/MainActivity.java +++ b/app/src/main/java/com/a1/nextlocation/MainActivity.java @@ -38,7 +38,6 @@ public class MainActivity extends AppCompatActivity implements Refreshable { */ @Override protected void onCreate(Bundle savedInstanceState) { - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); super.onCreate(savedInstanceState); // initialize saved language from sharedPreferences diff --git a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java index e0a2937..6155a58 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java @@ -108,7 +108,7 @@ public class SettingsFragment extends Fragment { editor.commit(); }); - this.colorBlindMode = view.findViewById(R.id.settingsEyesButton); + this.colorBlindMode = view.findViewById(R.id.colourblindSwitch); this.colorBlindMode.setOnClickListener(view1 -> { editor.putBoolean("colorBlindModeSwitch", imperialSwitch.isChecked()); editor.apply(); @@ -117,10 +117,12 @@ public class SettingsFragment extends Fragment { if (colorBlindMode.isChecked()){ requireActivity().setTheme(R.style.Theme_NextLocation); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + getActivity().recreate(); System.out.println("AAN"); }else if (!colorBlindMode.isChecked()){ - requireActivity().setTheme(R.style.Theme_NextLocationNight); + requireActivity().setTheme(R.style.Theme_NextLocation); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + getActivity().recreate(); System.out.println("UIT"); } From 2f5b53e2b4ae9f598ad71d9fb488edf27dacb59e Mon Sep 17 00:00:00 2001 From: Bipin Date: Tue, 12 Jan 2021 12:13:29 +0100 Subject: [PATCH 10/46] barFix --- app/src/main/res/layout/fragment_settings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 2b1128a..d71b96b 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -127,7 +127,7 @@ android:id="@+id/Balk2" android:layout_width="2dp" android:layout_height="match_parent" - android:background="@color/buttonColour" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -182,7 +182,7 @@ android:id="@+id/Balk3" android:layout_width="2dp" android:layout_height="match_parent" - android:background="@color/black" + android:background="@color/secondaryColour" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" From 0f17e8d1e529e14c64a3835eca7228832ef01275 Mon Sep 17 00:00:00 2001 From: RemoMeijer Date: Tue, 12 Jan 2021 12:18:21 +0100 Subject: [PATCH 11/46] Added distance from current location to opend location --- app/src/main/assets/locations-nl.json | 42 +++++++++--------- app/src/main/assets/locations.json | 44 +++++++++---------- .../java/com/a1/nextlocation/data/Data.java | 8 ++++ .../nextlocation/fragments/HomeFragment.java | 1 + .../fragments/LocationDetailFragment.java | 24 +++++++++- 5 files changed, 75 insertions(+), 44 deletions(-) diff --git a/app/src/main/assets/locations-nl.json b/app/src/main/assets/locations-nl.json index a68d082..9c267c1 100644 --- a/app/src/main/assets/locations-nl.json +++ b/app/src/main/assets/locations-nl.json @@ -2,77 +2,77 @@ { "name":"McDonald's Breda Karnemelkstraat", "coordinates":"51.586058044064735, 4.775804729737406", - "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.\n\nAdres:\tKaranemelkstraat 5\nOpeningstijden:\t11:00-23:00\nTelefoon:\t076 533 3000", + "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.\n\nAdres:\tKaranemelkstraat 5\nOpeningstijden:\t11:00-23:00\nTelefoon:\t076 533 3000\nAfstand tot (m): ", "imageUrl":"mc_donalds", "iconUrl": "mcdonalds_icon" }, { "name":"Subway Karnemelkstraat 10 A, 1", "coordinates":"51.586110268250046, 4.775124041110522", - "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.\n\nAdres:\tKarnemelkstraat 10 A\nOpeningstijden:\t10:00-19:30\nTelefoon:\t076 521 4411", + "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.\n\nAdres:\tKarnemelkstraat 10 A\nOpeningstijden:\t10:00-19:30\nTelefoon:\t076 521 4411\nAfstand tot: ", "imageUrl":"subway", "iconUrl": "subway_icon" }, { "name":"Wok To Go Halstraat 40", "coordinates":"51.58648245586817, 4.77757540779623", - "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.\n\nAdres:\tHalstraat 40\nOpeningstijden:\t12:30-21:00\nTelefoon:\t076 522 5643", + "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.\n\nAdres:\tHalstraat 40\nOpeningstijden:\t12:30-21:00\nTelefoon:\t076 522 5643\nAfstand tot: ", "imageUrl":"wok_to_go", "iconUrl": "wok_icon" }, { "name":"De Boterhal Grote Markt 19", "coordinates":"51.58798587092525, 4.776248508784696", - "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.\n\nAdres:\tGrote Markt 19\nOpeningstijden:\t12:00-01:00\nTelefoon:\t076 889 8180", + "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.\n\nAdres:\tGrote Markt 19\nOpeningstijden:\t12:00-01:00\nTelefoon:\t076 889 8180\nAfstand tot: ", "imageUrl":"de_boter_hal", "iconUrl": "restaurant_icon" }, { "name":"Gauchos Grote Markt 33", "coordinates":"51.588456220778504, 4.77602051562935", - "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.\n\nAdres:\tGrote Markt 33\nOpeningstijden:\t17:00-23:00\nTelefoon:\t076 522 4505", + "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.\n\nAdres:\tGrote Markt 33\nOpeningstijden:\t17:00-23:00\nTelefoon:\t076 522 4505\nAfstand tot: ", "imageUrl":"gauchos", "iconUrl": "restaurant_icon" }, { "name":"The Tosti Club Breda A4, Vlaszak 2", "coordinates":"51.588914881807106, 4.780460117020282", - "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?\n\nAdres:\tVlaszak 2\nOpeningstijden:\t10:30-16:00\nTelefoon:\t076 303 3302", + "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?\n\nAdres:\tVlaszak 2\nOpeningstijden:\t10:30-16:00\nTelefoon:\t076 303 3302\nAfstand tot: ", "imageUrl":"the_tosti_club", "iconUrl": "restaurant_icon" }, { "name":"Coffee & Lunch 4 you Oude Vest 31", "coordinates":"51.58724065015693, 4.779495750152812", - "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.\n\nAdres:\tOude Vest 31\nOpeningstijden:\tgesloten\nTelefoon:\t076 888 6000", + "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.\n\nAdres:\tOude Vest 31\nOpeningstijden:\tgesloten\nTelefoon:\t076 888 6000\nAfstand tot: ", "imageUrl":"coffee_and_lunch", "iconUrl": "coffee_icon" }, { "name":"t Zusje Breda Vismarktstraat 28", "coordinates":"51.58989852937449, 4.7734114226595885", - "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!\n\nAdres:\tVismarktstraat 28\nOpeningstijden:\t17:30-22:30\nTelefoon:\t0900 98753", + "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!\n\nAdres:\tVismarktstraat 28\nOpeningstijden:\t17:30-22:30\nTelefoon:\t0900 98753\nAfstand tot: ", "imageUrl":"t_zusje_breda", "iconUrl": "restaurant_icon" }, { "name":"VR-World Nassaustraat 2", "coordinates":"51.59149198370258, 4.786158496485409", - "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.\n\nAdres:\tNassaustraat 2\nOpeningstijden:\t10:00-23:00\nTelefoon:\t085 077 0077", + "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.\n\nAdres:\tNassaustraat 2\nOpeningstijden:\t10:00-23:00\nTelefoon:\t085 077 0077\nAfstand tot: ", "imageUrl":"vr_world", "iconUrl": "vr_icon" }, { "name":"Kees Kroket Houtmarkt 9", "coordinates":"51.58629976171061, 4.7769606819261", - "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.\n\nAdres:\tHoutmarkt 9\nOpeningstijden:\t15:00-19:30\nTelefoon:\t076 785 4359", + "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.\n\nAdres:\tHoutmarkt 9\nOpeningstijden:\t15:00-19:30\nTelefoon:\t076 785 4359\nAfstand tot: ", "imageUrl":"kees_kroket", "iconUrl": "restaurant_icon" }, { "name":"Prison Escape Kloosterlaan 168", "coordinates":"51.590621347316336, 4.784612424356731", - "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.\n\nAdres:\tKloosterlaan 168\nOpeningstijden:\tvr-za 13:45-22:30\nTelefoon:\t085 065 3268", + "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.\n\nAdres:\tKloosterlaan 168\nOpeningstijden:\tvr-za 13:45-22:30\nTelefoon:\t085 065 3268\nAfstand tot: ", "imageUrl":"prison_escape_room", "iconUrl": "escape_icon" }, @@ -87,70 +87,70 @@ { "name":"Escaping Breda: Escape Room Games Boschstraat 114", "coordinates":" 51.59110835530862,4.784147222780912", - "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.\n\nAdres:\tBoschstraat 114\nOpeningstijden:\tOp reservering\nTelefoon:\t085 401 9567", + "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.\n\nAdres:\tBoschstraat 114\nOpeningstijden:\tOp reservering\nTelefoon:\t085 401 9567\nAfstand tot: ", "imageUrl":"escaping_room", "iconUrl": "escape_icon" }, { "name":"MEZZ Breda Keizerstraat 101", "coordinates":"51.583597834546616, 4.778605421170793", - "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.\n\nAdres:\tKeizerstraat 101\nOpeningstijden:\t-\nTelefoon:\t076 515 6677", + "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.\n\nAdres:\tKeizerstraat 101\nOpeningstijden:\t-\nTelefoon:\t076 515 6677\nAfstand tot: ", "imageUrl":"mezz_breda", "iconUrl": "mezz_icon" }, { "name":"Het Klooster Breda Schorsmolenstraat 13", "coordinates":"51.58774025242826, 4.765006685059431", - "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.\n\nAdres:\tSchorsmolenstraat13\nOpeningstijden:\t09:00-17:00\nTelefoon:\t076 593 8845", + "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.\n\nAdres:\tSchorsmolenstraat13\nOpeningstijden:\t09:00-17:00\nTelefoon:\t076 593 8845\nAfstand tot: ", "imageUrl":"het_klooster_breda", "iconUrl": "building_icon" }, { "name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade", "coordinates":"51.591384128082396, 4.771519780736044", - "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.\n\nAdres:\tNieuwe Prinsenkade\nOpeningstijden:\t-\nTelefoon:\t-", + "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.\n\nAdres:\tNieuwe Prinsenkade\nOpeningstijden:\t-\nTelefoon:\t-\nAfstand tot: ", "imageUrl":"beach_and_lounge_club", "iconUrl": "beach_icon" }, { "name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b", "coordinates":"51.59040026960037, 4.775767751364238", - "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.\n\nAdres:\tKraanstraat 4b\nOpeningstijden:\tdi 11:00-16:00\nTelefoon:\t-", + "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.\n\nAdres:\tKraanstraat 4b\nOpeningstijden:\tdi 11:00-16:00\nTelefoon:\t-\nAfstand tot: ", "imageUrl":"koningin_wilhelimna_paviljoen", "iconUrl": "building_icon" }, { "name":"Hercules en de Nemeïsche leeuw", "coordinates":"51.59120082440261, 4.777904512729459", - "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.\n\nAdres:\t4811 XJ Breda\nOpeningstijden:\t-\nTelefoon:\t14 076", + "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.\n\nAdres:\t4811 XJ Breda\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ", "imageUrl":"hercules_park_valkenburg", "iconUrl": "statue_icon" }, { "name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1", "coordinates":"51.59249639550226, 4.779742259785807", - "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.\n\nAdres:\tDelpratsingel 1\nOpeningstijden:\t-\nTelefoon:\t14 076", + "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.\n\nAdres:\tDelpratsingel 1\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ", "imageUrl":"nassau_baroniemonument", "iconUrl": "statue_icon" }, { "name":"Station Breda Gravinnen van Nassauboulevard 43", "coordinates":"51.59569850758307,4.780295549958155", - "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.\n\nAdres:\tGravinnen van Nassauboulevard 43\nOpeningstijden:\t-\nTelefoon:\t030 751 51 55", + "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.\n\nAdres:\tGravinnen van Nassauboulevard 43\nOpeningstijden:\t-\nTelefoon:\t030 751 51 55\nAfstand tot: ", "imageUrl":"station_breda", "iconUrl": "building_icon" }, { "name":"Belcrum Beach Veilingkade 12a", "coordinates":"51.59945849923229, 4.765404193295078", - "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.\n\nAdres:\tVeilingskade 12a\nOpeningstijden:\t12:00-19:00\nTelefoon:\t-", + "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.\n\nAdres:\tVeilingskade 12a\nOpeningstijden:\t12:00-19:00\nTelefoon:\t-\nAfstand tot: ", "imageUrl":"belcrum_beach", "iconUrl": "beach_icon" }, { "name":"De Belcrum Watertoren (1935) Speelhuislaan 158", "coordinates":"51.60052702557225, 4.7689948674496145", - "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.\n\nAdres:\tSpeelhuislaan 158\nOpeningstijden:\t08:30-18:00\nTelefoon:\t076 521 3080", + "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.\n\nAdres:\tSpeelhuislaan 158\nOpeningstijden:\t08:30-18:00\nTelefoon:\t076 521 3080\nAfstand tot: ", "imageUrl":"belcrum_watertoren", "iconUrl": "building_icon" } diff --git a/app/src/main/assets/locations.json b/app/src/main/assets/locations.json index fe716d6..3a2fd7c 100644 --- a/app/src/main/assets/locations.json +++ b/app/src/main/assets/locations.json @@ -2,84 +2,84 @@ { "name":"McDonald's Breda Karnemelkstraat", "coordinates":"51.586058044064735, 4.775804729737406", - "description":"Did you know McDonald's is the largest restaurant chain in the world? This gives us an impressive history. But we prefer to look at our future. New restaurants, better products, and sustainable entrepreneurship.\n\nAdress:\tKaranemelkstraat 5\nOpening hours:\t11:00-23:00\nPhone:\t076 533 3000", + "description":"Did you know McDonald's is the largest restaurant chain in the world? This gives us an impressive history. But we prefer to look at our future. New restaurants, better products, and sustainable entrepreneurship.\n\nAdress:\tKaranemelkstraat 5\nOpening hours:\t11:00-23:00\nPhone:\t076 533 3000\nDistance to: ", "imageUrl":"mc_donalds", "iconUrl": "mcdonalds_icon" }, { "name":"Subway Karnemelkstraat 10 A, 1", "coordinates":"51.586110268250046, 4.775124041110522", - "description":"Subway is an American multinational fast-food chain that mainly sells sandwiches. The company distinguishes itself from many other sandwich shops because the customer can have the sandwich put together themselves. Subway works with franchises. The company has nearly 45,000 offices on all continents.\n\nAdress:\tKarnemelkstraat 10 A\nOpening hours:\t10:00-19:30\nPhone:\t076 521 4411", + "description":"Subway is an American multinational fast-food chain that mainly sells sandwiches. The company distinguishes itself from many other sandwich shops because the customer can have the sandwich put together themselves. Subway works with franchises. The company has nearly 45,000 offices on all continents.\n\nAdress:\tKarnemelkstraat 10 A\nOpening hours:\t10:00-19:30\nPhone:\t076 521 4411\nDistance to: ", "imageUrl":"subway", "iconUrl": "subway_icon" }, { "name":"Wok To Go Halstraat 40", "coordinates":"51.58648245586817, 4.77757540779623", - "description":"At Wok To Go we love fast, healthy and tasty meals. Since 2003 our chefs have been developing the most delicious wok dishes with fresh ingredients. We do this with complete dedication under the motto “ Making people happy through food ”. By stir-frying - with a small amount of oil - on high heat, the taste and healthy nutrients are preserved. We choose healthy and different ingredients and prepare balanced courses in a 'Wokki box' for a healthy lifestyle.\n\nAdress:\tHalstraat 40\nOpening hours:\t12:30-21:00\nPhone:\t076 522 5643", + "description":"At Wok To Go we love fast, healthy and tasty meals. Since 2003 our chefs have been developing the most delicious wok dishes with fresh ingredients. We do this with complete dedication under the motto “ Making people happy through food ”. By stir-frying - with a small amount of oil - on high heat, the taste and healthy nutrients are preserved. We choose healthy and different ingredients and prepare balanced courses in a 'Wokki box' for a healthy lifestyle.\n\nAdress:\tHalstraat 40\nOpening hours:\t12:30-21:00\nPhone:\t076 522 5643\nDistance to: ", "imageUrl":"wok_to_go", "iconUrl": "wok_icon" }, { "name":"De Boterhal Grote Markt 19", "coordinates":"51.58798587092525, 4.776248508784696", - "description":"De Boterhal in Breda is an international tapas restaurant, specialty beer café, and wine bar. You can enjoy lunch, drinks, and dinner with us. We have an extensive menu with a lot of beers, wines, both per glass and per bottle, lunch, and tapas dishes. In addition to the food we serve, we also have a lot of beers and wines. In addition to the beers on the menu, we have varying beers: five kettle beers and five seasonal beers.\n\nAdress:\tGrote Markt 19\nOpening hours:\t12:00-01:00\nPhone:\t076 889 8180", + "description":"De Boterhal in Breda is an international tapas restaurant, specialty beer café, and wine bar. You can enjoy lunch, drinks, and dinner with us. We have an extensive menu with a lot of beers, wines, both per glass and per bottle, lunch, and tapas dishes. In addition to the food we serve, we also have a lot of beers and wines. In addition to the beers on the menu, we have varying beers: five kettle beers and five seasonal beers.\n\nAdress:\tGrote Markt 19\nOpening hours:\t12:00-01:00\nPhone:\t076 889 8180\nDistance to: ", "imageUrl":"de_boter_hal", "iconUrl": "restaurant_icon" }, { "name":"Gauchos Grote Markt 33", "coordinates":"51.588456220778504, 4.77602051562935", - "description":"The medieval Grote Markt is a historic place in the Burgundian heart of Breda, once in the hands of the Spanish occupier. Gauchos Grill-Restaurant combines Brabant conviviality with professional hospitality. In our Latin kitchen, we prepare a tender Argentinian steak or a tasty fish dish from the grill.\n\\nAdress:\tGrote Markt 33\nOpening hours:\t17:00-23:00\nPhone:\t076 522 4505", + "description":"The medieval Grote Markt is a historic place in the Burgundian heart of Breda, once in the hands of the Spanish occupier. Gauchos Grill-Restaurant combines Brabant conviviality with professional hospitality. In our Latin kitchen, we prepare a tender Argentinian steak or a tasty fish dish from the grill.\n\\nAdress:\tGrote Markt 33\nOpening hours:\t17:00-23:00\nPhone:\t076 522 4505\nDistance to: ", "imageUrl":"gauchos", "iconUrl": "restaurant_icon" }, { "name":"The Tosti Club Breda A4, Vlaszak 2", "coordinates":"51.588914881807106, 4.780460117020282", - "description":"You can go to all our branches all day because at The Tosti Club you eat around the clock. So come for breakfast, lunch, or a quick bite at the end of the day (how about our The Tosti Slice, our variant on pizza!). If you don't feel like bread, then we can also delight you with acai smoothie bowls, pancakes, granolas/yogurt, or just a nice hot drink with cake. Can we recommend the Red Velvet fudge cake?\n\\nAdress:\tVlaszak 2\nOpening hours:\t10:30-16:00\nPhone:\t076 303 3302", + "description":"You can go to all our branches all day because at The Tosti Club you eat around the clock. So come for breakfast, lunch, or a quick bite at the end of the day (how about our The Tosti Slice, our variant on pizza!). If you don't feel like bread, then we can also delight you with acai smoothie bowls, pancakes, granolas/yogurt, or just a nice hot drink with cake. Can we recommend the Red Velvet fudge cake?\n\\nAdress:\tVlaszak 2\nOpening hours:\t10:30-16:00\nPhone:\t076 303 3302\nDistance to: ", "imageUrl":"the_tosti_club", "iconUrl": "restaurant_icon" }, { "name":"Coffee & Lunch 4 you Oude Vest 31", "coordinates":"51.58724065015693, 4.779495750152812", - "description":"Welcome to Coffee & Lunch 4 you! Our atmospheric lunchroom is located in the center of Breda, near the parking garage and the bicycle shed.\n\nAdress:\tOude Vest 31\nOpening hours:\tClosed\nPhone:\t076 888 6000", + "description":"Welcome to Coffee & Lunch 4 you! Our atmospheric lunchroom is located in the center of Breda, near the parking garage and the bicycle shed.\n\nAdress:\tOude Vest 31\nOpening hours:\tClosed\nPhone:\t076 888 6000\nDistance to: ", "imageUrl":"coffee_and_lunch", "iconUrl": "coffee_icon" }, { "name":"t Zusje Breda Vismarktstraat 28", "coordinates":"51.58989852937449, 4.7734114226595885", - "description":"That is an evening at 't Zusje. Cozy get-together in a homely atmosphere and enjoy our small dishes, which you can order all evening. At' t Zusje you are at home: you determine the content of the evening yourself. \nWe would like to hear what your wishes are, would like to surprise you with special dishes, and would like to go the extra mile. We offer you an evening out, as we would like to see in ourselves. Enjoy a full evening of Burgundian? In the beautiful building of our Zusje in Breda, you will experience a pleasant evening with full evening tapas food for 31.80. \nCall quickly and book! \n\nAdress:\tVismarktstraat 28\nOpening hours:\t17:30-22:30\nPhone:\t0900 98753", + "description":"That is an evening at 't Zusje. Cozy get-together in a homely atmosphere and enjoy our small dishes, which you can order all evening. At' t Zusje you are at home: you determine the content of the evening yourself. \nWe would like to hear what your wishes are, would like to surprise you with special dishes, and would like to go the extra mile. We offer you an evening out, as we would like to see in ourselves. Enjoy a full evening of Burgundian? In the beautiful building of our Zusje in Breda, you will experience a pleasant evening with full evening tapas food for 31.80. \nCall quickly and book! \n\nAdress:\tVismarktstraat 28\nOpening hours:\t17:30-22:30\nPhone:\t0900 98753\nDistance to: ", "imageUrl":"t_zusje_breda", "iconUrl": "restaurant_icon" }, { "name":"VR-World Nassaustraat 2", "coordinates":"51.59149198370258, 4.786158496485409", - "description":"Virtual Reality is the outing of the moment. Beating zombies, shooting fireballs, or fighting with laser swords, nothing is too crazy with Virtual Reality. At VR World we are looking every day for the newest experiences for you. \n\nWhat about for an example of an Escape Room, but in Virtual Reality? At VR World we offer the latest Escapes in Virtual Reality. Escape from a Pyramid or dismantle a rocket, for example. Do you dare to take on this challenge? \n\nVR World is located at a unique location, namely the dome prison of Breda. This prison was still in operation until 2016 and then companies moved in, including VR World.\n\nAdress:\tNassaustraat 2\nOpening hours:\t10:00-23:00\nPhone:\t085 077 0077", + "description":"Virtual Reality is the outing of the moment. Beating zombies, shooting fireballs, or fighting with laser swords, nothing is too crazy with Virtual Reality. At VR World we are looking every day for the newest experiences for you. \n\nWhat about for an example of an Escape Room, but in Virtual Reality? At VR World we offer the latest Escapes in Virtual Reality. Escape from a Pyramid or dismantle a rocket, for example. Do you dare to take on this challenge? \n\nVR World is located at a unique location, namely the dome prison of Breda. This prison was still in operation until 2016 and then companies moved in, including VR World.\n\nAdress:\tNassaustraat 2\nOpening hours:\t10:00-23:00\nPhone:\t085 077 0077\nDistance to: ", "imageUrl":"vr_world", "iconUrl": "vr_icon" }, { "name":"Kees Kroket Houtmarkt 9", "coordinates":"51.58629976171061, 4.7769606819261", - "description":"KEEEEES KROKET! For more than ten years, Kees Kroket has been located in the center of Breda, close to shoppers. First in the well-known Houtmarktpassage and since April 2019, we have been located at our new location at Houtmarkt 9. You can taste the quality of our fresh fries. These fries, cut from the Agria potato, are pre-fried in sunflower oil and finished in a mix of vegetable oils. This not only ensures the delicious taste, but also that our fries contain relatively little saturated fats and trans-fatty acids, so may use the logo 'Responsible Frying'.\n\\nAdress:\tHoutmarkt 9\nOpening hours:\t15:00-19:30\nPhone:\t076 785 4359", + "description":"KEEEEES KROKET! For more than ten years, Kees Kroket has been located in the center of Breda, close to shoppers. First in the well-known Houtmarktpassage and since April 2019, we have been located at our new location at Houtmarkt 9. You can taste the quality of our fresh fries. These fries, cut from the Agria potato, are pre-fried in sunflower oil and finished in a mix of vegetable oils. This not only ensures the delicious taste, but also that our fries contain relatively little saturated fats and trans-fatty acids, so may use the logo 'Responsible Frying'.\n\\nAdress:\tHoutmarkt 9\nOpening hours:\t15:00-19:30\nPhone:\t076 785 4359\nDistance to: ", "imageUrl":"kees_kroket", "iconUrl": "restaurant_icon" }, { "name":"Prison Escape Kloosterlaan 168", "coordinates":"51.590621347316336, 4.784612424356731", - "description":"Prison Escape lasts a total of 3 hours and your goal is to escape the maximum-security prison. A cast of 25 actors brings the experience to life and it's up to you to find your way out. Hidden objects that might make it easier to realize the way out. \n\nBe careful, look around you, trust (almost) nobody, and approach people .. \nThe clock is ticking and you have 1 goal: to find the way to freedom.\n\nAdress:\tKloosterlaan 168\nOpening hours:\tvr-za 13:45-22:30\nPhone:\t085 065 3268", + "description":"Prison Escape lasts a total of 3 hours and your goal is to escape the maximum-security prison. A cast of 25 actors brings the experience to life and it's up to you to find your way out. Hidden objects that might make it easier to realize the way out. \n\nBe careful, look around you, trust (almost) nobody, and approach people .. \nThe clock is ticking and you have 1 goal: to find the way to freedom.\n\nAdress:\tKloosterlaan 168\nOpening hours:\tvr-za 13:45-22:30\nPhone:\t085 065 3268\nDistance to: ", "imageUrl":"prison_escape_room", "iconUrl": "escape_icon" }, { "name":"De Koepel - FutureDome Events Nassausingel 26", "coordinates":"51.59016000704554, 4.788289825900094", - "description":"In groups, you will be guided by one of our guides across the most unique and beautiful monumental places in and around the Dome! \n\n The guide will explain the illustrious past at the various locations. tour of the prison grounds will take you past the dome, the authentic chapel, women's prison, various air places, and the old court building.\n\nAdress:\tNassausingel 26\nOpening hours:\t09:00-17:00\nPhone:\t076 763 2700", + "description":"In groups, you will be guided by one of our guides across the most unique and beautiful monumental places in and around the Dome! \n\n The guide will explain the illustrious past at the various locations. tour of the prison grounds will take you past the dome, the authentic chapel, women's prison, various air places, and the old court building.\n\nAdress:\tNassausingel 26\nOpening hours:\t09:00-17:00\nPhone:\t076 763 2700\nDistance to: ", "imageUrl":"de_koepel_future_events", "iconUrl": "escape_icon" }, @@ -87,70 +87,70 @@ { "name":"Escaping Breda: Escape Room Games Boschstraat 114", "coordinates":" 51.59110835530862,4.784147222780912", - "description":"Escaping Breda is a new modern location and currently has 2 adventurous escape rooms. Besides, 2 extra escape rooms will be added next year. \n\nEscape from the exciting escape room Let's Rob The Bank, a room suitable for adults and children. If you prefer to escape from an escape room with a higher level of excitement and play, then choose Patient X. \n\nOt our location in Breda we also have a cozy board game café. Combine your escape with a drink, snack, and all free board games. \n\nEscaping Breda is the perfect place for an outing with your family, friends, or colleagues.\n\\nAdress:\\tBoschstraat 114\nOpening hours:\tReservation only\nPhone:\t085 401 9567", + "description":"Escaping Breda is a new modern location and currently has 2 adventurous escape rooms. Besides, 2 extra escape rooms will be added next year. \n\nEscape from the exciting escape room Let's Rob The Bank, a room suitable for adults and children. If you prefer to escape from an escape room with a higher level of excitement and play, then choose Patient X. \n\nOt our location in Breda we also have a cozy board game café. Combine your escape with a drink, snack, and all free board games. \n\nEscaping Breda is the perfect place for an outing with your family, friends, or colleagues.\n\\nAdress:\\tBoschstraat 114\nOpening hours:\tReservation only\nPhone:\t085 401 9567\nDistance to: ", "imageUrl":"escaping_room", "iconUrl": "escape_icon" }, { "name":"MEZZ Breda Keizerstraat 101", "coordinates":"51.583597834546616, 4.778605421170793", - "description":"MEZZ is an open club, involved, curious and inquisitive. MEZZ has humor, is witty, sometimes provocative, and surprising. Experience and fun are central where we think bottom-up. We are there for you, your MEZZ. Do you have ideas or will you want to know more, contact us. We always respond.\n\nAdress:\tKeizerstraat 101\nOpening hours:\t-\nPhone:\t076 515 6677", + "description":"MEZZ is an open club, involved, curious and inquisitive. MEZZ has humor, is witty, sometimes provocative, and surprising. Experience and fun are central where we think bottom-up. We are there for you, your MEZZ. Do you have ideas or will you want to know more, contact us. We always respond.\n\nAdress:\tKeizerstraat 101\nOpening hours:\t-\nPhone:\t076 515 6677\nDistance to: ", "imageUrl":"mezz_breda", "iconUrl": "mezz_icon" }, { "name":"Het Klooster Breda Schorsmolenstraat 13", "coordinates":"51.58774025242826, 4.765006685059431", - "description":"In this old Capuchin monastery a living and working community will be established under the name\" Het Klooster Breda \". \nWith the income from activities, 12 people who are homeless are offered shelter, from which they can regain a place in society.\n\nAdress:\tSchorsmolenstraat13\nOpening hours:\t09:00-17:00\nPhone:\t076 593 8845", + "description":"In this old Capuchin monastery a living and working community will be established under the name\" Het Klooster Breda \". \nWith the income from activities, 12 people who are homeless are offered shelter, from which they can regain a place in society.\n\nAdress:\tSchorsmolenstraat13\nOpening hours:\t09:00-17:00\nPhone:\t076 593 8845\nDistance to: ", "imageUrl":"het_klooster_breda", "iconUrl": "building_icon" }, { "name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade", "coordinates":"51.591384128082396, 4.771519780736044", - "description":"Beach & Lounge Club Spider is known for its immensely popular location in Bergen op Zoom. Since 2020, this high segment lounge club has opened a second location in Breda called Beach & Lounge Club Spider Rooftop Bar.\n\nAdress:\tNieuwe Prinsenkade\nOpening hours:\t-\nPhone:\t", + "description":"Beach & Lounge Club Spider is known for its immensely popular location in Bergen op Zoom. Since 2020, this high segment lounge club has opened a second location in Breda called Beach & Lounge Club Spider Rooftop Bar.\n\nAdress:\tNieuwe Prinsenkade\nOpening hours:\t-\nPhone:\t\nDistance to: ", "imageUrl":"beach_and_lounge_club", "iconUrl": "beach_icon" }, { "name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b", "coordinates":"51.59040026960037, 4.775767751364238", - "description":"Queen Wilhelmina Pavilion is a building in Breda Center in Breda. It belongs to the Royal Military Academy (KMA) and has the status of a national monument. It is located at Kasteelplein 15, just in front of Breda Castle. the west side of the driveway of the castle, with the long right side wall on the castle moat and the long left side wall on the Cingelstraat.\n\nAdress:\tKraanstraat 4b\nOpening hours:\tdi 11:00-16:00\nPhone:\t-", + "description":"Queen Wilhelmina Pavilion is a building in Breda Center in Breda. It belongs to the Royal Military Academy (KMA) and has the status of a national monument. It is located at Kasteelplein 15, just in front of Breda Castle. the west side of the driveway of the castle, with the long right side wall on the castle moat and the long left side wall on the Cingelstraat.\n\nAdress:\tKraanstraat 4b\nOpening hours:\tdi 11:00-16:00\nPhone:\t-\nDistance to: ", "imageUrl":"koningin_wilhelimna_paviljoen", "iconUrl": "building_icon" }, { "name":"Hercules en de Nemeïsche leeuw", "coordinates":"51.59120082440261, 4.777904512729459", - "description":"The statue shows Hercules with the skin of the Nemean lion. Heracles or Hercules is a figure from Greek mythology. He was a Greek hero and became famous for the 12 difficult works he performed at the behest of King Eurystheus. The statue is part of the 17 other sandstone statues that Willem III bought between 1670 and 1686. The statues were spread over lawns in the Valkenberg park.\nHercules is the only original statue that remains.\n\nAdress:\t4811 XJ Breda\nOpening hours:\t-\nPhone:\t14 076", + "description":"The statue shows Hercules with the skin of the Nemean lion. Heracles or Hercules is a figure from Greek mythology. He was a Greek hero and became famous for the 12 difficult works he performed at the behest of King Eurystheus. The statue is part of the 17 other sandstone statues that Willem III bought between 1670 and 1686. The statues were spread over lawns in the Valkenberg park.\nHercules is the only original statue that remains.\n\nAdress:\t4811 XJ Breda\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ", "imageUrl":"hercules_park_valkenburg", "iconUrl": "statue_icon" }, { "name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1", "coordinates":"51.59249639550226, 4.779742259785807", - "description":"The Baroniemonument or Nassau-Baroniemonument is a statue of the Dutch architect Pierre Cuypers. It is located in Park Valkenberg in Breda. The monument was placed in memorial of the 500-year bond (1904) between Breda and the Oranje-Nassau house. In 1404 Engelbrecht I of Nassau-Siegen was honored as lord of Breda.\n\nAdress:\tDelpratsingel 1\nOpening hours:\t-\nPhone:\t14 076", + "description":"The Baroniemonument or Nassau-Baroniemonument is a statue of the Dutch architect Pierre Cuypers. It is located in Park Valkenberg in Breda. The monument was placed in memorial of the 500-year bond (1904) between Breda and the Oranje-Nassau house. In 1404 Engelbrecht I of Nassau-Siegen was honored as lord of Breda.\n\nAdress:\tDelpratsingel 1\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ", "imageUrl":"nassau_baroniemonument", "iconUrl": "statue_icon" }, { "name":"Station Breda Gravinnen van Nassauboulevard 43", "coordinates":"51.59569850758307,4.780295549958155", - "description":"Breda Station is the central railway station of the Dutch city of Breda. It is located north of the city center. Surrounding neighborhoods are Stationskwartier and Drie Hoefijzers on the south side, and Belcrum, Doornbos-Linie, and Havenkwartier on the north side. \n\nThe first station in Breda was opened on May 1, 1855, when the Roosendaal - Breda Railway was opened. This station was replaced by a new building in 1863, when the line to Tilburg was opened, because Breda was still a fortress at the time and it station fell under the restrictions of the Fortress Act, it was constructed in such a way that it could be quickly demolished in times of war.\n\nAdress:\tGravinnen van Nassauboulevard 43\nOpening hours:\t-\nPhone:\t030 751 51 55", + "description":"Breda Station is the central railway station of the Dutch city of Breda. It is located north of the city center. Surrounding neighborhoods are Stationskwartier and Drie Hoefijzers on the south side, and Belcrum, Doornbos-Linie, and Havenkwartier on the north side. \n\nThe first station in Breda was opened on May 1, 1855, when the Roosendaal - Breda Railway was opened. This station was replaced by a new building in 1863, when the line to Tilburg was opened, because Breda was still a fortress at the time and it station fell under the restrictions of the Fortress Act, it was constructed in such a way that it could be quickly demolished in times of war.\n\nAdress:\tGravinnen van Nassauboulevard 43\nOpening hours:\t-\nPhone:\t030 751 51 55\nDistance to: ", "imageUrl":"station_breda", "iconUrl": "building_icon" }, { "name":"Belcrum Beach Veilingkade 12a", "coordinates":"51.59945849923229, 4.765404193295078", - "description":"Belcrum Beach is THE city beach of Breda, located on the Haveneiland in the Belcrum district. We started in 2013 at this unique location in Breda. The beach works with three managers and a large number of volunteers for the bar, maintenance, programming, sponsoring, and garden. A place to relax with a drink and a snack, enjoying the sun, chatting with your friends, listening to music from a band or DJ, sometimes in a festival setting. Children who can play in the sand or join do special children's activities. Belcrum Beach is also a unique location for a party or to celebrate your birthday, getting married on the beach or a wedding are also possible.\n\nAdress:\tVeilingskade 12a\nOpening hours:\t12:00-19:00\nPhone:\t-", + "description":"Belcrum Beach is THE city beach of Breda, located on the Haveneiland in the Belcrum district. We started in 2013 at this unique location in Breda. The beach works with three managers and a large number of volunteers for the bar, maintenance, programming, sponsoring, and garden. A place to relax with a drink and a snack, enjoying the sun, chatting with your friends, listening to music from a band or DJ, sometimes in a festival setting. Children who can play in the sand or join do special children's activities. Belcrum Beach is also a unique location for a party or to celebrate your birthday, getting married on the beach or a wedding are also possible.\n\nAdress:\tVeilingskade 12a\nOpening hours:\t12:00-19:00\nPhone:\t-\nDistance to: ", "imageUrl":"belcrum_beach", "iconUrl": "beach_icon" }, { "name":"De Belcrum Watertoren (1935) Speelhuislaan 158", "coordinates":"51.60052702557225, 4.7689948674496145", - "description":"The water tower in the Belcrum in Breda is an industrial monument from the interwar period. The tower is the home base for SOAB advisers for housing and living environments and underlines the mission of our office. The tower is part of the Belcrum. As a landmark and as a shelter for activities. For example, the Belcrummers celebrated their 400th anniversary in the tower, and lunches with a guided tour are organized at a high level. Watch and taste.\n\nAdress:\tSpeelhuislaan 158\nOpening hours:\t08:30-18:00\nPhone:\t076 521 3080", + "description":"The water tower in the Belcrum in Breda is an industrial monument from the interwar period. The tower is the home base for SOAB advisers for housing and living environments and underlines the mission of our office. The tower is part of the Belcrum. As a landmark and as a shelter for activities. For example, the Belcrummers celebrated their 400th anniversary in the tower, and lunches with a guided tour are organized at a high level. Watch and taste.\n\nAdress:\tSpeelhuislaan 158\nOpening hours:\t08:30-18:00\nPhone:\t076 521 3080\nDistance to: ", "imageUrl":"belcrum_watertoren", "iconUrl": "building_icon" } diff --git a/app/src/main/java/com/a1/nextlocation/data/Data.java b/app/src/main/java/com/a1/nextlocation/data/Data.java index 73e37b7..6bc4bbe 100644 --- a/app/src/main/java/com/a1/nextlocation/data/Data.java +++ b/app/src/main/java/com/a1/nextlocation/data/Data.java @@ -11,6 +11,7 @@ public enum Data { private int locationsVisited = 0; private long totalTime = 0; private double zoom = 0; + private android.location.Location location; public double getZoom() { return zoom; @@ -51,4 +52,11 @@ public enum Data { } + public android.location.Location getLocation() { + return location; + } + + public void setLocation(android.location.Location location) { + this.location = location; + } } diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index cf442a1..07021e4 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -338,6 +338,7 @@ public class HomeFragment extends Fragment implements LocationListener { // can't walk 100 meters in a few seconds if (distance < 100) Data.INSTANCE.addDistance(distance); + Data.INSTANCE.setLocation(location); } currentLocation = location; diff --git a/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java index 5fd5a49..3d025c1 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java @@ -1,5 +1,7 @@ package com.a1.nextlocation.fragments; +import android.annotation.SuppressLint; +import android.content.Context; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; @@ -13,6 +15,7 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; import com.a1.nextlocation.R; +import com.a1.nextlocation.data.Data; import com.a1.nextlocation.data.Location; import com.a1.nextlocation.recyclerview.LocationListManager; @@ -37,6 +40,7 @@ public class LocationDetailFragment extends Fragment { super.onCreate(savedInstanceState); } + @SuppressLint("DefaultLocale") @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -45,8 +49,26 @@ public class LocationDetailFragment extends Fragment { this.titelText = view.findViewById(R.id.detail_location_name); this.titelText.setText(location.getName()); + double currentDistanceToLocation = 0.0; + if(Data.INSTANCE.getLocation() != null){ + currentDistanceToLocation = Location.getDistance(Data.INSTANCE.getLocation().getLatitude(), Data.INSTANCE.getLocation().getLongitude(), this.location.getLat(), this.location.getLong()); + } + + String detailText = ""; + if(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)){ + if(currentDistanceToLocation > 1609) + detailText = location.getDescription() + String.format("%.3f",currentDistanceToLocation * 0.000621371192) + "mi"; + else + detailText = location.getDescription() + String.format("%.2f",currentDistanceToLocation * 1.0936133) + "yd"; + } else { + if(currentDistanceToLocation > 1000) + detailText = location.getDescription() + String.format("%.3f",currentDistanceToLocation / 1000) + "km"; + else + detailText = location.getDescription() + currentDistanceToLocation + "m"; + } + this.detailText = view.findViewById(R.id.detail_location_text); - this.detailText.setText(location.getDescription()); + this.detailText.setText(detailText); //Initialises the back button this.backButton = view.findViewById(R.id.detail_location_back_button); From b110d25549c15871065a9f046f02879eab956b46 Mon Sep 17 00:00:00 2001 From: Robin Koedood Date: Tue, 12 Jan 2021 12:48:25 +0100 Subject: [PATCH 12/46] KAN NIET MEER OPNIEUW MAP OPENEN ALS TIE AL OPEN IS --- .../com/a1/nextlocation/MainActivity.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/a1/nextlocation/MainActivity.java b/app/src/main/java/com/a1/nextlocation/MainActivity.java index 7c2e1e9..0879161 100644 --- a/app/src/main/java/com/a1/nextlocation/MainActivity.java +++ b/app/src/main/java/com/a1/nextlocation/MainActivity.java @@ -12,8 +12,10 @@ import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; +import com.a1.nextlocation.data.Route; import com.a1.nextlocation.fragments.HelpPopup; import com.a1.nextlocation.fragments.HomeFragment; +import com.a1.nextlocation.fragments.LocationFragment; import com.a1.nextlocation.fragments.Refreshable; import com.a1.nextlocation.fragments.RouteFragment; import com.a1.nextlocation.fragments.SettingsFragment; @@ -29,6 +31,11 @@ public class MainActivity extends AppCompatActivity implements Refreshable { private static final String TAG = MainActivity.class.getName(); private BottomNavigationView bottomNav; private ImageButton infoButton; + private HomeFragment homeFragment = new HomeFragment(); + private RouteFragment routeFragment = new RouteFragment(); + private StatisticFragment statisticFragment = new StatisticFragment(); + private SettingsFragment settingsFragment = new SettingsFragment(); + /** * onCreate method that creates the main activity @@ -61,7 +68,7 @@ public class MainActivity extends AppCompatActivity implements Refreshable { RouteListManager.INSTANCE.load(); if (savedInstanceState == null) { - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit(); + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).commit(); } } @@ -91,24 +98,26 @@ public class MainActivity extends AppCompatActivity implements Refreshable { private final BottomNavigationView.OnNavigationItemSelectedListener navListener = item -> { Fragment selectedFragment = null; - switch (item.getItemId()) { case R.id.locations: - selectedFragment = new HomeFragment(); + selectedFragment = homeFragment; break; case R.id.routes: - selectedFragment = new RouteFragment(); + selectedFragment = routeFragment; break; case R.id.statistics: - selectedFragment = new StatisticFragment(); + selectedFragment = statisticFragment; break; case R.id.settings: - selectedFragment = new SettingsFragment(); + selectedFragment = settingsFragment; break; } - getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit(); - return true; + if (!selectedFragment.isVisible() && selectedFragment != null){ + getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit(); + return true; + } + return false; }; /** From 5544da5d2e211fbf205ecb0c1039198fc0ce6374 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 12 Jan 2021 13:22:00 +0100 Subject: [PATCH 13/46] add geofencing --- app/build.gradle | 1 + app/src/main/AndroidManifest.xml | 6 +- .../nextlocation/fragments/HomeFragment.java | 33 +++++++++- .../geofencing/GeoFenceBroadcastReceiver.java | 5 +- .../geofencing/GeoFencingHelper.java | 2 +- .../geofencing/GeofenceInitalizer.java | 63 ++++++++++++++++--- app/src/main/res/values-nl/strings.xml | 2 + app/src/main/res/values/strings.xml | 2 + 8 files changed, 102 insertions(+), 12 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 34bae3b..d97dbd5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -43,6 +43,7 @@ dependencies { implementation 'com.google.android.gms:play-services-location:17.1.0' implementation 'com.google.android.gms:play-services-maps:17.0.0' testImplementation 'junit:junit:4.13.1' +// implementation "com.android.support:support-compat:28.0.0" // okhttp implementation 'com.squareup.okhttp3:okhttp:4.9.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fb7b89b..b2cdc54 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,7 +25,11 @@ - + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index 27970a4..db67ec8 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -2,6 +2,8 @@ package com.a1.nextlocation.fragments; import android.Manifest; +import android.app.NotificationChannel; +import android.app.NotificationManager; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; @@ -19,6 +21,7 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.app.ActivityCompat; +import androidx.core.app.NotificationCompat; import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentActivity; @@ -61,6 +64,8 @@ public class HomeFragment extends Fragment implements LocationListener { private int color; private Location currentLocation; private Overlay allLocationsOverlay; + private GeofenceInitalizer initializer; + private final static String CHANNEL_ID = "next_location01"; @Override public void onCreate(Bundle savedInstanceState) { @@ -143,6 +148,7 @@ public class HomeFragment extends Fragment implements LocationListener { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); + initializer = new GeofenceInitalizer(requireContext(),requireActivity()); initMap(view); } @@ -249,6 +255,7 @@ public class HomeFragment extends Fragment implements LocationListener { private void addLocations() { // get the locations of the current route or all locations List locations = RouteHandler.INSTANCE.isFollowingRoute() ? RouteHandler.INSTANCE.getCurrentRoute().getLocations() : LocationListManager.INSTANCE.getLocationList(); + initializer.removeGeoFences(); final ArrayList items = new ArrayList<>(locations.size()); // marker icon Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24); @@ -312,7 +319,9 @@ public class HomeFragment extends Fragment implements LocationListener { * @param locations the locations to add geofences for */ private void addGeofences(List locations) { - GeofenceInitalizer initializer = new GeofenceInitalizer(requireContext()); + + Log.d(TAG, "addGeofences: adding geofences!"); + initializer.init(locations); } @@ -382,9 +391,31 @@ public class HomeFragment extends Fragment implements LocationListener { public void onLocationVisited(com.a1.nextlocation.data.Location location) { Data.INSTANCE.visitLocation(location); + showNotification(location); } + private void showNotification(com.a1.nextlocation.data.Location location) { + + NotificationManager mNotificationManager = (NotificationManager) requireActivity().getSystemService(Context.NOTIFICATION_SERVICE); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { + int importance = NotificationManager.IMPORTANCE_LOW; + NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, "next_location", importance); + notificationChannel.enableLights(true); + notificationChannel.enableVibration(true); + notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); + mNotificationManager.createNotificationChannel(notificationChannel); + } + + NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(requireContext(),CHANNEL_ID) + .setSmallIcon(R.drawable.ic_launcher_foreground) + .setContentTitle(getString(R.string.notification_title)) + .setContentText(getString(R.string.notification_text,location.getName())) + .setAutoCancel(true); + + mNotificationManager.notify(0,mBuilder.build()); + } + // empty override methods for the LocationListener @Override diff --git a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java index 37c49a4..382cad8 100644 --- a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java +++ b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.Intent; import android.util.Log; +import com.a1.nextlocation.data.Data; import com.a1.nextlocation.data.Location; import com.a1.nextlocation.recyclerview.LocationListManager; import com.google.android.gms.location.Geofence; @@ -20,6 +21,7 @@ public class GeoFenceBroadcastReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent); + Log.i(TAG, "onReceive: RECEIVED GEOFENCE STUFF"); if (geofencingEvent.hasError()) { String errorMessage = GeofenceStatusCodes @@ -40,7 +42,8 @@ public class GeoFenceBroadcastReceiver extends BroadcastReceiver { if (geofence.getRequestId().equals(l.getName())) { l.setVisited(true); // let the homefragment know that we are close to a location - + Data.INSTANCE.getLocationProximityListener().onLocationVisited(l); + Log.d(TAG, "onReceive: VISITED LOCATION " + l.getName()); break; } } diff --git a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFencingHelper.java b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFencingHelper.java index dd9e8d4..01f6335 100644 --- a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFencingHelper.java +++ b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFencingHelper.java @@ -44,7 +44,7 @@ public class GeoFencingHelper extends ContextWrapper { } Intent intent = new Intent(this, GeoFenceBroadcastReceiver.class); - pendingIntent = PendingIntent.getBroadcast(this, 2607, intent, PendingIntent.FLAG_UPDATE_CURRENT); + pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); return pendingIntent; } diff --git a/app/src/main/java/com/a1/nextlocation/geofencing/GeofenceInitalizer.java b/app/src/main/java/com/a1/nextlocation/geofencing/GeofenceInitalizer.java index 874c6b8..7a1af31 100644 --- a/app/src/main/java/com/a1/nextlocation/geofencing/GeofenceInitalizer.java +++ b/app/src/main/java/com/a1/nextlocation/geofencing/GeofenceInitalizer.java @@ -1,12 +1,16 @@ package com.a1.nextlocation.geofencing; import android.Manifest; +import android.app.Activity; import android.app.PendingIntent; import android.content.Context; import android.content.pm.PackageManager; +import android.os.Build; import android.util.Log; +import androidx.annotation.NonNull; import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; import com.a1.nextlocation.data.Data; import com.a1.nextlocation.data.Location; @@ -15,27 +19,53 @@ import com.google.android.gms.location.Geofence; import com.google.android.gms.location.GeofencingClient; import com.google.android.gms.location.GeofencingRequest; import com.google.android.gms.location.LocationServices; +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; import org.osmdroid.util.GeoPoint; import java.util.List; +import static android.content.ContentValues.TAG; + public class GeofenceInitalizer { + private final Activity activity; private GeofencingClient geofencingClient; private GeoFencingHelper geoFencingHelper; private final Context context; private final String TAG = GeofenceInitalizer.class.getCanonicalName(); private List locations; + private int BACKGROUND_LOCATION_ACCESS_REQUEST_CODE = 10002; - public GeofenceInitalizer(Context context) { + public GeofenceInitalizer(Context context, Activity activity) { this.context = context; + this.activity = activity; } public void init(List locations) { + if (!checkFineLocationPermission()) return; + geofencingClient = LocationServices.getGeofencingClient(context); geoFencingHelper = new GeoFencingHelper(context); this.locations = locations; - addFences(); + if (Build.VERSION.SDK_INT >= 29) { + //If API is higher then 29 we need background permission + + if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED) { + addFences(); + } else { + //Permission is not granted!! Need to request it.. + if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_BACKGROUND_LOCATION)) { + //We show a dialog and ask for permission + ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE); + } else { + ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE); + + } + } + } else { + addFences(); + } } private void addFences() { @@ -45,18 +75,35 @@ public class GeofenceInitalizer { } } + public void removeGeoFences() { + geofencingClient = LocationServices.getGeofencingClient(context); + geoFencingHelper = new GeoFencingHelper(context); + + PendingIntent pendingIntent = geoFencingHelper.getPendingIntent(); + + geofencingClient.removeGeofences(pendingIntent) + .addOnSuccessListener(aVoid -> Log.d(TAG, "Geofence is removed... ")) + .addOnFailureListener(e -> Log.d(TAG, e.getLocalizedMessage())); + if (this.locations != null) this.locations.clear(); + + } + private void addGeofence(GeoPoint p, String name) { - Geofence geofence = geoFencingHelper.getGeofence(name, p, 30); + if (!checkFineLocationPermission()) return; + + Geofence geofence = geoFencingHelper.getGeofence(name, p, 45); GeofencingRequest geofencingRequest = geoFencingHelper.getGeoFencingRequest(geofence); PendingIntent pendingIntent = geoFencingHelper.getPendingIntent(); - if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) { - return; - } geofencingClient.addGeofences(geofencingRequest, pendingIntent).addOnSuccessListener(v -> { - Log.d(TAG, "addGeofence: added geofence"); + Log.i(TAG, "addGeofence: added geofence"); }).addOnFailureListener(v -> { - + Log.e(TAG, "addGeofence: failure adding geofence " + v.getMessage()); }); + Log.i(TAG, "addGeofence: added geofence to client"); + } + + private boolean checkFineLocationPermission() { + return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED; } } diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index b18831e..367dd5e 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -26,4 +26,6 @@ Chinees HELP Onderaan het scherm zijn verschillende knoppen te zien. Deze knoppen hebben de volgende functies: \n\nLocaties: toont een lijst met alle locaties die bezocht kunnen worden. Elke locatie wordt kort beschreven. \n\nRoutes: Toont een lijst met alle routes die gelopen kunnen worden. Van elke route wordt een omschrijving gegeven. \n\nStatistieken: Toont persoonlijke statistieken. \n\nInstellingen: Hier kunnen app-instellingen worden aangepast naar eigen voorkeur. \n\nEen locatie ingedrukt houden laat extra informatie zien over de gekozen locatie + Je bent dicht bij een locatie! + Je bent bijna bij %1$s \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c965083..0c084f1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -25,4 +25,6 @@ Chinese HELP Hasn\'t been translated yet + You\'re close to a location! + You\'re almost at %1$s \ No newline at end of file From b010de709fa51a66bec87a30e5cc1625ae0fe1c3 Mon Sep 17 00:00:00 2001 From: Bart Date: Tue, 12 Jan 2021 13:30:35 +0100 Subject: [PATCH 14/46] Saves distance, visitedNames list and displays saved info in statistics. --- .../com/a1/nextlocation/MainActivity.java | 4 ++ .../java/com/a1/nextlocation/data/Data.java | 46 ++++++++++++++++++- .../nextlocation/fragments/HomeFragment.java | 4 +- .../fragments/StatisticFragment.java | 2 +- 4 files changed, 52 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/a1/nextlocation/MainActivity.java b/app/src/main/java/com/a1/nextlocation/MainActivity.java index 7c2e1e9..417763d 100644 --- a/app/src/main/java/com/a1/nextlocation/MainActivity.java +++ b/app/src/main/java/com/a1/nextlocation/MainActivity.java @@ -1,6 +1,7 @@ package com.a1.nextlocation; import android.app.Activity; +import android.content.Context; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; @@ -12,6 +13,7 @@ import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; +import com.a1.nextlocation.data.Data; import com.a1.nextlocation.fragments.HelpPopup; import com.a1.nextlocation.fragments.HomeFragment; import com.a1.nextlocation.fragments.Refreshable; @@ -59,6 +61,8 @@ public class MainActivity extends AppCompatActivity implements Refreshable { CouponListManager.INSTANCE.load(); RouteListManager.INSTANCE.setContext(this); RouteListManager.INSTANCE.load(); + Data.INSTANCE.setContext(this); + Data.INSTANCE.load(); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit(); diff --git a/app/src/main/java/com/a1/nextlocation/data/Data.java b/app/src/main/java/com/a1/nextlocation/data/Data.java index 73e37b7..520538e 100644 --- a/app/src/main/java/com/a1/nextlocation/data/Data.java +++ b/app/src/main/java/com/a1/nextlocation/data/Data.java @@ -1,5 +1,12 @@ package com.a1.nextlocation.data; +import android.content.Context; +import android.content.SharedPreferences; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; import java.util.ArrayList; /** @@ -11,6 +18,16 @@ public enum Data { private int locationsVisited = 0; private long totalTime = 0; private double zoom = 0; + private SharedPreferences.Editor editor; + private Context context; + + public void setContext(Context context) { + this.context = context; + } + + public void setEditor(SharedPreferences.Editor editor) { + this.editor = editor; + } public double getZoom() { return zoom; @@ -20,10 +37,13 @@ public enum Data { this.zoom = zoom; } - private final ArrayList visitedNames = new ArrayList<>(); + private ArrayList visitedNames = new ArrayList<>(); public void addDistance(double d) { distanceTraveled += d; + + editor.putString("distanceTraveled", String.valueOf(distanceTraveled)); + editor.apply(); } public long getTotalTime() { @@ -34,7 +54,6 @@ public enum Data { totalTime += time; } - public double getDistanceTraveled() { return distanceTraveled; } @@ -43,6 +62,9 @@ public enum Data { if (!visitedNames.contains(location.getName())) { locationsVisited++; visitedNames.add(location.getName()); + saveVisitedNamesList(); + editor.putInt("locationsVisited", locationsVisited); + editor.apply(); } } @@ -50,5 +72,25 @@ public enum Data { return locationsVisited; } + public void saveVisitedNamesList(){ + Gson gson = new Gson(); + String json = gson.toJson(visitedNames); + editor.putString("visitedNames", json); + editor.apply(); + } + + public ArrayList loadAndGetVisitedNamesList(){ + String json = context.getSharedPreferences("Data", Context.MODE_PRIVATE).getString("visitedNames", "[]"); + Type type = new TypeToken>() {}.getType(); + visitedNames = new Gson().fromJson(json, type); + return visitedNames; + } + + public void load(){ + SharedPreferences prefs = context.getSharedPreferences("Data", Context.MODE_PRIVATE); + this.editor = prefs.edit(); + Data.INSTANCE.addDistance(Double.parseDouble(prefs.getString("distanceTraveled", "0"))); + this.locationsVisited = loadAndGetVisitedNamesList().size(); + } } diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index abb285f..293cfae 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -3,6 +3,7 @@ package com.a1.nextlocation.fragments; import android.Manifest; import android.content.Context; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.location.Location; @@ -336,8 +337,9 @@ public class HomeFragment extends Fragment implements LocationListener { if (currentLocation != null) { double distance = currentLocation.distanceTo(location); // in meters // can't walk 100 meters in a few seconds - if (distance < 100) + if (distance < 100) { Data.INSTANCE.addDistance(distance); + } } currentLocation = location; diff --git a/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java index e8ab15f..854213e 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/StatisticFragment.java @@ -79,7 +79,7 @@ public class StatisticFragment extends Fragment { private void initializeDistanceTextView(View view){ distance = view.findViewById(R.id.statistics_km); - double dist = Data.INSTANCE.getDistanceTraveled()/1000; + double dist = Double.parseDouble(getContext().getSharedPreferences("Data", Context.MODE_PRIVATE).getString("distanceTraveled", "0")) /1000; if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)) distance.setText("" + String.format("%.1f",dist * 0.621371) + " mi"); else From 39ff2684cbb006bbd63224044a9992d6ea004bf7 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Tue, 12 Jan 2021 13:51:50 +0100 Subject: [PATCH 15/46] added saving route duration --- .../java/com/a1/nextlocation/data/RouteHandler.java | 10 ++++++++++ .../com/a1/nextlocation/fragments/HomeFragment.java | 1 + .../geofencing/GeoFenceBroadcastReceiver.java | 3 +++ 3 files changed, 14 insertions(+) diff --git a/app/src/main/java/com/a1/nextlocation/data/RouteHandler.java b/app/src/main/java/com/a1/nextlocation/data/RouteHandler.java index a6959e7..331d28e 100644 --- a/app/src/main/java/com/a1/nextlocation/data/RouteHandler.java +++ b/app/src/main/java/com/a1/nextlocation/data/RouteHandler.java @@ -13,6 +13,15 @@ public enum RouteHandler { private int stepCount = 0; private RouteFinishedListener routeFinishedListener; private long startedTime; + private double currentRouteDuration; + + public void setCurrentRouteDuration(double currentRouteDuration) { + this.currentRouteDuration = currentRouteDuration; + } + + public double getCurrentRouteDuration() { + return currentRouteDuration; + } private Polyline currentRouteLine; @@ -20,6 +29,7 @@ public enum RouteHandler { this.currentRouteLine = currentRouteLine; } + public Polyline getCurrentRouteLine() { return currentRouteLine; } diff --git a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java index db67ec8..2330912 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/HomeFragment.java @@ -139,6 +139,7 @@ public class HomeFragment extends Fragment implements LocationListener { roadOverlay.setColor(color); // pass the line to the route handler + RouteHandler.INSTANCE.setCurrentRouteDuration(directionsResult.getDuration()); RouteHandler.INSTANCE.setCurrentRouteLine(roadOverlay); Log.d(TAG, "onDirectionsAvailable: successfully added road!"); diff --git a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java index 382cad8..eff3ec2 100644 --- a/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java +++ b/app/src/main/java/com/a1/nextlocation/geofencing/GeoFenceBroadcastReceiver.java @@ -14,6 +14,9 @@ import com.google.android.gms.location.GeofencingEvent; import java.util.List; +/** + * broadcast receiver for geofence events + */ public class GeoFenceBroadcastReceiver extends BroadcastReceiver { private final String TAG = GeoFenceBroadcastReceiver.class.getCanonicalName(); From efbbe7124bd8b02239f3eda80ab566905d5ef8a6 Mon Sep 17 00:00:00 2001 From: RemoMeijer Date: Tue, 12 Jan 2021 13:52:02 +0100 Subject: [PATCH 16/46] Route detail added --- app/src/main/assets/routes.json | 4 +-- .../fragments/LocationDetailFragment.java | 4 +-- .../fragments/RouteDetailFragment.java | 13 ++++++-- .../res/layout/fragment_location_detail.xml | 1 + .../main/res/layout/fragment_route_detail.xml | 30 ++++++++++++------- app/src/main/res/values-nl/strings.xml | 4 +++ app/src/main/res/values/strings.xml | 3 ++ 7 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/src/main/assets/routes.json b/app/src/main/assets/routes.json index 5619f4f..ddf291a 100644 --- a/app/src/main/assets/routes.json +++ b/app/src/main/assets/routes.json @@ -1,6 +1,6 @@ [ { - "name": "Evenementen Route", + "name": "Event Route", "locations": [ { "name": "Escaping Breda: Escape Room Games Boschstraat 114", @@ -39,7 +39,7 @@ "imageURL": "escaping_room" }, { - "name": "Hongerige Route", + "name": "Hungry Route", "locations": [ { "name":"Subway Karnemelkstraat 10 A, 1", diff --git a/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java index 3d025c1..88b9eb2 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java @@ -54,7 +54,8 @@ public class LocationDetailFragment extends Fragment { currentDistanceToLocation = Location.getDistance(Data.INSTANCE.getLocation().getLatitude(), Data.INSTANCE.getLocation().getLongitude(), this.location.getLat(), this.location.getLong()); } - String detailText = ""; + //Adds distance text from the current distance of the user to the opened location + String detailText; if(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)){ if(currentDistanceToLocation > 1609) detailText = location.getDescription() + String.format("%.3f",currentDistanceToLocation * 0.000621371192) + "mi"; @@ -66,7 +67,6 @@ public class LocationDetailFragment extends Fragment { else detailText = location.getDescription() + currentDistanceToLocation + "m"; } - this.detailText = view.findViewById(R.id.detail_location_text); this.detailText.setText(detailText); diff --git a/app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java index 921329a..c3f36b0 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java @@ -3,6 +3,7 @@ package com.a1.nextlocation.fragments; import android.annotation.SuppressLint; import android.content.Context; import android.os.Bundle; +import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -44,7 +45,7 @@ public class RouteDetailFragment extends Fragment { } - @SuppressLint("SetTextI18n") + @SuppressLint({"SetTextI18n", "DefaultLocale"}) @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_route_detail, container, false); @@ -60,8 +61,14 @@ public class RouteDetailFragment extends Fragment { TextView routeName = view.findViewById(R.id.route_title); routeName.setText(this.route.getName()); - TextView routeDetailText = view.findViewById(R.id.reoute_detail_tekst); - routeDetailText.setText(this.route.getDescription()); + TextView routeDetailText = view.findViewById(R.id.route_detail_tekst); + StringBuilder locations = new StringBuilder(); + for(Location location : this.route.getLocations()){ + locations.append("
•").append(location.getName()); + } + String detailText = this.route.getDescription() + "

" + getResources().getString(R.string.following_locations) + "" + locations + "

" + getResources().getString(R.string.start_location) + ": " + route.getLocations().get(0).getName() + "
" + "" + getResources().getString(R.string.end_location) + ": " + route.getLocations().get(route.getLocations().size()-1).getName(); + routeDetailText.setText(Html.fromHtml(detailText)); + TextView totalDistance = view.findViewById(R.id.total_distance); String distance_tekst = getResources().getString(R.string.total_distance_route); diff --git a/app/src/main/res/layout/fragment_location_detail.xml b/app/src/main/res/layout/fragment_location_detail.xml index a89a336..3a68b38 100644 --- a/app/src/main/res/layout/fragment_location_detail.xml +++ b/app/src/main/res/layout/fragment_location_detail.xml @@ -46,6 +46,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/secondaryColour" + android:layout_marginHorizontal="20dp" android:text="" />
diff --git a/app/src/main/res/layout/fragment_route_detail.xml b/app/src/main/res/layout/fragment_route_detail.xml index 3eb21d2..bc35974 100644 --- a/app/src/main/res/layout/fragment_route_detail.xml +++ b/app/src/main/res/layout/fragment_route_detail.xml @@ -37,19 +37,27 @@ android:id="@+id/route_detail_image" app:layout_constraintTop_toBottomOf="@id/route_detail_back_button" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst" /> + app:layout_constraintEnd_toEndOf="parent"/> - + app:layout_constraintEnd_toEndOf="parent" + > + + + +