DT @02.01.2016: ReportWF refactored und erweitert. Kategorien in strings.xml hinzugefügt. InAppBillingService hinzugefügt (muss jedoch noch implementiert werden)
This commit is contained in:
34
app/app.iml
34
app/app.iml
@@ -78,14 +78,14 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.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.8.1/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-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-gcm/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-plus/8.3.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-basement/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-gcm/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-location/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-maps/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-measurement/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-plus/8.4.0/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.maps.android/android-maps-utils/0.4/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/google-material-typeface/2.1.0.1.original/jars" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.mikepenz/iconics-core/2.5.1/jars" />
|
||||
@@ -105,32 +105,32 @@
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="play-services-base-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="design-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-ads-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialize-0.5.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="facebook-android-sdk-4.8.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="multidex-1.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-measurement-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="androidbootstrap-2.0.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="retrofit-1.6.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="appcompat-v7-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="materialdrawer-4.5.8" level="project" />
|
||||
<orderEntry type="library" exported="" name="library-1.0.19" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-base-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-location-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="fabric-1.3.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-maps-utils-0.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-location-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="twitter-core-1.4.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-plus-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-basement-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="bolts-android-1.2.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-maps-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-maps-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="google-material-typeface-2.1.0.1.original" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-ads-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-23.1.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-gcm-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-gcm-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-plus-8.4.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="iconics-core-2.5.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="gson-2.4" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-basement-8.3.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="play-services-measurement-8.4.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -40,13 +40,16 @@ dependencies {
|
||||
compile('com.twitter.sdk.android:twitter-core:1.4.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
compile('com.mikepenz:materialdrawer:4.5.8@aar') {
|
||||
transitive = true
|
||||
}
|
||||
compile 'com.android.support:appcompat-v7:23.1.1'
|
||||
compile 'com.mikepenz:iconics-core:2.5.1@aar'
|
||||
compile 'com.mikepenz:google-material-typeface:2.1.0.1.original@aar'
|
||||
compile 'com.google.android.gms:play-services-gcm:8.3.0'
|
||||
compile 'com.google.android.gms:play-services-plus:8.3.0'
|
||||
compile 'com.google.android.gms:play-services-location:8.3.0'
|
||||
compile 'com.google.android.gms:play-services-ads:8.3.0'
|
||||
compile 'com.google.android.gms:play-services-gcm:8.4.0'
|
||||
compile 'com.google.android.gms:play-services-plus:8.4.0'
|
||||
compile 'com.google.android.gms:play-services-location:8.4.0'
|
||||
compile 'com.google.android.gms:play-services-ads:8.4.0'
|
||||
compile 'com.facebook.android:facebook-android-sdk:4.8.1'
|
||||
compile 'com.beardedhen:androidbootstrap:2.0.1'
|
||||
compile 'com.mcxiaoke.volley:library:1.0.19'
|
||||
@@ -54,7 +57,4 @@ dependencies {
|
||||
compile 'com.google.code.gson:gson:2.4'
|
||||
compile 'com.google.maps.android:android-maps-utils:0.4'
|
||||
compile 'com.android.support:support-v4:23.1.1'
|
||||
compile('com.mikepenz:materialdrawer:4.5.8@aar') {
|
||||
transitive = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.vending.billing;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
/**
|
||||
* InAppBillingService is the service that provides in-app billing version 3 and beyond.
|
||||
* This service provides the following features:
|
||||
* 1. Provides a new API to get details of in-app items published for the app including
|
||||
* price, type, title and description.
|
||||
* 2. The purchase flow is synchronous and purchase information is available immediately
|
||||
* after it completes.
|
||||
* 3. Purchase information of in-app purchases is maintained within the Google Play system
|
||||
* till the purchase is consumed.
|
||||
* 4. An API to consume a purchase of an inapp item. All purchases of one-time
|
||||
* in-app items are consumable and thereafter can be purchased again.
|
||||
* 5. An API to get current purchases of the user immediately. This will not contain any
|
||||
* consumed purchases.
|
||||
*
|
||||
* All calls will give a response code with the following possible values
|
||||
* RESULT_OK = 0 - success
|
||||
* RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog
|
||||
* RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested
|
||||
* RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase
|
||||
* RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API
|
||||
* RESULT_ERROR = 6 - Fatal error during the API action
|
||||
* RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned
|
||||
* RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned
|
||||
*/
|
||||
interface IInAppBillingService {
|
||||
/**
|
||||
* Checks support for the requested billing API version, package and in-app type.
|
||||
* Minimum API version supported by this interface is 3.
|
||||
* @param apiVersion the billing version which the app is using
|
||||
* @param packageName the package name of the calling app
|
||||
* @param type type of the in-app item being purchased "inapp" for one-time purchases
|
||||
* and "subs" for subscription.
|
||||
* @return RESULT_OK(0) on success, corresponding result code on failures
|
||||
*/
|
||||
int isBillingSupported(int apiVersion, String packageName, String type);
|
||||
|
||||
/**
|
||||
* Provides details of a list of SKUs
|
||||
* Given a list of SKUs of a valid type in the skusBundle, this returns a bundle
|
||||
* with a list JSON strings containing the productId, price, title and description.
|
||||
* This API can be called with a maximum of 20 SKUs.
|
||||
* @param apiVersion billing API version that the Third-party is using
|
||||
* @param packageName the package name of the calling app
|
||||
* @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST"
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "DETAILS_LIST" with a StringArrayList containing purchase information
|
||||
* in JSON format similar to:
|
||||
* '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00",
|
||||
* "title : "Example Title", "description" : "This is an example description" }'
|
||||
*/
|
||||
Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle);
|
||||
|
||||
/**
|
||||
* Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU,
|
||||
* the type, a unique purchase token and an optional developer payload.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param sku the SKU of the in-app item as published in the developer console
|
||||
* @param type the type of the in-app item ("inapp" for one-time purchases
|
||||
* and "subs" for subscription).
|
||||
* @param developerPayload optional argument to be sent back with the purchase information
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "BUY_INTENT" - PendingIntent to start the purchase flow
|
||||
*
|
||||
* The Pending intent should be launched with startIntentSenderForResult. When purchase flow
|
||||
* has completed, the onActivityResult() will give a resultCode of OK or CANCELED.
|
||||
* If the purchase is successful, the result data will contain the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "INAPP_PURCHASE_DATA" - String in JSON format similar to
|
||||
* '{"orderId":"12999763169054705758.1371079406387615",
|
||||
* "packageName":"com.example.app",
|
||||
* "productId":"exampleSku",
|
||||
* "purchaseTime":1345678900000,
|
||||
* "purchaseToken" : "122333444455555",
|
||||
* "developerPayload":"example developer payload" }'
|
||||
* "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that
|
||||
* was signed with the private key of the developer
|
||||
* TODO: change this to app-specific keys.
|
||||
*/
|
||||
Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type,
|
||||
String developerPayload);
|
||||
|
||||
/**
|
||||
* Returns the current SKUs owned by the user of the type and package name specified along with
|
||||
* purchase information and a signature of the data to be validated.
|
||||
* This will return all SKUs that have been purchased in V3 and managed items purchased using
|
||||
* V1 and V2 that have not been consumed.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param type the type of the in-app items being requested
|
||||
* ("inapp" for one-time purchases and "subs" for subscription).
|
||||
* @param continuationToken to be set as null for the first call, if the number of owned
|
||||
* skus are too many, a continuationToken is returned in the response bundle.
|
||||
* This method can be called again with the continuation token to get the next set of
|
||||
* owned skus.
|
||||
* @return Bundle containing the following key-value pairs
|
||||
* "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on
|
||||
* failure as listed above.
|
||||
* "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs
|
||||
* "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information
|
||||
* "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures
|
||||
* of the purchase information
|
||||
* "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the
|
||||
* next set of in-app purchases. Only set if the
|
||||
* user has more owned skus than the current list.
|
||||
*/
|
||||
Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken);
|
||||
|
||||
/**
|
||||
* Consume the last purchase of the given SKU. This will result in this item being removed
|
||||
* from all subsequent responses to getPurchases() and allow re-purchase of this item.
|
||||
* @param apiVersion billing API version that the app is using
|
||||
* @param packageName package name of the calling app
|
||||
* @param purchaseToken token in the purchase information JSON that identifies the purchase
|
||||
* to be consumed
|
||||
* @return 0 if consumption succeeded. Appropriate error values for failures.
|
||||
*/
|
||||
int consumePurchase(int apiVersion, String packageName, String purchaseToken);
|
||||
}
|
||||
@@ -75,6 +75,7 @@ public class MainActivity extends BaseActivity{
|
||||
|
||||
Drawable reportIcon = new IconicsDrawable(this)
|
||||
.icon(GoogleMaterial.Icon.gmd_room)
|
||||
.color(getResources().getColor(R.color.white))
|
||||
.sizeDp(24);
|
||||
|
||||
report.setCompoundDrawables(reportIcon, null, null, null);
|
||||
@@ -90,6 +91,7 @@ public class MainActivity extends BaseActivity{
|
||||
|
||||
Drawable mapIcon = new IconicsDrawable(this)
|
||||
.icon(GoogleMaterial.Icon.gmd_map)
|
||||
.color(getResources().getColor(R.color.white))
|
||||
.sizeDp(24);
|
||||
|
||||
map.setCompoundDrawables(null,null, mapIcon, null);
|
||||
|
||||
@@ -52,6 +52,7 @@ import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -76,9 +77,9 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
private LatLng markedLocation;
|
||||
|
||||
private static final int DEFAULT_ZOOM_LEVEL = 14;
|
||||
private static final int THRESHOLD_ZOOM_LEVEL = 7;
|
||||
private static final int THRESHOLD_ZOOM_LEVEL = 10;
|
||||
|
||||
private static final int MIN_ZOOM_LEVEL = 5;
|
||||
private static final int MIN_ZOOM_LEVEL = 7;
|
||||
|
||||
private LatLng curNortheastBounds;
|
||||
private LatLng curSouthwestBounds;
|
||||
@@ -94,6 +95,8 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
findViewById(R.id.btn_maps_confirm_position).setVisibility(View.GONE);
|
||||
navDrawer.setSelection(mapAvtivityID, false);
|
||||
|
||||
System.gc();
|
||||
|
||||
initMap();
|
||||
handleIntent(getIntent());
|
||||
initClustering();
|
||||
@@ -102,6 +105,12 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
System.gc();
|
||||
}
|
||||
|
||||
private void initMap() {
|
||||
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.frag_maps_map)).getMap();
|
||||
mMap.getUiSettings().setZoomControlsEnabled(true);
|
||||
@@ -517,10 +526,23 @@ public class MapsActivity extends BaseActivity implements LoaderManager.LoaderCa
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(point, DEFAULT_ZOOM_LEVEL));
|
||||
} else {
|
||||
myPosition = session.getLocation();
|
||||
if (myPosition != null)
|
||||
if ((myPosition != null) && (myPosition.latitude != 0.0) && (myPosition.longitude != 0.0))
|
||||
{
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
|
||||
new LatLng(myPosition.latitude, myPosition.longitude), DEFAULT_ZOOM_LEVEL));
|
||||
}else{
|
||||
String sDefSystemLanguage = Locale.getDefault().getLanguage();
|
||||
|
||||
if(sDefSystemLanguage.equals("en")){
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
|
||||
new LatLng(52.603048, -2.298889), DEFAULT_ZOOM_LEVEL));
|
||||
} else if (sDefSystemLanguage.equals("de")){
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
|
||||
new LatLng(53.090725, 14.268494), DEFAULT_ZOOM_LEVEL));
|
||||
} else {
|
||||
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(
|
||||
new LatLng(19.432608, -99.133209), DEFAULT_ZOOM_LEVEL));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.deke.risk.riskahead;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -26,6 +26,7 @@ import com.google.gson.Gson;
|
||||
import org.deke.risk.riskahead.fragment.ReportWF_1_Fragment;
|
||||
import org.deke.risk.riskahead.fragment.ReportWF_2_Fragment;
|
||||
import org.deke.risk.riskahead.fragment.ReportWF_3_Fragment;
|
||||
import org.deke.risk.riskahead.fragment.ReportWF_4_Fragment;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
import org.deke.risk.riskahead.helper.AppConfig;
|
||||
import org.deke.risk.riskahead.helper.AppController;
|
||||
@@ -41,16 +42,17 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_2_Fragment.OnInputFinishedListener, ReportWF_3_Fragment.OnInputFinishedListener {
|
||||
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_2_Fragment.OnInputFinishedListener, ReportWF_3_Fragment.OnInputFinishedListener, ReportWF_4_Fragment.OnInputFinishedListener {
|
||||
|
||||
private final static String mActivityTitle = "Report Incident";
|
||||
private final static String TAG = ReportWFActivity.class.getSimpleName();
|
||||
|
||||
private List<Fragment> fragList = new ArrayList<Fragment>();
|
||||
private List<Fragment> fragList = new ArrayList<>();
|
||||
|
||||
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 Fragment frag_report_4 = new ReportWF_4_Fragment();
|
||||
|
||||
private BootstrapButton btnContinue;
|
||||
private BootstrapButton btnReportNow;
|
||||
@@ -62,8 +64,8 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
|
||||
public boolean resetSignal = false;
|
||||
|
||||
SharedPreferences mPrefs;
|
||||
SharedPreferences.Editor prefsEditor;
|
||||
private SharedPreferences mPrefs;
|
||||
private SharedPreferences.Editor prefsEditor;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -72,6 +74,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);
|
||||
fragList.add(frag_report_4);
|
||||
|
||||
initFragment(currentState);
|
||||
|
||||
@@ -105,7 +108,6 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mPrefs = getPreferences(MODE_PRIVATE);
|
||||
prefsEditor = mPrefs.edit();
|
||||
}
|
||||
@@ -156,7 +158,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
}
|
||||
|
||||
public void setIncident(IncidentReport newIncident){
|
||||
if(resetSignal == false){
|
||||
if(!resetSignal){
|
||||
incident = newIncident;
|
||||
}
|
||||
}
|
||||
@@ -165,7 +167,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
findViewById(R.id.atvStatus).setVisibility(View.INVISIBLE);
|
||||
currentState = state;
|
||||
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
transaction.replace(R.id.fragment_reportwf, fragList.get(state));
|
||||
transaction.addToBackStack(null);
|
||||
@@ -182,16 +184,6 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
return R.layout.activity_report_wf;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getActivityName() {
|
||||
return mActivityTitle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInputFinished(boolean finished) {
|
||||
if(finished) {
|
||||
@@ -215,7 +207,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
public void onStop(){
|
||||
super.onStop();
|
||||
|
||||
if(resetSignal == false){
|
||||
if(!resetSignal){
|
||||
Gson gson = new Gson();
|
||||
prefsEditor.putString("incident", gson.toJson(incident));
|
||||
prefsEditor.putInt("currentState", currentState);
|
||||
@@ -263,9 +255,6 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
})
|
||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||
.show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
@@ -277,7 +266,14 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
}else{
|
||||
btnMap.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void onBackPressed(){
|
||||
if(currentState > 0) {
|
||||
initFragment(currentState - 1);
|
||||
}else{
|
||||
super.onBackPressed();
|
||||
}
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestAddIncidentWithPosition(final IncidentReport incident) {
|
||||
@@ -358,4 +354,13 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
return R.layout.activity_report_wf;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getActivityName() {
|
||||
return mActivityTitle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,73 @@
|
||||
package org.deke.risk.riskahead;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.android.vending.billing.IInAppBillingService;
|
||||
|
||||
import org.deke.risk.riskahead.helper.BaseActivity;
|
||||
|
||||
|
||||
public class SubscriptionsActivity extends BaseActivity {
|
||||
public class SubscriptionsActivity extends BaseActivity implements ServiceConnection{
|
||||
|
||||
private final static String mActivityTitle = "Subscriptions";
|
||||
private final static String TAG = StartActivity.class.getSimpleName();
|
||||
|
||||
private Button btnPurchaseNoAds;
|
||||
private Button btnPurchaseExtraFunctions;
|
||||
|
||||
IInAppBillingService mService;
|
||||
ServiceConnection mServiceConn;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
userHasToBeLoggedIn();
|
||||
|
||||
btnPurchaseNoAds = (Button) findViewById(R.id.btn_subscription_1);
|
||||
btnPurchaseExtraFunctions = (Button) findViewById(R.id.btn_subscription_2);
|
||||
|
||||
Intent serviceIntent =
|
||||
new Intent("com.android.vending.billing.InAppBillingService.BIND");
|
||||
serviceIntent.setPackage("com.android.vending");
|
||||
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
|
||||
|
||||
// Bundle activeSubs = mService.getPurchases(3, "org.deke.risk.riskahead", "subs", continueToken);
|
||||
|
||||
btnPurchaseNoAds.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
/*
|
||||
Bundle bundle = mService.getBuyIntent(3, "org.deke.risk.riskahead",MY_SKU, "subs", developerPayload);
|
||||
|
||||
PendingIntent pendingIntent = bundle.getParcelable(RESPONSE_BUY_INTENT);
|
||||
if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) {
|
||||
// Start purchase flow (this brings up the Google Play UI).
|
||||
// Result will be delivered through onActivityResult().
|
||||
startIntentSenderForResult(pendingIntent, RC_BUY, new Intent(),
|
||||
Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
|
||||
}
|
||||
*/
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
navDrawer.setSelection(subscriptionsAvtivityID,false);
|
||||
navDrawer.setSelection(subscriptionsAvtivityID, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutResourceId() {
|
||||
return R.layout.activity_subscriptions;
|
||||
@@ -29,4 +75,22 @@ public class SubscriptionsActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected String getActivityName() { return mActivityTitle; }
|
||||
|
||||
@Override
|
||||
public void onServiceConnected(ComponentName name, IBinder service) {
|
||||
mService = IInAppBillingService.Stub.asInterface(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServiceDisconnected(ComponentName name) {
|
||||
mService = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mService != null) {
|
||||
unbindService(mServiceConn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,33 +41,33 @@ public class ViewReportActivity extends BaseActivity {
|
||||
private TextView txtPosition;
|
||||
|
||||
private BootstrapLabel scorelabel;
|
||||
private IncidentReport incident;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
userHasToBeLoggedIn();
|
||||
|
||||
Intent intent = getIntent();
|
||||
final Integer uid = intent.getIntExtra(BaseActivity.EXTRA_MESSAGE, 0);
|
||||
|
||||
txtIncidentCategory = (EditText) findViewById(R.id.txt_viewreport_incidentcategory);
|
||||
txtIncidentSubCategory = (EditText) findViewById(R.id.txt_viewreport_incidentsubcategory);
|
||||
txtPosition = (TextView) findViewById(R.id.txt_viewreport_position);
|
||||
scorelabel = (BootstrapLabel) findViewById(R.id.txt_viewreport_points);
|
||||
|
||||
getIncident(uid);
|
||||
Intent intent = getIntent();
|
||||
final Integer id = intent.getIntExtra(BaseActivity.EXTRA_MESSAGE, 0);
|
||||
getIncident(id);
|
||||
|
||||
findViewById(R.id.btn_viewreport_upvote).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
makeUpvote(uid);
|
||||
makeUpvote(id);
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.btn_viewreport_downvote).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
makeDownvote(uid);
|
||||
makeDownvote(id);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ViewReportActivity extends BaseActivity {
|
||||
.setMessage("Do you really want to delete this incident?")
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
deleteReport(uid);
|
||||
deleteReport(id);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
|
||||
@@ -185,9 +185,7 @@ public class ViewReportActivity extends BaseActivity {
|
||||
|
||||
if (!error) {
|
||||
JSONObject jIncident = jObj.getJSONObject("msg");
|
||||
IncidentReport incident = new IncidentReport(jIncident);
|
||||
|
||||
initReport(incident);
|
||||
initReport(new IncidentReport(jIncident));
|
||||
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
@@ -229,6 +227,8 @@ public class ViewReportActivity extends BaseActivity {
|
||||
txtIncidentCategory.setText(incident.getIncidentCategoryName(getApplicationContext()));
|
||||
txtIncidentSubCategory.setText(incident.getIncidentSubCategoryName(getApplicationContext()));
|
||||
|
||||
this.incident = incident;
|
||||
|
||||
Geocoder geocoder = new Geocoder(getApplicationContext(), Locale.getDefault());
|
||||
|
||||
try {
|
||||
@@ -265,16 +265,24 @@ public class ViewReportActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public void makeUpvote(Integer uid) {
|
||||
String tag_string_req = "addvote";
|
||||
StringRequest strReq = getStringRequestAddVote(uid, "1");
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
public void makeUpvote(Integer incidentid) {
|
||||
if(user.get(SessionManager.KEY_UID).equals(Integer.toString(incident.getFidFromUser()))){
|
||||
showMessage("You can not vote your own incidents");
|
||||
}else {
|
||||
String tag_string_req = "addvote";
|
||||
StringRequest strReq = getStringRequestAddVote(incidentid, "1");
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
}
|
||||
|
||||
public void makeDownvote(Integer uid) {
|
||||
String tag_string_req = "addvote";
|
||||
StringRequest strReq = getStringRequestAddVote(uid, "2");
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
public void makeDownvote(Integer incidentid) {
|
||||
if(user.get(SessionManager.KEY_UID).equals(Integer.toString(incident.getFidFromUser()))){
|
||||
showMessage("You can not vote your own incidents");
|
||||
}else {
|
||||
String tag_string_req = "addvote";
|
||||
StringRequest strReq = getStringRequestAddVote(incidentid, "2");
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestAddVote(final Integer incidentid, final String votetype) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.deke.risk.riskahead.adapter;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -67,7 +68,11 @@ public class ReportListAdapter extends BaseAdapter {
|
||||
titleText.setTypeface(null, Typeface.BOLD);
|
||||
ll.setBackgroundColor(item.getCategoryColor());
|
||||
|
||||
iv.setBackground(parent.getContext().getDrawable(item.getIconDrawable()));
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
iv.setBackground(parent.getContext().getDrawable(item.getIconDrawable()));
|
||||
} else {
|
||||
iv.setBackgroundDrawable(parent.getResources().getDrawable(item.getIconDrawable()));
|
||||
}
|
||||
|
||||
return vi;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -13,15 +13,13 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
import org.deke.risk.riskahead.adapter.SpinnerHintAdapter;
|
||||
|
||||
/**
|
||||
* Created by Dennis on 04.12.2015.
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_1_Fragment extends Fragment{
|
||||
|
||||
@@ -41,11 +39,9 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
private RelativeLayout timeLayout;
|
||||
private TextView txtPositionInformation;
|
||||
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
private IncidentReport incident;
|
||||
|
||||
IncidentReport incident;
|
||||
|
||||
OnInputFinishedListener mCallbackFinished;
|
||||
private OnInputFinishedListener mCallbackFinished;
|
||||
|
||||
public interface OnInputFinishedListener {
|
||||
void onInputFinished(boolean finished);
|
||||
@@ -60,93 +56,71 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
|
||||
viewFragment = inflater.inflate(R.layout.fragment_reportwf_1, container, false);
|
||||
|
||||
initSpinnerOneMain();
|
||||
initSpinnerOneSub();
|
||||
initLayerPosition();
|
||||
|
||||
crimeSubOther = (EditText) viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc);
|
||||
crimeSubOther.setVisibility(View.INVISIBLE);
|
||||
initInputElements();
|
||||
setMainSpinnerValues(R.array.cat_situation_main);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean isFinished = isMandatoryCategoryFilled && (incident != null) && (incident.getPosition() != null);
|
||||
|
||||
if(isMandatoryCategoryFilled){
|
||||
viewFragment.findViewById(R.id.ll_pos).setVisibility(View.VISIBLE);
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(true);
|
||||
}
|
||||
|
||||
mCallbackFinished.onInputFinished(isFinished);
|
||||
}
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
private void initInputElements() {
|
||||
crimeCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_main);
|
||||
crimeSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_1_cat_sub);
|
||||
crimeSubOther = (EditText) viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc);
|
||||
timeLayout = (RelativeLayout) viewFragment.findViewById(R.id.ll_pos);
|
||||
txtPositionInformation = (TextView) viewFragment.findViewById(R.id.lbl_reportwf_position_detail);
|
||||
|
||||
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);
|
||||
crimeCategory.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
crimeSubCategory.setVisibility(View.INVISIBLE);
|
||||
crimeSubOther.setVisibility(View.INVISIBLE);
|
||||
timeLayout.setVisibility(View.INVISIBLE);
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(false);
|
||||
|
||||
crimeCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
int stringId;
|
||||
|
||||
switch (position) {
|
||||
case 1:
|
||||
stringid = R.array.cat_situation_sub_general;
|
||||
stringId = R.array.cat_situation_sub_general;
|
||||
break;
|
||||
case 2:
|
||||
stringid = R.array.cat_situation_sub_verbal;
|
||||
stringId = R.array.cat_situation_sub_verbal;
|
||||
break;
|
||||
case 3:
|
||||
stringid = R.array.cat_situation_sub_force;
|
||||
stringId = R.array.cat_situation_sub_force;
|
||||
break;
|
||||
case 4:
|
||||
stringid = R.array.cat_situation_sub_force_serious;
|
||||
stringId = R.array.cat_situation_sub_force_serious;
|
||||
break;
|
||||
case 5:
|
||||
stringid = R.array.cat_situation_sub_nature;
|
||||
stringId = R.array.cat_situation_sub_nature;
|
||||
break;
|
||||
case 6:
|
||||
stringid = R.array.cat_situation_sub_infrastructure;
|
||||
stringId = R.array.cat_situation_sub_infrastructure;
|
||||
break;
|
||||
default:
|
||||
stringid = R.array.cat_situation_sub_general;
|
||||
stringId = R.array.cat_situation_sub_general;
|
||||
break;
|
||||
}
|
||||
|
||||
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 SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
if (((SpinnerHintAdapter) crimeCategory.getAdapter()).isInInitialState()) {
|
||||
spinner_sub_1.setVisibility(View.INVISIBLE);
|
||||
if (((SpinnerHintAdapter) parent.getAdapter()).isInInitialState()) {
|
||||
crimeSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
spinner_sub_1.setVisibility(View.VISIBLE);
|
||||
crimeSubCategory.setVisibility(View.VISIBLE);
|
||||
incident.setFidIncidentCategory(position);
|
||||
setSubSpinnerValues(stringId);
|
||||
}
|
||||
|
||||
incident.setFidIncidentCategory(position);
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// your code here
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
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;
|
||||
@@ -172,38 +146,60 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
break;
|
||||
}
|
||||
|
||||
if (position == i) {
|
||||
viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.VISIBLE);
|
||||
if (((SpinnerHintAdapter) parent.getAdapter()).isInInitialState()) {
|
||||
crimeSubOther.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
viewFragment.findViewById(R.id.txt_reportwf_1_cat_etc).setVisibility(View.INVISIBLE);
|
||||
timeLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
if (position == i){
|
||||
crimeSubOther.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
crimeSubOther.setVisibility(View.INVISIBLE);
|
||||
crimeSubOther.setText("");
|
||||
}
|
||||
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(true);
|
||||
incident.setFidIncidentSubCategory(position);
|
||||
}
|
||||
|
||||
if (((SpinnerHintAdapter) crimeSubCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
} else {
|
||||
isMandatoryCategoryFilled = true;
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
if ((position == 0) && (incident.getFidIncidentSubCategory() != 0))
|
||||
crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||
|
||||
incident.setFidIncidentSubCategory(position);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initLayerPosition(){
|
||||
timeLayout = (RelativeLayout) viewFragment.findViewById(R.id.ll_pos);
|
||||
timeLayout.setVisibility(View.INVISIBLE);
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(false);
|
||||
private void setMainSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(),stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
crimeCategory.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
}
|
||||
|
||||
txtPositionInformation = (TextView) viewFragment.findViewById(R.id.lbl_reportwf_position_detail);
|
||||
private void setSubSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(),stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
crimeSubCategory.setAdapter(new SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
if(incident.getFidIncidentSubCategory() > 0) crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean mainCategoryIsFilled = false;
|
||||
boolean subCategoryIsFilled = false;
|
||||
boolean positionIsFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
mainCategoryIsFilled = (crimeCategory.getSelectedItemPosition() > 0) && (incident.getFidIncidentCategory() > 0);
|
||||
|
||||
subCategoryIsFilled = (crimeSubCategory.isShown()) && (crimeSubCategory.getSelectedItemPosition() > 0) && (incident.getFidIncidentSubCategory() > 0);
|
||||
|
||||
positionIsFilled = (timeLayout.isShown()) && (incident.getPosition() != null);
|
||||
}
|
||||
|
||||
boolean isFinished = mainCategoryIsFilled && subCategoryIsFilled && positionIsFilled;
|
||||
|
||||
mCallbackFinished.onInputFinished(isFinished);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -213,23 +209,20 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
|
||||
if(incident != null){
|
||||
if(incident.getFidIncidentCategory() > 0){
|
||||
crimeCategory.setSelection(incident.getFidIncidentCategory());
|
||||
// The IncidentSubCategory gets automatically initialized
|
||||
}
|
||||
|
||||
if (!incident.getEtcIncidentCategory().equals("")){
|
||||
crimeSubOther.setText(incident.getEtcIncidentCategory());
|
||||
}
|
||||
|
||||
if(incident.getPosition() != null){
|
||||
timeLayout.setVisibility(View.VISIBLE);
|
||||
txtPositionInformation.setText(incident.getIncidentPositionDescription());
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(true);
|
||||
}
|
||||
|
||||
if(incident.getFidIncidentCategory() != 0){
|
||||
crimeCategory.setSelection(incident.getFidIncidentCategory());
|
||||
}
|
||||
|
||||
if(incident.getFidIncidentSubCategory() != 0){
|
||||
crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||
}
|
||||
|
||||
if(!incident.getEtcIncidentCategory().toString().equals("")){
|
||||
crimeSubOther.setText(incident.getEtcIncidentCategory());
|
||||
}
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
@@ -246,15 +239,14 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
try {
|
||||
mCallbackFinished = (OnInputFinishedListener) activity;
|
||||
mCallbackFinished = (OnInputFinishedListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement all Listeners");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.app.Fragment;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.format.DateFormat;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -28,7 +28,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
|
||||
/**
|
||||
* Created by Dennis on 08.12.2015.
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
@@ -51,93 +51,42 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
private EditText tmpInput;
|
||||
|
||||
private IncidentReport incident;
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
|
||||
OnInputFinishedListener mCallback;
|
||||
private 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_2, container, false);
|
||||
|
||||
initSpinnerOneMain();
|
||||
initSpinnerOneSub();
|
||||
|
||||
initLayoutFromTime();
|
||||
initLayoutToTime();
|
||||
|
||||
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));
|
||||
|
||||
inputTimeFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputTimeFrom;
|
||||
showTimePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
inputTimeTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputTimeTo;
|
||||
showTimePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
inputDateTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputDateTo;
|
||||
showDatePickerDialog(v);
|
||||
}
|
||||
});
|
||||
|
||||
inputDateFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputDateFrom;
|
||||
showDatePickerDialog(v);
|
||||
}
|
||||
});
|
||||
initInputElements();
|
||||
setMainSpinnerValues(R.array.cat_time_main);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
private void initLayoutToTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_to_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
private void initInputElements() {
|
||||
initLayoutFromDateTime();
|
||||
initLayoutToDateTime();
|
||||
|
||||
private void initLayoutFromTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_from_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
timeCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_2_time_main);
|
||||
timeSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_2_time_sub);
|
||||
|
||||
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);
|
||||
timeCategory.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
|
||||
timeCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
int stringId = 0;
|
||||
resetDates();
|
||||
|
||||
switch (position) {
|
||||
case NOW:
|
||||
@@ -147,77 +96,58 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
inputDateFrom.setText(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
|
||||
inputTimeFrom.setText(new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime()));
|
||||
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
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;
|
||||
stringId = R.array.cat_time_sub_periodical;
|
||||
break;
|
||||
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 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 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;
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
|
||||
if (!((SpinnerHintAdapter) 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);
|
||||
timeSubCategory.setAdapter(new SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
timeSubCategory.setVisibility(View.VISIBLE);
|
||||
} else if (stringid == 0) {
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (((SpinnerHintAdapter) timeCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
checkIfFinished();
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
incident.setFidTimeCategory(position);
|
||||
|
||||
if (stringId != 0) {
|
||||
timeSubCategory.setVisibility(View.VISIBLE);
|
||||
setSubSpinnerValues(stringId);
|
||||
}
|
||||
}
|
||||
|
||||
incident.setFidTimeCategory(position);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// your code here
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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 = !((SpinnerHintAdapter) timeSubCategory.getAdapter()).isInInitialState();
|
||||
|
||||
if ((position == 0) && (incident.getFidTimeSubCategory() != 0))
|
||||
if ((position < 1) && (incident.getFidTimeSubCategory() != 0))
|
||||
timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||
|
||||
checkIfFinished();
|
||||
incident.setFidTimeSubCategory(position);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -227,16 +157,157 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
private void setMainSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(), stringId , android.R.layout.simple_spinner_dropdown_item);
|
||||
timeCategory.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
}
|
||||
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
private void setSubSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
timeSubCategory.setAdapter(new SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
|
||||
if(incident.getFidTimeSubCategory() > 0) timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||
}
|
||||
|
||||
private void initLayoutFromDateTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_from_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
|
||||
inputDateFrom = ((EditText) viewFragment.findViewById(R.id.input_report_from_date));
|
||||
inputTimeFrom = ((EditText) viewFragment.findViewById(R.id.input_report_from_time));
|
||||
|
||||
inputDateFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputDateFrom;
|
||||
showDatePickerDialog();
|
||||
}
|
||||
});
|
||||
|
||||
inputTimeFrom.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputTimeFrom;
|
||||
showTimePickerDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initLayoutToDateTime() {
|
||||
RelativeLayout rlFromTime = (RelativeLayout) viewFragment.findViewById(R.id.ll_report_to_time);
|
||||
rlFromTime.setVisibility(View.INVISIBLE);
|
||||
|
||||
inputDateTo = ((EditText) viewFragment.findViewById(R.id.input_report_to_date));
|
||||
inputTimeTo = ((EditText) viewFragment.findViewById(R.id.input_report_to_time));
|
||||
|
||||
inputDateTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputDateTo;
|
||||
showDatePickerDialog();
|
||||
}
|
||||
});
|
||||
|
||||
inputTimeTo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputTimeTo;
|
||||
showTimePickerDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int hour = c.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = c.get(Calendar.MINUTE);
|
||||
|
||||
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(" "));
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
public void showTimePickerDialog() {
|
||||
DialogFragment newFragment = new TimePickerFragment();
|
||||
newFragment.show(getActivity().getSupportFragmentManager(), "Pick Time");
|
||||
}
|
||||
|
||||
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int year = c.get(Calendar.YEAR);
|
||||
int month = c.get(Calendar.MONTH);
|
||||
int day = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
return new DatePickerDialog(getActivity(), this, year, month, day);
|
||||
}
|
||||
|
||||
public void onDateSet(DatePicker view, int year, int month, int day) {
|
||||
tmpInput.setText(new StringBuilder()
|
||||
.append(year).append("-").append(month + 1).append("-")
|
||||
.append(day).append(" "));
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
public void showDatePickerDialog() {
|
||||
DialogFragment newFragment = new DatePickerFragment();
|
||||
newFragment.show(getActivity().getSupportFragmentManager(), "Pick Date");
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean isTimeCategoryFilled = false;
|
||||
boolean isSubCategoryFilled = false;
|
||||
boolean isFromDateFilled = false;
|
||||
boolean isToDateFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
|
||||
if((timeCategory.getSelectedItemPosition() > 0) && timeCategory.getVisibility() == View.VISIBLE){
|
||||
isTimeCategoryFilled = true;
|
||||
}
|
||||
|
||||
if(timeSubCategory.isShown()){
|
||||
isSubCategoryFilled = (timeSubCategory.getSelectedItemPosition() > 0) && (incident.getFidTimeSubCategory() > 0);
|
||||
}else{
|
||||
isSubCategoryFilled = true;
|
||||
}
|
||||
|
||||
if(inputDateFrom.isShown()){
|
||||
isFromDateFilled = inputDateFrom.getText().toString().trim().length() > 0;
|
||||
}else{
|
||||
isFromDateFilled = true;
|
||||
}
|
||||
|
||||
if(inputDateTo.isShown()){
|
||||
isToDateFilled = inputDateTo.getText().toString().trim().length() > 0;
|
||||
}else{
|
||||
isToDateFilled = true;
|
||||
}
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isTimeCategoryFilled && isSubCategoryFilled && isFromDateFilled && isToDateFilled);
|
||||
}
|
||||
|
||||
private void resetDates() {
|
||||
incident.resetDatetime();
|
||||
|
||||
inputDateFrom.setText("");
|
||||
inputTimeFrom.setText("");
|
||||
inputDateTo.setText("");
|
||||
inputDateFrom.setText("");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -248,10 +319,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
if(incident != null){
|
||||
if(incident.getFidTimeCategory() != 0){
|
||||
timeCategory.setSelection(incident.getFidTimeCategory());
|
||||
}
|
||||
|
||||
if(incident.getFidTimeSubCategory() != 0){
|
||||
timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||
//SubCategory is automatically initialized
|
||||
}
|
||||
|
||||
if(incident.getFromDate() != null && !incident.getFromDate().equals("")){
|
||||
@@ -288,69 +356,18 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
public class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener {
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int hour = c.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = c.get(Calendar.MINUTE);
|
||||
|
||||
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(" "));
|
||||
|
||||
checkIfFinished();
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
}
|
||||
}
|
||||
|
||||
public void showTimePickerDialog(View v) {
|
||||
DialogFragment newFragment = new TimePickerFragment();
|
||||
newFragment.show(getFragmentManager(),"Pick Time");
|
||||
}
|
||||
|
||||
public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener {
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
final Calendar c = Calendar.getInstance();
|
||||
int year = c.get(Calendar.YEAR);
|
||||
int month = c.get(Calendar.MONTH);
|
||||
int day = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
return new DatePickerDialog(getActivity(), this, year, month, day);
|
||||
}
|
||||
|
||||
public void onDateSet(DatePicker view, int year, int month, int day) {
|
||||
tmpInput.setText(new StringBuilder()
|
||||
.append(year).append("-").append(month + 1).append("-")
|
||||
.append(day).append(" "));
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
public void showDatePickerDialog(View v) {
|
||||
DialogFragment newFragment = new DatePickerFragment();
|
||||
newFragment.show(getFragmentManager(), "Pick Date");
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
if( viewFragment.findViewById(R.id.ll_report_from_time).getVisibility() == View.VISIBLE) {
|
||||
isMandatoryCategoryFilled = !inputDateFrom.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();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -17,7 +17,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
import org.deke.risk.riskahead.adapter.SpinnerHintAdapter;
|
||||
|
||||
/**
|
||||
* Created by Dennis on 08.12.2015.
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_3_Fragment extends Fragment {
|
||||
|
||||
@@ -33,144 +33,133 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
private View viewFragment;
|
||||
|
||||
private Spinner suspectCategory;
|
||||
private Spinner suspectOriginCategory;
|
||||
private Spinner suspectSubCategory;
|
||||
private EditText suspectEtcInput;
|
||||
|
||||
private IncidentReport incident;
|
||||
private boolean isMandatoryCategoryFilled;
|
||||
|
||||
OnInputFinishedListener mCallback;
|
||||
private 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);
|
||||
initInputElements();
|
||||
setMainSpinnerValues(R.array.cat_suspect_main);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
|
||||
private void initSpinnerOneMain() {
|
||||
private void initInputElements() {
|
||||
suspectCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect);
|
||||
suspectSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect_sub);
|
||||
suspectEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_3_suspect_etc);
|
||||
|
||||
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 SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
suspectSubCategory.setVisibility(View.INVISIBLE);
|
||||
suspectEtcInput.setVisibility(View.INVISIBLE);
|
||||
|
||||
suspectCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringid = 0;
|
||||
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;
|
||||
stringId = R.array.cat_suspect_sub_location;
|
||||
break;
|
||||
case MILITARY:
|
||||
stringid = R.array.cat_suspect_sub_location;
|
||||
isMandatoryCategoryFilled = false;
|
||||
stringId = R.array.cat_suspect_sub_location;
|
||||
break;
|
||||
case TERRORIST:
|
||||
stringid = R.array.cat_suspect_sub_location;
|
||||
isMandatoryCategoryFilled = false;
|
||||
stringId = R.array.cat_suspect_sub_location;
|
||||
break;
|
||||
case ETC:
|
||||
suspectEtcInput.setVisibility(View.VISIBLE);
|
||||
isMandatoryCategoryFilled = false;
|
||||
break;
|
||||
case DONTKNOW:
|
||||
isMandatoryCategoryFilled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (position != ETC) {
|
||||
suspectEtcInput.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
if (!((SpinnerHintAdapter) 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 SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
suspectOriginCategory.setVisibility(View.VISIBLE);
|
||||
} else if (stringid == 0) {
|
||||
suspectOriginCategory.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (((SpinnerHintAdapter) suspectCategory.getAdapter()).isInInitialState()) {
|
||||
isMandatoryCategoryFilled = false;
|
||||
suspectSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
incident.setFidSuspectCategory(position);
|
||||
|
||||
if (stringId != 0) {
|
||||
suspectSubCategory.setVisibility(View.VISIBLE);
|
||||
setSubSpinnerValues(stringId);
|
||||
}
|
||||
|
||||
if (position != ETC){
|
||||
suspectEtcInput.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
incident.setFidSuspectCategory(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// your code here
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initSpinnerOneSub() {
|
||||
suspectOriginCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect_sub);
|
||||
suspectOriginCategory.setVisibility(View.INVISIBLE);
|
||||
suspectOriginCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
suspectSubCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if ((position < 1) && (incident.getFidSuspectSubCategory() != 0))
|
||||
suspectSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||
|
||||
isMandatoryCategoryFilled = !((SpinnerHintAdapter) suspectOriginCategory.getAdapter()).isInInitialState();
|
||||
|
||||
if ((position == 0) && (incident.getFidSuspectSubCategory() != 0))
|
||||
suspectOriginCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||
|
||||
checkIfFinished();
|
||||
incident.setFidSuspectSubCategory(position);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
private void setMainSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(),stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
suspectCategory.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
}
|
||||
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(activity.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
private void setSubSpinnerValues(int stringId) {
|
||||
ArrayAdapter<CharSequence> adapter_sub_1 = ArrayAdapter.createFromResource(viewFragment.getContext(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
suspectSubCategory.setAdapter(new SpinnerHintAdapter(adapter_sub_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
}
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean isSuspectCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
if(suspectCategory.getSelectedItemPosition() > 0){
|
||||
isSuspectCategoryFilled = true;
|
||||
}
|
||||
|
||||
if(suspectSubCategory.isShown()){
|
||||
isSuspectCategoryFilled = suspectSubCategory.getSelectedItemPosition() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isSuspectCategoryFilled);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,7 +170,7 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
|
||||
if(incident != null){
|
||||
if(incident.getFidSuspectCategory() != 0) suspectCategory.setSelection(incident.getFidSuspectCategory());
|
||||
if(incident.getFidSuspectSubCategory() != 0) suspectOriginCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||
if(incident.getFidSuspectSubCategory() != 0) suspectSubCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||
if(incident.getEtcSuspectCategory() != null && !incident.getEtcSuspectCategory().equals("")) suspectEtcInput.setText(incident.getEtcSuspectCategory());
|
||||
}
|
||||
|
||||
@@ -193,22 +182,28 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
super.onPause();
|
||||
|
||||
incident.setFidSuspectCategory(suspectCategory.getSelectedItemPosition());
|
||||
incident.setFidSuspectSubCategory(suspectOriginCategory.getSelectedItemPosition());
|
||||
incident.setFidSuspectSubCategory(suspectSubCategory.getSelectedItemPosition());
|
||||
incident.setEtcSuspectCategory(suspectEtcInput.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
|
||||
private void checkIfFinished(){
|
||||
mCallback.onInputFinished(isMandatoryCategoryFilled);
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
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.adapter.SpinnerHintAdapter;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_4_Fragment extends Fragment {
|
||||
|
||||
private final static int COMMON_OBJECTS = 1;
|
||||
private final static int FIREARM = 2;
|
||||
private final static int EXPLOSIONS = 3;
|
||||
private final static int MIL= 4;
|
||||
private final static int ETC = 5;
|
||||
private final static int DONTKNOW = 6;
|
||||
|
||||
private View viewFragment;
|
||||
|
||||
private Spinner suspectWeapon;
|
||||
private EditText suspectWeaponEtcInput;
|
||||
|
||||
private IncidentReport incident;
|
||||
|
||||
private 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_4, container, false);
|
||||
|
||||
initInputElements();
|
||||
setMainSpinnerValues(R.array.cat_suspect_weapons);
|
||||
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
suspectWeapon = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_4_weapon);
|
||||
suspectWeaponEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_4_weapon_etc);
|
||||
|
||||
suspectWeapon.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
switch (position) {
|
||||
case DONTKNOW:
|
||||
suspectWeaponEtcInput.setVisibility(View.INVISIBLE);
|
||||
break;
|
||||
default:
|
||||
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidSuspectWeaponCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setMainSpinnerValues(int stringId){
|
||||
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||
suspectWeapon.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||
}
|
||||
|
||||
|
||||
private void checkIfFinished(){
|
||||
boolean isMainCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isMainCategoryFilled = (suspectWeapon.getSelectedItemPosition() > 0) && (incident.getFidSuspectWeaponCategory() > 0);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isMainCategoryFilled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||
|
||||
if(incident != null){
|
||||
if(incident.getFidSuspectWeaponCategory() != 0) suspectWeapon.setSelection(incident.getFidSuspectWeaponCategory());
|
||||
if(incident.getEtcSuspectWeaponCategory() != null && !incident.getEtcSuspectWeaponCategory().equals("")) suspectWeaponEtcInput.setText(incident.getEtcSuspectWeaponCategory());
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
incident.setFidSuspectWeaponCategory(suspectWeapon.getSelectedItemPosition());
|
||||
incident.setEtcSuspectWeaponCategory(suspectWeaponEtcInput.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
|
||||
try {
|
||||
mCallback = (OnInputFinishedListener) context;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(context.toString()
|
||||
+ " must implement OnInputFinishedListener");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.ads.AdListener;
|
||||
@@ -287,9 +288,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showAd(){
|
||||
// TODO: 03.12.2015 activate when needed
|
||||
if (mInterstitialAd.isLoaded()) {
|
||||
// mInterstitialAd.show();
|
||||
//TODO: ACTIVATE WHEN NEEDED
|
||||
//mInterstitialAd.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,6 +418,10 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
protected abstract String getActivityName();
|
||||
|
||||
|
||||
private boolean isEmpty(EditText etText) {
|
||||
return etText.getText().toString().trim().length() == 0;
|
||||
}
|
||||
|
||||
public void showDialog() {
|
||||
if (!pDialog.isShowing())
|
||||
pDialog.show();
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
android:background="@color/btn_login_bg"
|
||||
android:minWidth="120dp"
|
||||
android:text="@string/btn_start_login"
|
||||
android:textColor="@color/btn_login" />
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lbl_login_policy"
|
||||
|
||||
@@ -72,7 +72,8 @@
|
||||
<Button
|
||||
android:id="@+id/btn_main_report"
|
||||
android:layout_weight="1"
|
||||
android:background="#651a1111"
|
||||
android:background="@color/bg_common_trans"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginRight="1dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_width="0dp"
|
||||
@@ -85,7 +86,8 @@
|
||||
style="?android:attr/borderlessButtonStyle"
|
||||
android:layout_weight="1"
|
||||
android:paddingRight="10dp"
|
||||
android:background="#651a1111"
|
||||
android:textColor="@color/white"
|
||||
android:background="@color/bg_common_trans"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Show Map" />
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutMain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -25,53 +25,14 @@
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutContent"
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_reportwf"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center_horizontal" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_reportwf"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal" >
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_reportwf_map"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:clickable="true"
|
||||
android:src="@android:drawable/ic_dialog_map"
|
||||
app:layout_anchor="@+id/layoutStatus"
|
||||
app:layout_anchorGravity="top|right|end"
|
||||
android:layout_gravity="right|bottom" />
|
||||
</FrameLayout>
|
||||
|
||||
<com.beardedhen.androidbootstrap.AwesomeTextView
|
||||
android:id="@+id/atvStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:padding="5dp"
|
||||
android:textSize="50dp"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
bootstrap:fontAwesomeIcon="fa_check_circle_o" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutStatus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0"
|
||||
android:animateLayoutChanges="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layoutFooter"
|
||||
@@ -101,7 +62,30 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_reportwf_map"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
android:layout_above="@+id/layoutFooter"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:clickable="true"
|
||||
android:src="@android:drawable/ic_dialog_map" />
|
||||
|
||||
<com.beardedhen.androidbootstrap.AwesomeTextView
|
||||
android:id="@+id/atvStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/layoutFooter"
|
||||
android:layout_centerInParent="true"
|
||||
android:padding="5dp"
|
||||
android:textSize="40dp"
|
||||
bootstrap:bootstrapBrand="success"
|
||||
bootstrap:fontAwesomeIcon="fa_check_circle_o" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -140,7 +140,8 @@
|
||||
<Button
|
||||
android:id="@+id/btn_settings_change"
|
||||
android:layout_weight="1"
|
||||
android:background="#651a1111"
|
||||
android:textColor="@color/white"
|
||||
android:background="@color/bg_common_trans"
|
||||
android:layout_marginRight="1dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
android:id="@android:id/text1"
|
||||
style="?android:attr/spinnerItemStyle"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_margin="5dp"
|
||||
android:gravity="left|center"
|
||||
android:background="@drawable/dd_bg"
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/layoutMainContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:id="@+id/ll_01_01"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
@@ -27,7 +27,7 @@
|
||||
<TextView
|
||||
android:id="@+id/lbl_reportwf_1_question"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="What happened?"
|
||||
android:text="@string/lbl_question_situation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
@@ -37,6 +37,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_1_cat_main"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
@@ -47,6 +48,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_1_cat_sub"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
@@ -57,7 +59,8 @@
|
||||
<EditText
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Please enter your info here"
|
||||
android:layout_centerInParent="true"
|
||||
android:hint="@string/cat_hint"
|
||||
android:id="@+id/txt_reportwf_1_cat_etc"
|
||||
android:layout_below="@id/dd_reportwf_1_cat_sub" />
|
||||
|
||||
@@ -65,13 +68,14 @@
|
||||
android:id="@+id/ll_pos"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:layout_below="@+id/txt_reportwf_1_cat_etc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lbl_reportwf_1_question_2"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="Can you tell us the place?"
|
||||
android:text="@string/lbl_question_place"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
@@ -82,19 +86,16 @@
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="70dp"
|
||||
android:background="@drawable/layout_bg"
|
||||
android:hint="No position choosen yet"
|
||||
android:hint="@string/hint_place"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:id="@+id/lbl_reportwf_position_detail"
|
||||
android:layout_below="@+id/lbl_reportwf_1_question_2"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginLeft="20dp" />
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="20dp"
|
||||
android:text="When did it happen?"
|
||||
android:text="@string/lbl_question_time"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/bg_common" />
|
||||
|
||||
|
||||
@@ -30,13 +30,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="20dp"
|
||||
android:text="Who is the suspect?"
|
||||
android:text="@string/lbl_question_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_centerInParent="true"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
@@ -47,6 +48,7 @@
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_3_suspect_sub"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_margin="5dp"
|
||||
@@ -57,7 +59,8 @@
|
||||
<EditText
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Please enter your info here"
|
||||
android:layout_centerInParent="true"
|
||||
android:hint="@string/cat_hint"
|
||||
android:id="@+id/txt_reportwf_3_suspect_etc"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
</LinearLayout>
|
||||
|
||||
57
app/src/main/res/layout/fragment_reportwf_4.xml
Normal file
57
app/src/main/res/layout/fragment_reportwf_4.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<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_4_question"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="20dp"
|
||||
android:text="@string/lbl_question_weapon"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/bg_common" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/dd_reportwf_4_weapon"
|
||||
android:background="@drawable/dropdown_4"
|
||||
android:layout_centerInParent="true"
|
||||
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:layout_centerInParent="true"
|
||||
android:hint="@string/cat_hint"
|
||||
android:id="@+id/txt_reportwf_4_weapon_etc"
|
||||
android:layout_gravity="center_horizontal" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -122,22 +122,37 @@
|
||||
<string name="lbl_report_to_date">To date (yyyy-MM-dd)</string>
|
||||
<string name="lbl_report_to_time">To time</string>
|
||||
|
||||
|
||||
<string name="lbl_question_situation">Was ist passiert?</string>
|
||||
<string name="lbl_question_place">Wo passiert es?</string>
|
||||
<string name="lbl_question_time">Wann passiert es?</string>
|
||||
<string name="lbl_question_suspect">Wer tut das?</string>
|
||||
<string name="lbl_question_weapon">Mit welchen Waffen passiert es?</string>
|
||||
<string name="lbl_question_count">Wie viele tun das?</string>
|
||||
<string name="lbl_question_victim">Wer ist betroffen?</string>
|
||||
<string name="lbl_question_victimorigin">Kommen die Opfer aus der Umgebung?</string>
|
||||
<string name="lbl_question_etc">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_vehicle">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_victimaff">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
||||
<string name="lbl_question_etc_etc">Weiteres?</string>
|
||||
|
||||
<string-array name="cat_situation_main">
|
||||
<item>Allgemeiner Vorfall/Situation</item>
|
||||
<item>Mündliche Gewalt</item>
|
||||
<item>Leichte bis schwere körperliche Gewalt</item>
|
||||
<item>Leichte / schwere körperliche Gewalt</item>
|
||||
<item>Lebensgefährliche Gewalt</item>
|
||||
<item>Naturkatastrophe</item>
|
||||
<item>Menschliche Katastrophe & Infrastruktur</item>
|
||||
<item>Menschl. Katastrophe & Infrastruktur</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_situation_sub_general">
|
||||
<item>Diebstahl, Betrug</item>
|
||||
<item>Drogen in Getränk/Speise, Drogenmissbrauch</item>
|
||||
<item>Demonstration, Unruhen, Straßenblockade</item>
|
||||
<item>Drogenmissbrauch z.B.Getränk</item>
|
||||
<item>Protest, Unruhe, Straßenblockade</item>
|
||||
<item>Checkpoint, Kontrollen</item>
|
||||
<item>Korruption, Erpressung, Schutzgeld</item>
|
||||
<item>Einflussgebiet Kriminalität, Milizen, Terroristen</item>
|
||||
<item>Korruption, Erpressung</item>
|
||||
<item>Einfluss Kriminalität, Milizen, Terror</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
|
||||
@@ -164,7 +179,7 @@
|
||||
<item>Schießerei</item>
|
||||
<item>Explosion, Selbstmordattentat</item>
|
||||
<item>Mord, Tötung, Hinrichtung</item>
|
||||
<item>Leichenzurschaustellung zur Abschreckung</item>
|
||||
<item>Leiche in Öffentlichkeit</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
|
||||
@@ -173,7 +188,7 @@
|
||||
<item>Wind, Sturm, Orkan, Tornado</item>
|
||||
<item>Überschwemmung/-flutung</item>
|
||||
<item>Erdbeben, Berghang Einsturz</item>
|
||||
<item>Feuer, Rauch-, Aschewolken, Vulkanausbruch</item>
|
||||
<item>Feuer, Rauch, Vulkanausbruch</item>
|
||||
<item>Hungersnot, Tierplage</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
@@ -205,20 +220,81 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_main">
|
||||
<item>Straßenkriminelle/Gangs</item>
|
||||
<item>Kriminelle/Gangs </item>
|
||||
<item>Polizei</item>
|
||||
<item>Volksmenge</item>
|
||||
<item>Miliz, Kartell, Guerilla (Paramilitär)</item>
|
||||
<item>Auftragskiller, Kartell, Miliz, Guerilla</item>
|
||||
<item>Soldaten (Militär)</item>
|
||||
<item>Terroristen (religiöse oder politische)</item>
|
||||
<item>Sonstige:…</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_sub_location">
|
||||
<item>Lokale aus dem Land (National)</item>
|
||||
<item>Lokale aus dem Land</item>
|
||||
<item>Ausländische</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_weapons">
|
||||
<item>Alltagsgegenstände</item>
|
||||
<item>Schusswaffe</item>
|
||||
<item>Explosionswaffen oder Sprengkörper</item>
|
||||
<item>Großkaliber z.B. Panzer, Flugbombe</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_count">
|
||||
<item>Einzelperson</item>
|
||||
<item>Kleine Gruppe (2-5)</item>
|
||||
<item>Große Gruppe (mehr als 5)</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_victim">
|
||||
<item>Frauen</item>
|
||||
<item>Kinder</item>
|
||||
<item>Männer</item>
|
||||
<item>Tieren</item>
|
||||
<item>Gebäude/Infrastruktur</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_victim_origin">
|
||||
<item>Heimische Bevölkerung</item>
|
||||
<item>Touristen</item>
|
||||
<item>Ausländer, der dort arbeitet z.B. Expat</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_vehicle">
|
||||
<item>Zu Fuß</item>
|
||||
<item>Motorrad</item>
|
||||
<item>Auto, Jeep, Pick-up</item>
|
||||
<item>Lkw, Bus</item>
|
||||
<item>Militärfahrzeug, Panzer</item>
|
||||
<item>Flugzeug, Helikopter</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_victimaff">
|
||||
<item>Religion</item>
|
||||
<item>Volksgruppe/Ethnie z.B. Hautfarbe</item>
|
||||
<item>Politische Zugehörigkeit</item>
|
||||
<item>Soziale Gruppe z.B. Einwanderer</item>
|
||||
<item>Beruf z.B. Journalisten, Prostituierte</item>
|
||||
<item>Sprachzugehörigkeit</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_suspect_recon">
|
||||
<item>Männer</item>
|
||||
<item>Frauen</item>
|
||||
<item>Kinder</item>
|
||||
<item>Tiere</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<resources>
|
||||
|
||||
<color name="bg_login">#26ae90</color>
|
||||
<color name="bg_login">#a9a9a9</color>
|
||||
<color name="bg_register">#2e3237</color>
|
||||
|
||||
|
||||
<color name="bg_common">#1175b7</color>
|
||||
<color name="bg_common_trans">#9e1175b7</color>
|
||||
<color name="bg_common_2">#0461a8</color>
|
||||
<color name="common_text">#333333</color>
|
||||
<color name="actionbar_text">#fdfdfd</color>
|
||||
@@ -22,7 +23,7 @@
|
||||
<color name="input_register_bg">#3b4148</color>
|
||||
<color name="input_register_hint">#5e6266</color>
|
||||
<color name="btn_login">#26ae90</color>
|
||||
<color name="btn_login_bg">#eceef1</color>
|
||||
<color name="btn_login_bg">#1175b7</color>
|
||||
<color name="lbl_name">#333333</color>
|
||||
<color name="btn_logut_bg">#ff6861</color>
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@
|
||||
<string name="btn_profile_viewposts">{fa_search} View Posts</string>
|
||||
<string name="lbl_profile_top10">Top 10</string>
|
||||
|
||||
|
||||
<string name="btn_maps_confirm_position">{fa_paint_brush} Report this position!</string>
|
||||
|
||||
<string name="navigation_start">Home</string>
|
||||
@@ -126,22 +125,38 @@
|
||||
<string name="lbl_viewreport_incidentcategory">Incident Category</string>
|
||||
<string name="lbl_viewreport_incidentsubcategory">Incident Subcategory</string>
|
||||
|
||||
<string name="lbl_question_situation">Was ist passiert?</string>
|
||||
<string name="lbl_question_place">Wo passiert es?</string>
|
||||
<string name="lbl_question_time">Wann passiert es?</string>
|
||||
<string name="lbl_question_suspect">Wer tut das?</string>
|
||||
<string name="lbl_question_weapon">Mit welchen Waffen passiert es?</string>
|
||||
<string name="lbl_question_count">Wie viele tun das?</string>
|
||||
<string name="lbl_question_victim">Wer ist betroffen?</string>
|
||||
<string name="lbl_question_victimorigin">Kommen die Opfer aus der Umgebung?</string>
|
||||
<string name="lbl_question_etc">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_vehicle">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_victimaff">Weißt du noch mehr?</string>
|
||||
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
||||
<string name="lbl_question_etc_etc">Weiteres?</string>
|
||||
<string name="cat_hint">Weitere Details...</string>
|
||||
<string name="hint_place">Bitte wähle zunächst einen Ort auf der Karte aus</string>
|
||||
|
||||
<string-array name="cat_situation_main">
|
||||
<item>Allgemeiner Vorfall/Situation</item>
|
||||
<item>Mündliche Gewalt</item>
|
||||
<item>Leichte bis schwere körperliche Gewalt</item>
|
||||
<item>Leichte / schwere körperliche Gewalt</item>
|
||||
<item>Lebensgefährliche Gewalt</item>
|
||||
<item>Naturkatastrophe</item>
|
||||
<item>Menschliche Katastrophe & Infrastruktur</item>
|
||||
<item>Menschl. Katastrophe & Infrastruktur</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_situation_sub_general">
|
||||
<item>Diebstahl, Betrug</item>
|
||||
<item>Drogen in Getränk/Speise, Drogenmissbrauch</item>
|
||||
<item>Demonstration, Unruhen, Straßenblockade</item>
|
||||
<item>Drogenmissbrauch z.B.Getränk</item>
|
||||
<item>Protest, Unruhe, Straßenblockade</item>
|
||||
<item>Checkpoint, Kontrollen</item>
|
||||
<item>Korruption, Erpressung, Schutzgeld</item>
|
||||
<item>Einflussgebiet Kriminalität, Milizen, Terroristen</item>
|
||||
<item>Korruption, Erpressung</item>
|
||||
<item>Einfluss Kriminalität, Milizen, Terror</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
|
||||
@@ -168,7 +183,7 @@
|
||||
<item>Schießerei</item>
|
||||
<item>Explosion, Selbstmordattentat</item>
|
||||
<item>Mord, Tötung, Hinrichtung</item>
|
||||
<item>Leichenzurschaustellung zur Abschreckung</item>
|
||||
<item>Leiche in Öffentlichkeit</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
|
||||
@@ -177,7 +192,7 @@
|
||||
<item>Wind, Sturm, Orkan, Tornado</item>
|
||||
<item>Überschwemmung/-flutung</item>
|
||||
<item>Erdbeben, Berghang Einsturz</item>
|
||||
<item>Feuer, Rauch-, Aschewolken, Vulkanausbruch</item>
|
||||
<item>Feuer, Rauch, Vulkanausbruch</item>
|
||||
<item>Hungersnot, Tierplage</item>
|
||||
<item>Sonstiges...</item>
|
||||
</string-array>
|
||||
@@ -209,20 +224,80 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_main">
|
||||
<item>Straßenkriminelle/Gangs</item>
|
||||
<item>Kriminelle/Gangs </item>
|
||||
<item>Polizei</item>
|
||||
<item>Volksmenge</item>
|
||||
<item>Miliz, Kartell, Guerilla (Paramilitär)</item>
|
||||
<item>Auftragskiller, Kartell, Miliz, Guerilla</item>
|
||||
<item>Soldaten (Militär)</item>
|
||||
<item>Terroristen (religiöse oder politische)</item>
|
||||
<item>Sonstige:…</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_sub_location">
|
||||
<item>Lokale aus dem Land (National)</item>
|
||||
<item>Lokale aus dem Land</item>
|
||||
<item>Ausländische</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_weapons">
|
||||
<item>Alltagsgegenstände</item>
|
||||
<item>Schusswaffe</item>
|
||||
<item>Explosionswaffen oder Sprengkörper</item>
|
||||
<item>Großkaliber z.B. Panzer, Flugbombe</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_suspect_count">
|
||||
<item>Einzelperson</item>
|
||||
<item>Kleine Gruppe (2-5)</item>
|
||||
<item>Große Gruppe (mehr als 5)</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_victim">
|
||||
<item>Frauen</item>
|
||||
<item>Kinder</item>
|
||||
<item>Männer</item>
|
||||
<item>Tieren</item>
|
||||
<item>Gebäude/Infrastruktur</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_victim_origin">
|
||||
<item>Heimische Bevölkerung</item>
|
||||
<item>Touristen</item>
|
||||
<item>Ausländer, der dort arbeitet z.B. Expat</item>
|
||||
<item>Sonstiges…</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_vehicle">
|
||||
<item>Zu Fuß</item>
|
||||
<item>Motorrad</item>
|
||||
<item>Auto, Jeep, Pick-up</item>
|
||||
<item>Lkw, Bus</item>
|
||||
<item>Militärfahrzeug, Panzer</item>
|
||||
<item>Flugzeug, Helikopter</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_victimaff">
|
||||
<item>Religion</item>
|
||||
<item>Volksgruppe/Ethnie z.B. Hautfarbe</item>
|
||||
<item>Politische Zugehörigkeit</item>
|
||||
<item>Soziale Gruppe z.B. Einwanderer</item>
|
||||
<item>Beruf z.B. Journalisten, Prostituierte</item>
|
||||
<item>Sprachzugehörigkeit</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_details_suspect_recon">
|
||||
<item>Männer</item>
|
||||
<item>Frauen</item>
|
||||
<item>Kinder</item>
|
||||
<item>Tiere</item>
|
||||
<item>Sonstiges…</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user