Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop

This commit is contained in:
Sem van der Hoeven
2021-01-06 19:25:15 +01:00
19 changed files with 125 additions and 275 deletions

View File

@@ -1,7 +1,6 @@
package com.a1.nextlocation.fragments;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
@@ -22,14 +21,13 @@ import com.a1.nextlocation.recyclerview.LocationListManager;
public class LocationDetailFragment extends Fragment {
private static final String TAG = LocationDetailFragment.class.getCanonicalName();
private ImageButton imageButton;
private ImageButton backButton;
private Location location;
private TextView titelText;
private TextView detailText;
private ImageView locationImage;
public LocationDetailFragment() {
}
public LocationDetailFragment(Location location) {
@@ -52,12 +50,14 @@ public class LocationDetailFragment extends Fragment {
this.detailText = view.findViewById(R.id.detail_location_text);
this.detailText.setText(location.getDescription());
this.imageButton = view.findViewById(R.id.detail_location_back_button);
this.imageButton.setOnClickListener(v -> {
//Initialises the back button
this.backButton = view.findViewById(R.id.detail_location_back_button);
this.backButton.setOnClickListener(v -> {
LocationFragment locationFragment = new LocationFragment();
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
});
//Logs the location
if (location != null) {
Log.d(TAG, "onCreateView: the location has a name of: " + location.getName());
}
@@ -71,8 +71,4 @@ public class LocationDetailFragment extends Fragment {
return view;
}
public void setLocation(Location location) {
this.location = location;
}
}