Commit 60f887ebc0c34a16652190f4a86d729ddb1ccc79

Authored by kristinlaahneolsen
2 parents db85426c bf51a036

Merge branch 'Kristin_setUpActivitiesAndAdapters' into master_application

Risiko/.idea/misc.xml
... ... @@ -24,7 +24,7 @@
24 24 </value>
25 25 </option>
26 26 </component>
27   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  27 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
28 28 <output url="file://$PROJECT_DIR$/build/classes" />
29 29 </component>
30 30 <component name="ProjectType">
... ...
Risiko/.idea/vcs.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <project version="4">
3 3 <component name="VcsDirectoryMappings">
4   - <mapping directory="$PROJECT_DIR$" vcs="Git" />
  4 + <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5 5 </component>
6 6 </project>
7 7 \ No newline at end of file
... ...
Risiko/app/build.gradle
... ... @@ -16,6 +16,10 @@ android {
16 16 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 17 }
18 18 }
  19 + compileOptions {
  20 + targetCompatibility 1.8
  21 + sourceCompatibility 1.8
  22 + }
19 23 }
20 24  
21 25 dependencies {
... ...
Risiko/app/src/main/AndroidManifest.xml
... ... @@ -20,7 +20,9 @@
20 20 <activity android:name="activity.Activities" />
21 21 <activity android:name="activity.Events" />
22 22 <activity android:name="activity.NewEvent" />
23   - <activity android:name="activity.NewEvaluation"></activity>
  23 + <activity android:name="activity.NewEvaluation" />
  24 + <activity android:name="activity.Evaluations" />
  25 + <activity android:name="activity.SequenceOfActivities"></activity>
24 26 </application>
25 27  
26 28 </manifest>
27 29 \ No newline at end of file
... ...
Risiko/app/src/main/java/activity/Activities.java
1 1 package activity;
2 2  
  3 +import android.content.Intent;
3 4 import android.support.v7.app.AppCompatActivity;
4 5 import android.os.Bundle;
5 6 import android.view.View;
... ... @@ -14,7 +15,7 @@ import dataclasses.Activity;
14 15  
15 16 public class Activities extends AppCompatActivity {
16 17 ListView lv;
17   - int chosenActivityId;
  18 + String chosenActivity;
18 19  
19 20 @Override
20 21 protected void onCreate(Bundle savedInstanceState) {
... ... @@ -32,19 +33,22 @@ public class Activities extends AppCompatActivity {
32 33 }
33 34  
34 35  
35   -
36   -
37   -
38 36 private void insertActivities(List<Activity> activities) {
39 37 lv = (ListView) findViewById(R.id.lv_activities);
40 38 lv.setAdapter(new ListAdapterActivities(this, activities));
41 39 lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
42 40 @Override
43 41 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
44   - chosenActivityId = ((Activity) lv.getItemAtPosition(position)).getId();
45   - //DOSOMETHING
46   -
  42 + chosenActivity = ((Activity) lv.getItemAtPosition(position)).getNameOfActivity();
  43 + goToChosenActivity();
47 44 }
48 45 });
49 46 }
  47 +
  48 +
  49 + private void goToChosenActivity() {
  50 + Intent intent = new Intent(this, Evaluations.class);
  51 + intent.putExtra("NAME_OF_CHOSEN_ACTIVITY", chosenActivity);
  52 + startActivity(intent);
  53 + }
