[FIX] mapview stuff
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
package com.a1.nextlocation.fragments;
|
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.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
@@ -13,11 +19,6 @@ import androidx.core.app.ActivityCompat;
|
|||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
|
||||||
import org.osmdroid.api.IMapController;
|
import org.osmdroid.api.IMapController;
|
||||||
@@ -69,7 +70,7 @@ public class HomeFragment extends Fragment {
|
|||||||
Configuration.getInstance().setUserAgentValue(userAgent);
|
Configuration.getInstance().setUserAgentValue(userAgent);
|
||||||
|
|
||||||
// create the map view
|
// create the map view
|
||||||
mapView = (MapView) view.findViewById(R.id.mapView);
|
mapView = view.findViewById(R.id.mapView);
|
||||||
mapView.setDestroyMode(false);
|
mapView.setDestroyMode(false);
|
||||||
mapView.setTag("mapView");
|
mapView.setTag("mapView");
|
||||||
mapView.setMultiTouchControls(true);
|
mapView.setMultiTouchControls(true);
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.a1.nextlocation.fragments;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -23,15 +25,20 @@ public class SettingsFragment extends Fragment {
|
|||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
|
||||||
|
return inflater.inflate(R.layout.fragment_settings, container, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
// Inflate the layout for this fragment
|
// Inflate the layout for this fragment
|
||||||
View view = getView();
|
|
||||||
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
||||||
|
|
||||||
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
|
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
|
||||||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||||
|
|
||||||
dropdown.setAdapter(arrayAdapter);
|
dropdown.setAdapter(arrayAdapter);
|
||||||
|
|
||||||
return inflater.inflate(R.layout.fragment_settings, container, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
tools:context=".fragments.HomeFragment">
|
tools:context=".fragments.HomeFragment">
|
||||||
|
|
||||||
|
|
||||||
<com.google.android.gms.maps.MapView
|
<org.osmdroid.views.MapView
|
||||||
android:id="@+id/mapView"
|
android:id="@+id/mapView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|||||||
Reference in New Issue
Block a user