DT @13.01.2016: A LOT OF bugfixes.. und sprachdateien 1.6
This commit is contained in:
Binary file not shown.
@@ -304,7 +304,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error at social media login (Server returned error): " + errorMsg);
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.txt_errormsg_sociallogin), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.txt_errormsg_login)+getResources().getString(R.string.txt_errormsg_suffix), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
@@ -316,7 +316,7 @@ public class LoginActivity extends AppCompatActivity implements FacebookButtonFr
|
||||
@Override
|
||||
public void onErrorResponse(VolleyError error) {
|
||||
Log.e(TAG, "Social Media Login Error: " + error.getMessage());
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.txt_errormsg_sociallogin), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.txt_errormsg_login)+getResources().getString(R.string.txt_errormsg_suffix), Toast.LENGTH_LONG).show();
|
||||
hideDialog();
|
||||
}
|
||||
}) {
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.beardedhen.androidbootstrap.BootstrapButton;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.deke.risk.riskahead.fragment.BaseReportWFFragment;
|
||||
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;
|
||||
@@ -55,17 +56,17 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
private final static String mActivityTitle = "Report Incident";
|
||||
private final static String TAG = ReportWFActivity.class.getSimpleName();
|
||||
|
||||
private List<Fragment> fragList = new ArrayList<>();
|
||||
private List<BaseReportWFFragment> 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 Fragment frag_report_5 = new ReportWF_5_Fragment();
|
||||
private Fragment frag_report_6 = new ReportWF_6_Fragment();
|
||||
private Fragment frag_report_7 = new ReportWF_7_Fragment();
|
||||
private Fragment frag_report_8 = new ReportWF_8_Fragment();
|
||||
private Fragment frag_report_finish = new ReportWF_Finish_Fragment();
|
||||
private BaseReportWFFragment frag_report_1 = new ReportWF_1_Fragment();
|
||||
private BaseReportWFFragment frag_report_2 = new ReportWF_2_Fragment();
|
||||
private BaseReportWFFragment frag_report_3 = new ReportWF_3_Fragment();
|
||||
private BaseReportWFFragment frag_report_4 = new ReportWF_4_Fragment();
|
||||
private BaseReportWFFragment frag_report_5 = new ReportWF_5_Fragment();
|
||||
private BaseReportWFFragment frag_report_6 = new ReportWF_6_Fragment();
|
||||
private BaseReportWFFragment frag_report_7 = new ReportWF_7_Fragment();
|
||||
private BaseReportWFFragment frag_report_8 = new ReportWF_8_Fragment();
|
||||
private BaseReportWFFragment frag_report_finish = new ReportWF_Finish_Fragment();
|
||||
|
||||
private BootstrapButton btnContinue;
|
||||
private BootstrapButton btnReportNow;
|
||||
@@ -111,6 +112,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
btnContinue.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
incident = fragList.get(currentState).getCurrentInput();
|
||||
initFragment(currentState + 1);
|
||||
}
|
||||
});
|
||||
@@ -120,6 +122,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
btnReportNow.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
incident = fragList.get(currentState).getCurrentInput();
|
||||
sendReport();
|
||||
}
|
||||
});
|
||||
@@ -130,6 +133,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
btnMap.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
incident = fragList.get(currentState).getCurrentInput();
|
||||
if (incident != null && incident.getPosition() != null) {
|
||||
gotoMapActivity(incident.getPosition().latitude + ":" + incident.getPosition().longitude);
|
||||
} else {
|
||||
@@ -157,7 +161,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
siteIndicator.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
String currentSite = (currentState+1)+"/"+(fragList.size()-1);
|
||||
String currentSite = (currentState+1) + "/" + (fragList.size()-1);
|
||||
siteIndicator.setText(currentSite);
|
||||
}
|
||||
|
||||
@@ -198,11 +202,14 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
|
||||
@Override
|
||||
public void sendReport() {
|
||||
incident = fragList.get(currentState).getCurrentInput();
|
||||
|
||||
String tag_string_req = "addincidentwithposition";
|
||||
StringRequest strReq = getStringRequestAddIncidentWithPosition(incident);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
}
|
||||
|
||||
|
||||
public void setIncident(IncidentReport newIncident){
|
||||
if(!resetSignal){
|
||||
incident = newIncident;
|
||||
@@ -291,7 +298,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
||||
boolean error = jObj.getBoolean("error");
|
||||
|
||||
if (!error) {
|
||||
showMessage("Report added!");
|
||||
showMessage(getString(R.string.txt_success_addreport));
|
||||
|
||||
LatLng gotoPosition = new LatLng(incident.getPosition().latitude,incident.getPosition().longitude);
|
||||
resetStateAndIncident();
|
||||
|
||||
@@ -50,8 +50,8 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
Bundle querySkus;
|
||||
|
||||
HashMap<String,JSONObject> purchaseMap = new HashMap<>();
|
||||
|
||||
HashMap<String,String> dbItems = new HashMap<>();
|
||||
ArrayList<String> ownedSkus = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -60,7 +60,6 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
registerBroadcastReceiver();
|
||||
|
||||
tblBillings = (TableLayout) findViewById(R.id.tbl_billing);
|
||||
getSubscriptions(user.get(SessionManager.KEY_UID));
|
||||
|
||||
ServiceConnection mServiceConn = new ServiceConnection() {
|
||||
@Override
|
||||
@@ -92,7 +91,6 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
querySkus = new Bundle();
|
||||
querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void getAlreadyPurchasedItems() {
|
||||
@@ -101,7 +99,7 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
|
||||
int response = activeSubs.getInt("RESPONSE_CODE");
|
||||
if (response == 0) {
|
||||
ArrayList<String> ownedSkus = activeSubs.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
|
||||
ownedSkus = activeSubs.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
|
||||
ArrayList<String> purchaseDataList = activeSubs.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
|
||||
ArrayList<String> signatureList = activeSubs.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");
|
||||
String continuationToken = activeSubs.getString("INAPP_CONTINUATION_TOKEN");
|
||||
@@ -114,7 +112,7 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
Log.d(TAG, "Already purchased: " + sku + " : " + purchaseData + " : " + signature);
|
||||
}
|
||||
|
||||
syncWithDatabase(ownedSkus);
|
||||
getSubscriptionsAndSync(user.get(SessionManager.KEY_UID));
|
||||
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
@@ -123,7 +121,8 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
}
|
||||
|
||||
private void syncWithDatabase(ArrayList<String> ownedSkus) {
|
||||
Log.d(TAG, "sync subs with database...");
|
||||
Log.d(TAG, "Sync subs with database...");
|
||||
Log.d(TAG, "Database shows following active subs: "+dbItems.toString());
|
||||
|
||||
ArrayList<String> subs = new ArrayList<>();
|
||||
subs.add("extra_functions_01");
|
||||
@@ -132,15 +131,17 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
subs.add("no_ads_02");
|
||||
|
||||
for(String sub : subs){
|
||||
|
||||
boolean itemFound = false;
|
||||
if(dbItems.containsKey("extra_functions_01")){
|
||||
|
||||
if(dbItems.containsKey(sub)){
|
||||
for(String sku : ownedSkus){
|
||||
itemFound = itemFound || sku.equals(sub);
|
||||
}
|
||||
|
||||
if(itemFound == false){
|
||||
Log.d(TAG, "found sub in database which is active but sub already expired: "+sub);
|
||||
deactivateSubscriptions(dbItems.get(sub));
|
||||
deactivateSubscriptionInDB(dbItems.get(sub));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,8 +247,8 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
JSONObject jo = new JSONObject(purchaseData);
|
||||
String sku = jo.getString("productId");
|
||||
String title = jo.getString("title");
|
||||
//TODO: Dont show sku but product title
|
||||
showMessage(getResources().getString(R.string.txt_subs_youbought) + sku + ". "+getResources().getString(R.string.txt_subs_thankyou));
|
||||
|
||||
showMessage(getResources().getString(R.string.txt_subs_youbought) +" "+ title + ". "+getResources().getString(R.string.txt_subs_thankyou));
|
||||
addSubscription(purchaseMap.get(sku).getString("productId"),purchaseMap.get(sku).getString("type"),purchaseMap.get(sku).getString("price_amount_micros"),purchaseMap.get(sku).getString("price_currency_code"));
|
||||
}
|
||||
catch (JSONException e) {
|
||||
@@ -279,7 +280,7 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
Log.e(TAG, "Error adding subscription (Server returned error): " + errorMsg);
|
||||
showMessage(getResources().getString(R.string.txt_errormsg_subs));
|
||||
} else {
|
||||
getSubscriptions(user.get(SessionManager.KEY_UID));
|
||||
getSubscriptionsAndSync(user.get(SessionManager.KEY_UID));
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
@@ -311,7 +312,7 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
};
|
||||
}
|
||||
|
||||
private void getSubscriptions(String userId) {
|
||||
private void getSubscriptionsAndSync(String userId) {
|
||||
String tag_string_req = "requestgetsubscription";
|
||||
StringRequest strReq = getStringGetSubscriptions(userId);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
@@ -333,10 +334,13 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
dbItems = null;
|
||||
}else{
|
||||
JSONArray subs = jObj.getJSONArray("msg");
|
||||
Log.d(TAG,"SUB FROM DB RECEIVED");
|
||||
|
||||
for(int i = 0;i < subs.length();i++){
|
||||
dbItems.put(subs.getJSONObject(i).getString("productId"),subs.getJSONObject(i).getString("id"));
|
||||
}
|
||||
|
||||
syncWithDatabase(ownedSkus);
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
@@ -364,7 +368,9 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
};
|
||||
}
|
||||
|
||||
private void deactivateSubscriptions(String subscriptionId) {
|
||||
private void deactivateSubscriptionInDB(String subscriptionId) {
|
||||
Log.d(TAG,"Deactivate sub with uid: "+subscriptionId);
|
||||
|
||||
String tag_string_req = "requestdeactivatesubscription";
|
||||
StringRequest strReq = getStringDeactivateSubscriptions(subscriptionId);
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
@@ -383,6 +389,8 @@ public class SubscriptionsActivity extends BaseActivity{
|
||||
if (error) {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error deactivating subscription (Server returned error): " + errorMsg);
|
||||
}else{
|
||||
Log.d(TAG,"Sub with uid: "+subscriptionId+" deactivated in DB");
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
|
||||
@@ -162,7 +162,7 @@ public class ViewReportActivity extends BaseActivity {
|
||||
boolean error = jObj.getBoolean("error");
|
||||
|
||||
if (!error) {
|
||||
showMessage("Incident deleted");
|
||||
showMessage(getString(R.string.txt_success_incidentdel));
|
||||
gotoProfileActivity();
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
@@ -364,7 +364,7 @@ public class ViewReportActivity extends BaseActivity {
|
||||
boolean error = jObj.getBoolean("error");
|
||||
|
||||
if (!error) {
|
||||
showMessage("Voted! Score updated.");
|
||||
showMessage(getString(R.string.txt_success_voted));
|
||||
JSONObject jPoints = jObj.getJSONObject("points");
|
||||
|
||||
scorelabel.setText(Integer.toString(jPoints.getInt("upvoted")-jPoints.getInt("downvoted")));
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
|
||||
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.TextView;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public abstract class BaseReportWFFragment extends Fragment {
|
||||
|
||||
|
||||
public BaseReportWFFragment() {
|
||||
// Required empty public constructor
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
TextView textView = new TextView(getActivity());
|
||||
|
||||
return textView;
|
||||
}
|
||||
|
||||
public abstract IncidentReport getCurrentInput();
|
||||
|
||||
}
|
||||
@@ -133,8 +133,8 @@ public class ProfileStatisticsFragment extends Fragment {
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error getting user stats (server returned error): " + errorMsg);
|
||||
//TODO: CONTINUE HERE WITH STRINGS
|
||||
parent.showMessage(errorMsg);
|
||||
|
||||
parent.showMessage(getResources().getString(R.string.txt_errormsg_retrievestats));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -13,6 +12,8 @@ import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
@@ -21,8 +22,7 @@ import org.deke.risk.riskahead.adapter.SpinnerHintAdapter;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_1_Fragment extends Fragment{
|
||||
|
||||
public class ReportWF_1_Fragment extends BaseReportWFFragment{
|
||||
private final static int VIOLANCE_GENERAL = 1;
|
||||
private final static int VIOLANCE_VERBAL = 2;
|
||||
private final static int VIOLANCE_LIGHT = 3;
|
||||
@@ -38,6 +38,7 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
|
||||
private RelativeLayout timeLayout;
|
||||
private TextView txtPositionInformation;
|
||||
private LatLng position;
|
||||
|
||||
private IncidentReport incident;
|
||||
|
||||
@@ -62,6 +63,12 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -107,11 +114,12 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
crimeSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
crimeSubCategory.setVisibility(View.VISIBLE);
|
||||
incident.setFidIncidentCategory(position);
|
||||
setSubSpinnerValues(stringId);
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,6 +128,7 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
crimeSubCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
@@ -151,18 +160,16 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
} else {
|
||||
timeLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
if (position == i){
|
||||
if (position == i) {
|
||||
crimeSubOther.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
} else {
|
||||
crimeSubOther.setVisibility(View.INVISIBLE);
|
||||
crimeSubOther.setText("");
|
||||
}
|
||||
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(true);
|
||||
incident.setFidIncidentSubCategory(position);
|
||||
((ReportWFActivity) getActivity()).setMapButtonVisibility(true);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -170,8 +177,10 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
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()));
|
||||
@@ -190,15 +199,16 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
boolean positionIsFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
mainCategoryIsFilled = (crimeCategory.getSelectedItemPosition() > 0) && (incident.getFidIncidentCategory() > 0);
|
||||
mainCategoryIsFilled = (crimeCategory.getSelectedItemPosition() > 0);
|
||||
|
||||
subCategoryIsFilled = (crimeSubCategory.isShown()) && (crimeSubCategory.getSelectedItemPosition() > 0) && (incident.getFidIncidentSubCategory() > 0);
|
||||
subCategoryIsFilled = (crimeSubCategory.isShown()) && (crimeSubCategory.getSelectedItemPosition() > 0);
|
||||
|
||||
positionIsFilled = (timeLayout.isShown()) && (incident.getPosition() != null);
|
||||
positionIsFilled = (timeLayout.isShown() && incident.getPosition() != null);
|
||||
}
|
||||
|
||||
boolean isFinished = mainCategoryIsFilled && subCategoryIsFilled && positionIsFilled;
|
||||
|
||||
//saveInput();
|
||||
mCallbackFinished.onInputFinished(isFinished);
|
||||
}
|
||||
|
||||
@@ -211,11 +221,10 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
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.getFidIncidentSubCategory() > 0){
|
||||
crimeSubCategory.setSelection(incident.getFidIncidentSubCategory());
|
||||
}
|
||||
|
||||
if(incident.getPosition() != null){
|
||||
@@ -223,6 +232,10 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
txtPositionInformation.setText(incident.getIncidentPositionDescription());
|
||||
((ReportWFActivity)getActivity()).setMapButtonVisibility(true);
|
||||
}
|
||||
|
||||
if (!incident.getEtcIncidentCategory().equals("")){
|
||||
crimeSubOther.setText(incident.getEtcIncidentCategory());
|
||||
}
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
@@ -232,11 +245,15 @@ public class ReportWF_1_Fragment extends Fragment{
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
public void saveInput() {
|
||||
incident.setFidIncidentCategory(crimeCategory.getSelectedItemPosition());
|
||||
incident.setFidIncidentSubCategory(crimeSubCategory.getSelectedItemPosition());
|
||||
incident.setEtcIncidentCategory(crimeSubOther.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
((ReportWFActivity) getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.deke.risk.riskahead.fragment;
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.Dialog;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -32,13 +31,11 @@ import java.util.Date;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
public class ReportWF_2_Fragment extends BaseReportWFFragment {
|
||||
private final static int NOW = 1;
|
||||
private final static int PERIODIC = 2;
|
||||
private final static int DATETIME = 3;
|
||||
private final static int DATETIMEAREA = 4;
|
||||
private final static int DONTKNOW = 5;
|
||||
|
||||
private View viewFragment;
|
||||
|
||||
@@ -56,6 +53,9 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
private OnInputFinishedListener mCallback;
|
||||
|
||||
private boolean tmpIsToDate = false;
|
||||
private boolean tmpIsToTime = false;
|
||||
|
||||
public interface OnInputFinishedListener {
|
||||
void onInputFinished(boolean finished);
|
||||
}
|
||||
@@ -75,6 +75,12 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
initLayoutFromDateTime();
|
||||
initLayoutToDateTime();
|
||||
@@ -88,7 +94,6 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
int stringId = 0;
|
||||
resetDates();
|
||||
|
||||
switch (position) {
|
||||
case NOW:
|
||||
@@ -97,7 +102,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
|
||||
inputDateFrom.setText(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
|
||||
inputTimeFrom.setText(new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime()));
|
||||
inputTimeFrom.setText(new SimpleDateFormat("HH:mm").format(Calendar.getInstance().getTime()));
|
||||
break;
|
||||
case PERIODIC:
|
||||
viewFragment.findViewById(R.id.ll_report_from_time).setVisibility(View.INVISIBLE);
|
||||
@@ -115,25 +120,28 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
viewFragment.findViewById(R.id.ll_report_to_time).setVisibility(View.VISIBLE);
|
||||
viewFragment.findViewById(R.id.dd_reportwf_2_time_sub).setVisibility(View.INVISIBLE);
|
||||
break;
|
||||
case DONTKNOW:
|
||||
default:
|
||||
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);
|
||||
|
||||
inputDateFrom.setText(new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()));
|
||||
inputTimeFrom.setText(new SimpleDateFormat("HH:mm").format(Calendar.getInstance().getTime()));
|
||||
break;
|
||||
}
|
||||
|
||||
if (((SpinnerHintAdapter) timeCategory.getAdapter()).isInInitialState()) {
|
||||
timeSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
incident.setFidTimeCategory(position);
|
||||
|
||||
if (stringId != 0) {
|
||||
timeSubCategory.setVisibility(View.VISIBLE);
|
||||
setSubSpinnerValues(stringId);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,11 +153,11 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
timeSubCategory.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
if ((position < 1) && (incident.getFidTimeSubCategory() != 0))
|
||||
timeSubCategory.setSelection(incident.getFidTimeSubCategory());
|
||||
if (((SpinnerHintAdapter) timeSubCategory.getAdapter()).isInInitialState()) {
|
||||
|
||||
incident.setFidTimeSubCategory(position);
|
||||
checkIfFinished();
|
||||
} else {
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,6 +214,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputDateTo;
|
||||
tmpIsToDate = true;
|
||||
showDatePickerDialog();
|
||||
}
|
||||
});
|
||||
@@ -214,6 +223,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
tmpInput = inputTimeTo;
|
||||
tmpIsToTime = true;
|
||||
showTimePickerDialog();
|
||||
}
|
||||
});
|
||||
@@ -245,6 +255,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
|
||||
public void showTimePickerDialog() {
|
||||
DialogFragment newFragment = new TimePickerFragment();
|
||||
|
||||
newFragment.show(getActivity().getSupportFragmentManager(), "Pick Time");
|
||||
}
|
||||
|
||||
@@ -257,6 +268,20 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
int month = c.get(Calendar.MONTH);
|
||||
int day = c.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
if(tmpIsToDate && inputDateFrom.getText().length() > 0){
|
||||
try {
|
||||
DatePickerDialog tmpDialog = new DatePickerDialog(getActivity(), this, year, month, day);
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date tmpFromDate = simpleDateFormat.parse(inputDateFrom.getText().toString());
|
||||
tmpDialog.getDatePicker().setMinDate(tmpFromDate.getTime());
|
||||
tmpIsToDate = false;
|
||||
return tmpDialog;
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new DatePickerDialog(getActivity(), this, year, month, day);
|
||||
}
|
||||
|
||||
@@ -268,6 +293,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
}
|
||||
@@ -290,7 +316,7 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
}
|
||||
|
||||
if(timeSubCategory.isShown()){
|
||||
isSubCategoryFilled = (timeSubCategory.getSelectedItemPosition() > 0) && (incident.getFidTimeSubCategory() > 0);
|
||||
isSubCategoryFilled = (timeSubCategory.getSelectedItemPosition() > 0);
|
||||
}else{
|
||||
isSubCategoryFilled = true;
|
||||
}
|
||||
@@ -306,22 +332,12 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
}else{
|
||||
isToDateFilled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
saveInput();
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
mCallback.onInputFinished(isTimeCategoryFilled && isSubCategoryFilled && isFromDateFilled && isToDateFilled);
|
||||
}
|
||||
|
||||
private void resetDates() {
|
||||
incident.resetDatetime();
|
||||
|
||||
inputDateFrom.setText("");
|
||||
inputTimeFrom.setText("");
|
||||
inputDateTo.setText("");
|
||||
inputDateFrom.setText("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
@@ -331,7 +347,6 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
if(incident != null){
|
||||
if(incident.getFidTimeCategory() != 0){
|
||||
timeCategory.setSelection(incident.getFidTimeCategory());
|
||||
//SubCategory is automatically initialized
|
||||
}
|
||||
|
||||
if(incident.getFromDate() != null && !incident.getFromDate().equals("")){
|
||||
@@ -359,17 +374,18 @@ public class ReportWF_2_Fragment extends Fragment {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
private void saveInput() {
|
||||
public void saveInput() {
|
||||
|
||||
incident.setFidTimeCategory(timeCategory.getSelectedItemPosition());
|
||||
incident.setFidTimeSubCategory(timeSubCategory.getSelectedItemPosition());
|
||||
incident.setFromDate(inputDateFrom.getText().toString());
|
||||
incident.setFromTime(inputTimeFrom.getText().toString());
|
||||
incident.setToDate(inputDateTo.getText().toString());
|
||||
incident.setToTime(inputTimeTo.getText().toString());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.deke.risk.riskahead.fragment;
|
||||
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -19,8 +18,7 @@ import org.deke.risk.riskahead.adapter.SpinnerHintAdapter;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_3_Fragment extends Fragment {
|
||||
|
||||
public class ReportWF_3_Fragment extends BaseReportWFFragment {
|
||||
private final static int GANGS = 1;
|
||||
private final static int POLICE = 2;
|
||||
private final static int MOB = 3;
|
||||
@@ -30,7 +28,6 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
private final static int DONTKNOW = 7;
|
||||
private final static int ETC = 8;
|
||||
|
||||
|
||||
private View viewFragment;
|
||||
|
||||
private Spinner suspectCategory;
|
||||
@@ -60,6 +57,12 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
suspectCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect);
|
||||
suspectSubCategory = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_3_suspect_sub);
|
||||
@@ -99,16 +102,14 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
if (((SpinnerHintAdapter) suspectCategory.getAdapter()).isInInitialState()) {
|
||||
suspectSubCategory.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
incident.setFidSuspectCategory(position);
|
||||
|
||||
if (stringId != 0) {
|
||||
suspectSubCategory.setVisibility(View.VISIBLE);
|
||||
setSubSpinnerValues(stringId);
|
||||
}else{
|
||||
} else {
|
||||
suspectSubCategory.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
if (position != ETC){
|
||||
if (position != ETC) {
|
||||
suspectEtcInput.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
@@ -125,10 +126,8 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
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.getFidSuspectSubCategory());
|
||||
if ((position < 1) && (incident.getFidSuspectSubCategory() != 0)) suspectSubCategory.setSelection(incident.getFidSuspectSubCategory());
|
||||
|
||||
incident.setFidSuspectSubCategory(position);
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -139,6 +138,7 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
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()));
|
||||
@@ -184,6 +184,10 @@ public class ReportWF_3_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput() {
|
||||
incident.setFidSuspectCategory(suspectCategory.getSelectedItemPosition());
|
||||
incident.setFidSuspectSubCategory(suspectSubCategory.getSelectedItemPosition());
|
||||
incident.setEtcSuspectCategory(suspectEtcInput.getText().toString());
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.deke.risk.riskahead.fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,8 +21,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_4_Fragment extends Fragment {
|
||||
|
||||
public class ReportWF_4_Fragment extends BaseReportWFFragment {
|
||||
private final static int COMMON_OBJECTS = 1;
|
||||
private final static int FIREARM = 2;
|
||||
private final static int EXPLOSIONS = 3;
|
||||
@@ -56,6 +57,13 @@ public class ReportWF_4_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
|
||||
private void initInputElements() {
|
||||
suspectWeapon = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_4_weapon);
|
||||
suspectWeaponEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_4_weapon_etc);
|
||||
@@ -87,10 +95,6 @@ public class ReportWF_4_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidSuspectWeaponCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -99,6 +103,7 @@ public class ReportWF_4_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setMainSpinnerValues(int stringId){
|
||||
@@ -111,9 +116,10 @@ public class ReportWF_4_Fragment extends Fragment {
|
||||
boolean isMainCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isMainCategoryFilled = (suspectWeapon.getSelectedItemPosition() > 0) && (incident.getFidSuspectWeaponCategory() > 0);
|
||||
isMainCategoryFilled = (suspectWeapon.getSelectedItemPosition() > 0);
|
||||
}
|
||||
|
||||
saveInput();
|
||||
mCallback.onInputFinished(isMainCategoryFilled);
|
||||
}
|
||||
|
||||
@@ -135,6 +141,10 @@ public class ReportWF_4_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput(){
|
||||
incident.setFidSuspectWeaponCategory(suspectWeapon.getSelectedItemPosition());
|
||||
incident.setEtcSuspectWeaponCategory(suspectWeaponEtcInput.getText().toString());
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.deke.risk.riskahead.fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,7 +21,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_5_Fragment extends Fragment {
|
||||
public class ReportWF_5_Fragment extends BaseReportWFFragment {
|
||||
|
||||
|
||||
private final static int SINGLE_PERSON = 1;
|
||||
@@ -56,6 +58,12 @@ public class ReportWF_5_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
suspectCount = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_5_count);
|
||||
suspectCountEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_5_count_etc);
|
||||
@@ -84,10 +92,6 @@ public class ReportWF_5_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidSuspectCountCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -96,6 +100,7 @@ public class ReportWF_5_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setMainSpinnerValues(int stringId){
|
||||
@@ -108,7 +113,7 @@ public class ReportWF_5_Fragment extends Fragment {
|
||||
boolean isMainCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isMainCategoryFilled = (suspectCount.getSelectedItemPosition() > 0) && (incident.getFidSuspectCountCategory() > 0);
|
||||
isMainCategoryFilled = (suspectCount.getSelectedItemPosition() > 0);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isMainCategoryFilled);
|
||||
@@ -132,6 +137,10 @@ public class ReportWF_5_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput(){
|
||||
incident.setFidSuspectCountCategory(suspectCount.getSelectedItemPosition());
|
||||
incident.setEtcSuspectCountCategory(suspectCountEtcInput.getText().toString());
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_6_Fragment extends Fragment {
|
||||
public class ReportWF_6_Fragment extends BaseReportWFFragment {
|
||||
|
||||
private final static int WOMEN = 1;
|
||||
private final static int CHILDREN = 2;
|
||||
@@ -53,6 +53,12 @@ public class ReportWF_6_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
victimType = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_6_victim);
|
||||
|
||||
@@ -73,16 +79,12 @@ public class ReportWF_6_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidVictimCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parentView) {
|
||||
// do nothing
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -97,7 +99,7 @@ public class ReportWF_6_Fragment extends Fragment {
|
||||
boolean isMainCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isMainCategoryFilled = (victimType.getSelectedItemPosition() > 0) && (incident.getFidVictimCategory() > 0);
|
||||
isMainCategoryFilled = (victimType.getSelectedItemPosition() > 0);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isMainCategoryFilled);
|
||||
@@ -120,6 +122,10 @@ public class ReportWF_6_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput(){
|
||||
incident.setFidVictimCategory(victimType.getSelectedItemPosition());
|
||||
|
||||
((ReportWFActivity)getActivity()).setIncident(incident);
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.deke.risk.riskahead.fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,7 +21,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_7_Fragment extends Fragment {
|
||||
public class ReportWF_7_Fragment extends BaseReportWFFragment {
|
||||
|
||||
|
||||
private final static int LOCAL = 1;
|
||||
@@ -56,6 +58,12 @@ public class ReportWF_7_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initInputElements() {
|
||||
victimOrigin = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_7_victimorigin);
|
||||
victimOriginEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_7_victimorigin_etc);
|
||||
@@ -84,10 +92,6 @@ public class ReportWF_7_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidVictimOriginCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -96,6 +100,7 @@ public class ReportWF_7_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setMainSpinnerValues(int stringId){
|
||||
@@ -108,7 +113,7 @@ public class ReportWF_7_Fragment extends Fragment {
|
||||
boolean isMainCategoryFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isMainCategoryFilled = (victimOrigin.getSelectedItemPosition() > 0) && (incident.getFidVictimOriginCategory() > 0);
|
||||
isMainCategoryFilled = (victimOrigin.getSelectedItemPosition() > 0);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isMainCategoryFilled);
|
||||
@@ -132,6 +137,10 @@ public class ReportWF_7_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput(){
|
||||
incident.setFidVictimOriginCategory(victimOrigin.getSelectedItemPosition());
|
||||
incident.setEtcVictimOriginCategory(victimOriginEtcInput.getText().toString());
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@ package org.deke.risk.riskahead.fragment;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -19,7 +21,7 @@ import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
/**
|
||||
* @author Dennis Thießen
|
||||
*/
|
||||
public class ReportWF_8_Fragment extends Fragment {
|
||||
public class ReportWF_8_Fragment extends BaseReportWFFragment {
|
||||
|
||||
|
||||
private final static int FEET = 1;
|
||||
@@ -88,6 +90,12 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
saveInput();
|
||||
return incident;
|
||||
}
|
||||
|
||||
private void initSuspectVehicleInputElements() {
|
||||
suspectVehicle = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_8_suspectvehicle);
|
||||
suspectVehicleEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_8_suspectvehicle);
|
||||
@@ -122,10 +130,6 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidSuspectTransportationCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -134,6 +138,7 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setSuspectVehicleMainSpinnerValues(int stringId){
|
||||
@@ -175,10 +180,6 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidVictimBelongingCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -187,6 +188,7 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setVictimAffiliationMainSpinnerValues(int stringId){
|
||||
@@ -222,10 +224,6 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
break;
|
||||
}
|
||||
|
||||
if (position > 0) {
|
||||
incident.setFidSuspectCharacteristicsCategory(position);
|
||||
}
|
||||
|
||||
checkIfFinished();
|
||||
}
|
||||
|
||||
@@ -234,6 +232,7 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void setSuspectRecognitionMainSpinnerValues(int stringId){
|
||||
@@ -247,9 +246,9 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
boolean isSuspectRecoginitionFilled = false;
|
||||
|
||||
if(incident != null){
|
||||
isSuspectVehicleFilled = (suspectVehicle.getSelectedItemPosition() > 0) && (incident.getFidSuspectTransportationCategory() > 0);
|
||||
isVictimAffiliationFilled = (victimAffiliation.getSelectedItemPosition() > 0) && (incident.getFidVictimBelongingCategory() > 0);
|
||||
isSuspectRecoginitionFilled = (suspectRecongnition.getSelectedItemPosition() > 0) && (incident.getFidSuspectCharacteristicsCategory() > 0);
|
||||
isSuspectVehicleFilled = (suspectVehicle.getSelectedItemPosition() > 0);
|
||||
isVictimAffiliationFilled = (victimAffiliation.getSelectedItemPosition() > 0);
|
||||
isSuspectRecoginitionFilled = (suspectRecongnition.getSelectedItemPosition() > 0);
|
||||
}
|
||||
|
||||
mCallback.onInputFinished(isSuspectVehicleFilled && isVictimAffiliationFilled && isSuspectRecoginitionFilled);
|
||||
@@ -281,6 +280,10 @@ public class ReportWF_8_Fragment extends Fragment {
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
|
||||
saveInput();
|
||||
}
|
||||
|
||||
private void saveInput(){
|
||||
incident.setFidSuspectTransportationCategory(suspectVehicle.getSelectedItemPosition());
|
||||
incident.setEtcSuspectTransportationCategory(suspectVehicleEtcInput.getText().toString());
|
||||
|
||||
|
||||
@@ -10,11 +10,13 @@ import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
import org.deke.risk.riskahead.ReportWFActivity;
|
||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public class ReportWF_Finish_Fragment extends Fragment {
|
||||
public class ReportWF_Finish_Fragment extends BaseReportWFFragment {
|
||||
|
||||
private View viewFragment;
|
||||
private SendReportListener mCallback;
|
||||
@@ -35,6 +37,11 @@ public class ReportWF_Finish_Fragment extends Fragment {
|
||||
return viewFragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IncidentReport getCurrentInput() {
|
||||
return ((ReportWFActivity)getActivity()).getIncident();
|
||||
}
|
||||
|
||||
public interface SendReportListener {
|
||||
void sendReport();
|
||||
}
|
||||
|
||||
@@ -128,8 +128,8 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
prefGPSENabled.setEnabled(false);
|
||||
prefLocation.setEnabled(false);
|
||||
|
||||
prefGPSENabled.setTitle(prefGPSENabled.getTitle()+" (Only Premium)");
|
||||
prefLocation.setTitle(prefLocation.getTitle()+" (Only Premium)");
|
||||
prefGPSENabled.setTitle(prefGPSENabled.getTitle() + " " + getResources().getString(R.string.txt_premium_only));
|
||||
prefLocation.setTitle(prefLocation.getTitle() + " " + getResources().getString(R.string.txt_premium_only));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,8 +157,8 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new AlertDialog.Builder(getActivity())
|
||||
.setTitle("Send password reset E-Mail")
|
||||
.setMessage("Do you really want to reset your password? An E-Mail will be send to your address. Please follow the instructions to reset your password.")
|
||||
.setTitle(getResources().getString(R.string.txt_settings_resetpwtitle))
|
||||
.setMessage(getResources().getString(R.string.txt_settings_resetpwtext))
|
||||
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
requestPasswordReset();
|
||||
@@ -202,7 +202,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
prefRadius.setValue(Integer.toString(session.getNotificationRadius()));
|
||||
prefRadius.setSummary(prefRadius.getEntry());
|
||||
prefGPSENabled.setChecked(session.isGPSForNotificationsEnabled());
|
||||
prefLocation.setSummary("Your Location (Latitude/Longitude):\n"+Double.toString(session.getLocation().latitude)+" : "+Double.toString(session.getLocation().longitude));
|
||||
prefLocation.setSummary(getResources().getString(R.string.txt_settings_gps_loca_sum)+":\n"+Double.toString(session.getLocation().latitude)+" : "+Double.toString(session.getLocation().longitude));
|
||||
|
||||
if(session.isGPSForNotificationsEnabled()){
|
||||
prefLocation.setEnabled(false);
|
||||
@@ -216,7 +216,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
StringRequest strReq = getStringRequestResetPW(user.get(SessionManager.KEY_EMAIL));
|
||||
AppController.getInstance().addToRequestQueue(strReq, tag_string_req);
|
||||
|
||||
((SettingsActivity) getActivity()).showMessage("E-Mail was sent to your address");
|
||||
((SettingsActivity) getActivity()).showMessage(getString(R.string.alert_passwordreset_confirmation));
|
||||
}
|
||||
|
||||
private StringRequest getStringRequestResetPW(final String email) {
|
||||
@@ -236,7 +236,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error request email reset (Server returned error): " + errorMsg);
|
||||
((SettingsActivity) getActivity()).showMessage(errorMsg);
|
||||
((SettingsActivity) getActivity()).showMessage(getResources().getString(R.string.txt_errormsg_resetpw));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
@@ -256,7 +256,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
@Override
|
||||
protected Map<String, String> getParams() {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("tag", "requestpwreset");
|
||||
params.put("tag", AppConfig.REST_REQUESTPWRESET);
|
||||
params.put("email", email);
|
||||
|
||||
return params;
|
||||
@@ -296,7 +296,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
JSONObject jObj = new JSONObject(response);
|
||||
boolean error = jObj.getBoolean("error");
|
||||
if (!error) {
|
||||
((SettingsActivity) getActivity()).showMessage(jObj.getString("msg"));
|
||||
((SettingsActivity) getActivity()).showMessage(getResources().getString(R.string.txt_success_changesett));
|
||||
JSONObject tmpuser = jObj.getJSONObject("user");
|
||||
|
||||
JSONArray jSubs = tmpuser.getJSONArray("subs");
|
||||
@@ -320,7 +320,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error getting user settings (Server returned error): " + errorMsg);
|
||||
((SettingsActivity) getActivity()).showMessage(errorMsg);
|
||||
((SettingsActivity) getActivity()).showMessage(getResources().getString(R.string.txt_errormsg_changesettings));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
@@ -345,7 +345,7 @@ public class SettingsFragment extends PreferenceFragment {
|
||||
protected Map<String, String> getParams() {
|
||||
// Posting params to register url
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("tag", "updateuser");
|
||||
params.put("tag", AppConfig.REST_UPDATE_USER);
|
||||
params.put("uid", user.get(SessionManager.KEY_UID));
|
||||
params.put("token", user.get(SessionManager.TOKEN));
|
||||
params.put("username", username);
|
||||
|
||||
@@ -103,7 +103,7 @@ public class Top10Fragment extends Fragment {
|
||||
} else {
|
||||
String errorMsg = jObj.getString("error_msg");
|
||||
Log.e(TAG, "Error getting top 10 stats (Server returned error): " + errorMsg);
|
||||
parent.showMessage(errorMsg);
|
||||
parent.showMessage(getResources().getString(R.string.txt_errormsg_gettop10));
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
@@ -123,7 +123,7 @@ public class Top10Fragment extends Fragment {
|
||||
@Override
|
||||
protected Map<String, String> getParams() {
|
||||
Map<String, String> params = new HashMap<>();
|
||||
params.put("tag", "gettop10");
|
||||
params.put("tag", AppConfig.REST_GET_TOP10);
|
||||
params.put("uid", parent.user.get(SessionManager.KEY_UID));
|
||||
params.put("token", parent.user.get(SessionManager.TOKEN));
|
||||
|
||||
|
||||
@@ -142,14 +142,14 @@ public class IncidentReport implements ClusterItem {
|
||||
int mIcon;
|
||||
|
||||
Date tmpFromDate = null;
|
||||
SimpleDateFormat simpleDateFormat = null;
|
||||
SimpleDateFormat simpleDateFormat;
|
||||
Date today = new Date(System.currentTimeMillis()-1*60*60*1000);
|
||||
|
||||
try {
|
||||
if(this.fromTime != null){
|
||||
if(this.fromDate != null && this.fromTime != null){
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
||||
tmpFromDate = simpleDateFormat.parse(this.fromDate+" "+this.fromTime);
|
||||
}else{
|
||||
}else if(this.fromDate != null){
|
||||
simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
tmpFromDate = simpleDateFormat.parse(this.fromDate);
|
||||
}
|
||||
@@ -282,15 +282,6 @@ public class IncidentReport implements ClusterItem {
|
||||
}
|
||||
}
|
||||
|
||||
public void resetDatetime() {
|
||||
toTime = "";
|
||||
toDate = "";
|
||||
fromTime = "";
|
||||
fromDate = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -300,11 +291,18 @@ public class IncidentReport implements ClusterItem {
|
||||
}
|
||||
|
||||
public String getIncidentCategoryName(Context context){
|
||||
return context.getResources().getStringArray(R.array.cat_situation_main)[this.fidIncidentCategory-1];
|
||||
String returnValue = "";
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_situation_main);
|
||||
|
||||
if((this.fidIncidentCategory > 0) && (this.fidIncidentCategory <= stringArray.length)){
|
||||
returnValue = stringArray[this.fidIncidentCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getIncidentSubCategoryName(Context context){
|
||||
String returnValue = "";
|
||||
String returnValue;
|
||||
String[] stringArray;
|
||||
|
||||
switch(this.fidIncidentCategory){
|
||||
@@ -348,7 +346,7 @@ public class IncidentReport implements ClusterItem {
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidIncidentSubCategory)){
|
||||
returnValue = getEtcIncidentCategory();
|
||||
}else if(stringArray != null){
|
||||
}else if((stringArray != null) && (this.fidIncidentSubCategory > 0) && (this.fidIncidentSubCategory <= stringArray.length)){
|
||||
returnValue = stringArray[this.fidIncidentSubCategory-1];
|
||||
}
|
||||
|
||||
@@ -357,24 +355,31 @@ public class IncidentReport implements ClusterItem {
|
||||
|
||||
public String getTimeString(Context context){
|
||||
String returnString = "";
|
||||
String[] returnTimeArray = context.getResources().getStringArray(R.array.cat_time_main);
|
||||
String[] returnSubTimeArray = context.getResources().getStringArray(R.array.cat_time_sub_periodical);
|
||||
|
||||
switch (this.fidTimeCategory){
|
||||
case 1:
|
||||
if((this.fromDate != null) && !(this.fromDate.equals("0000-00-00"))){
|
||||
if((this.fromDate != null) && !(this.fromDate.equals("0000-00-00")) && (this.fromTime != null) && (this.fromTime.length() > 4)){
|
||||
returnString = this.fromDate+" "+this.fromTime.substring(0,5);
|
||||
}else if(this.fromDate.equals("0000-00-00")){
|
||||
}else if((this.fromDate != null) && (this.fromDate.equals("0000-00-00")) && (this.createdAt.length() > 15)){
|
||||
returnString = this.createdAt.substring(0,16);
|
||||
}else{
|
||||
returnString = context.getResources().getStringArray(R.array.cat_time_main)[this.fidTimeCategory-1];
|
||||
}else if((this.fidTimeCategory > 0) && (this.fidTimeCategory <= returnTimeArray.length)){
|
||||
returnString = returnTimeArray[this.fidTimeCategory-1];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
returnString = context.getResources().getStringArray(R.array.cat_time_sub_periodical)[this.fidTimeSubCategory-1];
|
||||
if(this.fidTimeSubCategory > 0 && this.fidTimeSubCategory <= returnSubTimeArray.length){
|
||||
returnString = returnSubTimeArray[this.fidTimeSubCategory-1];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if((this.fromTime != null) && !(this.fromTime.equals("00:00:00"))){
|
||||
if((this.fromDate != null) && !(this.fromDate.equals("0000-00-00")) && (this.fromTime != null) && (this.fromTime.length() > 4)){
|
||||
returnString = this.fromDate+" "+this.fromTime.substring(0,5);
|
||||
}else{
|
||||
returnString = this.fromDate;
|
||||
}else if((this.fromDate != null) && (this.fromDate.equals("0000-00-00")) && (this.createdAt.length() > 15)){
|
||||
returnString = this.createdAt.substring(0,16);
|
||||
}else if((this.fidTimeCategory > 0) && (this.fidTimeCategory <= returnTimeArray.length)){
|
||||
returnString = returnTimeArray[this.fidTimeCategory-1];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@@ -384,47 +389,50 @@ public class IncidentReport implements ClusterItem {
|
||||
returnString = this.fromDate+" -> "+this.toDate;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
returnString = context.getResources().getStringArray(R.array.cat_time_main)[this.fidTimeCategory-1];
|
||||
default:
|
||||
if((this.createdAt != null) && (this.createdAt.length() > 15)) {
|
||||
returnString = this.createdAt.substring(0, 16);
|
||||
}else{
|
||||
returnString = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
return returnString;
|
||||
}
|
||||
|
||||
public String getSuspectString(Context context){
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_suspect_main);
|
||||
|
||||
if(this.fidSuspectCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_suspect_main);
|
||||
returnValue = stringArray[this.fidSuspectCategory-1];
|
||||
if(this.fidSuspectCategory > 0 && this.fidSuspectCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidSuspectCategory){
|
||||
returnValue = getEtcSuspectCategory();
|
||||
}else{
|
||||
returnValue = stringArray[this.fidSuspectCategory-1];
|
||||
|
||||
|
||||
if((this.fidSuspectCategory == 4) || (this.fidSuspectCategory == 5) || (this.fidSuspectCategory == 6)) {
|
||||
|
||||
String[] stringSubArray = context.getResources().getStringArray(R.array.cat_suspect_sub_location);
|
||||
if(this.fidSuspectSubCategory > 0 && this.fidSuspectSubCategory <= stringSubArray.length){
|
||||
returnValue += " ("+stringSubArray[this.fidSuspectSubCategory-1]+")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidSuspectCategory)){
|
||||
returnValue = getEtcSuspectCategory();
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidSuspectCategory-1];
|
||||
}
|
||||
|
||||
if(this.fidSuspectCategory == 4 || this.fidSuspectCategory == 5 || this.fidSuspectCategory == 6) {
|
||||
returnValue += " ("+context.getResources().getStringArray(R.array.cat_suspect_sub_location)[this.fidSuspectSubCategory-1]+")";
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getVictimString(Context context){
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_victim);
|
||||
|
||||
if(this.fidVictimCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_victim);
|
||||
if(this.fidVictimCategory > 0 && this.fidVictimCategory <= stringArray.length){
|
||||
returnValue = stringArray[this.fidVictimCategory-1];
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
@@ -457,132 +465,108 @@ public class IncidentReport implements ClusterItem {
|
||||
}
|
||||
|
||||
public String getSuspectWeaponsString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_suspect_weapons);
|
||||
|
||||
if(this.fidSuspectWeaponCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_suspect_weapons);
|
||||
returnValue = stringArray[this.fidSuspectWeaponCategory-1];
|
||||
if(this.fidSuspectWeaponCategory > 0 && this.fidSuspectWeaponCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidSuspectWeaponCategory){
|
||||
returnValue = etcSuspectWeaponCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidSuspectWeaponCategory-1];
|
||||
|
||||
if(this.fidSuspectWeaponCategory < 5 && this.etcSuspectWeaponCategory.trim().length() > 0) {
|
||||
returnValue += " ( "+this.etcSuspectWeaponCategory+" )";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidSuspectWeaponCategory)){
|
||||
returnValue = etcSuspectWeaponCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidSuspectWeaponCategory-1];
|
||||
}
|
||||
|
||||
if(this.fidSuspectWeaponCategory < 5 && this.etcSuspectWeaponCategory.length() > 0) {
|
||||
returnValue += " ( "+this.etcSuspectWeaponCategory+" )";
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getSuspectNoOfString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_suspect_count);
|
||||
|
||||
if(this.fidSuspectCountCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_suspect_count);
|
||||
returnValue = stringArray[this.fidSuspectCountCategory-1];
|
||||
if(this.fidSuspectCountCategory > 0 && this.fidSuspectCountCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidSuspectCountCategory){
|
||||
returnValue = etcSuspectCountCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidSuspectCountCategory-1];
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidSuspectCountCategory)){
|
||||
returnValue = etcSuspectCountCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidSuspectCountCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getVictimOriginString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_victim_origin);
|
||||
|
||||
if(this.fidVictimOriginCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_victim_origin);
|
||||
returnValue = stringArray[this.fidVictimOriginCategory-1];
|
||||
if(this.fidVictimOriginCategory > 0 && this.fidVictimOriginCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidVictimOriginCategory){
|
||||
returnValue = etcVictimOriginCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidVictimOriginCategory-1];
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidVictimOriginCategory)){
|
||||
returnValue = etcVictimOriginCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidVictimOriginCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getSuspectTransportString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_details_vehicle);
|
||||
|
||||
if(this.fidSuspectTransportationCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_details_vehicle);
|
||||
returnValue = stringArray[this.fidSuspectTransportationCategory-1];
|
||||
if(this.fidSuspectTransportationCategory > 0 && this.fidSuspectTransportationCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidSuspectTransportationCategory){
|
||||
returnValue = etcSuspectTransportationCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidSuspectTransportationCategory-1];
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidSuspectTransportationCategory)){
|
||||
returnValue = etcSuspectTransportationCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidSuspectTransportationCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getVictimAffiliationString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_details_victimaff);
|
||||
|
||||
if(this.fidVictimBelongingCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_details_victimaff);
|
||||
returnValue = stringArray[this.fidVictimBelongingCategory-1];
|
||||
if(this.fidVictimBelongingCategory > 0 && this.fidVictimBelongingCategory <= stringArray.length){
|
||||
if(stringArray.length == this.fidVictimBelongingCategory){
|
||||
returnValue = etcVictimBelongingCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidVictimBelongingCategory-1];
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidVictimBelongingCategory)){
|
||||
returnValue = etcVictimBelongingCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidVictimBelongingCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public String getSuspectRecognitionString(Context context) {
|
||||
String returnValue = "";
|
||||
String[] stringArray;
|
||||
String returnValue;
|
||||
String[] stringArray = context.getResources().getStringArray(R.array.cat_details_suspect_recon);
|
||||
|
||||
if(this.fidSuspectCharacteristicsCategory > 0){
|
||||
stringArray = context.getResources().getStringArray(R.array.cat_details_suspect_recon);
|
||||
returnValue = stringArray[this.fidSuspectCharacteristicsCategory-1];
|
||||
if(stringArray.length == this.fidSuspectCharacteristicsCategory){
|
||||
returnValue = etcSuspectCharacteristicsCategory;
|
||||
}else{
|
||||
returnValue = stringArray[this.fidSuspectCharacteristicsCategory-1];
|
||||
}
|
||||
}else{
|
||||
stringArray = null;
|
||||
returnValue = "";
|
||||
}
|
||||
|
||||
if(stringArray != null && (stringArray.length == this.fidSuspectCharacteristicsCategory)){
|
||||
returnValue = etcSuspectCharacteristicsCategory;
|
||||
}else if(stringArray != null){
|
||||
returnValue = stringArray[this.fidSuspectCharacteristicsCategory-1];
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -590,7 +574,7 @@ public class IncidentReport implements ClusterItem {
|
||||
|
||||
/*
|
||||
Simple Getters and Setter below
|
||||
*/
|
||||
*/
|
||||
|
||||
public void setPosition(LatLng position) {
|
||||
this.incidentPosition = position;
|
||||
|
||||
@@ -13,6 +13,8 @@ import android.util.Log;
|
||||
import android.util.Patterns;
|
||||
import android.widget.Button;
|
||||
|
||||
import org.deke.risk.riskahead.R;
|
||||
|
||||
/**
|
||||
* Copyright 2015 RiskAhead Dennis Thiessen
|
||||
* <p/>
|
||||
@@ -58,14 +60,12 @@ public class ValidatedEditTextPreference extends EditTextPreference
|
||||
|
||||
if((getEditText().getInputType() & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) != 0){
|
||||
if (!Patterns.EMAIL_ADDRESS.matcher(value).matches()) {
|
||||
getEditText().setError("Please enter a valid email address\n" +
|
||||
"e.g.: text@abc.de");
|
||||
getEditText().setError(getEditText().getContext().getResources().getString(R.string.error_email));
|
||||
enable = false;
|
||||
}
|
||||
}else{
|
||||
if (value.length() < 5) {
|
||||
getEditText().setError("Your username must be at least\n" +
|
||||
"5 characters in length.");
|
||||
getEditText().setError(getEditText().getContext().getResources().getString(R.string.error_anytext));
|
||||
enable = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="10dp"
|
||||
android:layout_marginRight="45dp"
|
||||
android:layout_marginRight="55dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="250dp"
|
||||
android:minWidth="250dp"
|
||||
android:width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="6dp"
|
||||
@@ -55,7 +55,7 @@
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:id="@+id/txt_infowindow_subcategory"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
@@ -67,7 +67,7 @@
|
||||
android:textColor="#b9000000"
|
||||
android:text="Loading subject..."
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:id="@+id/txt_infowindow_subject"
|
||||
android:typeface="serif"
|
||||
android:singleLine="true"
|
||||
@@ -80,7 +80,7 @@
|
||||
android:textColor="#b9000000"
|
||||
android:text="Loading victim..."
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:id="@+id/txt_infowindow_victim"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
@@ -93,7 +93,7 @@
|
||||
android:textColor="#b9000000"
|
||||
android:text="Loading time..."
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:id="@+id/txt_infowindow_time"
|
||||
android:singleLine="true"
|
||||
|
||||
@@ -147,24 +147,61 @@
|
||||
|
||||
<string name="btn_reportwf_reportnow">Jetzt melden!</string>
|
||||
<string name="btn_reportwf_next">Weiter</string>
|
||||
|
||||
<string name="menu_send_feedback">Feedback senden</string>
|
||||
<string name="txt_errormsg_sociallogin">Could not log-in. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_login">Sorry, could not log-in. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_register">Sorry, could not registrate. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getpwreset">Sorry, could not send E-Mail. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getactivationlink">Sorry, we could not send you an activation link. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getinfowindow">Sorry, could not load info window values. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_reportwf_newincidenttitle">Create new incident?</string>
|
||||
<string name="txt_reportwf_newincidenttext">Do you want to reset all values and create a new incident?</string>
|
||||
<string name="txt_subs_youbought">You have bought</string>
|
||||
<string name="txt_subs_thankyou">Thank you for your support!</string>
|
||||
<string name="txt_errormsg_subs">There was an error parsing your purchase data. Please try again or contact RiskAhead support.</string>
|
||||
<string name="txt_viewreport_deletetitle">Delete incident?</string>
|
||||
<string name="txt_viewreport_deletetext">Do you really want to delete this incident? A deleted incident can not be restored.</string>
|
||||
<string name="txt_errormsg_deleteincident">Sorry, we could not delete this incident. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getincidentdetail">Sorry, we could not retrieve incident details. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_cannotvoteowninc">You can not vote your own incident.</string>
|
||||
<string name="txt_errormsg_couldnotvote">Sorry, we could not save your vote. Please try again later or contact RiskAhead support.</string>
|
||||
|
||||
<string name="txt_reportwf_newincidenttitle">Neuen Vorfall anlegen?</string>
|
||||
<string name="txt_reportwf_newincidenttext">Willst du alle gemachten Eingaben zurücksetzen und einen neuen Vorfall erstellen?</string>
|
||||
<string name="txt_subs_youbought">Du hast gekauft</string>
|
||||
<string name="txt_subs_thankyou">Vielen Dank für deine Unterstützung!</string>
|
||||
<string name="txt_viewreport_deletetitle">Vorfall löschen?</string>
|
||||
<string name="txt_viewreport_deletetext">Willst du wirklich diesen Vorfall löschen? Ein gelöschter Vorfall kann nicht wiederhergestellt werden.</string>
|
||||
|
||||
<string name="txt_errormsg_suffix">Bitte versuche es später erneut oder schreibe dem RiskAhead Support.</string>
|
||||
<string name="txt_errormsg_login">Anmeldung ist fehlgeschlagen.</string>
|
||||
<string name="txt_errormsg_register">Registrierung ist fehlgeschlagen.</string>
|
||||
<string name="txt_errormsg_getpwreset">Konnte keine E-Mail versenden.</string>
|
||||
<string name="txt_errormsg_getactivationlink">Aktivierungslink konnte nicht versendet werden.</string>
|
||||
<string name="txt_errormsg_getinfowindow">Vorfall konnte nicht geladen werden.</string>
|
||||
<string name="txt_errormsg_subs">Es gab einen Fehler bei der Verarbeitung Ihrer Bestellung.</string>
|
||||
<string name="txt_errormsg_deleteincident">Vorfall konnte nicht gelöscht werden.</string>
|
||||
<string name="txt_errormsg_getincidentdetail">Vorfall konnte nicht geladen werden.</string>
|
||||
<string name="txt_errormsg_cannotvoteowninc">Du kannst nicht für deinen eigenen Vorfall stimmen.</string>
|
||||
<string name="txt_errormsg_couldnotvote">Stimme konnte nicht gespeichert werden.</string>
|
||||
<string name="txt_errormsg_retrievestats">Konnte Profil nicht abrufen.</string>
|
||||
<string name="txt_settings_resetpwtitle">Passwort zurücksetzen?</string>
|
||||
<string name="txt_settings_resetpwtext">Willst du wirklich dein Passwort zurücksetzen? Eine E-Mail wird dazu an deine Adresse versendet. Bitte folge dem Link um dein Passwort zurückzusetzen.</string>
|
||||
<string name="txt_errormsg_resetpw">Versenden der Passwort-Zurücksetzen E-Mail fehlgeschlagen.</string>
|
||||
<string name="txt_errormsg_changesettings">Benutzerinstellungen konnten nicht gespeichert werden.</string>
|
||||
<string name="txt_errormsg_gettop10">Top10 Liste konnte nicht geladen werden.</string>
|
||||
|
||||
<string name="txt_success_voted">Stimme erfasst. Wertung aktualisiert!</string>
|
||||
<string name="txt_success_incidentdel">Vorfall wurde gelöscht</string>
|
||||
<string name="txt_success_addreport">Vorfall erfolgreich hinzugefügt!</string>
|
||||
<string name="txt_success_changesett">Benutzereinstellungen erfolgreich geändert</string>
|
||||
<string name="txt_premium_only">(Nur Premium)</string>
|
||||
<string name="txt_settings_acc_headline">Benutzereinstellungen</string>
|
||||
<string name="txt_settings_username">Benutzername</string>
|
||||
<string name="txt_settings_username_sum">Bitte gebe deinen Benutzernamen ein</string>
|
||||
<string name="txt_settings_name_title">Name</string>
|
||||
<string name="txt_settings_name_sum">Bitte gebe deinen Namen ein</string>
|
||||
<string name="txt_settings_surname_title">Nachname</string>
|
||||
<string name="txt_settings_surname_sum">Bitte gebe deinen Nachnamen ein</string>
|
||||
<string name="txt_settings_email_title">E-Mail</string>
|
||||
<string name="txt_settings_email_sum">Bitte gebe deine E-Mail Adresse ein</string>
|
||||
<string name="txt_settings_resetpw_title">Passwort zurücksetzen</string>
|
||||
<string name="txt_settings_resetpw_sum">Fordere ein neues Passwort an</string>
|
||||
<string name="txt_settings_notify_head">Benachrichtigungen</string>
|
||||
<string name="txt_settings_showno_title">Zeige Benachrichtigungen</string>
|
||||
<string name="txt_settings_showno_sum">Aktiviere Benachrichtigungen in deiner Umgebung</string>
|
||||
<string name="txt_settings_notify_showradius">Radius</string>
|
||||
<string name="txt_settings_notify_showradius_sum">Wähle den Radius um deine letzte bekannte Position von wo du aus Benachrichtungen erhalten möchtest</string>
|
||||
<string name="txt_settings_notify_pollfreq">Abrufhäufigkeit</string>
|
||||
<string name="txt_settings_notify_pollfreq_sum">Wähle wie häufig deine Umgebung nach neuen Vorfällen untersucht werden soll</string>
|
||||
<string name="txt_settings_gps_enable_title">Aktiviere GPS</string>
|
||||
<string name="txt_settings_gps_enable_sum">Deine letzte bekannte Position wird automatisch durch GPS bestimmt (GPS muss in den Geräteeinstellungen aktiviert sein)</string>
|
||||
<string name="txt_settings_gps_loca_title">Wähle deine Position</string>
|
||||
<string name="txt_settings_gps_loca_sum">Deine Position (Latitude/Longitude):</string>
|
||||
|
||||
<string-array name="cat_situation_main">
|
||||
<item>Allgemeiner Vorfall/Situation</item>
|
||||
@@ -238,7 +275,6 @@
|
||||
<item>Regelmäßig</item>
|
||||
<item>Bestimmter Zeitpunkt</item>
|
||||
<item>Bestimmter Zeitraum</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_time_sub_periodical">
|
||||
|
||||
@@ -152,24 +152,60 @@
|
||||
<string name="btn_reportwf_reportnow">Report NOW!</string>
|
||||
<string name="btn_reportwf_next">Next</string>
|
||||
<string name="menu_send_feedback">Send Feedback</string>
|
||||
<string name="txt_errormsg_sociallogin">Could not log-in. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_login">Sorry, could not log-in. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_register">Sorry, could not registrate. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getpwreset">Sorry, could not send E-Mail. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getactivationlink">Sorry, we could not send you an activation link. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getinfowindow">Sorry, could not load info window values. Please try again later or contact RiskAhead support.</string>
|
||||
|
||||
<string name="txt_reportwf_newincidenttitle">Create new incident?</string>
|
||||
<string name="txt_reportwf_newincidenttext">Do you want to reset all values and create a new incident?</string>
|
||||
<string name="txt_errormsg_createincident">Sorry, we could not save your incident. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_subs_youbought">You have bought</string>
|
||||
<string name="txt_subs_thankyou">Thank you for your support!</string>
|
||||
<string name="txt_errormsg_subs">There was an error parsing your purchase data. Please try again or contact RiskAhead support.</string>
|
||||
<string name="txt_viewreport_deletetitle">Delete incident?</string>
|
||||
<string name="txt_viewreport_deletetext">Do you really want to delete this incident? A deleted incident can not be restored.</string>
|
||||
<string name="txt_errormsg_deleteincident">Sorry, we could not delete this incident. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_getincidentdetail">Sorry, we could not retrieve incident details. Please try again later or contact RiskAhead support.</string>
|
||||
|
||||
<string name="txt_errormsg_suffix">Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_login">Could not log-in. .</string>
|
||||
<string name="txt_errormsg_register">Could not registrate.</string>
|
||||
<string name="txt_errormsg_getpwreset">Could not send E-Mail.</string>
|
||||
<string name="txt_errormsg_getactivationlink">Could not send you an activation link.</string>
|
||||
<string name="txt_errormsg_getinfowindow">Could not load info window values.</string>
|
||||
<string name="txt_errormsg_createincident">Could not save your incident.</string>
|
||||
<string name="txt_errormsg_subs">There was an error parsing your purchase data.</string>
|
||||
<string name="txt_errormsg_deleteincident">Could not delete this incident.</string>
|
||||
<string name="txt_errormsg_getincidentdetail">Could not retrieve incident details.</string>
|
||||
<string name="txt_errormsg_cannotvoteowninc">You can not vote your own incident.</string>
|
||||
<string name="txt_errormsg_couldnotvote">Sorry, we could not save your vote. Please try again later or contact RiskAhead support.</string>
|
||||
<string name="txt_errormsg_couldnotvote">Could not save your vote.</string>
|
||||
<string name="txt_errormsg_retrievestats">Could not retrieve profile stats.</string>
|
||||
<string name="txt_settings_resetpwtitle">Reset password?</string>
|
||||
<string name="txt_settings_resetpwtext">Do you really want to reset your password? An E-Mail will be send to your address. Please follow the given link to reset your password.</string>
|
||||
<string name="txt_errormsg_resetpw">Could not send you an password reset E-Mail.</string>
|
||||
<string name="txt_errormsg_changesettings">Could not change your user settings.</string>
|
||||
<string name="txt_errormsg_gettop10">Could not get the Top10 list.</string>
|
||||
|
||||
<string name="txt_success_voted">Voted! Score updated.</string>
|
||||
<string name="txt_success_incidentdel">Incident deleted</string>
|
||||
<string name="txt_success_addreport">Report added!</string>
|
||||
<string name="txt_success_changesett">User settings changed successfully</string>
|
||||
<string name="txt_premium_only">(Only Premium)</string>
|
||||
<string name="txt_settings_acc_headline">Account Settings</string>
|
||||
<string name="txt_settings_username">Username</string>
|
||||
<string name="txt_settings_username_sum">Please enter your username</string>
|
||||
<string name="txt_settings_name_title">Name</string>
|
||||
<string name="txt_settings_name_sum">Please enter your name</string>
|
||||
<string name="txt_settings_surname_title">Surname</string>
|
||||
<string name="txt_settings_surname_sum">Please enter your surname</string>
|
||||
<string name="txt_settings_email_title">E-Mail</string>
|
||||
<string name="txt_settings_email_sum">Please enter your email</string>
|
||||
<string name="txt_settings_resetpw_title">Reset Password</string>
|
||||
<string name="txt_settings_resetpw_sum">Request a new password</string>
|
||||
<string name="txt_settings_notify_head">Notifications</string>
|
||||
<string name="txt_settings_showno_title">Show Notifications</string>
|
||||
<string name="txt_settings_showno_sum">Enable notifications in your area</string>
|
||||
<string name="txt_settings_notify_showradius">Radius</string>
|
||||
<string name="txt_settings_notify_showradius_sum">Choose the radius from your last known location in which notifications will be displayed</string>
|
||||
<string name="txt_settings_notify_pollfreq">Poll Frequency</string>
|
||||
<string name="txt_settings_notify_pollfreq_sum">Decide how often notification updates should be received from server</string>
|
||||
<string name="txt_settings_gps_enable_title">Enable GPS</string>
|
||||
<string name="txt_settings_gps_enable_sum">Get your last know location with GPS (GPS has to be activated in your device settings)</string>
|
||||
<string name="txt_settings_gps_loca_title">Choose your location</string>
|
||||
<string name="txt_settings_gps_loca_sum">Your Location (Latitude/Longitude):</string>
|
||||
|
||||
<string-array name="cat_situation_main">
|
||||
<item>Allgemeiner Vorfall/Situation</item>
|
||||
@@ -243,7 +279,6 @@
|
||||
<item>Regelmäßig</item>
|
||||
<item>Bestimmter Zeitpunkt</item>
|
||||
<item>Bestimmter Zeitraum</item>
|
||||
<item>Weiß ich nicht</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="cat_time_sub_periodical">
|
||||
@@ -361,5 +396,4 @@
|
||||
<item>60</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -3,74 +3,74 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="Account Settings">
|
||||
android:title="@string/txt_settings_acc_headline">
|
||||
|
||||
<org.deke.risk.riskahead.helper.ValidatedEditTextPreference
|
||||
android:key="usernamePref"
|
||||
android:title="Username"
|
||||
android:summary="Please enter your username"
|
||||
android:dialogTitle="Enter your username" />
|
||||
android:title="@string/txt_settings_username"
|
||||
android:summary="@string/txt_settings_username_sum"
|
||||
android:dialogTitle="@string/txt_settings_username_sum" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="namePref"
|
||||
android:title="Name"
|
||||
android:summary="Please enter your name"
|
||||
android:dialogTitle="Enter your name" />
|
||||
android:title="@string/txt_settings_name_title"
|
||||
android:summary="@string/txt_settings_name_sum"
|
||||
android:dialogTitle="@string/txt_settings_name_sum" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="surnamePref"
|
||||
android:title="Surname"
|
||||
android:summary="Please enter your surname"
|
||||
android:dialogTitle="Enter your surname" />
|
||||
android:title="@string/txt_settings_surname_title"
|
||||
android:summary="@string/txt_settings_surname_sum"
|
||||
android:dialogTitle="@string/txt_settings_surname_sum" />
|
||||
|
||||
<org.deke.risk.riskahead.helper.ValidatedEditTextPreference
|
||||
android:key="emailPref"
|
||||
android:inputType="textEmailAddress"
|
||||
android:title="E-Mail"
|
||||
android:summary="Please enter your email"
|
||||
android:dialogTitle="Enter your email" />
|
||||
android:title="@string/txt_settings_email_title"
|
||||
android:summary="@string/txt_settings_email_sum"
|
||||
android:dialogTitle="@string/txt_settings_email_sum" />
|
||||
|
||||
<Preference
|
||||
android:key="resetPassword"
|
||||
android:title="Reset Password"
|
||||
android:summary="Request a new password" />
|
||||
android:title="@string/txt_settings_resetpw_title"
|
||||
android:summary="@string/txt_settings_resetpw_sum" />
|
||||
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="Notifications">
|
||||
android:title="@string/txt_settings_notify_head">
|
||||
|
||||
<SwitchPreference
|
||||
android:key="notifyEnable"
|
||||
android:title="Show Notifications"
|
||||
android:summary="Enable notifications in your area" />
|
||||
android:title="@string/txt_settings_showno_title"
|
||||
android:summary="@string/txt_settings_showno_sum" />
|
||||
|
||||
<ListPreference
|
||||
android:key="notifyRadius"
|
||||
android:title="Radius"
|
||||
android:title="@string/txt_settings_notify_showradius"
|
||||
android:entries="@array/notification_radius"
|
||||
android:entryValues="@array/notification_radius_entry"
|
||||
android:summary="Choose the radius from your last known location in which notifications will be displayed"
|
||||
android:dialogTitle="Notification Radius" />
|
||||
android:summary="@string/txt_settings_notify_showradius_sum"
|
||||
android:dialogTitle="@string/txt_settings_notify_showradius" />
|
||||
|
||||
<ListPreference
|
||||
android:key="notifyFrequency"
|
||||
android:title="Poll Frequency"
|
||||
android:title="@string/txt_settings_notify_pollfreq"
|
||||
android:entries="@array/notification_freq"
|
||||
android:entryValues="@array/notification_freq_entry"
|
||||
android:summary="Decide how often notification updates should be received from server"
|
||||
android:dialogTitle="Poll Frequency" />
|
||||
android:summary="@string/txt_settings_notify_pollfreq_sum"
|
||||
android:dialogTitle="@string/txt_settings_notify_pollfreq" />
|
||||
|
||||
<SwitchPreference
|
||||
android:key="notifyEnableGPS"
|
||||
android:title="Enable GPS"
|
||||
android:summary="Get your last know location with GPS (GPS has to be activated in your device settings)" />
|
||||
android:title="@string/txt_settings_gps_enable_title"
|
||||
android:summary="@string/txt_settings_gps_enable_sum" />
|
||||
|
||||
<Preference
|
||||
android:key="notifyChooseLocation"
|
||||
android:title="Choose your location"
|
||||
android:summary="Your Location (Latitude/Longitude):" />
|
||||
android:title="@string/txt_settings_gps_loca_title"
|
||||
android:summary="@string/txt_settings_gps_loca_sum" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user