50 54 }
... ...
Risiko/app/src/main/java/activity/Evaluations.java 0 → 100644
  1 +package activity;
  2 +
  3 +import android.content.Intent;
  4 +import android.graphics.Color;
  5 +import android.graphics.Typeface;
  6 +import android.support.v7.app.AlertDialog;
  7 +import android.support.v7.app.AppCompatActivity;
  8 +import android.os.Bundle;
  9 +import android.text.TextUtils;
  10 +import android.view.LayoutInflater;
  11 +import android.view.View;
  12 +import android.widget.AdapterView;
  13 +import android.widget.Button;
  14 +import android.widget.EditText;
  15 +import android.widget.ListView;
  16 +import android.widget.TextView;
  17 +
  18 +import com.risiko.risiko.R;
  19 +
  20 +import java.util.ArrayList;
  21 +import java.util.List;
  22 +
  23 +import adapters.ListAdapterEvaluations;
  24 +
  25 +import dataclasses.Evaluation;
  26 +
  27 +public class Evaluations extends AppCompatActivity {
  28 + ListView lv;
  29 + String chosenEvaluation;
  30 + TextView consequence;
  31 + Button addNewEvaluation;
  32 +
  33 + @Override
  34 + protected void onCreate(Bundle savedInstanceState) {
  35 + super.onCreate(savedInstanceState);
  36 + setContentView(R.layout.activity_evaluations);
  37 +
  38 + addNewEvaluation = findViewById(R.id.btn_add_new_evaluation);
  39 + addNewEvaluation.setOnClickListener(view -> startActivity(new Intent(this, NewEvaluation.class)));
  40 +
  41 + //TODO Bytte ut Mockdata på sikt
  42 + ArrayList<Evaluation> evaluationList= new ArrayList<>();
  43 + evaluationList.add(new Evaluation("Tråkke over", "Skade foten", "Velge riktig skotøy", "Ufarlig", "Stor"));
  44 + evaluationList.add(new Evaluation("Falle i elva", "Blir våt", "Ikke gjør det", "Ufarlig", "Liten"));
  45 + insertEvaluations(evaluationList);
  46 + }
  47 +
  48 +
  49 + private void insertEvaluations(List<Evaluation> evaluations) {
  50 + lv = (ListView) findViewById(R.id.lv_evaluations);
  51 + lv.setAdapter(new ListAdapterEvaluations(this, evaluations));
  52 + lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  53 + @Override
  54 + public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
  55 + chosenEvaluation = ((Evaluation) lv.getItemAtPosition(position)).getHeadline();
  56 + showEvaluationPopup();
  57 + }
  58 + });
  59 + }
  60 +
  61 + private void showEvaluationPopup() {
  62 +
  63 + LayoutInflater layoutInflater = LayoutInflater.from(this);
  64 + View promptView = layoutInflater.inflate(R.layout.popup_evaluation, null);
  65 + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
  66 + alertDialogBuilder.setView(promptView);
  67 +
  68 + //TODO FINNE EN MÅTE Å KNYTTE SAMMEN POPUP MED DET ELEMENTET SOM
  69 + Evaluation evaluati = new Evaluation("Tråkke over", "Skade foten", "Velge riktig skotøy", "Ufarlig", "Middels");
  70 +
  71 +
  72 +
  73 + TextView headline = promptView.findViewById(R.id.pop_headline);
  74 + TextView outcome = promptView.findViewById(R.id.pop_possible_outcomes);
  75 + TextView measures = promptView.findViewById(R.id.pop_measures);
  76 + TextView consequenceHarmless = promptView.findViewById(R.id.pop_consequence_harmless);
  77 + TextView consequenceModerate = promptView.findViewById(R.id.pop_consequence_moderate);
  78 + TextView consequenceSevere = promptView.findViewById(R.id.pop_consequence_severe);
  79 + TextView probabilityLow = promptView.findViewById(R.id.pop_probability_low);
  80 + TextView probabilityMedium = promptView.findViewById(R.id.pop_probability_medium);
  81 + TextView probabilityHigh = promptView.findViewById(R.id.pop_probability_high);
  82 +
  83 +
  84 + if (evaluati.getProbability().equals("Stor")) {
  85 + probabilityHigh.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  86 + probabilityHigh.setTypeface(Typeface.DEFAULT_BOLD);
  87 + } else if(evaluati.getProbability().equals("Middels")) {
  88 + probabilityMedium.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  89 + probabilityMedium.setTypeface(Typeface.DEFAULT_BOLD);
  90 + } else {
  91 + probabilityLow.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  92 + probabilityLow.setTypeface(Typeface.DEFAULT_BOLD);
  93 + }
  94 +
  95 +
  96 + if (evaluati.getConsequence().equals("Ufarlig")) {
  97 + consequenceHarmless.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  98 + consequenceHarmless.setTypeface(Typeface.DEFAULT_BOLD);
  99 + } else if(evaluati.getConsequence().equals("Moderat")) {
  100 + consequenceModerate.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  101 + consequenceModerate.setTypeface(Typeface.DEFAULT_BOLD);
  102 + } else {
  103 + consequenceSevere.setTextColor(getResources().getColor(R.color.colorDarkGreen));
  104 + consequenceSevere.setTypeface(Typeface.DEFAULT_BOLD);
  105 + }
  106 +
  107 +
  108 + headline.setText(evaluati.getHeadline());
  109 + outcome.setText("- " + evaluati.getPossibleOutcomes());
  110 + measures.setText("- " + evaluati.getMeasures());
  111 +
  112 +
  113 + alertDialogBuilder.setCancelable(false)
  114 + .setNegativeButton(getString(R.string.cancel),
  115 + (dialog, id) -> dialog.cancel());
  116 + AlertDialog alert = alertDialogBuilder.create();
  117 +
  118 + alert.show();
  119 +
  120 +
  121 + }
  122 +
  123 +}
... ...
Risiko/app/src/main/java/activity/Events.java
1 1 package activity;
2 2  
  3 +import android.support.v7.app.AlertDialog;
