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();
}
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);
}
}
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);
}
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);
}
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;
}
Aggregations