-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anna Ślimak
committed
Sep 9, 2020
1 parent
83c5156
commit ddb8428
Showing
8 changed files
with
241 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
AirCasting - Share your Air! | ||
Copyright (C) 2011-2012 HabitatMap, Inc. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
You can contact the authors by email at <[email protected]> | ||
--> | ||
<android.support.v4.widget.DrawerLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/drawer_layout" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
> | ||
|
||
<!--main content--> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_height="fill_parent" | ||
android:layout_width="fill_parent" | ||
> | ||
|
||
<include layout="@layout/toolbar"/> | ||
|
||
<RelativeLayout android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:layout_weight="1" | ||
android:background="@android:color/background_light" | ||
> | ||
|
||
<fragment xmlns:map="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/map" | ||
android:name="com.google.android.libraries.maps.SupportMapFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
map:uiZoomControls="true" | ||
map:uiZoomGestures="true" /> | ||
|
||
<include layout="@layout/gauges"/> | ||
|
||
<RelativeLayout android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:id="@+id/buttons" | ||
> | ||
|
||
<Button android:id="@+id/locate" | ||
android:layout_width="38dp" | ||
android:layout_height="38dp" | ||
android:background="@drawable/center_map_button" | ||
android:layout_marginBottom="96dp" | ||
android:layout_alignParentRight="true" | ||
android:layout_alignParentBottom="true" | ||
android:layout_marginRight="5dp" | ||
/> | ||
|
||
</RelativeLayout> | ||
</RelativeLayout> | ||
|
||
|
||
</LinearLayout> | ||
|
||
<!--navigation drawer--> | ||
<android.support.design.widget.NavigationView | ||
android:id="@+id/navigation_view" | ||
android:layout_height="match_parent" | ||
android:layout_width="280dp" | ||
android:layout_gravity="start" | ||
android:background="#FCFAFD" | ||
app:menu="@menu/aircasting"/> | ||
|
||
</android.support.v4.widget.DrawerLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
src/main/java/pl/llp/aircasting/screens/stream/map/AirCastingMapActivity2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/** | ||
AirCasting - Share your Air! | ||
Copyright (C) 2011-2012 HabitatMap, Inc. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
You can contact the authors by email at <[email protected]> | ||
*/ | ||
package pl.llp.aircasting.screens.stream.map; | ||
|
||
import android.Manifest; | ||
import android.content.Intent; | ||
import android.content.pm.PackageManager; | ||
import android.support.v4.app.ActivityCompat; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.view.*; | ||
import android.view.animation.Animation; | ||
import android.widget.Button; | ||
import android.widget.ImageView; | ||
|
||
import com.google.android.libraries.maps.CameraUpdateFactory; | ||
import com.google.android.libraries.maps.GoogleMap; | ||
import com.google.android.libraries.maps.OnMapReadyCallback; | ||
import com.google.android.libraries.maps.SupportMapFragment; | ||
import com.google.android.libraries.maps.model.LatLng; | ||
import com.google.android.libraries.maps.model.MarkerOptions; | ||
import com.google.android.maps.MapController; | ||
import com.google.android.maps.OverlayItem; | ||
import com.google.common.eventbus.Subscribe; | ||
import pl.llp.aircasting.Intents; | ||
import pl.llp.aircasting.R; | ||
import pl.llp.aircasting.screens.common.base.RoboActivityWithProgress; | ||
import pl.llp.aircasting.screens.common.helpers.LocationHelper; | ||
import pl.llp.aircasting.screens.stream.base.AirCastingActivity; | ||
import pl.llp.aircasting.event.session.VisibleSessionUpdatedEvent; | ||
import pl.llp.aircasting.networking.drivers.AveragesDriver; | ||
import pl.llp.aircasting.event.sensor.LocationEvent; | ||
import pl.llp.aircasting.event.session.NoteCreatedEvent; | ||
import pl.llp.aircasting.event.ui.DoubleTapEvent; | ||
import pl.llp.aircasting.event.ui.VisibleStreamUpdatedEvent; | ||
import pl.llp.aircasting.screens.common.ToastHelper; | ||
import pl.llp.aircasting.screens.common.sessionState.VisibleSession; | ||
import pl.llp.aircasting.model.Measurement; | ||
import pl.llp.aircasting.model.Note; | ||
import pl.llp.aircasting.model.Sensor; | ||
import pl.llp.aircasting.model.internal.Region; | ||
import pl.llp.aircasting.networking.httpUtils.HttpResult; | ||
import pl.llp.aircasting.screens.stream.MeasurementPresenter; | ||
|
||
import android.location.Location; | ||
import android.net.ConnectivityManager; | ||
import android.net.NetworkInfo; | ||
import android.os.AsyncTask; | ||
import android.os.Bundle; | ||
import android.widget.Toast; | ||
import com.google.android.maps.GeoPoint; | ||
import com.google.android.maps.Projection; | ||
import com.google.inject.Inject; | ||
|
||
import roboguice.inject.InjectResource; | ||
import roboguice.inject.InjectView; | ||
|
||
import java.util.List; | ||
|
||
import static java.lang.Math.min; | ||
import static pl.llp.aircasting.screens.common.helpers.LocationHelper.REQUEST_CHECK_SETTINGS; | ||
import static pl.llp.aircasting.screens.stream.map.LocationConversionHelper.boundingBox; | ||
import static pl.llp.aircasting.screens.stream.map.LocationConversionHelper.geoPoint; | ||
import static pl.llp.aircasting.screens.stream.map.MapIdleDetector.detectMapIdle; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* User: obrok | ||
* Date: 10/17/11 | ||
* Time: 5:04 PM | ||
*/ | ||
public class AirCastingMapActivity2 extends AppCompatActivity implements OnMapReadyCallback { | ||
private GoogleMap mMap; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
|
||
setContentView(R.layout.heat_map2); | ||
|
||
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() | ||
.findFragmentById(R.id.map); | ||
mapFragment.getMapAsync(this); | ||
} | ||
|
||
@Override | ||
public void onMapReady(GoogleMap googleMap) { | ||
mMap = googleMap; | ||
|
||
// Add a marker in Sydney and move the camera | ||
LatLng sydney = new LatLng(-34, 151); | ||
mMap.addMarker(new MarkerOptions() | ||
.position(sydney) | ||
.title("Marker in Sydney")); | ||
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney)); | ||
} | ||
} |