Search in sources :

Example 6 with MapView

use of com.google.android.gms.maps.MapView in project codenameone-google-maps by codenameone.

the class InternalNativeMapsImpl method initMaps.

private static void initMaps() {
    if (!initialized) {
        initialized = true;
        try {
            // this triggers the creation of the maps so they are ready when the peer component is invoked
            MapsInitializer.initialize(AndroidNativeUtil.getActivity());
            MapView v = new MapView(AndroidNativeUtil.getActivity());
            v.onCreate(AndroidNativeUtil.getActivationBundle());
            v.onResume();
        // v.getMap();
        } catch (Exception e) {
            supported = false;
            System.out.println("Failed to initialize, google play services not installed: " + e);
            e.printStackTrace();
        }
    }
}
Also used : MapView(com.google.android.gms.maps.MapView)

Example 7 with MapView

use of com.google.android.gms.maps.MapView in project Remindy by abicelis.

the class EditLocationBasedReminderFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_edit_location_based_reminder, container, false);
    mPlace = (Spinner) rootView.findViewById(R.id.fragment_edit_location_based_reminder_place);
    mMapView = (MapView) rootView.findViewById(R.id.fragment_edit_location_based_reminder_map);
    mAddress = (TextView) rootView.findViewById(R.id.fragment_edit_location_based_reminder_address);
    mEntering = (CheckBox) rootView.findViewById(R.id.fragment_edit_location_based_reminder_entering);
    mExiting = (CheckBox) rootView.findViewById(R.id.fragment_edit_location_based_reminder_exiting);
    mMapView.setClickable(false);
    mEntering.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            mReminder.setTriggerEntering(isChecked);
        }
    });
    mExiting.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            mReminder.setTriggerExiting(isChecked);
        }
    });
    setupSpinners();
    setReminderValues();
    // Initialise the MapView
    mMapView.onCreate(null);
    // Set the map ready callback to receive the GoogleMap object
    mMapView.getMapAsync(this);
    return rootView;
}
Also used : View(android.view.View) AdapterView(android.widget.AdapterView) MapView(com.google.android.gms.maps.MapView) TextView(android.widget.TextView) CompoundButton(android.widget.CompoundButton) Nullable(android.support.annotation.Nullable)

Example 8 with MapView

use of com.google.android.gms.maps.MapView in project wire-android by wireapp.

the class LocationFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup viewGroup, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_location, viewGroup, false);
    toolbar = ViewUtils.getView(view, R.id.t_location_toolbar);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (getActivity() == null) {
                return;
            }
            getControllerFactory().getLocationController().hideShareLocation(null);
        }
    });
    toolbarTitle = ViewUtils.getView(view, R.id.tv__location_toolbar__title);
    selectedLocationBackground = ViewUtils.getView(view, R.id.iv__selected_location__background);
    selectedLocationPin = ViewUtils.getView(view, R.id.gtv__selected_location__pin);
    selectedLocationDetails = ViewUtils.getView(view, R.id.ll_selected_location_details);
    selectedLocationDetails.setVisibility(View.INVISIBLE);
    touchRegisteringFrameLayout = ViewUtils.getView(view, R.id.trfl_location_touch_registerer);
    touchRegisteringFrameLayout.setTouchCallback(this);
    requestCurrentLocationButton = ViewUtils.getView(view, R.id.gtv__location__current__button);
    requestCurrentLocationButton.setOnClickListener(this);
    sendCurrentLocationButton = ViewUtils.getView(view, R.id.ttv__location_send_button);
    sendCurrentLocationButton.setOnClickListener(this);
    selectedLocationAddress = ViewUtils.getView(view, R.id.ttv__location_address);
    final Bundle mapViewSavedInstanceState = savedInstanceState != null ? savedInstanceState.getBundle(MAP_VIEW_SAVE_STATE) : null;
    mapView = ViewUtils.getView(view, R.id.mv_map);
    mapView.onCreate(mapViewSavedInstanceState);
    mapView.getMapAsync(this);
    return view;
}
Also used : Bundle(android.os.Bundle) View(android.view.View) MapView(com.google.android.gms.maps.MapView) TextView(android.widget.TextView) GlyphTextView(com.waz.zclient.ui.text.GlyphTextView) Nullable(androidx.annotation.Nullable)

Aggregations

MapView (com.google.android.gms.maps.MapView)8 View (android.view.View)4 TextView (android.widget.TextView)3 GoogleMap (com.google.android.gms.maps.GoogleMap)3 OnMapReadyCallback (com.google.android.gms.maps.OnMapReadyCallback)3 RelativeLayout (android.widget.RelativeLayout)2 CameraPosition (com.google.android.gms.maps.model.CameraPosition)2 LatLng (com.google.android.gms.maps.model.LatLng)2 Bundle (android.os.Bundle)1 Nullable (android.support.annotation.Nullable)1 AdapterView (android.widget.AdapterView)1 CompoundButton (android.widget.CompoundButton)1 Nullable (androidx.annotation.Nullable)1 CircleOptions (com.google.android.gms.maps.model.CircleOptions)1 MarkerOptions (com.google.android.gms.maps.model.MarkerOptions)1 GlyphTextView (com.waz.zclient.ui.text.GlyphTextView)1 SimpleLocation (im.delight.android.location.SimpleLocation)1