Location detail now displays images
This commit is contained in:
@@ -3,133 +3,133 @@
|
||||
"name":"McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.58596318905295,4.77586651481887",
|
||||
"description":"McDonald's restaurant",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"mc_donalds"
|
||||
},
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.58632782568612,4.775219531501114",
|
||||
"description":"4811 KJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"subway"
|
||||
},
|
||||
{
|
||||
"name":"Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58650312572897,4.777467069592386",
|
||||
"description":"4811HX Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"wok_to_go"
|
||||
},
|
||||
{
|
||||
"name":"De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.588069667604756,4.7762685632180695",
|
||||
"description":"4811XL Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"de_boter_hal"
|
||||
},
|
||||
{
|
||||
"name":"Gauchos Grote Markt 33",
|
||||
"coordinates":"51.58859328857082,4.77601349563689",
|
||||
"description":"4811XP Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"gauchos"
|
||||
},
|
||||
{
|
||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.58905632735254,4.780729463841719",
|
||||
"description":"4811GR Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"the_tosti_club"
|
||||
},
|
||||
{
|
||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||
"coordinates":"51.58741730235298,4.779832967540571",
|
||||
"description":"4811HS Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"coffee_and_lunch"
|
||||
},
|
||||
{
|
||||
"name":"t Zusje Breda Vismarktstraat 28",
|
||||
"coordinates":"51.590133292554434,4.773911506170458",
|
||||
"description":"4811WE Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"t_zusje_breda"
|
||||
},
|
||||
{
|
||||
"name":"VR-World Nassaustraat 2",
|
||||
"coordinates":"51.5913566342086,4.786256804321071",
|
||||
"description":"4811DD Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"vr_world"
|
||||
},
|
||||
{
|
||||
"name":"Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58647180329833,4.77741809637617",
|
||||
"description":"KEEEEES KROKET!",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"kees_kroket"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59073795635181,4.784917104321059",
|
||||
"description":"4811EE Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"prison_escape_room"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.590431588532105,4.786756741648511",
|
||||
"description":"4811HP Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"de_koepel_future_events"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"4811GK Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"escaping_room"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.58394697737321,4.779757901349616",
|
||||
"description":"4811HL Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"mezz_breda"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58775443759389,4.765568874365066",
|
||||
"description":"4811VN Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"het_klooster_breda"
|
||||
},
|
||||
{
|
||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||
"coordinates":"51.59212977605884,4.774043765582372",
|
||||
"description":"4811VC Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"beach_and_lounge_club"
|
||||
},
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.590645369292396,4.776045124415531",
|
||||
"description":"4811XV Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59130522182325,4.778161739135078",
|
||||
"description":"4811XJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"hercules_park_valkenburg"
|
||||
},
|
||||
{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.592530636759136,4.780278353833301",
|
||||
"description":"4811AM Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"nassau_baroniemonument"
|
||||
},
|
||||
{
|
||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||
"coordinates":"51.59569850758307,4.780295549958155",
|
||||
"description":"4815CA Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"station_breda"
|
||||
},
|
||||
{
|
||||
"name":"Belcrum Beach Veilingkade 12a",
|
||||
"coordinates":"51.599434239284726,4.76632797992092",
|
||||
"description":"4815HC Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"belcrum_beach"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60135351009892,4.7705765989322755",
|
||||
"description":"4815CJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
"imageUrl":"belcrum_watertoren"
|
||||
}
|
||||
]
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -9,12 +10,18 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
|
||||
public class LocationDetailFragment extends Fragment {
|
||||
|
||||
private ImageButton imageButton;
|
||||
private ImageView locationImage;
|
||||
private Location location;
|
||||
|
||||
public LocationDetailFragment(){}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -31,6 +38,15 @@ public class LocationDetailFragment extends Fragment {
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.locationImage = view.findViewById(R.id.detail_location_image);
|
||||
Context context = this.locationImage.getContext();
|
||||
int id = context.getResources().getIdentifier(this.location.getImageUrl(), "drawable", context.getPackageName());
|
||||
this.locationImage.setImageResource(id);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setLocation(Location location){
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,7 @@ public class LocationFragment extends Fragment {
|
||||
LocationDetailFragment locationDetailFragment = new LocationDetailFragment();
|
||||
Bundle locationBundle = new Bundle();
|
||||
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
|
||||
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
|
||||
locationDetailFragment.setArguments(locationBundle);
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user