3 4 import android.support.v7.app.AppCompatActivity;
4 5 import android.os.Bundle;
  6 +import android.view.LayoutInflater;
5 7 import android.view.View;
6 8 import android.widget.AdapterView;
7 9 import android.widget.ListView;
... ... @@ -45,9 +47,26 @@ public class Events extends AppCompatActivity {
45 47 @Override
46 48 public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
47 49 chosenEventId = ((Event) lv.getItemAtPosition(position)).getId();
48   - //DOSOMETHING
  50 + showEventPopup();
49 51  
50 52 }
51 53 });
52 54 }
53   -}
  55 +
  56 + private void showEventPopup() {
  57 + LayoutInflater layoutInflater = LayoutInflater.from(this);
  58 + View promptView = layoutInflater.inflate(R.layout.popup_event, null);
  59 + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
  60 + alertDialogBuilder.setView(promptView);
  61 +
  62 + alertDialogBuilder.setCancelable(false)
  63 + .setNegativeButton(getString(R.string.cancel),
  64 + (dialog, id) -> dialog.cancel());
  65 + AlertDialog alert = alertDialogBuilder.create();
  66 +
  67 + alert.show();
  68 +
  69 + }
  70 + }
  71 +
  72 +
... ...
Risiko/app/src/main/java/activity/MainMenu.java
... ... @@ -11,37 +11,23 @@ import com.risiko.risiko.R;
11 11 public class MainMenu extends AppCompatActivity {
12 12 Button toActivityList;
13 13 Button toEventList;
  14 + Button toSequences;
  15 + Button toNewEvent;
14 16  
15 17 @Override
16 18 protected void onCreate(Bundle savedInstanceState) {
17 19 super.onCreate(savedInstanceState);
18 20 setContentView(R.layout.activity_main_menu);
  21 +
19 22 toActivityList = findViewById(R.id.btn_to_activitylist);
20   - toActivityList.setOnClickListener(new View.OnClickListener() {
21   - @Override
22   - public void onClick(View view) {
23   - toActivityListEvent();
24   - }
25   - });
26   -
27   -
28   - toActivityList = findViewById(R.id.btn_to_events);
29   - toActivityList.setOnClickListener(new View.OnClickListener() {
30   - @Override
31   - public void onClick(View view) {
32   - toEventListEvent();
33   - }
34   - });
35   -}
  23 + toActivityList.setOnClickListener(view -> startActivity(new Intent(this, Activities.class)));
36 24  
  25 + toEventList = findViewById(R.id.btn_to_events);
  26 + toEventList.setOnClickListener(view -> startActivity(new Intent(this, Events.class)));
37 27  
38   - public void toActivityListEvent(){
39   - Intent intent = new Intent(this, Activities.class);
40   - startActivity(intent);
41   - }
  28 + toNewEvent = findViewById(R.id.btn_to_new_event);
  29 + toNewEvent.setOnClickListener(view -> startActivity(new Intent(this, NewEvent.class)));
42 30  
43   - public void toEventListEvent(){
44   - Intent intent = new Intent(this, Events.class);
45   - startActivity(intent);
46 31 }
  32 +
47 33 }
... ...
Risiko/app/src/main/java/activity/NewEvaluation.java
... ... @@ -2,6 +2,8 @@ package activity;
2 2  
3 3 import android.support.v7.app.AppCompatActivity;
4 4 import android.os.Bundle;
  5 +import android.widget.ArrayAdapter;
  6 +import android.widget.Spinner;
5 7  
6 8 import com.risiko.risiko.R;
7 9  
... ... @@ -11,5 +13,15 @@ public class NewEvaluation extends AppCompatActivity {
11 13 protected void onCreate(Bundle savedInstanceState) {
12 14 super.onCreate(savedInstanceState);
13 15 setContentView(R.layout.activity_new_evaluation);
  16 +
  17 + Spinner consequenceSpinner = (Spinner) findViewById(R.id.spinner_consequence);
  18 + ArrayAdapter<CharSequence> consequenceAdapter = ArrayAdapter.createFromResource(this, R.array.consequence_array, android.R.layout.simple_spinner_item);
  19 + consequenceAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  20 + consequenceSpinner.setAdapter(consequenceAdapter);
  21 +
  22 + Spinner associatedRiskSpinner = (Spinner) findViewById(R.id.spinner_associated_risk);
  23 + ArrayAdapter<CharSequence> associatedRiskAdapter = ArrayAdapter.createFromResource(this, R.array.associated_risk_array, android.R.layout.simple_spinner_item);
  24 + consequenceAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  25 + associatedRiskSpinner.setAdapter(associatedRiskAdapter);
14 26 }
15 27 }
... ...
Risiko/app/src/main/java/activity/SequenceOfActivities.java 0 → 100644
  1 +package activity;
  2 +
  3 +import android.support.v7.app.AppCompatActivity;
  4 +import android.os.Bundle;
  5 +
  6 +import com.risiko.risiko.R;
  7 +
  8 +public class SequenceOfActivities extends AppCompatActivity {
  9 +
  10 + @Override
  11 + protected void onCreate(Bundle savedInstanceState) {
  12 + super.onCreate(savedInstanceState);
  13 + setContentView(R.layout.activity_sequence_of_activities);
  14 + }
  15 +}
