Updated values

This commit is contained in:
RemoMeijer
2021-01-05 12:02:20 +01:00
parent d63b150275
commit d53f63a6d7
17 changed files with 48 additions and 61 deletions

View File

@@ -1,14 +1,10 @@
package com.a1.nextlocation; package com.a1.nextlocation;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import android.os.Bundle; import android.os.Bundle;
import android.view.MenuItem;
import com.a1.nextlocation.R;
import com.a1.nextlocation.fragments.HomeFragment; import com.a1.nextlocation.fragments.HomeFragment;
import com.a1.nextlocation.fragments.RouteFragment; import com.a1.nextlocation.fragments.RouteFragment;
import com.a1.nextlocation.fragments.SettingsFragment; import com.a1.nextlocation.fragments.SettingsFragment;
@@ -28,7 +24,7 @@ public class MainActivity extends AppCompatActivity {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
BottomNavigationView bottomNav = findViewById(R.id.navbar); BottomNavigationView bottomNav = findViewById(R.id.navigation_bar);
bottomNav.setOnNavigationItemSelectedListener(navListener); bottomNav.setOnNavigationItemSelectedListener(navListener);
LocationListManager.INSTANCE.setContext(this); LocationListManager.INSTANCE.setContext(this);

View File

@@ -1,7 +1,6 @@
package com.a1.nextlocation.fragments; package com.a1.nextlocation.fragments;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
@@ -38,11 +37,11 @@ public class CouponFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_coupon, container, false); View view = inflater.inflate(R.layout.fragment_coupon, container, false);
this.couponRecyclerView = view.findViewById(R.id.couponRecyclerView); this.couponRecyclerView = view.findViewById(R.id.coupon_recyclerview);
this.couponRecyclerView.setHasFixedSize(true); this.couponRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext()); this.layoutManager = new LinearLayoutManager(this.getContext());
this.imageButton = view.findViewById(R.id.couponBackButton); this.imageButton = view.findViewById(R.id.coupon_back_button);
this.imageButton.setOnClickListener(v -> { this.imageButton.setOnClickListener(v -> {
StatisticFragment statisticFragment = new StatisticFragment(); StatisticFragment statisticFragment = new StatisticFragment();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit(); ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();

View File

@@ -5,7 +5,6 @@ package com.a1.nextlocation.fragments;
import android.Manifest; import android.Manifest;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.location.Location; import android.location.Location;
import android.location.LocationManager; import android.location.LocationManager;
import android.os.Bundle; import android.os.Bundle;
@@ -23,17 +22,13 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import com.a1.nextlocation.R; import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.recyclerview.CouponListManager;
import com.a1.nextlocation.recyclerview.CustomOverlay; import com.a1.nextlocation.recyclerview.CustomOverlay;
import com.a1.nextlocation.recyclerview.LocationListManager; import com.a1.nextlocation.recyclerview.LocationListManager;
import com.a1.nextlocation.recyclerview.RouteListManager;
import org.osmdroid.api.IMapController; import org.osmdroid.api.IMapController;
import org.osmdroid.config.Configuration; import org.osmdroid.config.Configuration;
import org.osmdroid.util.GeoPoint; import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.MapView; import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.Overlay;
import org.osmdroid.views.overlay.OverlayItem; import org.osmdroid.views.overlay.OverlayItem;
import org.osmdroid.views.overlay.compass.CompassOverlay; import org.osmdroid.views.overlay.compass.CompassOverlay;
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider; import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider;
@@ -87,7 +82,7 @@ public class HomeFragment extends Fragment {
Configuration.getInstance().setUserAgentValue(userAgent); Configuration.getInstance().setUserAgentValue(userAgent);
// create the map view // create the map view
mapView = view.findViewById(R.id.mapView); mapView = view.findViewById(R.id.map_view);
mapView.setDestroyMode(false); mapView.setDestroyMode(false);
mapView.setTag("mapView"); mapView.setTag("mapView");
mapView.setMultiTouchControls(true); mapView.setMultiTouchControls(true);

View File

@@ -14,11 +14,9 @@ import android.widget.ImageButton;
import com.a1.nextlocation.R; import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Location; import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.recyclerview.CouponAdapter;
import com.a1.nextlocation.recyclerview.LocationAdapter; import com.a1.nextlocation.recyclerview.LocationAdapter;
import com.a1.nextlocation.recyclerview.LocationListManager; import com.a1.nextlocation.recyclerview.LocationListManager;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class LocationFragment extends Fragment { public class LocationFragment extends Fragment {
@@ -38,11 +36,11 @@ public class LocationFragment extends Fragment {
View view = inflater.inflate(R.layout.fragment_location, container, false); View view = inflater.inflate(R.layout.fragment_location, container, false);
this.locationRecyclerView = view.findViewById(R.id.locationRecyclerView); this.locationRecyclerView = view.findViewById(R.id.location_recyclerview);
this.locationRecyclerView.setHasFixedSize(true); this.locationRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext()); this.layoutManager = new LinearLayoutManager(this.getContext());
this.imageButton = view.findViewById(R.id.locationBackButton); this.imageButton = view.findViewById(R.id.location_back_button);
this.imageButton.setOnClickListener(v -> { this.imageButton.setOnClickListener(v -> {
HomeFragment homeFragment = new HomeFragment(); HomeFragment homeFragment = new HomeFragment();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit(); ((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();

View File

@@ -16,7 +16,6 @@ import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.recyclerview.RouteAdapter; import com.a1.nextlocation.recyclerview.RouteAdapter;
import com.a1.nextlocation.recyclerview.RouteListManager; import com.a1.nextlocation.recyclerview.RouteListManager;
import java.util.ArrayList;
import java.util.List; import java.util.List;
public class RouteFragment extends Fragment { public class RouteFragment extends Fragment {
@@ -36,7 +35,7 @@ public class RouteFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_route, container, false); View view = inflater.inflate(R.layout.fragment_route, container, false);
this.routeRecyclerView = view.findViewById(R.id.routeRecyclerView); this.routeRecyclerView = view.findViewById(R.id.route_recyclerview);
this.routeRecyclerView.setHasFixedSize(true); this.routeRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext()); this.layoutManager = new LinearLayoutManager(this.getContext());

View File

@@ -13,14 +13,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:background="@drawable/ic_back_button_24" android:background="@drawable/ic_back_button_24"
app:layout_constraintBottom_toBottomOf="@+id/routeTitle" app:layout_constraintBottom_toBottomOf="@+id/route_title"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/routeTitle" app:layout_constraintTop_toTopOf="@+id/route_title"
app:layout_constraintEnd_toStartOf="@id/routeTitle" app:layout_constraintEnd_toStartOf="@id/route_title"
/> />
<TextView <TextView
android:id="@+id/routeTitle" android:id="@+id/route_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="250dp" android:layout_marginEnd="250dp"

View File

@@ -10,15 +10,15 @@
android:id="@+id/fragment_layout" android:id="@+id/fragment_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/topBar" app:layout_constraintTop_toBottomOf="@+id/top_bar"
app:layout_constraintBottom_toTopOf="@id/navbar" app:layout_constraintBottom_toTopOf="@id/navigation_bar"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
/> />
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:showAsAction="always|withText" android:showAsAction="always|withText"
android:id="@+id/navbar" android:id="@+id/navigation_bar"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
@@ -31,7 +31,7 @@
/> />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/topBar" android:id="@+id/top_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@@ -41,27 +41,27 @@
android:background="@color/primaryColour"/> android:background="@color/primaryColour"/>
<ImageButton <ImageButton
android:id="@+id/infoButton" android:id="@+id/info_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_baseline_info_24" android:src="@drawable/ic_baseline_info_24"
android:backgroundTint="@color/primaryColour" android:backgroundTint="@color/primaryColour"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/topBar" app:layout_constraintTop_toTopOf="@id/top_bar"
app:layout_constraintBottom_toBottomOf="@id/topBar" app:layout_constraintBottom_toBottomOf="@id/top_bar"
android:tint="@color/secondaryColour" android:tint="@color/secondaryColour"
/> />
<TextView <TextView
android:id="@+id/text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toEndOf="@id/infoButton"
app:layout_constraintTop_toTopOf="@id/topBar"
app:layout_constraintBottom_toBottomOf="@id/topBar"
android:text="@string/app_name" android:text="@string/app_name"
android:textSize="25dp"
android:textColor="@color/secondaryColour" android:textColor="@color/secondaryColour"
/> android:textSize="25dp"
app:layout_constraintBottom_toBottomOf="@id/top_bar"
app:layout_constraintStart_toEndOf="@id/info_button"
app:layout_constraintTop_toTopOf="@id/top_bar" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -5,7 +5,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Box1" android:id="@+id/name_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginHorizontal="20dp" android:layout_marginHorizontal="20dp"

View File

@@ -15,11 +15,11 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="Statistics" android:text="Statistics"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/couponBackButton" app:layout_constraintStart_toEndOf="@id/coupon_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton <ImageButton
android:id="@+id/couponBackButton" android:id="@+id/coupon_back_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
@@ -33,9 +33,9 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:id="@+id/couponRecyclerView" android:id="@+id/coupon_recyclerview"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/couponBackButton" /> app:layout_constraintTop_toBottomOf="@+id/coupon_back_button" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -7,7 +7,7 @@
tools:context=".fragments.HomeFragment"> tools:context=".fragments.HomeFragment">
<org.osmdroid.views.MapView <org.osmdroid.views.MapView
android:id="@+id/mapView" android:id="@+id/map_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">

View File

@@ -15,11 +15,11 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="Locations" android:text="Locations"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/locationBackButton" app:layout_constraintStart_toEndOf="@id/location_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<ImageButton <ImageButton
android:id="@+id/locationBackButton" android:id="@+id/location_back_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
@@ -31,7 +31,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/locationRecyclerView" android:id="@+id/location_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="60dp" android:layout_marginTop="60dp"

View File

@@ -8,7 +8,7 @@
tools:context=".fragments.RouteFragment"> tools:context=".fragments.RouteFragment">
<ImageButton <ImageButton
android:id="@+id/routeBackButton" android:id="@+id/route_back_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
@@ -18,23 +18,23 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/routeTitle" android:id="@+id/route_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="9dp" android:layout_margin="9dp"
android:text="titel" android:text="titel"
android:textSize="20sp" android:textSize="20sp"
app:layout_constraintStart_toEndOf="@id/routeBackButton" app:layout_constraintStart_toEndOf="@id/route_back_button"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/routeRecyclerView" android:id="@+id/route_recyclerview"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:background="@color/primaryColour" android:background="@color/primaryColour"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/routeBackButton" /> app:layout_constraintTop_toBottomOf="@+id/route_back_button" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -13,13 +13,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="100dp" android:layout_marginEnd="100dp"
android:background="@drawable/ic_back_button_24" android:background="@drawable/ic_back_button_24"
app:layout_constraintBottom_toBottomOf="@id/routeTitle" app:layout_constraintBottom_toBottomOf="@id/route_title"
app:layout_constraintEnd_toStartOf="@id/routeTitle" app:layout_constraintEnd_toStartOf="@id/route_title"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/routeTitle" /> app:layout_constraintTop_toTopOf="@id/route_title" />
<TextView <TextView
android:id="@+id/routeTitle" android:id="@+id/route_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="titel" android:text="titel"

View File

@@ -30,7 +30,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Box1" android:id="@+id/name_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
app:layout_constraintBottom_toTopOf="@id/Box2" app:layout_constraintBottom_toTopOf="@id/Box2"
@@ -86,7 +86,7 @@
app:layout_constraintBottom_toTopOf="@id/Box3" app:layout_constraintBottom_toTopOf="@id/Box3"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/Box1" app:layout_constraintTop_toBottomOf="@id/name_box"
> >

View File

@@ -20,7 +20,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Box1" android:id="@+id/name_box"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="70dp" android:layout_height="70dp"
app:layout_constraintBottom_toTopOf="@id/Box2" app:layout_constraintBottom_toTopOf="@id/Box2"
@@ -77,7 +77,7 @@
app:layout_constraintBottom_toTopOf="@id/Box3" app:layout_constraintBottom_toTopOf="@id/Box3"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/Box1" app:layout_constraintTop_toBottomOf="@id/name_box"
> >

View File

@@ -21,6 +21,6 @@
android:gravity="center" android:gravity="center"
android:text="location" android:text="location"
android:textSize="20dp" android:textSize="20dp"
app:layout_constraintStart_toEndOf="@+id/routeImage" /> app:layout_constraintStart_toEndOf="@+id/route_Image" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -9,7 +9,7 @@
<ImageView <ImageView
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:id="@+id/routeImage" android:id="@+id/route_Image"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
/> />
@@ -21,7 +21,7 @@
android:text="test text" android:text="test text"
android:gravity="center" android:gravity="center"
android:textSize="20dp" android:textSize="20dp"
app:layout_constraintStart_toEndOf="@+id/routeImage" app:layout_constraintStart_toEndOf="@+id/route_Image"
/> />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>