DT @12.12.2015: Report-Workflow weiterentwickelt (noch nicht fertig), MapInfoWindow verändert, etc...
This commit is contained in:
106
app/app.iml
106
app/app.iml
@@ -71,40 +71,42 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/debug" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/22.0.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/mediarouter-v7/22.2.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.beardedhen/androidbootstrap/2.0.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.facebook.android/facebook-android-sdk/4.1.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appinvite/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appstate/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-drive/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-fitness/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-games/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-nearby/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-panorama/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-safetynet/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wallet/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services/7.5.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-analytics/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appindexing/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appinvite/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-appstate/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-auth/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-cast/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-drive/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-fitness/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-games/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-nearby/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-panorama/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-safetynet/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-vision/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wallet/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.maps.android/android-maps-utils/0.3.4/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.twitter.sdk.android/twitter-core/1.4.1/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/io.fabric.sdk.android/fabric/1.3.4/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/fabric" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/release" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
|
||||
@@ -114,39 +116,43 @@
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="play-services-base-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appinvite-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-panorama-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-drive-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-gcm-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-fitness-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-games-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="androidbootstrap-2.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-vision-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appindexing-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0.19" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-wearable-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-safetynet-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-games-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-base-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appindexing-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-auth-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-drive-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-identity-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="fabric-1.3.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-plus-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-maps-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appstate-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-fitness-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-location-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-safetynet-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="twitter-core-1.4.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-analytics-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="mediarouter-v7-22.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-wallet-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="mediarouter-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-plus-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appinvite-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-cast-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-wearable-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="bolts-android-1.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-identity-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-appstate-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-nearby-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-maps-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-nearby-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="facebook-android-sdk-4.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-cast-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-panorama-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-gcm-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-analytics-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-wallet-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-maps-utils-0.3.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-ads-7.5.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-22.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-basement-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-location-7.5.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -37,15 +37,15 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile 'com.android.support:appcompat-v7:22.2.0'
|
||||
compile 'com.google.android.gms:play-services:7.5.0'
|
||||
compile('com.twitter.sdk.android:twitter-core:1.4.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.google.android.gms:play-services:8.3.0'
|
||||
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
|
||||
compile 'com.beardedhen:androidbootstrap:2.0.1'
|
||||
compile 'com.mcxiaoke.volley:library:1.0.+'
|
||||
compile 'com.google.code.gson:gson:2.4'
|
||||
compile('com.twitter.sdk.android:twitter-core:1.4.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
compile 'com.beardedhen:androidbootstrap:2.0.0'
|
||||
compile 'com.google.maps.android:android-maps-utils:0.3+'
|
||||
compile 'com.google.maps.android:android-maps-utils:0.3.+'
|
||||
compile 'com.android.support:support-v4:22.2.1'
|
||||
}
|
||||
|
||||
@@ -66,10 +66,13 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
private AppClusterItem clickedClusterItem;
|
||||
private ArrayList<AppClusterItem> myMarkers = new ArrayList<AppClusterItem>();
|
||||
private HashMap<Integer, AppClusterItem> visibleMarkers = new HashMap<Integer, AppClusterItem>();
|
||||
|
||||
private List<LatLng> mHeatMapPositionList = new ArrayList<>();
|
||||
|
||||
private ClusterManager<AppClusterItem> mClusterManager;
|
||||
|
||||
TileOverlay mOverlay;
|
||||
HeatmapTileProvider mProvider;
|
||||
|
||||
private boolean isMarkerShown = false;
|
||||
|
||||
private LatLng myLocation;
|
||||
@@ -126,8 +129,6 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
|
||||
if(position.zoom >= THRESHOLD_ZOOM_LEVEL)
|
||||
{
|
||||
//mClusterManager.addItems(myMarkers);
|
||||
addMarkersToMap();
|
||||
isMarkerShown = true;
|
||||
} else if (position.zoom < THRESHOLD_ZOOM_LEVEL && (isMarkerShown == true)){
|
||||
mClusterManager.clearItems();
|
||||
@@ -135,6 +136,7 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
isMarkerShown = false;
|
||||
}
|
||||
|
||||
addMarkersToMap();
|
||||
|
||||
}
|
||||
};
|
||||
@@ -142,18 +144,17 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
|
||||
private void addMarkersToMap(){
|
||||
LatLngBounds bounds = mMap.getProjection().getVisibleRegion().latLngBounds;
|
||||
|
||||
mHeatMapPositionList.clear();
|
||||
//Loop through all the items that are available to be placed on the map
|
||||
for(AppClusterItem item : myMarkers)
|
||||
{
|
||||
//If the item is within the the bounds of the screen
|
||||
if(bounds.contains(item.getPosition()))
|
||||
{
|
||||
mHeatMapPositionList.add(item.getPosition());
|
||||
//If the item isn't already being displayed
|
||||
if(!visibleMarkers.containsKey(item.getID()))
|
||||
if(isMarkerShown && !visibleMarkers.containsKey(item.getID()))
|
||||
{
|
||||
Log.d(TAG,"Should add now marker!");
|
||||
|
||||
mClusterManager.addItem(item);
|
||||
mClusterManager.cluster();
|
||||
|
||||
@@ -173,6 +174,11 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
*/
|
||||
}
|
||||
}
|
||||
if(!mHeatMapPositionList.isEmpty())
|
||||
{
|
||||
mProvider.setData(mHeatMapPositionList);
|
||||
mOverlay.clearTileCache();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -268,12 +274,18 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
}
|
||||
|
||||
private void addHeatMap() {
|
||||
HeatmapTileProvider mProvider = new HeatmapTileProvider.Builder()
|
||||
mHeatMapPositionList.add(new LatLng(53.252151,10.422109));
|
||||
|
||||
mProvider = new HeatmapTileProvider.Builder()
|
||||
.radius(40)
|
||||
.data(mHeatMapPositionList)
|
||||
.radius(50)
|
||||
.opacity(0.7)
|
||||
.build();
|
||||
|
||||
TileOverlay mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));
|
||||
|
||||
mOverlay = mMap.addTileOverlay(new TileOverlayOptions().tileProvider(mProvider));
|
||||
|
||||
addMarkersToMap();
|
||||
}
|
||||
|
||||
private void handleIntent(Intent intent){
|
||||
@@ -415,15 +427,12 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
JSONArray incidents = jObj.getJSONArray("message");
|
||||
for(int i=0;i<incidents.length();i++){
|
||||
JSONObject incident = incidents.getJSONObject(i);
|
||||
|
||||
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);
|
||||
|
||||
myMarkers.add(new AppClusterItem(incident,pos));
|
||||
mHeatMapPositionList.add(pos);
|
||||
}
|
||||
addHeatMap();
|
||||
|
||||
addHeatMap();
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error getting map positions (server returned error): " + errorMsg);
|
||||
|
||||
@@ -7,24 +7,37 @@ import android.content.SharedPreferences;
|
||||
import android.location.Address;
|
||||
import android.location.Geocoder;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.VolleyError;
|
||||
import com.android.volley.toolbox.StringRequest;
|
||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.deke.risk.riskahead.fragments.ReportWF_1_Fragment;
|
||||
import org.deke.risk.riskahead.fragments.ReportWF_2_Fragment;
|
||||
import org.deke.risk.riskahead.fragments.ReportWF_3_Fragment;
|
||||
import org.deke.risk.riskahead.helper.AppClusterItem;
|
||||
import org.deke.risk.riskahead.helper.AppConfig;
|
||||
import org.deke.risk.riskahead.helper.AppController;
|
||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_1_Fragment.OnCallMapListener, ReportWF_2_Fragment.OnInputFinishedListener {
|
||||
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_1_Fragment.OnCallMapListener, ReportWF_2_Fragment.OnInputFinishedListener, ReportWF_3_Fragment.OnInputFinishedListener {
|
||||
|
||||
private final static String mActivityTitle = "Report NEW";
|
||||
private final static String TAG = ReportWFActivity.class.getSimpleName();
|
||||
@@ -33,6 +46,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
|
||||
private Fragment frag_report_1 = new ReportWF_1_Fragment();
|
||||
private Fragment frag_report_2 = new ReportWF_2_Fragment();
|
||||
private Fragment frag_report_3 = new ReportWF_3_Fragment();
|
||||
|
||||
private BootstrapButton btnContinue;
|
||||
private BootstrapButton btnReportNow;
|
||||
@@ -47,6 +61,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
|
||||
fragList.add(frag_report_1);
|
||||
fragList.add(frag_report_2);
|
||||
fragList.add(frag_report_3);
|
||||
|
||||
initFragment(currentState);
|
||||
|
||||
@@ -55,12 +70,24 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
btnContinue.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
initFragment(currentState+1);
|
||||
initFragment(currentState + 1);
|
||||
}
|
||||
});
|
||||
|
||||
btnReportNow = (BootstrapButton) findViewById(R.id.btn_reportwf_reportnow);
|
||||
btnReportNow.setVisibility(View.INVISIBLE);
|
||||
btnReportNow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
reportIncident(incident);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void reportIncident(AppClusterItem incident){
|
||||
String tag_string_req = "addincidentwithposition";
|
||||
StringRequest strReq = getStringRequestAddIncidentWithPosition(incident);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
|
||||
private void modifiyPos(String pos){
|
||||
@@ -97,6 +124,9 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
}
|
||||
|
||||
private void initFragment(int state) {
|
||||
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
||||
currentState = state;
|
||||
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
|
||||
transaction.replace(R.id.fragment_reportwf, fragList.get(state));
|
||||
@@ -128,8 +158,10 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
public void onInputFinished(boolean finished) {
|
||||
if(finished) {
|
||||
btnContinue.setVisibility(View.VISIBLE);
|
||||
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
btnContinue.setVisibility(View.INVISIBLE);
|
||||
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if(finished && (currentState == 1)){
|
||||
@@ -142,8 +174,8 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop(){
|
||||
super.onStop();
|
||||
public void onPause(){
|
||||
super.onPause();
|
||||
|
||||
SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);
|
||||
Gson gson = new Gson();
|
||||
@@ -151,6 +183,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
SharedPreferences.Editor prefsEditor = mPrefs.edit();
|
||||
|
||||
prefsEditor.putString("incident",gson.toJson(incident));
|
||||
prefsEditor.putInt("currentState", currentState);
|
||||
prefsEditor.commit();
|
||||
}
|
||||
|
||||
@@ -166,12 +199,78 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
Intent intent = getIntent();
|
||||
String pos = intent.getStringExtra(EXTRA_MESSAGE);
|
||||
if(pos != null) modifiyPos(pos);
|
||||
|
||||
currentState = mPrefs.getInt("currentState",0);
|
||||
if(currentState != 0) initFragment(currentState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onCallMap() {
|
||||
gotoMapActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
|
||||
if((id == R.id.menu_btn_goback)){
|
||||
initFragment(currentState-1);
|
||||
}else if((id == R.id.menu_btn_gotostart)){
|
||||
initFragment(0);
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
||||
private StringRequest getStringRequestAddIncidentWithPosition(final AppClusterItem incident) {
|
||||
showDialog();
|
||||
return new StringRequest(Request.Method.POST, AppConfig.URL_REGISTER, new Response.Listener<String>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(String response) {
|
||||
Log.d(TAG, "Report response: " + response);
|
||||
hideDialog();
|
||||
try {
|
||||
JSONObject jObj = new JSONObject(response);
|
||||
boolean error = jObj.getBoolean("error");
|
||||
|
||||
if (!error) {
|
||||
showMessage("Report added!");
|
||||
SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();
|
||||
editor.clear().commit();
|
||||
|
||||
|
||||
|
||||
showAd();
|
||||
gotoMapActivity(incident.getPosition().latitude+":"+incident.getPosition().longitude);
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error adding incident (Server returned error): " + errorMsg);
|
||||
showMessage(errorMsg);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}, new Response.ErrorListener() {
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
Log.e(TAG, "Error adding incident: " + error.getMessage());
|
||||
showMessage(getString(R.string.errormsg_couldnotretrieve));
|
||||
hideDialog();
|
||||
}
|
||||
}) {
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getParams() {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("tag", "addincidentwithposition");
|
||||
params.put("uid", user.get("uid"));
|
||||
|
||||
return params;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
@@ -234,7 +233,7 @@ public class ViewReportActivity extends BaseActivity {
|
||||
});
|
||||
|
||||
if(!incident.getString("fid_user").equals(user.get("uid"))){
|
||||
findViewById(R.id.ll_01).setVisibility(View.GONE);
|
||||
findViewById(R.id.layoutFooter).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -14,12 +14,10 @@ import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.AppClusterItem;
|
||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||
import org.deke.risk.riskahead.helper.HintAdapter;
|
||||
|
||||
/**
|
||||
@@ -27,17 +25,26 @@ import org.deke.risk.riskahead.helper.HintAdapter;
|
||||
*/
|
||||
public class ReportWF_1_Fragment extends Fragment{
|
||||
|
||||
private View mainview;
|
||||
private final static int VIOLANCE_GENERAL = 1;
|
||||
private final static int VIOLANCE_VERBAL = 2;
|
||||
private final static int VIOLANCE_LIGHT = 3;
|
||||
private final static int VIOLANCE_HARD = 4;
|
||||
private final static int VIOLANCE_NATURE = 5;
|
||||
private final static int VIOLANCE_INFRASTRUCTURE = 6;
|
||||
|
||||
private Spinner spinner_main_1;
|
||||
private Spinner spinner_sub_1;
|
||||
private EditText sub_1_etc;
|
||||
private RelativeLayout rl_pos;
|
||||
private BootstrapButton btnPos;
|
||||
private TextView txtPosDetail;
|
||||
private View viewFragment;
|
||||
|
||||
private boolean isCatFinished;
|
||||
AppClusterItem tmpIncident = new AppClusterItem();
|
||||
private Spinner crimeCategory;
|
||||
private Spinner crimeSubCategory;
|
||||
private EditText crimeSubOther;
|
||||
|
||||
private RelativeLayout timeLayout;
|
||||
private BootstrapButton btnPositionSearch;
|
||||
private TextView txtPositionInformation;
|
||||
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
|
||||
AppClusterItem incident;
|
||||
|
||||
OnInputFinishedListener mCallbackFinished;
|
||||
OnCallMapListener mCallbackMapListener;
|
||||
@@ -57,38 +64,34 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
||||
mainview = inflater.inflate(R.layout.fragment_reportwf_1, container, false);
|
||||
viewFragment = inflater.inflate(R.layout.fragment_reportwf_1, container, false);
|
||||
|
||||
initSpinnerOneMain();
|
||||
initSpinnerOneSub();
|
||||
initLayerPosition();
|
||||
|
||||
return mainview;
|
||||
crimeSubOther = (EditText) viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean isFinished = isCatFinished && (tmpIncident != null) && (tmpIncident.getPosition() != null);
|
||||
boolean isFinished = isMandatoryCategoryFilled && (incident != null) && (incident.getPosition() != null);
|
||||
|
||||
if(isCatFinished) mainview.findViewById(R.id.ll_pos).setVisibility(View.VISIBLE);
|
||||
|
||||
if(isFinished ){
|
||||
mainview.findViewById(R.id.atv_reportwf_1_finish).setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
mainview.findViewById(R.id.atv_reportwf_1_finish).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if(isMandatoryCategoryFilled) viewFragment.findViewById(R.id.ll_pos).setVisibility(View.VISIBLE);
|
||||
|
||||
mCallbackFinished.onInputFinished(isFinished);
|
||||
}
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
spinner_main_1 = (Spinner) mainview.findViewById(R.id.dd_reportwf_1_cat_main);
|
||||
crimeCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_main);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(),
|
||||
R.array.cat_situation_main, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_main_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner_main_1.setAdapter(new HintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
crimeCategory.setAdapter(new HintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
spinner_main_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
crimeCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
@@ -117,19 +120,20 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
break;
|
||||
}
|
||||
|
||||
Spinner spinner_sub_1 = (Spinner) mainview.findViewById(R.id.dd_reportwf_1_cat_sub);
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(mainview.getContext(),
|
||||
Spinner spinner_sub_1 = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_sub);
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(),
|
||||
stringid, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_sub_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner_sub_1.setAdapter(new HintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
if (((HintAdapter) spinner_main_1.getAdapter()).isInInitialState()) {
|
||||
if (((HintAdapter) crimeCategory.getAdapter()).isInInitialState()) {
|
||||
spinner_sub_1.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
spinner_sub_1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
isCatFinished = false;
|
||||
incident.setmFidCat1_Main(position);
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -141,51 +145,53 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
sub_1_etc = (EditText) mainview.findViewById(R.id.txt_reportwf_1_cat_etc);
|
||||
spinner_sub_1 = (Spinner) mainview.findViewById(R.id.dd_reportwf_1_cat_sub);
|
||||
spinner_sub_1.setVisibility(View.INVISIBLE);
|
||||
spinner_sub_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
crimeSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_sub);
|
||||
crimeSubCategory.setVisibility(View.INVISIBLE);
|
||||
crimeSubCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int i = 99;
|
||||
int i = 0;
|
||||
|
||||
switch (((Spinner) mainview.findViewById(R.id.dd_reportwf_1_cat_main)).getSelectedItemPosition()) {
|
||||
case 1:
|
||||
switch (((Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_main)).getSelectedItemPosition()) {
|
||||
case VIOLANCE_GENERAL:
|
||||
i = 7;
|
||||
break;
|
||||
case 2:
|
||||
case VIOLANCE_VERBAL:
|
||||
i = 5;
|
||||
break;
|
||||
case 3:
|
||||
case VIOLANCE_LIGHT:
|
||||
i = 6;
|
||||
break;
|
||||
case 4:
|
||||
case VIOLANCE_HARD:
|
||||
i = 7;
|
||||
break;
|
||||
case 5:
|
||||
case VIOLANCE_NATURE:
|
||||
i = 7;
|
||||
break;
|
||||
case 6:
|
||||
case VIOLANCE_INFRASTRUCTURE:
|
||||
i = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
if (position == i) {
|
||||
mainview.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.VISIBLE);
|
||||
viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mainview.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (((HintAdapter) spinner_sub_1.getAdapter()).isInInitialState()) {
|
||||
isCatFinished = false;
|
||||
if (((HintAdapter) crimeSubCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
} else {
|
||||
isCatFinished = true;
|
||||
isMandatoryCategoryFilled = true;
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
if((position == 0) && (tmpIncident.getmFidCat1_Sub() != 0)) spinner_sub_1.setSelection(tmpIncident.getmFidCat1_Sub());
|
||||
if ((position == 0) && (incident.getmFidCat1_Sub() != 0))
|
||||
crimeSubCategory.setSelection(incident.getmFidCat1_Sub());
|
||||
|
||||
incident.setmFidCat1_Sub(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,13 +201,13 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
}
|
||||
|
||||
private void initLayerPosition(){
|
||||
rl_pos = (RelativeLayout) mainview.findViewById(R.id.ll_pos);
|
||||
rl_pos.setVisibility(View.INVISIBLE);
|
||||
timeLayout = (RelativeLayout) viewFragment.findViewById(R.id.ll_pos);
|
||||
timeLayout.setVisibility(View.INVISIBLE);
|
||||
|
||||
btnPos = (BootstrapButton) mainview.findViewById(R.id.btn_reportwf_position);
|
||||
txtPosDetail = (TextView) mainview.findViewById(R.id.lbl_reportwf_position_detail);
|
||||
btnPositionSearch = (BootstrapButton) viewFragment.findViewById(R.id.btn_reportwf_position);
|
||||
txtPositionInformation = (TextView) viewFragment.findViewById(R.id.lbl_reportwf_position_detail);
|
||||
|
||||
btnPos.setOnClickListener(new View.OnClickListener() {
|
||||
btnPositionSearch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mCallbackMapListener.onCallMap();
|
||||
@@ -213,24 +219,24 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
tmpIncident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
|
||||
if(tmpIncident != null){
|
||||
if(tmpIncident.getPosition() != null){
|
||||
rl_pos.setVisibility(View.VISIBLE);
|
||||
txtPosDetail.setText(tmpIncident.getmPosDescription());
|
||||
if(incident != null){
|
||||
if(incident.getPosition() != null){
|
||||
timeLayout.setVisibility(View.VISIBLE);
|
||||
txtPositionInformation.setText(incident.getmPosDescription());
|
||||
}
|
||||
|
||||
if(tmpIncident.getmFidCat1_Main() != 0){
|
||||
spinner_main_1.setSelection(tmpIncident.getmFidCat1_Main());
|
||||
if(incident.getmFidCat1_Main() != 0){
|
||||
crimeCategory.setSelection(incident.getmFidCat1_Main());
|
||||
}
|
||||
|
||||
if(tmpIncident.getmFidCat1_Sub() != 0){
|
||||
spinner_sub_1.setSelection(tmpIncident.getmFidCat1_Sub());
|
||||
if(incident.getmFidCat1_Sub() != 0){
|
||||
crimeSubCategory.setSelection(incident.getmFidCat1_Sub());
|
||||
}
|
||||
|
||||
if(tmpIncident.getmCat1_Sub_etc() != null){
|
||||
sub_1_etc.setText(tmpIncident.getmCat1_Sub_etc());
|
||||
if(incident.getmCat1_Sub_etc() != null){
|
||||
crimeSubOther.setText(incident.getmCat1_Sub_etc());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,11 +247,11 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
tmpIncident.setmFidCat1_Main(spinner_main_1.getSelectedItemPosition());
|
||||
tmpIncident.setmFidCat1_Sub(spinner_sub_1.getSelectedItemPosition());
|
||||
tmpIncident.setmCat1_Sub_etc(sub_1_etc.getText().toString());
|
||||
incident.setmFidCat1_Main(crimeCategory.getSelectedItemPosition());
|
||||
incident.setmFidCat1_Sub(crimeSubCategory.getSelectedItemPosition());
|
||||
incident.setmCat1_Sub_etc(crimeSubOther.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(tmpIncident);
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,8 +20,11 @@ import android.widget.Spinner;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.AppClusterItem;
|
||||
import org.deke.risk.riskahead.helper.HintAdapter;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
@@ -29,17 +32,26 @@ import java.util.Calendar;
|
||||
*/
|
||||
public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
View mainview;
|
||||
private final static int NOW = 1;
|
||||
private final static int PERIODIC = 2;
|
||||
private final static int DATETIME = 3;
|
||||
private final static int DATETIMEAREA = 4;
|
||||
private final static int DONTKNOW = 5;
|
||||
|
||||
Spinner spinner_main_1;
|
||||
Spinner spinner_sub_1;
|
||||
private View viewFragment;
|
||||
|
||||
EditText input_time_from;
|
||||
EditText input_date_from;
|
||||
EditText input_time_to;
|
||||
EditText input_date_to;
|
||||
private Spinner timeCategory;
|
||||
private Spinner timeSubCategory;
|
||||
|
||||
EditText tmpInput;
|
||||
private EditText inputTimeFrom;
|
||||
private EditText inputDateFrom;
|
||||
private EditText inputTimeTo;
|
||||
private EditText inputDateTo;
|
||||
|
||||
private EditText tmpInput;
|
||||
|
||||
private AppClusterItem incident;
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
|
||||
OnInputFinishedListener mCallback;
|
||||
|
||||
@@ -47,15 +59,6 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
void onInputFinished(boolean finished);
|
||||
}
|
||||
|
||||
private void isFinished(boolean isFinished){
|
||||
if(isFinished){
|
||||
mainview.findViewById(R.id.atv_reportwf_2_finish).setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
mainview.findViewById(R.id.atv_reportwf_2_finish).setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -65,7 +68,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
||||
mainview = inflater.inflate(R.layout.fragment_reportwf_2, container, false);
|
||||
viewFragment = inflater.inflate(R.layout.fragment_reportwf_2, container, false);
|
||||
|
||||
initSpinnerOneMain();
|
||||
initSpinnerOneSub();
|
||||
@@ -73,140 +76,128 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
initLayoutFromTime();
|
||||
initLayoutToTime();
|
||||
|
||||
input_time_from = ((EditText) mainview.findViewById(R.id.input_report_from_time));
|
||||
input_time_to = ((EditText) mainview.findViewById(R.id.input_report_to_time));
|
||||
input_date_from = ((EditText) mainview.findViewById(R.id.input_report_from_date));
|
||||
input_date_to = ((EditText) mainview.findViewById(R.id.input_report_to_date));
|
||||
inputTimeFrom = ((EditText) viewFragment.findViewById(R.id.input_report_from_time));
|
||||
inputTimeTo = ((EditText) viewFragment.findViewById(R.id.input_report_to_time));
|
||||
inputDateFrom = ((EditText) viewFragment.findViewById(R.id.input_report_from_date));
|
||||
inputDateTo = ((EditText) viewFragment.findViewById(R.id.input_report_to_date));
|
||||
|
||||
input_time_from.setOnClickListener(new View.OnClickListener() {
|
||||
inputTimeFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = input_time_from;
|
||||
tmpInput = inputTimeFrom;
|
||||
showTimePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
input_time_to.setOnClickListener(new View.OnClickListener() {
|
||||
inputTimeTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = input_time_to;
|
||||
tmpInput = inputTimeTo;
|
||||
showTimePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
input_date_to.setOnClickListener(new View.OnClickListener() {
|
||||
inputDateTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = input_date_to;
|
||||
tmpInput = inputDateTo;
|
||||
showDatePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
input_date_from.setOnClickListener(new View.OnClickListener() {
|
||||
inputDateFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = input_date_from;
|
||||
tmpInput = inputDateFrom;
|
||||
showDatePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
return mainview;
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
private void initLayoutToTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) mainview.findViewById(R.id.ll_report_to_time);
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_to_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private void initLayoutFromTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) mainview.findViewById(R.id.ll_report_from_time);
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_from_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
spinner_sub_1 = (Spinner) mainview.findViewById(R.id.dd_reportwf_2_time_sub);
|
||||
spinner_sub_1.setVisibility(View.INVISIBLE);
|
||||
spinner_sub_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if(((HintAdapter) spinner_sub_1.getAdapter()).isInInitialState()){
|
||||
isFinished(false);
|
||||
} else {
|
||||
isFinished(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
spinner_main_1 = (Spinner) mainview.findViewById(R.id.dd_reportwf_2_time_main);
|
||||
timeCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_2_time_main);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(),
|
||||
R.array.cat_time_main, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_main_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner_main_1.setAdapter(new HintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
timeCategory.setAdapter(new HintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
spinner_main_1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
timeCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
|
||||
switch (position) {
|
||||
case 1:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isFinished(true);
|
||||
case NOW:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
|
||||
incident.setFromDate(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
|
||||
incident.setFromTime(new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime()));
|
||||
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
case 2:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
case PERIODIC:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
|
||||
incident.resetDatetime();
|
||||
|
||||
stringid = R.array.cat_time_sub_periodical;
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case 3:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.VISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
checkIfDateTimeFinished();
|
||||
case DATETIME:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.VISIBLE);
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case 4:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.VISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.VISIBLE);
|
||||
mainview.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
checkIfDateTimeFinished();
|
||||
case DATETIMEAREA:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.VISIBLE);
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.VISIBLE);
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case 5:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isFinished(true);
|
||||
break;
|
||||
default:
|
||||
mainview.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
mainview.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isFinished(false);
|
||||
case DONTKNOW:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.INVISIBLE);
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if(!((HintAdapter) spinner_main_1.getAdapter()).isInInitialState() && stringid != 0) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(mainview.getContext(),
|
||||
stringid, android.R.layout.simple_spinner_dropdown_item);
|
||||
checkIfFinished();
|
||||
|
||||
if (!((HintAdapter) timeCategory.getAdapter()).isInInitialState() && stringid != 0) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(),stringid, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_sub_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
spinner_sub_1.setAdapter(new HintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
spinner_sub_1.setVisibility(View.VISIBLE);
|
||||
} else if(stringid == 0) {
|
||||
spinner_sub_1.setVisibility(View.INVISIBLE);
|
||||
timeSubCategory.setAdapter(new HintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
timeSubCategory.setVisibility(View.VISIBLE);
|
||||
} else if (stringid == 0) {
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if(((HintAdapter) spinner_main_1.getAdapter()).isInInitialState()){
|
||||
isFinished(false);
|
||||
if (((HintAdapter) timeCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
|
||||
|
||||
incident.setmFidTimeMainCat(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -216,6 +207,27 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
timeSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_2_time_sub);
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
timeSubCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
isMandatoryCategoryFilled = !((HintAdapter) timeSubCategory.getAdapter()).isInInitialState();
|
||||
|
||||
if ((position == 0) && (incident.getmFidTimeSubCat() != 0))
|
||||
timeSubCategory.setSelection(incident.getmFidTimeSubCat());
|
||||
|
||||
checkIfFinished();
|
||||
incident.setmFidTimeSubCat(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
@@ -229,26 +241,71 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
public class TimePickerFragment extends DialogFragment
|
||||
implements TimePickerDialog.OnTimeSetListener {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
|
||||
if(incident != null){
|
||||
if(incident.getmFidTimeMainCat() != 0){
|
||||
timeCategory.setSelection(incident.getmFidTimeMainCat());
|
||||
}
|
||||
|
||||
if(incident.getmFidTimeSubCat() != 0){
|
||||
timeSubCategory.setSelection(incident.getmFidTimeSubCat());
|
||||
}
|
||||
|
||||
if(incident.getFromDate() != null && !incident.getFromDate().equals("")){
|
||||
inputDateFrom.setText(incident.getFromDate());
|
||||
}
|
||||
|
||||
if(incident.getFromTime() != null && !incident.getFromTime().equals("")){
|
||||
inputTimeFrom.setText(incident.getFromTime());
|
||||
}
|
||||
|
||||
if(incident.getToDate() != null && !incident.getToDate().equals("")){
|
||||
inputDateTo.setText(incident.getToDate());
|
||||
}
|
||||
|
||||
if(incident.getToTime() != null && !incident.getToTime().equals("")){
|
||||
inputDateTo.setText(incident.getToDate());
|
||||
}
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
incident.setmFidTimeMainCat(timeCategory.getSelectedItemPosition());
|
||||
incident.setmFidTimeSubCat(timeSubCategory.getSelectedItemPosition());
|
||||
incident.setFromDate(inputDateFrom.getText().toString());
|
||||
incident.setFromTime(inputTimeFrom.getText().toString());
|
||||
incident.setToDate(inputDateTo.getText().toString());
|
||||
incident.setToTime(inputTimeTo.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
// Use the current time as the default values for the picker
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int hour = c.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = c.get(Calendar.MINUTE);
|
||||
|
||||
// Create a new instance of TimePickerDialog and return it
|
||||
return new TimePickerDialog(getActivity(), this, hour, minute,
|
||||
DateFormat.is24HourFormat(getActivity()));
|
||||
return new TimePickerDialog(getActivity(), this, hour, minute,DateFormat.is24HourFormat(getActivity()));
|
||||
}
|
||||
|
||||
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
|
||||
tmpInput.setText(new StringBuilder().append(hourOfDay)
|
||||
.append(":").append(minute).append(" "));
|
||||
|
||||
checkIfDateTimeFinished();
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,8 +314,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
newFragment.show(getFragmentManager(),"Pick Time");
|
||||
}
|
||||
|
||||
public class DatePickerFragment extends DialogFragment
|
||||
implements DatePickerDialog.OnDateSetListener {
|
||||
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
@@ -275,7 +331,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
.append(year).append("-").append(month + 1).append("-")
|
||||
.append(day).append(" "));
|
||||
|
||||
checkIfDateTimeFinished();
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,16 +340,19 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
newFragment.show(getFragmentManager(), "Pick Date");
|
||||
}
|
||||
|
||||
private void checkIfDateTimeFinished(){
|
||||
if( mainview.findViewById(R.id.ll_report_from_time).getVisibility() == View.VISIBLE) {
|
||||
isFinished(!input_date_from.getText().toString().matches(""));
|
||||
private void checkIfFinished(){
|
||||
if( viewFragment.findViewById(R.id.ll_report_from_time).getVisibility() == View.VISIBLE) {
|
||||
isMandatoryCategoryFilled = !inputDateFrom.getText().toString().matches("");
|
||||
}
|
||||
|
||||
if (mainview.findViewById(R.id.ll_report_to_time).getVisibility() == View.VISIBLE){
|
||||
isFinished(!input_date_to.getText().toString().matches(""));
|
||||
if (isMandatoryCategoryFilled && viewFragment.findViewById(R.id.ll_report_to_time).getVisibility() == View.VISIBLE){
|
||||
isMandatoryCategoryFilled = !inputDateTo.getText().toString().matches("");
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isMandatoryCategoryFilled);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
|
||||
@@ -0,0 +1,214 @@
|
||||
package org.deke.risk.riskahead.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.AppClusterItem;
|
||||
import org.deke.risk.riskahead.helper.HintAdapter;
|
||||
|
||||
/**
|
||||
* Created by Dennis on 08.12.2015.
|
||||
*/
|
||||
public class ReportWF_3_Fragment extends Fragment {
|
||||
|
||||
private final static int GANGS = 1;
|
||||
private final static int POLICE = 2;
|
||||
private final static int MOB = 3;
|
||||
private final static int PARAMILITARY = 4;
|
||||
private final static int MILITARY = 5;
|
||||
private final static int TERRORIST = 6;
|
||||
private final static int ETC = 7;
|
||||
private final static int DONTKNOW = 8;
|
||||
|
||||
private View viewFragment;
|
||||
|
||||
private Spinner suspectCategory;
|
||||
private Spinner suspectOriginCategory;
|
||||
private EditText suspectEtcInput;
|
||||
|
||||
private AppClusterItem incident;
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
|
||||
OnInputFinishedListener mCallback;
|
||||
|
||||
public interface OnInputFinishedListener {
|
||||
void onInputFinished(boolean finished);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
||||
viewFragment = inflater.inflate(R.layout.fragment_reportwf_3, container, false);
|
||||
|
||||
initSpinnerOneMain();
|
||||
initSpinnerOneSub();
|
||||
|
||||
suspectEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_3_suspect_etc);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
suspectCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect);
|
||||
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(),
|
||||
R.array.cat_suspect_main, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_main_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
suspectCategory.setAdapter(new HintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
suspectCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
|
||||
switch (position) {
|
||||
case GANGS:
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
case POLICE:
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
case MOB:
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
case PARAMILITARY:
|
||||
stringid = R.array.cat_suspect_sub_location;
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case MILITARY:
|
||||
stringid = R.array.cat_suspect_sub_location;
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case TERRORIST:
|
||||
stringid = R.array.cat_suspect_sub_location;
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case ETC:
|
||||
suspectEtcInput.setVisibility(View.VISIBLE);
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case DONTKNOW:
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (position != ETC) {
|
||||
suspectEtcInput.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
if (!((HintAdapter) suspectCategory.getAdapter()).isInInitialState() && stringid != 0) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(), stringid, android.R.layout.simple_spinner_dropdown_item);
|
||||
adapter_sub_1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
suspectOriginCategory.setAdapter(new HintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
suspectOriginCategory.setVisibility(View.VISIBLE);
|
||||
} else if (stringid == 0) {
|
||||
suspectOriginCategory.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (((HintAdapter) suspectCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
incident.setmFidSuspectMainCat(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// your code here
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
suspectOriginCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect_sub);
|
||||
suspectOriginCategory.setVisibility(View.INVISIBLE);
|
||||
suspectOriginCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
isMandatoryCategoryFilled = !((HintAdapter) suspectOriginCategory.getAdapter()).isInInitialState();
|
||||
|
||||
if ((position == 0) && (incident.getmFidTimeSubCat() != 0))
|
||||
suspectOriginCategory.setSelection(incident.getmFidSuspectOrigin());
|
||||
|
||||
checkIfFinished();
|
||||
incident.setmFidTimeSubCat(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
|
||||
if(incident != null){
|
||||
if(incident.getmFidSuspectMainCat() != 0) suspectCategory.setSelection(incident.getmFidSuspectMainCat());
|
||||
if(incident.getmFidSuspectOrigin() != 0) suspectOriginCategory.setSelection(incident.getmFidSuspectOrigin());
|
||||
if(incident.getmSuspectEtc() != null && !incident.getmSuspectEtc().equals("")) suspectEtcInput.setText(incident.getmSuspectEtc());
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
incident.setmFidSuspectMainCat(suspectCategory.getSelectedItemPosition());
|
||||
incident.setmFidSuspectOrigin(suspectOriginCategory.getSelectedItemPosition());
|
||||
incident.setmSuspectEtc(suspectEtcInput.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void checkIfFinished(){
|
||||
mCallback.onInputFinished(isMandatoryCategoryFilled);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,18 @@ public class AppClusterItem implements ClusterItem {
|
||||
private String mCat1_Sub_etc;
|
||||
private String mPosDescription;
|
||||
|
||||
private int mFidTimeMainCat;
|
||||
private int mFidTimeSubCat;
|
||||
private String fromTime;
|
||||
private String fromDate;
|
||||
private String toTime;
|
||||
private String toDate;
|
||||
|
||||
private int mFidSuspectMainCat;
|
||||
private int mFidSuspectOrigin;
|
||||
private String mSuspectEtc;
|
||||
|
||||
|
||||
|
||||
private BitmapDescriptor icon;
|
||||
|
||||
@@ -189,4 +201,83 @@ public class AppClusterItem implements ClusterItem {
|
||||
public void setmCat1_Sub_etc(String mCat1_Sub_etc) {
|
||||
this.mCat1_Sub_etc = mCat1_Sub_etc;
|
||||
}
|
||||
|
||||
public int getmFidTimeMainCat() {
|
||||
return mFidTimeMainCat;
|
||||
}
|
||||
|
||||
public void setmFidTimeMainCat(int mFidTimeMainCat) {
|
||||
this.mFidTimeMainCat = mFidTimeMainCat;
|
||||
}
|
||||
|
||||
public int getmFidTimeSubCat() {
|
||||
return mFidTimeSubCat;
|
||||
}
|
||||
|
||||
public void setmFidTimeSubCat(int mFidTimeSubCat) {
|
||||
this.mFidTimeSubCat = mFidTimeSubCat;
|
||||
}
|
||||
|
||||
public String getFromTime() {
|
||||
return fromTime;
|
||||
}
|
||||
|
||||
public void setFromTime(String fromTime) {
|
||||
this.fromTime = fromTime;
|
||||
}
|
||||
|
||||
public String getFromDate() {
|
||||
return fromDate;
|
||||
}
|
||||
|
||||
public void setFromDate(String fromDate) {
|
||||
this.fromDate = fromDate;
|
||||
}
|
||||
|
||||
public String getToTime() {
|
||||
return toTime;
|
||||
}
|
||||
|
||||
public void setToTime(String toTime) {
|
||||
this.toTime = toTime;
|
||||
}
|
||||
|
||||
public String getToDate() {
|
||||
return toDate;
|
||||
}
|
||||
|
||||
public void setToDate(String toDate) {
|
||||
toDate = toDate;
|
||||
}
|
||||
|
||||
public void resetDatetime() {
|
||||
toTime = "";
|
||||
toDate = "";
|
||||
fromTime = "";
|
||||
fromDate = "";
|
||||
}
|
||||
|
||||
public int getmFidSuspectMainCat() {
|
||||
return mFidSuspectMainCat;
|
||||
}
|
||||
|
||||
public void setmFidSuspectMainCat(int mFidSuspectMainCat) {
|
||||
this.mFidSuspectMainCat = mFidSuspectMainCat;
|
||||
}
|
||||
|
||||
public int getmFidSuspectOrigin() {
|
||||
return mFidSuspectOrigin;
|
||||
}
|
||||
|
||||
public void setmFidSuspectOrigin(int mFidSuspectOrigin) {
|
||||
this.mFidSuspectOrigin = mFidSuspectOrigin;
|
||||
}
|
||||
|
||||
public String getmSuspectEtc() {
|
||||
return mSuspectEtc;
|
||||
}
|
||||
|
||||
public void setmSuspectEtc(String mSuspectEtc) {
|
||||
this.mSuspectEtc = mSuspectEtc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
tools:context="org.deke.risk.riskahead.MapsActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
tools:context=".ProfileActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -178,7 +178,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
android:layout_width="0px" android:layout_height="0px"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="15dp"
|
||||
@@ -170,7 +170,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
|
||||
@@ -8,54 +8,75 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/fragment_reportwf"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutStatus"
|
||||
android:background="#0f4845ff"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/fragment_reportwf"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_weight="1" />
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_weight="0">
|
||||
|
||||
<com.beardedhen.androidbootstrap.AwesomeTextView
|
||||
android:id="@+id/atvStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="50dp"
|
||||
android:visibility="invisible"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
bootstrap:fontAwesomeIcon="fa_check_circle_o" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="0dp">
|
||||
|
||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||
android:id="@+id/btn_reportwf_reportnow"
|
||||
bootstrap:bootstrapText="Report NOW!"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
bootstrap:bootstrapBrand="danger"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||
android:id="@+id/btn_reportwf_next"
|
||||
bootstrap:bootstrapText="Continue"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginBottom="0dp">
|
||||
|
||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||
android:id="@+id/btn_reportwf_reportnow"
|
||||
bootstrap:bootstrapText="Report NOW!"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
bootstrap:bootstrapBrand="danger"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||
android:id="@+id/btn_reportwf_next"
|
||||
bootstrap:bootstrapText="Continue"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<ListView
|
||||
android:id="@+id/navList"
|
||||
android:layout_width="200dp"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
tools:context=".ReportlistActivity">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerInParent="true"
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
tools:context=".SettingsActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
@@ -136,7 +136,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
android:background="#00ffffff" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_alignParentBottom="true">
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
tools:context=".SubscriptionsActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
tools:context=".ViewReportActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout1"
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
@@ -21,7 +21,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_main_content"
|
||||
android:id="@+id/layoutContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="10dp"
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutFooter"
|
||||
android:gravity="center"
|
||||
android:background="@color/bg_common"
|
||||
android:layout_height="50dp"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutMainContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
@@ -108,26 +108,5 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01_02"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_marginBottom="0dp">
|
||||
|
||||
<com.beardedhen.androidbootstrap.AwesomeTextView
|
||||
android:id="@+id/atv_reportwf_1_finish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="80dp"
|
||||
android:visibility="invisible"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
bootstrap:fontAwesomeIcon="fa_check_circle_o"
|
||||
android:layout_alignTop="@+id/txt_reportwf_1_cat_etc"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="19dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -9,7 +9,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01"
|
||||
android:id="@+id/layoutMainContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
@@ -151,22 +151,5 @@
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_01_02"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:gravity="center"
|
||||
android:layout_marginBottom="0dp">
|
||||
|
||||
<com.beardedhen.androidbootstrap.AwesomeTextView
|
||||
android:id="@+id/atv_reportwf_2_finish"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="80dp"
|
||||
android:visibility="invisible"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
bootstrap:fontAwesomeIcon="fa_check_circle_o" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
67
app/src/main/res/layout/fragment_reportwf_3.xml
Normal file
67
app/src/main/res/layout/fragment_reportwf_3.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@drawable/layout_bg_gradient"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutMainContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutSubContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lbl_reportwf_3_question"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="20dp"
|
||||
android:text="Who is the suspect?"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/bg_common" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_3_suspect"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
android:spinnerMode="dialog"
|
||||
android:prompt="@string/lbl_spinner_choose"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_3_suspect_sub"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
android:spinnerMode="dialog"
|
||||
android:prompt="@string/lbl_spinner_choose"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
|
||||
<EditText
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
android:hint="Please enter your info here"
|
||||
android:id="@+id/txt_reportwf_3_suspect_etc"
|
||||
android:layout_gravity="center_horizontal"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -1,14 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="150dp"
|
||||
android:layout_width="250dp"
|
||||
android:minWidth="200dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="7dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="13dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="7dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:background="@drawable/infowindow">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#a6000000"
|
||||
android:id="@+id/txt_infowindow_title"
|
||||
android:text="Header"
|
||||
android:textSize="18dp"
|
||||
android:paddingLeft="30dp"
|
||||
android:typeface="serif" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/lay_infowindow_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/lay_infowindow_color"
|
||||
@@ -19,25 +36,17 @@
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="144dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#a6000000"
|
||||
android:id="@+id/txt_infowindow_title"
|
||||
android:text="Header"
|
||||
android:textSize="16dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:typeface="serif" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="120dp"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:typeface="serif"
|
||||
android:textColor="#b9000000"
|
||||
android:text="Textabfdfdgregreger"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:id="@+id/txt_infowindow_description"
|
||||
android:singleLine="true"
|
||||
@@ -57,11 +66,10 @@
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/lay_infowindow_2"
|
||||
android:background="#55151515"
|
||||
android:background="#55ababab"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="3dp"
|
||||
>
|
||||
android:padding="3dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
@@ -89,5 +97,6 @@
|
||||
android:rating = "0"/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -2,12 +2,12 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<item android:id="@+id/btn_reportwf_new"
|
||||
<item android:id="@+id/menu_btn_gotostart"
|
||||
android:title="New Report"
|
||||
android:icon="@drawable/ic_action_reply_all"
|
||||
app:showAsAction="always"/>
|
||||
|
||||
<item android:id="@+id/btn_reportwf_back"
|
||||
<item android:id="@+id/menu_btn_goback"
|
||||
android:title="New Report"
|
||||
android:icon="@drawable/ic_action_reply"
|
||||
app:showAsAction="always"/>
|
||||
|
||||
@@ -207,7 +207,21 @@
|
||||
<item>Nachts</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_main">
|
||||
<item>Straßenkriminelle/Gangs</item>
|
||||
<item>Polizei</item>
|
||||
<item>Volksmenge</item>
|
||||
<item>Miliz, Kartell, Guerilla (Paramilitär)</item>
|
||||
<item>Soldaten (Militär)</item>
|
||||
<item>Terroristen (religiöse oder politische)</item>
|
||||
<item>Sonstige:…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_sub_location">
|
||||
<item>Lokale aus dem Land (National)</item>
|
||||
<item>Ausländische</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user