... ...
Risiko/app/src/main/java/adapters/ListAdapterEvaluations.java 0 → 100644
  1 +package adapters;
  2 +
  3 +import android.content.Context;
  4 +import android.support.annotation.NonNull;
  5 +import android.view.LayoutInflater;
  6 +import android.view.View;
  7 +import android.view.ViewGroup;
  8 +import android.widget.ArrayAdapter;
  9 +import android.widget.TextView;
  10 +import com.risiko.risiko.R;
  11 +import java.util.List;
  12 +import dataclasses.Evaluation;
  13 +
  14 +public class ListAdapterEvaluations extends ArrayAdapter<Evaluation> {
  15 +
  16 + public ListAdapterEvaluations(@NonNull Context context, List<Evaluation> evaluations) {
  17 + super(context, R.layout.activity_evaluations, evaluations);
  18 + }
  19 +
  20 + @NonNull
  21 + @Override
  22 + public View getView(int position, View convertView, @NonNull ViewGroup parent) {
  23 + Evaluation evaluation = getItem(position);
  24 + if (convertView == null) {
  25 + convertView = LayoutInflater.from(getContext()).inflate(R.layout.evaluationlist, parent, false);
  26 + }
  27 +
  28 + TextView evaluationHeadline = convertView.findViewById(R.id.tv_headline);
  29 + evaluationHeadline.setText(evaluation.getHeadline());
  30 +
  31 + TextView probability = convertView.findViewById(R.id.tv_probability);
  32 + probability.setText(evaluation.getProbability());
  33 +
  34 + TextView consequence = convertView.findViewById(R.id.tv_consequence);
  35 + consequence.setText(evaluation.getConsequence());
  36 +
  37 + return convertView;
  38 + }
  39 +
  40 +}
  41 +
  42 +
  43 +
... ...
Risiko/app/src/main/java/dataclasses/Evaluation.java 0 → 100644
  1 +package dataclasses;
  2 +
  3 +/**
  4 + * Created by kristinlaahneolsen on 25.09.2018.
  5 + */
  6 +
  7 +public class Evaluation {
  8 + String headline;
  9 + String possibleOutcomes;
  10 + String measures;
  11 + String consequence;
  12 + String probability;
  13 +
  14 + public Evaluation() {
  15 + }
  16 +
  17 +
  18 + public Evaluation(String headline, String possibleOutcomes, String measures, String consequence, String probability) {
  19 + this.headline = headline;
  20 + this.possibleOutcomes = possibleOutcomes;
  21 + this.measures = measures;
  22 + this.consequence = consequence;
  23 + this.probability = probability;
  24 + }
  25 +
  26 +
  27 + public String getHeadline() {
  28 + return headline;
  29 + }
  30 +
  31 + public void setHeadline(String headline) {
  32 + this.headline = headline;
  33 + }
  34 +
  35 + public String getMeasures() {
  36 + return measures;
  37 + }
  38 +
  39 + public void setMeasures(String measures) {
  40 + this.measures = measures;
  41 + }
  42 +
  43 + public String getConsequence() {
  44 + return consequence;
  45 + }
  46 +
  47 + public void setConsequence(String consequence) {
  48 + this.consequence = consequence;
  49 + }
  50 +
  51 + public String getProbability() {
  52 + return probability;
  53 + }
  54 +
  55 + public void setProbability(String probability) {
  56 + this.probability = probability;
  57 + }
  58 +
  59 + public String getPossibleOutcomes() {
  60 + return possibleOutcomes;
  61 + }
  62 +
  63 + public void setPossibleOutcomes(String possibleOutcomes) {
  64 + this.possibleOutcomes = possibleOutcomes;
  65 + }
  66 +}
