DT @1.11.2015: IncidentCategories final implementiert. Farben zu den einzelnen Kategorien hinzugefügt. Bugfixes in der ListenDarstellung.
This commit is contained in:
@@ -24,6 +24,7 @@ import com.google.android.gms.maps.CameraUpdate;
|
|||||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||||
import com.google.android.gms.maps.GoogleMap;
|
import com.google.android.gms.maps.GoogleMap;
|
||||||
import com.google.android.gms.maps.SupportMapFragment;
|
import com.google.android.gms.maps.SupportMapFragment;
|
||||||
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||||||
import com.google.android.gms.maps.model.Circle;
|
import com.google.android.gms.maps.model.Circle;
|
||||||
import com.google.android.gms.maps.model.CircleOptions;
|
import com.google.android.gms.maps.model.CircleOptions;
|
||||||
import com.google.android.gms.maps.model.LatLng;
|
import com.google.android.gms.maps.model.LatLng;
|
||||||
@@ -229,14 +230,30 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
|||||||
JSONObject incident = incidents.getJSONObject(i);
|
JSONObject incident = incidents.getJSONObject(i);
|
||||||
LatLng pos = new LatLng(Double.parseDouble(incident.getString("latitude")),Double.parseDouble(incident.getString("longitude")));
|
LatLng pos = new LatLng(Double.parseDouble(incident.getString("latitude")),Double.parseDouble(incident.getString("longitude")));
|
||||||
Log.d(TAG, "Adding marker with position: " + pos.latitude +" : "+ pos.longitude);
|
Log.d(TAG, "Adding marker with position: " + pos.latitude +" : "+ pos.longitude);
|
||||||
mMarker = mMap.addMarker(new MarkerOptions().position(pos).title(incident.getString("text_short")).snippet("Crime Category:" + incident.getString("fid_category")));
|
mMarker = mMap.addMarker(new MarkerOptions()
|
||||||
|
.position(pos)
|
||||||
|
.title(incident.getString("text_short"))
|
||||||
|
.snippet("Crime Category:" + incident.getString("cat_name")));
|
||||||
|
|
||||||
|
switch (incident.getInt("fid_category")) {
|
||||||
|
case 1:
|
||||||
|
mMarker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
mMarker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
mMarker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
markerIDs.put(mMarker.getId(), incident.getString("uid"));
|
markerIDs.put(mMarker.getId(), incident.getString("uid"));
|
||||||
|
|
||||||
CircleOptions circleOptions = new CircleOptions()
|
CircleOptions circleOptions = new CircleOptions()
|
||||||
.center(pos)
|
.center(pos)
|
||||||
.strokeColor(Color.BLACK)
|
.strokeColor(Color.BLACK)
|
||||||
.strokeWidth(2)
|
.strokeWidth(2)
|
||||||
.fillColor(Color.argb(50, 255, 0, 0))
|
.fillColor(Color.parseColor("#"+incident.getString("color")))
|
||||||
.radius(incident.getInt("radius")); // In meters
|
.radius(incident.getInt("radius")); // In meters
|
||||||
|
|
||||||
Circle circle = mMap.addCircle(circleOptions);
|
Circle circle = mMap.addCircle(circleOptions);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
|
|
||||||
private EditText txtTitle;
|
private EditText txtTitle;
|
||||||
private EditText txtDescription;
|
private EditText txtDescription;
|
||||||
private Spinner txtCrimeCategory;
|
private EditText txtCrimeCategory;
|
||||||
private EditText txtPosition;
|
private EditText txtPosition;
|
||||||
private EditText txtDate;
|
private EditText txtDate;
|
||||||
private EditText txtTime;
|
private EditText txtTime;
|
||||||
@@ -48,7 +48,7 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
|
|
||||||
txtTitle = (EditText) findViewById(R.id.input_viewreport_short);
|
txtTitle = (EditText) findViewById(R.id.input_viewreport_short);
|
||||||
txtDescription = (EditText) findViewById(R.id.input_viewreport_long);
|
txtDescription = (EditText) findViewById(R.id.input_viewreport_long);
|
||||||
txtCrimeCategory = (Spinner) findViewById(R.id.dd_viewreport_category);
|
txtCrimeCategory = (EditText) findViewById(R.id.input_viewreport_category);
|
||||||
txtDate = (EditText) findViewById(R.id.input_viewreport_date);
|
txtDate = (EditText) findViewById(R.id.input_viewreport_date);
|
||||||
txtTime = (EditText) findViewById(R.id.input_viewreport_time);
|
txtTime = (EditText) findViewById(R.id.input_viewreport_time);
|
||||||
txtPosition = (EditText) findViewById(R.id.input_viewreport_position);
|
txtPosition = (EditText) findViewById(R.id.input_viewreport_position);
|
||||||
@@ -99,7 +99,7 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
|
|
||||||
txtTitle.setText(incident.getString("text_short"));
|
txtTitle.setText(incident.getString("text_short"));
|
||||||
txtDescription.setText(incident.getString("text_long"));
|
txtDescription.setText(incident.getString("text_long"));
|
||||||
txtCrimeCategory.setSelection(incident.getInt("fid_category"));
|
txtCrimeCategory.setText(incident.getString("cat_name"));
|
||||||
|
|
||||||
String[] happened_at = incident.getString("happened_at").split(" ");
|
String[] happened_at = incident.getString("happened_at").split(" ");
|
||||||
txtDate.setText(happened_at[0]);
|
txtDate.setText(happened_at[0]);
|
||||||
@@ -118,8 +118,8 @@ public class ViewReportActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e2) {
|
||||||
e.printStackTrace();
|
e2.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new Response.ErrorListener() {
|
}, new Response.ErrorListener() {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_01"
|
android:id="@+id/ll_01"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="#33FF0000"
|
android:background="#c5a7a7a7"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|||||||
@@ -178,7 +178,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_01"
|
android:id="@+id/ll_01"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="#33FF0000"
|
android:background="#c55ed9ff"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
@@ -203,6 +203,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
|
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:background="#8ae6e6e6"
|
android:background="#8ae6e6e6"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -188,6 +187,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<android.support.v4.widget.DrawerLayout
|
<android.support.v4.widget.DrawerLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/drawer_layout"
|
android:id="@+id/drawer_layout"
|
||||||
android:background="#8ae6e6e6"
|
android:background="#8ae6e6e6"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -13,7 +12,6 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:layout_margin="20dp"
|
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
@@ -28,6 +26,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
|
|||||||
@@ -2,21 +2,34 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:weightSum="1">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#a6000000"
|
android:textColor="#a6000000"
|
||||||
android:id="@+id/txt_reportlist_lvrow_title"
|
android:id="@+id/txt_reportlist_lvrow_title"
|
||||||
android:text="Header"/>
|
android:text="Header"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:typeface="serif" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="#b9000000"
|
android:textColor="#b9000000"
|
||||||
android:text="Long Text"
|
android:text="Long Text"
|
||||||
android:id="@+id/txt_reportlist_lvrow_text"/>
|
android:id="@+id/txt_reportlist_lvrow_text"
|
||||||
|
android:typeface="serif" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#b9000000"
|
||||||
|
android:text="Category"
|
||||||
|
android:id="@+id/txt_reportlist_lvrow_category"
|
||||||
|
android:typeface="serif" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -160,6 +160,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
@@ -22,6 +22,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@+id/input_viewreport_long" />
|
android:layout_below="@+id/input_viewreport_long" />
|
||||||
|
|
||||||
<Spinner
|
<EditText
|
||||||
android:id="@+id/dd_viewreport_category"
|
android:id="@+id/input_viewreport_category"
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_below="@+id/dd_viewreport_category" />
|
android:layout_below="@+id/input_viewreport_category" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lbl_viewreport_time"
|
android:id="@+id/lbl_viewreport_time"
|
||||||
@@ -226,9 +226,6 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -238,6 +235,6 @@
|
|||||||
android:layout_width="200dp"
|
android:layout_width="200dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:background="#ffeeee"/>
|
android:background="#ffffff"/>
|
||||||
|
|
||||||
</android.support.v4.widget.DrawerLayout>
|
</android.support.v4.widget.DrawerLayout>
|
||||||
Reference in New Issue
Block a user