Search in sources :

Example 6 with SupportMapFragment

use of com.google.android.gms.maps.SupportMapFragment in project Ushahidi_Android by ushahidi.

the class AddReportActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    view.mLatitude.addTextChangedListener(latLonTextWatcher);
    view.mLongitude.addTextChangedListener(latLonTextWatcher);
    if (checkForGMap()) {
        SupportMapFragment mapFrag = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.location_map);
        view.map = mapFrag.getMap();
    }
    view.mBtnPicture.setOnClickListener(this);
    view.mBtnAddCategory.setOnClickListener(this);
    view.mPickDate.setOnClickListener(this);
    view.mPickTime.setOnClickListener(this);
    mCalendar = Calendar.getInstance();
    pendingPhoto = new UploadPhotoAdapter(this);
    view.gallery.setAdapter(pendingPhoto);
    view.gallery.setOnItemClickListener(this);
    view.mSwitcher.setFactory(this);
    if (getIntent().getExtras() != null) {
        this.id = getIntent().getExtras().getInt("id", 0);
    }
    mOgsDao = Database.mOpenGeoSmsDao;
    // edit existing report
    if (id > 0) {
        // make the delete button visible because we're editing
        view.mDeleteReport.setOnClickListener(this);
        view.mDeleteReport.setVisibility(View.VISIBLE);
        setSavedReport(id);
    } else {
        // add a new report
        updateDisplay();
        pendingPhoto.refresh();
    }
    registerForContextMenu(view.gallery);
    createSendMethodDialog();
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment) UploadPhotoAdapter(com.ushahidi.android.app.adapters.UploadPhotoAdapter)

Example 7 with SupportMapFragment

use of com.google.android.gms.maps.SupportMapFragment in project Space-Station-Tracker by Kiarasht.

the class MapsActivity method initializeAds.

/**
     * Initialize ads when the activity is started for the first time
     */
private void initializeAds() {
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    MobileAds.initialize(mContext, getString(R.string.app_ID_Main));
    // Initiate the interstitial ad and onAdClosed listener
    mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id));
    mInterstitialAd.setAdListener(new AdListener() {

        @Override
        public void onAdClosed() {
            requestNewInterstitial();
            switch(mInterstitialAdActivity) {
                case 0:
                    startActivity(new Intent(mContext, Locations.class));
                    break;
                case 1:
                    startActivity(new Intent(mContext, PeopleinSpace.class));
                    break;
            }
        }
    });
    if (!mSharedPreferences.getBoolean("advertisement", false)) {
        mAdView = (AdView) findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().addTestDevice(getString(R.string.test_device)).build();
        mAdView.loadAd(adRequest);
    } else if (mAdView == null) {
        findViewById(R.id.adView).setVisibility(View.GONE);
    }
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment) AdRequest(com.google.android.gms.ads.AdRequest) InterstitialAd(com.google.android.gms.ads.InterstitialAd) Intent(android.content.Intent) AdListener(com.google.android.gms.ads.AdListener)

Example 8 with SupportMapFragment

use of com.google.android.gms.maps.SupportMapFragment in project YourAppIdea by Michenux.

the class SimpleMapFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    SupportMapFragment mapFragment = getMapFragment();
    if (BuildConfig.DEBUG) {
        Log.d(YourApplication.LOG_TAG, "simpleMapFragment.onViewCreated - mapFragment = " + mapFragment);
    }
    if (mapFragment == null) {
        mapFragment = new SupportMapFragment();
        mapFragment.setRetainInstance(true);
        getChildFragmentManager().beginTransaction().replace(R.id.simplemap, mapFragment, null).commit();
    }
    mapFragment.getMapAsync(this);
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment)

Example 9 with SupportMapFragment

use of com.google.android.gms.maps.SupportMapFragment in project easy by MehdiBenmesa.

the class MapsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_maps);
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment)

Example 10 with SupportMapFragment

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

the class LocationBasedReminderDetailFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_detail_reminder_location_based, container, false);
    mContainer = (LinearLayout) rootView.findViewById(R.id.fragment_reminder_location_based_container);
    mAddress = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_address);
    mAddress.setText(mReminder.getPlace().getAddress());
    mRadius = (TextView) rootView.findViewById(R.id.fragment_reminder_location_based_radius);
    mRadius.setText(String.format(Locale.getDefault(), getResources().getString(R.string.fragment_detail_location_based_reminder_radius), mReminder.getPlace().getRadius(), mReminder.getEnteringExitingString(getActivity())));
    // Get the SupportMapFragment and request notification
    // when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.fragment_reminder_location_based_map);
    mapFragment.getMapAsync(this);
    return rootView;
}
Also used : SupportMapFragment(com.google.android.gms.maps.SupportMapFragment) View(android.view.View) TextView(android.widget.TextView) Nullable(android.support.annotation.Nullable)

Aggregations

SupportMapFragment (com.google.android.gms.maps.SupportMapFragment)12 View (android.view.View)3 LatLng (com.google.android.gms.maps.model.LatLng)3 TextView (android.widget.TextView)2 Activity (android.app.Activity)1 Intent (android.content.Intent)1 Handler (android.os.Handler)1 Nullable (android.support.annotation.Nullable)1 BottomSheetBehavior (android.support.design.widget.BottomSheetBehavior)1 NavigationView (android.support.design.widget.NavigationView)1 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)1 Toolbar (android.support.v7.widget.Toolbar)1 Window (android.view.Window)1 ImageView (android.widget.ImageView)1 BindView (butterknife.BindView)1 Place (com.bubelov.coins.model.Place)1 PlaceDetailsView (com.bubelov.coins.ui.widget.PlaceDetailsView)1 AdListener (com.google.android.gms.ads.AdListener)1 AdRequest (com.google.android.gms.ads.AdRequest)1 InterstitialAd (com.google.android.gms.ads.InterstitialAd)1