... ...
Risiko/app/src/main/res/layout/activity_evaluations.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:id="@+id/root"
  6 + android:layout_width="match_parent"
  7 + android:layout_height="match_parent">
  8 +
  9 + <TextView
  10 + android:id="@+id/tv_nameOfActivity"
  11 + android:layout_width="wrap_content"
  12 + android:layout_height="wrap_content"
  13 + android:text="Overskrift på aktivitet"
  14 + android:textStyle="bold"
  15 + android:textSize="25dp"
  16 + app:layout_constraintLeft_toLeftOf="parent"
  17 + app:layout_constraintRight_toRightOf="parent"
  18 + app:layout_constraintTop_toTopOf="parent"
  19 + android:layout_marginTop="25dp"/>
  20 +
  21 + <Button
  22 + android:id="@+id/btn_add_new_evaluation"
  23 + android:layout_width="match_parent"
  24 + android:layout_height="wrap_content"
  25 + android:layout_marginHorizontal="25dp"
  26 + android:text="@string/add_evaluation"
  27 + app:layout_constraintLeft_toLeftOf="parent"
  28 + app:layout_constraintRight_toRightOf="parent"
  29 + app:layout_constraintTop_toBottomOf="@id/tv_nameOfActivity"/>
  30 +
  31 + <TextView
  32 + android:layout_width="wrap_content"
  33 + android:layout_height="wrap_content"
  34 + android:text="@string/all_evaluations"
  35 + android:textStyle="bold"
  36 + app:layout_constraintLeft_toLeftOf="parent"
  37 + app:layout_constraintRight_toRightOf="parent"
  38 + app:layout_constraintTop_toBottomOf="@id/btn_add_new_evaluation"/>
  39 +
  40 + <android.support.constraint.ConstraintLayout
  41 + android:layout_width="match_parent"
  42 + android:layout_height="match_parent"
  43 + android:layout_marginTop="120dp">
  44 +
  45 +
  46 + <android.support.v4.widget.SwipeRefreshLayout
  47 + xmlns:android="http://schemas.android.com/apk/res/android"
  48 + android:id="@+id/swiperefresh"
  49 + android:layout_width="match_parent"
  50 + android:layout_height="match_parent">
  51 +
  52 +
  53 + <LinearLayout
  54 + android:layout_width="match_parent"
  55 + android:layout_height="match_parent"
  56 + android:orientation="vertical">
  57 +
  58 + <ListView
  59 + android:id="@+id/lv_evaluations"
  60 + android:layout_margin="10dp"
  61 + android:layout_width="match_parent"
  62 + android:layout_height="match_parent">
  63 + </ListView>
  64 +
  65 + </LinearLayout>
  66 + </android.support.v4.widget.SwipeRefreshLayout>
  67 +
  68 + </android.support.constraint.ConstraintLayout>
  69 +
  70 +</android.support.constraint.ConstraintLayout>
  71 +
... ...
Risiko/app/src/main/res/layout/activity_new_evaluation.xml
... ... @@ -10,6 +10,7 @@
10 10 android:layout_width="match_parent"
11 11 android:layout_height="match_parent"
12 12 android:orientation="vertical"
  13 +
13 14 android:layout_margin="15dp">
14 15  
15 16  
... ... @@ -18,40 +19,46 @@
18 19 android:layout_height="wrap_content"
19 20 android:text="Ny vurdering"
20 21 android:textSize="25dp"
21   - android:textStyle="bold"
22   - app:layout_constraintTop_toTopOf="parent"/>
  22 + android:textStyle="bold"/>
23 23  
24 24  
25 25 <EditText
  26 + android:layout_marginVertical="10dp"
26 27 android:layout_width="match_parent"
27 28 android:layout_height="wrap_content"
28 29 android:hint="Tittel:"
29 30 android:inputType="text"/>
30 31  
31 32 <EditText
  33 + android:layout_marginVertical="10dp"
32 34 android:layout_width="match_parent"
33 35 android:layout_height="wrap_content"
34 36 android:hint="Mulig utfall:"
35 37 android:inputType="text"/>
36 38  
37 39 <EditText
  40 + android:layout_marginVertical="10dp"
38 41 android:layout_width="match_parent"
39 42 android:layout_height="wrap_content"
40 43 android:hint="Tiltak:"
41 44 android:inputType="text"/>
42 45  
43 46 <LinearLayout
  47 + android:padding="10dp"
  48 + android:background="@color/colorLightGray"
44 49 android:layout_marginVertical="25dp"
45 50 android:layout_width="match_parent"
46 51 android:layout_height="wrap_content"
47 52 android:orientation="horizontal">
48 53  
49 54 <TextView
50   -
  55 + android:layout_marginEnd="20dp"
51 56 android:id="@+id/tv_consequence"
52 57 android:layout_width="wrap_content"
53 58 android:layout_height="wrap_content"
54   - android:text="Konsekvens" />
  59 + android:text="@string/consequence"
  60 + android:textStyle="bold"
  61 + android:textSize="17sp"/>
