DT @02.01.2016: Finished ReportWF Category implementation
This commit is contained in:
@@ -107,7 +107,7 @@ public class MainActivity extends BaseActivity{
|
|||||||
Log.d(this.toString(),"Run Notification Task");
|
Log.d(this.toString(),"Run Notification Task");
|
||||||
|
|
||||||
myPosition = session.getLocation();
|
myPosition = session.getLocation();
|
||||||
if(myPosition != null){
|
if((myPosition != null) && (myPosition.latitude != 0.0) && (myPosition.longitude != 0.0)){
|
||||||
|
|
||||||
String lastNotificationTime = "";
|
String lastNotificationTime = "";
|
||||||
|
|
||||||
@@ -253,7 +253,6 @@ public class MainActivity extends BaseActivity{
|
|||||||
startRepeatingTask();
|
startRepeatingTask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Runnable mHandlerTask = new Runnable()
|
Runnable mHandlerTask = new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ 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_2_Fragment;
|
||||||
import org.deke.risk.riskahead.fragment.ReportWF_3_Fragment;
|
import org.deke.risk.riskahead.fragment.ReportWF_3_Fragment;
|
||||||
import org.deke.risk.riskahead.fragment.ReportWF_4_Fragment;
|
import org.deke.risk.riskahead.fragment.ReportWF_4_Fragment;
|
||||||
|
import org.deke.risk.riskahead.fragment.ReportWF_5_Fragment;
|
||||||
|
import org.deke.risk.riskahead.fragment.ReportWF_6_Fragment;
|
||||||
|
import org.deke.risk.riskahead.fragment.ReportWF_7_Fragment;
|
||||||
|
import org.deke.risk.riskahead.fragment.ReportWF_8_Fragment;
|
||||||
import org.deke.risk.riskahead.helper.IncidentReport;
|
import org.deke.risk.riskahead.helper.IncidentReport;
|
||||||
import org.deke.risk.riskahead.helper.AppConfig;
|
import org.deke.risk.riskahead.helper.AppConfig;
|
||||||
import org.deke.risk.riskahead.helper.AppController;
|
import org.deke.risk.riskahead.helper.AppController;
|
||||||
@@ -42,7 +46,9 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_2_Fragment.OnInputFinishedListener, ReportWF_3_Fragment.OnInputFinishedListener, ReportWF_4_Fragment.OnInputFinishedListener {
|
public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragment.OnInputFinishedListener, ReportWF_2_Fragment.OnInputFinishedListener, ReportWF_3_Fragment.OnInputFinishedListener
|
||||||
|
,ReportWF_4_Fragment.OnInputFinishedListener, ReportWF_5_Fragment.OnInputFinishedListener,ReportWF_6_Fragment.OnInputFinishedListener
|
||||||
|
,ReportWF_7_Fragment.OnInputFinishedListener, ReportWF_8_Fragment.OnInputFinishedListener {
|
||||||
|
|
||||||
private final static String mActivityTitle = "Report Incident";
|
private final static String mActivityTitle = "Report Incident";
|
||||||
private final static String TAG = ReportWFActivity.class.getSimpleName();
|
private final static String TAG = ReportWFActivity.class.getSimpleName();
|
||||||
@@ -53,6 +59,10 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
private Fragment frag_report_2 = new ReportWF_2_Fragment();
|
private Fragment frag_report_2 = new ReportWF_2_Fragment();
|
||||||
private Fragment frag_report_3 = new ReportWF_3_Fragment();
|
private Fragment frag_report_3 = new ReportWF_3_Fragment();
|
||||||
private Fragment frag_report_4 = new ReportWF_4_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 BootstrapButton btnContinue;
|
private BootstrapButton btnContinue;
|
||||||
private BootstrapButton btnReportNow;
|
private BootstrapButton btnReportNow;
|
||||||
@@ -75,8 +85,10 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
fragList.add(frag_report_2);
|
fragList.add(frag_report_2);
|
||||||
fragList.add(frag_report_3);
|
fragList.add(frag_report_3);
|
||||||
fragList.add(frag_report_4);
|
fragList.add(frag_report_4);
|
||||||
|
fragList.add(frag_report_5);
|
||||||
initFragment(currentState);
|
fragList.add(frag_report_6);
|
||||||
|
fragList.add(frag_report_7);
|
||||||
|
fragList.add(frag_report_8);
|
||||||
|
|
||||||
btnContinue = (BootstrapButton) findViewById(R.id.btn_reportwf_next);
|
btnContinue = (BootstrapButton) findViewById(R.id.btn_reportwf_next);
|
||||||
btnContinue.setVisibility(View.INVISIBLE);
|
btnContinue.setVisibility(View.INVISIBLE);
|
||||||
@@ -160,6 +172,8 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
public void setIncident(IncidentReport newIncident){
|
public void setIncident(IncidentReport newIncident){
|
||||||
if(!resetSignal){
|
if(!resetSignal){
|
||||||
incident = newIncident;
|
incident = newIncident;
|
||||||
|
Gson gson = new Gson();
|
||||||
|
Log.d(this.getActivityName(),"Set Incident with CurrentState: "+currentState+" / Details: "+gson.toJson(incident));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +188,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
transaction.commit();
|
transaction.commit();
|
||||||
|
|
||||||
if(state > 1) btnReportNow.setVisibility(View.VISIBLE);
|
if(state > 1) btnReportNow.setVisibility(View.VISIBLE);
|
||||||
|
if(state == fragList.size()-1) btnReportNow.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -187,7 +202,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
@Override
|
@Override
|
||||||
public void onInputFinished(boolean finished) {
|
public void onInputFinished(boolean finished) {
|
||||||
if(finished) {
|
if(finished) {
|
||||||
btnContinue.setVisibility(View.VISIBLE);
|
if(currentState < fragList.size()-1) btnContinue.setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
findViewById(R.id.atvStatus).setVisibility(View.VISIBLE);
|
||||||
}else{
|
}else{
|
||||||
btnContinue.setVisibility(View.INVISIBLE);
|
btnContinue.setVisibility(View.INVISIBLE);
|
||||||
@@ -228,7 +243,7 @@ public class ReportWFActivity extends BaseActivity implements ReportWF_1_Fragmen
|
|||||||
if(pos != null) modifiyPos(pos);
|
if(pos != null) modifiyPos(pos);
|
||||||
|
|
||||||
currentState = mPrefs.getInt("currentState",0);
|
currentState = mPrefs.getInt("currentState",0);
|
||||||
if(currentState != 0) initFragment(currentState);
|
initFragment(currentState);
|
||||||
|
|
||||||
navDrawer.setSelection(reportAvtivityID, false);
|
navDrawer.setSelection(reportAvtivityID, false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,17 +60,31 @@ public class ReportWF_4_Fragment extends Fragment {
|
|||||||
suspectWeapon = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_4_weapon);
|
suspectWeapon = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_4_weapon);
|
||||||
suspectWeaponEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_4_weapon_etc);
|
suspectWeaponEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_4_weapon_etc);
|
||||||
|
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
suspectWeapon.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
suspectWeapon.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
switch (position) {
|
switch (position) {
|
||||||
|
case COMMON_OBJECTS:
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case FIREARM:
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case EXPLOSIONS:
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case MIL:
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC:
|
||||||
|
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
case DONTKNOW:
|
case DONTKNOW:
|
||||||
suspectWeaponEtcInput.setVisibility(View.INVISIBLE);
|
suspectWeaponEtcInput.setVisibility(View.INVISIBLE);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
suspectWeaponEtcInput.setVisibility(View.VISIBLE);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
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_5_Fragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
|
private final static int SINGLE_PERSON = 1;
|
||||||
|
private final static int SMALL_GROUP = 2;
|
||||||
|
private final static int BIG_GROUP = 3;
|
||||||
|
private final static int ETC = 4;
|
||||||
|
private final static int DONTKNOW = 5;
|
||||||
|
|
||||||
|
private View viewFragment;
|
||||||
|
|
||||||
|
private Spinner suspectCount;
|
||||||
|
private EditText suspectCountEtcInput;
|
||||||
|
|
||||||
|
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_5, container, false);
|
||||||
|
|
||||||
|
initInputElements();
|
||||||
|
setMainSpinnerValues(R.array.cat_suspect_count);
|
||||||
|
|
||||||
|
return viewFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initInputElements() {
|
||||||
|
suspectCount = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_5_count);
|
||||||
|
suspectCountEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_5_count_etc);
|
||||||
|
|
||||||
|
suspectCountEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
suspectCount.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case SINGLE_PERSON:
|
||||||
|
suspectCountEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case SMALL_GROUP:
|
||||||
|
suspectCountEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case BIG_GROUP:
|
||||||
|
suspectCountEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC:
|
||||||
|
suspectCountEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case DONTKNOW:
|
||||||
|
suspectCountEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidSuspectCountCategory(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);
|
||||||
|
suspectCount.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkIfFinished(){
|
||||||
|
boolean isMainCategoryFilled = false;
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
isMainCategoryFilled = (suspectCount.getSelectedItemPosition() > 0) && (incident.getFidSuspectCountCategory() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCallback.onInputFinished(isMainCategoryFilled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
if(incident.getFidSuspectCountCategory() != 0) suspectCount.setSelection(incident.getFidSuspectCountCategory());
|
||||||
|
if(incident.getEtcSuspectCountCategory() != null && !incident.getEtcSuspectCountCategory().equals("")) suspectCountEtcInput.setText(incident.getEtcSuspectCountCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
incident.setFidSuspectCountCategory(suspectCount.getSelectedItemPosition());
|
||||||
|
incident.setEtcSuspectCountCategory(suspectCountEtcInput.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
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.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_6_Fragment extends Fragment {
|
||||||
|
|
||||||
|
private final static int WOMEN = 1;
|
||||||
|
private final static int CHILDREN = 2;
|
||||||
|
private final static int MEN = 3;
|
||||||
|
private final static int ANIMALS = 4;
|
||||||
|
private final static int INFRASTRUCTURE = 5;
|
||||||
|
|
||||||
|
private View viewFragment;
|
||||||
|
|
||||||
|
private Spinner victimType;
|
||||||
|
|
||||||
|
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_6, container, false);
|
||||||
|
|
||||||
|
initInputElements();
|
||||||
|
setMainSpinnerValues(R.array.cat_victim);
|
||||||
|
|
||||||
|
return viewFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initInputElements() {
|
||||||
|
victimType = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_6_victim);
|
||||||
|
|
||||||
|
victimType.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case WOMEN:
|
||||||
|
break;
|
||||||
|
case CHILDREN:
|
||||||
|
break;
|
||||||
|
case MEN:
|
||||||
|
break;
|
||||||
|
case ANIMALS:
|
||||||
|
break;
|
||||||
|
case INFRASTRUCTURE:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidVictimCategory(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);
|
||||||
|
victimType.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkIfFinished(){
|
||||||
|
boolean isMainCategoryFilled = false;
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
isMainCategoryFilled = (victimType.getSelectedItemPosition() > 0) && (incident.getFidVictimCategory() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCallback.onInputFinished(isMainCategoryFilled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
if(incident.getFidVictimCategory() != 0) victimType.setSelection(incident.getFidVictimCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
incident.setFidVictimCategory(victimType.getSelectedItemPosition());
|
||||||
|
|
||||||
|
((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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
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_7_Fragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
|
private final static int LOCAL = 1;
|
||||||
|
private final static int TOURIST = 2;
|
||||||
|
private final static int FOREIGNER = 3;
|
||||||
|
private final static int ETC = 4;
|
||||||
|
private final static int DONTKNOW = 5;
|
||||||
|
|
||||||
|
private View viewFragment;
|
||||||
|
|
||||||
|
private Spinner victimOrigin;
|
||||||
|
private EditText victimOriginEtcInput;
|
||||||
|
|
||||||
|
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_7, container, false);
|
||||||
|
|
||||||
|
initInputElements();
|
||||||
|
setMainSpinnerValues(R.array.cat_victim_origin);
|
||||||
|
|
||||||
|
return viewFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initInputElements() {
|
||||||
|
victimOrigin = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_7_victimorigin);
|
||||||
|
victimOriginEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_7_victimorigin_etc);
|
||||||
|
|
||||||
|
victimOriginEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
victimOrigin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case LOCAL:
|
||||||
|
victimOriginEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case TOURIST:
|
||||||
|
victimOriginEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case FOREIGNER:
|
||||||
|
victimOriginEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC:
|
||||||
|
victimOriginEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
case DONTKNOW:
|
||||||
|
victimOriginEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidVictimCategory(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);
|
||||||
|
victimOrigin.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkIfFinished(){
|
||||||
|
boolean isMainCategoryFilled = false;
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
isMainCategoryFilled = (victimOrigin.getSelectedItemPosition() > 0) && (incident.getFidVictimOriginCategory() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCallback.onInputFinished(isMainCategoryFilled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
if(incident.getFidVictimOriginCategory() != 0) victimOrigin.setSelection(incident.getFidVictimOriginCategory());
|
||||||
|
if(incident.getEtcVictimOriginCategory() != null && !incident.getEtcVictimOriginCategory().equals("")) victimOriginEtcInput.setText(incident.getEtcVictimOriginCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
incident.setFidVictimOriginCategory(victimOrigin.getSelectedItemPosition());
|
||||||
|
incident.setEtcVictimOriginCategory(victimOriginEtcInput.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,317 @@
|
|||||||
|
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_8_Fragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
|
private final static int FEET = 1;
|
||||||
|
private final static int MOTORBIKE = 2;
|
||||||
|
private final static int CAR = 3;
|
||||||
|
private final static int BUS = 4;
|
||||||
|
private final static int TANK = 5;
|
||||||
|
private final static int PLANE = 6;
|
||||||
|
private final static int ETC_1 = 7;
|
||||||
|
|
||||||
|
private final static int RELIGION = 1;
|
||||||
|
private final static int ETHNICS = 2;
|
||||||
|
private final static int POLITICS = 3;
|
||||||
|
private final static int SOCIAL_GROUP = 4;
|
||||||
|
private final static int JOB = 5;
|
||||||
|
private final static int LANGUAGE = 6;
|
||||||
|
private final static int ETC_2 = 7;
|
||||||
|
|
||||||
|
private final static int MEN = 1;
|
||||||
|
private final static int WOMEN = 2;
|
||||||
|
private final static int CHILDREN = 3;
|
||||||
|
private final static int ANIMALS = 4;
|
||||||
|
private final static int ETC_3 = 5;
|
||||||
|
|
||||||
|
private View viewFragment;
|
||||||
|
|
||||||
|
private Spinner suspectVehicle;
|
||||||
|
private EditText suspectVehicleEtcInput;
|
||||||
|
|
||||||
|
private Spinner victimAffiliation;
|
||||||
|
private EditText victimAffiliationEtcInput;
|
||||||
|
|
||||||
|
private Spinner suspectRecongnition;
|
||||||
|
private EditText suspectRecongnitionEtcInput;
|
||||||
|
|
||||||
|
private EditText moreEtcInput;
|
||||||
|
|
||||||
|
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_7, container, false);
|
||||||
|
|
||||||
|
initSuspectVehicleInputElements();
|
||||||
|
setSuspectVehicleMainSpinnerValues(R.array.cat_details_vehicle);
|
||||||
|
|
||||||
|
initVictimAffiliationInputElements();
|
||||||
|
setVictimAffiliationMainSpinnerValues(R.array.cat_details_victimaff);
|
||||||
|
|
||||||
|
initSuspectRecognitionInputElements();
|
||||||
|
setSuspectRecognitionMainSpinnerValues(R.array.cat_details_suspect_recon);
|
||||||
|
|
||||||
|
moreEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_8_etc);
|
||||||
|
|
||||||
|
return viewFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSuspectVehicleInputElements() {
|
||||||
|
suspectVehicle = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_8_suspectvehicle);
|
||||||
|
suspectVehicleEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_8_suspectvehicle);
|
||||||
|
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
suspectVehicle.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case FEET:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case MOTORBIKE:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case CAR:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case BUS:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case TANK:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case PLANE:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC_1:
|
||||||
|
suspectVehicleEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidSuspectTransportationCategory(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parentView) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSuspectVehicleMainSpinnerValues(int stringId){
|
||||||
|
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
suspectVehicle.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initVictimAffiliationInputElements() {
|
||||||
|
victimAffiliation = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_8_victimaff);
|
||||||
|
victimAffiliationEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_8_victimaff);
|
||||||
|
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
victimAffiliation.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case RELIGION:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETHNICS:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case POLITICS:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case SOCIAL_GROUP:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case JOB:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case LANGUAGE:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC_2:
|
||||||
|
victimAffiliationEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidVictimBelongingCategory(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parentView) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setVictimAffiliationMainSpinnerValues(int stringId){
|
||||||
|
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
victimAffiliation.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSuspectRecognitionInputElements() {
|
||||||
|
suspectRecongnition = (Spinner) viewFragment.findViewById(R.id.dd_reportwf_8_recon);
|
||||||
|
suspectRecongnitionEtcInput = (EditText) viewFragment.findViewById(R.id.txt_reportwf_8_recon);
|
||||||
|
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
|
||||||
|
suspectRecongnition.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
|
||||||
|
switch (position) {
|
||||||
|
case MEN:
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case WOMEN:
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case CHILDREN:
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ANIMALS:
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.INVISIBLE);
|
||||||
|
break;
|
||||||
|
case ETC_3:
|
||||||
|
suspectRecongnitionEtcInput.setVisibility(View.VISIBLE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (position > 0) {
|
||||||
|
incident.setFidSuspectCharacteristicsCategory(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNothingSelected(AdapterView<?> parentView) {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSuspectRecognitionMainSpinnerValues(int stringId){
|
||||||
|
ArrayAdapter<CharSequence> adapter_main_1 = ArrayAdapter.createFromResource(getActivity(), stringId, android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
suspectRecongnition.setAdapter(new SpinnerHintAdapter(adapter_main_1, R.layout.contact_spinner_row_nothing_selected, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIfFinished(){
|
||||||
|
boolean isSuspectVehicleFilled = false;
|
||||||
|
boolean isVictimAffiliationFilled = false;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCallback.onInputFinished(isSuspectVehicleFilled && isVictimAffiliationFilled && isSuspectRecoginitionFilled);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
incident = ((ReportWFActivity)getActivity()).getIncident();
|
||||||
|
|
||||||
|
if(incident != null){
|
||||||
|
if(incident.getFidSuspectTransportationCategory() != 0) suspectVehicle.setSelection(incident.getFidSuspectTransportationCategory());
|
||||||
|
if(incident.getEtcSuspectTransportationCategory() != null && !incident.getEtcSuspectTransportationCategory().equals("")) suspectVehicleEtcInput.setText(incident.getEtcSuspectTransportationCategory());
|
||||||
|
|
||||||
|
if(incident.getFidVictimBelongingCategory() != 0) victimAffiliation.setSelection(incident.getFidVictimBelongingCategory());
|
||||||
|
if(incident.getEtcVictimBelongingCategory() != null && !incident.getEtcVictimBelongingCategory().equals("")) victimAffiliationEtcInput.setText(incident.getEtcVictimBelongingCategory());
|
||||||
|
|
||||||
|
if(incident.getFidSuspectCharacteristicsCategory() != 0) suspectRecongnition.setSelection(incident.getFidSuspectCharacteristicsCategory());
|
||||||
|
if(incident.getEtcSuspectCharacteristicsCategory() != null && !incident.getEtcSuspectCharacteristicsCategory().equals("")) suspectRecongnitionEtcInput.setText(incident.getEtcSuspectCharacteristicsCategory());
|
||||||
|
|
||||||
|
if(incident.getEtcOthersCategory() != null && !incident.getEtcOthersCategory().equals("")) moreEtcInput.setText(incident.getEtcOthersCategory());
|
||||||
|
}
|
||||||
|
|
||||||
|
checkIfFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
incident.setFidVictimOriginCategory(suspectVehicle.getSelectedItemPosition());
|
||||||
|
incident.setEtcVictimOriginCategory(suspectVehicleEtcInput.getText().toString());
|
||||||
|
|
||||||
|
incident.setFidVictimBelongingCategory(victimAffiliation.getSelectedItemPosition());
|
||||||
|
incident.setEtcVictimBelongingCategory(victimAffiliationEtcInput.getText().toString());
|
||||||
|
|
||||||
|
incident.setFidSuspectCharacteristicsCategory(suspectRecongnition.getSelectedItemPosition());
|
||||||
|
incident.setEtcSuspectCharacteristicsCategory(suspectRecongnitionEtcInput.getText().toString());
|
||||||
|
|
||||||
|
incident.setEtcOthersCategory(moreEtcInput.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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
57
app/src/main/res/layout/fragment_reportwf_5.xml
Normal file
57
app/src/main/res/layout/fragment_reportwf_5.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_5_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_count"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_5_count"
|
||||||
|
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_5_count_etc"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
50
app/src/main/res/layout/fragment_reportwf_6.xml
Normal file
50
app/src/main/res/layout/fragment_reportwf_6.xml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<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_6_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_victim"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_6_victim"
|
||||||
|
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" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
57
app/src/main/res/layout/fragment_reportwf_7.xml
Normal file
57
app/src/main/res/layout/fragment_reportwf_7.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_7_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_count"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_7_victimorigin"
|
||||||
|
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_7_victimorigin_etc"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
167
app/src/main/res/layout/fragment_reportwf_8.xml
Normal file
167
app/src/main/res/layout/fragment_reportwf_8.xml
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<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">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lbl_reportwf_8_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_etc"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutSubContent1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lbl_reportwf_8_question_1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:text="@string/lbl_question_etc_vehicle"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_8_suspectvehicle"
|
||||||
|
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_8_suspectvehicle"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutSubContent2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lbl_reportwf_8_question_2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:text="@string/lbl_question_etc_victimaff"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_8_victimaff"
|
||||||
|
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_8_victimaff"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutSubContent3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lbl_reportwf_8_question_3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:text="@string/lbl_question_etc_recon"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:id="@+id/dd_reportwf_8_recon"
|
||||||
|
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_8_recon"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutSubContent4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:animateLayoutChanges="true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/lbl_reportwf_8_question_4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:text="@string/lbl_question_etc_etc"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
|
android:textColor="@color/bg_common" />
|
||||||
|
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:hint="@string/cat_hint"
|
||||||
|
android:id="@+id/txt_reportwf_8_etc"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
@@ -132,10 +132,12 @@
|
|||||||
<string name="lbl_question_victim">Wer ist betroffen?</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_victimorigin">Kommen die Opfer aus der Umgebung?</string>
|
||||||
<string name="lbl_question_etc">Weißt du noch mehr?</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_vehicle">Mit was sind sie unterwegs?</string>
|
||||||
<string name="lbl_question_etc_victimaff">Weißt du noch mehr?</string>
|
<string name="lbl_question_etc_victimaff">Haben die Opfer etwas gemeinsam?</string>
|
||||||
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
||||||
<string name="lbl_question_etc_etc">Weiteres?</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">
|
<string-array name="cat_situation_main">
|
||||||
<item>Allgemeiner Vorfall/Situation</item>
|
<item>Allgemeiner Vorfall/Situation</item>
|
||||||
|
|||||||
@@ -134,8 +134,8 @@
|
|||||||
<string name="lbl_question_victim">Wer ist betroffen?</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_victimorigin">Kommen die Opfer aus der Umgebung?</string>
|
||||||
<string name="lbl_question_etc">Weißt du noch mehr?</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_vehicle">Mit was sind sie unterwegs?</string>
|
||||||
<string name="lbl_question_etc_victimaff">Weißt du noch mehr?</string>
|
<string name="lbl_question_etc_victimaff">Haben die Opfer etwas gemeinsam?</string>
|
||||||
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
<string name="lbl_question_etc_recon">Wie erkennt man die Täter?</string>
|
||||||
<string name="lbl_question_etc_etc">Weiteres?</string>
|
<string name="lbl_question_etc_etc">Weiteres?</string>
|
||||||
<string name="cat_hint">Weitere Details...</string>
|
<string name="cat_hint">Weitere Details...</string>
|
||||||
@@ -300,4 +300,7 @@
|
|||||||
<item>Sonstiges…</item>
|
<item>Sonstiges…</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user