55 62  
56 63 <Spinner
57 64 android:id="@+id/spinner_consequence"
... ... @@ -61,17 +68,20 @@
61 68 </LinearLayout>
62 69  
63 70 <LinearLayout
64   -
  71 + android:padding="10dp"
  72 + android:background="@color/colorLightGray"
65 73 android:layout_width="match_parent"
66 74 android:layout_height="wrap_content"
67 75 android:orientation="horizontal">
68 76  
69 77 <TextView
70   -
  78 + android:layout_marginEnd="20dp"
71 79 android:id="@+id/tv_associated_risk"
72 80 android:layout_width="wrap_content"
73 81 android:layout_height="wrap_content"
74   - android:text="Sannsynlighet" />
  82 + android:textSize="17sp"
  83 + android:textStyle="bold"
  84 + android:text="@string/probability" />
75 85  
76 86 <Spinner
77 87 android:id="@+id/spinner_associated_risk"
... ... @@ -81,7 +91,9 @@
81 91 </LinearLayout>
82 92  
83 93 <Button
84   - android:layout_width="wrap_content"
  94 + android:layout_marginTop="30dp"
  95 + android:layout_gravity="center"
  96 + android:layout_width="150dp"
85 97 android:layout_height="wrap_content"
86 98 android:text="Legg til "/>
87 99  
... ...
Risiko/app/src/main/res/layout/activity_new_event.xml
... ... @@ -43,10 +43,14 @@
43 43 android:layout_width="match_parent"
44 44 android:layout_height="wrap_content"
45 45 android:hint="Beskrivelse:"
46   - android:inputType="text"/>
  46 + android:minLines="2"
  47 + android:maxLines="5"
  48 + android:inputType="textMultiLine"/>
47 49  
48 50 <LinearLayout
49   - android:layout_marginVertical="25dp"
  51 + android:padding="10dp"
  52 + android:background="@color/colorLightGray"
  53 + android:layout_marginVertical="35dp"
50 54 android:layout_width="match_parent"
51 55 android:layout_height="wrap_content"
52 56 android:orientation="horizontal">
... ... @@ -66,7 +70,7 @@
66 70 </LinearLayout>
67 71  
68 72 <Button
69   -
  73 + android:layout_gravity="center"
70 74 android:layout_width="wrap_content"
71 75 android:layout_height="wrap_content"
72 76 android:text="Lagre hendelse"/>
... ...
Risiko/app/src/main/res/layout/activity_sequence_of_activities.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:layout_width="match_parent"
  6 + android:layout_height="match_parent"
  7 + tools:context="com.risiko.risiko.activity.SequenceOfActivities">
  8 +
  9 +</android.support.constraint.ConstraintLayout>
... ...
Risiko/app/src/main/res/layout/evaluationlist.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent"
  5 + android:layout_margin="20dp"
  6 + android:orientation="vertical">
  7 +
  8 + <LinearLayout
  9 + android:layout_width="match_parent"
  10 + android:layout_height="wrap_content"
  11 + android:orientation="horizontal">
  12 +
  13 +
  14 + <TextView
  15 + android:id="@+id/tv_headline"
  16 + android:layout_width="wrap_content"
  17 + android:layout_height="wrap_content"
  18 + android:layout_marginBottom="10dp"
  19 + android:text="Navn på vurdering"
  20 + android:textSize="20dp" />
  21 +
  22 + <ImageView
  23 + android:layout_width="35dp"
  24 + android:layout_height="35dp"
  25 + android:background="@drawable/ic_arrow_right" />
  26 +
  27 + </LinearLayout>
  28 +
  29 + <LinearLayout
  30 + android:layout_width="match_parent"
  31 + android:layout_height="wrap_content"
  32 + android:orientation="horizontal">
  33 +
  34 + <TextView
  35 + android:id="@+id/tv_probability"
  36 + android:layout_width="wrap_content"
  37 + android:layout_height="wrap_content"
  38 + android:text="@string/sannsynlighet" />
  39 +
  40 + <TextView
  41 + android:layout_width="wrap_content"
  42 + android:layout_height="wrap_content"
  43 + android:text=" , " />
  44 +
  45 +
  46 + <TextView
  47 + android:id="@+id/tv_consequence"
  48 + android:layout_width="wrap_content"
  49 + android:layout_height="wrap_content"
  50 + android:text="@string/konsekvens" />
  51 + </LinearLayout>
  52 +
  53 +</LinearLayout>
0 54 \ No newline at end of file
... ...
Risiko/app/src/main/res/layout/popup_evaluation.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="vertical"
  6 + android:padding="10dp">
  7 +
  8 + <TextView
  9 + android:id="@+id/pop_headline"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:padding="10dp"
  13 + android:text="@string/evaluation_headline"
  14 + android:textAlignment="center"
  15 + android:textAppearance="?android:attr/textAppearanceMedium"
  16 + android:textStyle="bold"
  17 + android:background="@color/colorLightGreen"/>
  18 +
  19 + <TextView
  20 + android:layout_width="wrap_content"
  21 + android:layout_height="wrap_content"
  22 + android:padding="10dp"
  23 + android:text="@string/possible_outcomes"
  24 + android:textStyle="bold"
  25 + android:textSize="15dp"/>
  26 +
  27 +
  28 + <TextView
  29 + android:id="@+id/pop_possible_outcomes"
  30 + android:layout_width="wrap_content"
  31 + android:layout_height="wrap_content"
  32 + android:padding="10dp"
  33 + android:text=" ...."/>
  34 +
  35 +
  36 + <TextView
  37 + android:layout_width="wrap_content"
  38 + android:layout_height="wrap_content"
  39 + android:padding="10dp"
  40 + android:text="@string/measures"
  41 + android:textStyle="bold"
  42 + android:textSize="15dp"/>
  43 +
  44 +
  45 + <TextView
  46 + android:id="@+id/pop_measures"
  47 + android:layout_width="wrap_content"
  48 + android:layout_height="wrap_content"
  49 + android:padding="10dp"
  50 + android:text="...."/>
  51 +
  52 +
  53 + <TextView
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:padding="10dp"
  57 + android:text="@string/consequence"
  58 + android:textStyle="bold"
  59 + android:textSize="15dp"/>
  60 +
  61 +
  62 + <TextView
  63 + android:id="@+id/pop_consequence_harmless"
  64 + android:layout_width="wrap_content"
  65 + android:layout_height="wrap_content"
  66 + android:padding="10dp"
  67 + android:text="@string/harmless"/>
  68 +
  69 + <TextView
  70 + android:id="@+id/pop_consequence_moderate"
  71 + android:layout_width="wrap_content"
  72 + android:layout_height="wrap_content"
  73 + android:padding="10dp"
  74 + android:text="@string/moderate"/>
  75 +
  76 + <TextView
  77 + android:id="@+id/pop_consequence_severe"
  78 + android:layout_width="wrap_content"
  79 + android:layout_height="wrap_content"
  80 + android:padding="10dp"
  81 + android:text="@string/severe"/>
  82 +
  83 + <TextView
  84 + android:layout_width="wrap_content"
  85 + android:layout_height="wrap_content"
  86 + android:padding="10dp"
  87 + android:text="@string/probability"
  88 + android:textStyle="bold"
  89 + android:textSize="15dp"/>
  90 +
  91 +
  92 + <TextView
  93 + android:id="@+id/pop_probability_low"
  94 + android:layout_width="wrap_content"
  95 + android:layout_height="wrap_content"
  96 + android:padding="10dp"
  97 + android:text="@string/low"/>
  98 +
  99 + <TextView
  100 + android:id="@+id/pop_probability_medium"
  101 + android:layout_width="wrap_content"
  102 + android:layout_height="wrap_content"
  103 + android:padding="10dp"
  104 + android:text="@string/medium"/>
  105 +
  106 + <TextView
  107 + android:id="@+id/pop_probability_high"
  108 + android:layout_width="wrap_content"
  109 + android:layout_height="wrap_content"
  110 + android:padding="10dp"
  111 + android:text="@string/high"/>
  112 +
  113 +
  114 +</LinearLayout>
0 115 \ No newline at end of file
... ...
Risiko/app/src/main/res/layout/popup_event.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="wrap_content"
  5 + android:orientation="vertical"
  6 + android:padding="10dp">
  7 +
  8 + <TextView
  9 + android:id="@+id/pop_event_headline"
  10 + android:layout_width="match_parent"
  11 + android:layout_height="wrap_content"
  12 + android:padding="10dp"
  13 + android:text="@string/event_headline"
  14 + android:textAlignment="center"
  15 + android:textAppearance="?android:attr/textAppearanceMedium"
  16 + android:textStyle="bold"
  17 + android:background="@color/colorLightGreen"/>
  18 +
  19 + <LinearLayout
  20 + android:layout_width="match_parent"
  21 + android:layout_height="wrap_content"
  22 + android:orientation="horizontal">
  23 +
  24 + <TextView
  25 + android:layout_width="wrap_content"
  26 + android:layout_height="wrap_content"
  27 + android:text="@string/date"
  28 + android:textStyle="bold"
  29 + android:padding="15dp"/>
  30 +
  31 + <TextView
  32 + android:id="@+id/pop_date"
  33 + android:layout_width="wrap_content"
  34 + android:layout_height="wrap_content"
  35 + android:text="..."/>
  36 +
  37 + </LinearLayout>
  38 +
  39 +
  40 + <LinearLayout
  41 + android:layout_width="match_parent"
  42 + android:layout_height="wrap_content"
  43 + android:orientation="horizontal">
  44 +
  45 + <TextView
  46 + android:layout_width="wrap_content"
  47 + android:layout_height="wrap_content"
  48 + android:text="@string/place"
  49 + android:textStyle="bold"
  50 + android:padding="15dp"/>
  51 +
  52 + <TextView
  53 + android:id="@+id/pop_place"
  54 + android:layout_width="wrap_content"
  55 + android:layout_height="wrap_content"
  56 + android:text="..."/>
  57 +
  58 + </LinearLayout>
  59 +
  60 + <LinearLayout
  61 + android:layout_width="match_parent"
  62 + android:layout_height="wrap_content"
  63 + android:orientation="horizontal">
  64 +
  65 + <TextView
  66 + android:layout_width="wrap_content"
  67 + android:layout_height="wrap_content"
  68 + android:text="@string/description"
  69 + android:textStyle="bold"
  70 + android:padding="15dp"/>
  71 +
  72 + <TextView
  73 + android:id="@+id/pop_description"
  74 + android:layout_width="wrap_content"
  75 + android:layout_height="wrap_content"
  76 + android:text="..."/>
  77 +
  78 + </LinearLayout>
  79 +
  80 + <LinearLayout
  81 + android:layout_width="match_parent"
  82 + android:layout_height="wrap_content"
  83 + android:orientation="horizontal">
  84 +
  85 + <TextView
  86 + android:layout_width="wrap_content"
  87 + android:layout_height="wrap_content"
  88 + android:text="@string/associated_risk"
  89 + android:textStyle="bold"
  90 + android:padding="15dp"/>
  91 +
  92 + <TextView
  93 + android:id="@+id/pop_associated_risk"
  94 + android:layout_width="wrap_content"
  95 + android:layout_height="wrap_content"
  96 + android:text="..."/>
  97 +
  98 + </LinearLayout>
  99 +
  100 +
  101 +
  102 +
  103 +</LinearLayout>
0 104 \ No newline at end of file
... ...
Risiko/app/src/main/res/layout/spinner_item.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:layout_width="match_parent"
  4 + android:layout_height="match_parent">
  5 +
  6 + <TextView
  7 + android:layout_width="wrap_content"
  8 + android:layout_height="wrap_content"
  9 + android:text="TEST"
  10 + android:textSize="30dp"/>
  11 +
  12 +</LinearLayout>
... ...
Risiko/app/src/main/res/values/array.xml 0 → 100644
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 +
  4 + <string-array name="consequence_array">
  5 + <item>Ufarlig</item>
  6 + <item>Moderate</item>
  7 + <item>Alvorlig</item>
  8 + </string-array>
  9 +
  10 + <string-array name="associated_risk_array">
  11 + <item>Lav</item>
  12 + <item>Middels</item>
  13 + <item>Stor</item>
  14 + </string-array>
  15 +
  16 +
  17 +</resources>
... ...
Risiko/app/src/main/res/values/colors.xml
... ... @@ -3,4 +3,7 @@
3 3 <color name="colorPrimary">#3F51B5</color>
4 4 <color name="colorPrimaryDark">#303F9F</color>
5 5 <color name="colorAccent">#FF4081</color>
  6 + <color name="colorLightGreen">#e2ffe2</color>
  7 + <color name="colorDarkGreen">#0f7c44</color>
  8 + <color name="colorLightGray">#E0E0E0</color>
6 9 </resources>
... ...
Risiko/app/src/main/res/values/strings.xml
1 1 <resources>
2 2 <string name="app_name">Risiko</string>
  3 + <string name="sannsynlighet">Sannsynlighet</string>
  4 + <string name="konsekvens">Konsekvens</string>
  5 + <string name="add_evaluation">Legg til vurdering +</string>
  6 + <string name="all_evaluations">Alle vurderinger:</string>
  7 + <string name="ok" />
  8 + <string name="evaluation_headline">Tittel på vurdering</string>
  9 + <string name="possible_outcomes">Mulige utfall</string>
  10 + <string name="measures">Tiltak</string>
  11 + <string name="consequence">Konsekvens</string>
  12 + <string name="probability">Sannsynlighet</string>
  13 + <string name="low">Lav</string>
  14 + <string name="medium">Middels</string>
  15 + <string name="high">Stor</string>
  16 + <string name="harmless">Ufarlig</string>
  17 + <string name="moderate">Moderat</string>
  18 + <string name="severe">Alvorlig</string>
  19 + <string name="cancel">Lukk</string>
  20 + <string name="event_headline">Tittel på hendelse</string>
  21 + <string name="date">Dato:</string>
  22 + <string name="place">Sted:</string>
  23