Commit bae1962893785e0f8b4250d71560154b3cc408ad

Authored by kristinlaahneolsen
1 parent 93b94e8c

Har laget en egen toolbar til appen, slik at brukervennligheten skulle få et opp…

…løst. Hovedsaklig var det en hjem-knapp som jeg følte appen manglet, slik at brukere lett kan komme seg tilbake til hovedmeny uansett hvor han/hun er i appen. Har laget klar en logg-ut-knapp også mtp samme formål om økt brukervennlighet. I tillegg har jeg laget mockdata til en dropdown-liste som skal brukes i forbindelse med konfidensialitetskravet i oppgave. Det skal tilby en mulighet for at man kan velge å lare noen hendelser på en slik måte at disse kun kan leses av en bestemt helsepersonellgruppe
Risiko/app/src/main/AndroidManifest.xml
... ... @@ -10,7 +10,7 @@
10 10 android:label="@string/app_name"
11 11 android:roundIcon="@mipmap/ic_launcher_round"
12 12 android:supportsRtl="true"
13   - android:theme="@style/risikoTheme">
  13 + android:theme="@style/AppTheme">
14 14 <activity android:name="activity.MainPage">
15 15 <intent-filter>
16 16 <action android:name="android.intent.action.MAIN" />
... ...
Risiko/app/src/main/java/activity/Activities.java
... ... @@ -3,8 +3,13 @@ package activity;
3 3 import android.content.Intent;
4 4 import android.support.v7.app.AppCompatActivity;
5 5 import android.os.Bundle;
  6 +import android.support.v7.widget.Toolbar;
6 7 import android.util.Log;
  8 +import android.view.Menu;
  9 +import android.view.MenuItem;
7 10 import android.widget.ListView;
  11 +import android.widget.Toast;
  12 +
8 13 import com.risiko.risiko.R;
9 14  
10 15 import java.util.ArrayList;
... ... @@ -23,6 +28,8 @@ public class Activities extends AppCompatActivity {
23 28 protected void onCreate(Bundle savedInstanceState) {
24 29 super.onCreate(savedInstanceState);
25 30 setContentView(R.layout.activity_activities);
  31 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  32 + setSupportActionBar(myToolbar);
26 33  
27 34  
28 35 /* //TODO Bytte ut Mockdata på sikt
... ... @@ -72,4 +79,31 @@ public class Activities extends AppCompatActivity {
72 79 intent.putExtra("ID_OF_CHOSEN_ACTIVITY", activityId);
73 80 startActivity(intent);
74 81 }
  82 +
  83 + @Override
  84 + public boolean onCreateOptionsMenu (Menu menu) {
  85 + getMenuInflater().inflate(R.menu.main, menu);
  86 + return true;
  87 + }
  88 +
  89 + @Override
  90 + public boolean onOptionsItemSelected(MenuItem item) {
  91 + switch (item.getItemId()) {
  92 + case R.id.action_logout:
  93 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  94 + Toast.makeText(Activities.this, "Logger ut",
  95 + Toast.LENGTH_LONG).show();
  96 + return true;
  97 +
  98 + case R.id.action_home:
  99 + Intent intent = new Intent(this, MainMenu.class);
  100 + startActivity(intent);
  101 + return true;
  102 +
  103 + default:
  104 + return super.onOptionsItemSelected(item);
  105 +
  106 + }
  107 + }
  108 +
75 109 }
... ...
Risiko/app/src/main/java/activity/EditIncident.java
... ... @@ -3,7 +3,10 @@ package activity;
3 3 import android.content.Intent;
4 4 import android.os.Bundle;
5 5 import android.support.v7.app.AppCompatActivity;
  6 +import android.support.v7.widget.Toolbar;
6 7 import android.util.Log;
  8 +import android.view.Menu;
  9 +import android.view.MenuItem;
7 10 import android.widget.ArrayAdapter;
8 11 import android.widget.Button;
9 12 import android.widget.EditText;
... ... @@ -34,6 +37,9 @@ public class EditIncident extends AppCompatActivity {
34 37 protected void onCreate(Bundle savedInstanceState) {
35 38 super.onCreate(savedInstanceState);
36 39 setContentView(R.layout.activity_edit_incident);
  40 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  41 + setSupportActionBar(myToolbar);
  42 +
37 43 Intent intent = getIntent();
38 44 Bundle b = intent.getExtras();
39 45 String id = b.getString("chosenEventId");
... ... @@ -140,6 +146,33 @@ public class EditIncident extends AppCompatActivity {
140 146 return evalMap;
141 147 }
142 148  
  149 + @Override
  150 + public boolean onCreateOptionsMenu (Menu menu) {
  151 + getMenuInflater().inflate(R.menu.main, menu);
  152 + return true;
  153 + }
  154 +
  155 + @Override
  156 + public boolean onOptionsItemSelected(MenuItem item) {
  157 + switch (item.getItemId()) {
  158 + case R.id.action_logout:
  159 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  160 + Toast.makeText(EditIncident.this, "Logger ut",
  161 + Toast.LENGTH_LONG).show();
  162 + return true;
  163 +
  164 + case R.id.action_home:
  165 + Intent intent = new Intent(this, MainMenu.class);
  166 + startActivity(intent);
  167 + return true;
  168 +
  169 + default:
  170 + return super.onOptionsItemSelected(item);
  171 +
  172 + }
  173 + }
  174 +
  175 +
143 176 }
144 177  
145 178  
... ...
Risiko/app/src/main/java/activity/Evaluations.java
... ... @@ -6,12 +6,16 @@ import android.graphics.Typeface;
6 6 import android.support.v7.app.AlertDialog;
7 7 import android.support.v7.app.AppCompatActivity;
8 8 import android.os.Bundle;
  9 +import android.support.v7.widget.Toolbar;
9 10 import android.util.Log;
10 11 import android.view.LayoutInflater;
  12 +import android.view.Menu;
  13 +import android.view.MenuItem;
11 14 import android.view.View;
12 15 import android.widget.Button;
13 16 import android.widget.ListView;
14 17 import android.widget.TextView;
  18 +import android.widget.Toast;
15 19  
16 20 import com.risiko.risiko.R;
17 21  
... ... @@ -38,6 +42,9 @@ public class Evaluations extends AppCompatActivity {
38 42 protected void onCreate(Bundle savedInstanceState) {
39 43 super.onCreate(savedInstanceState);
40 44 setContentView(R.layout.activity_evaluations);
  45 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  46 + setSupportActionBar(myToolbar);
  47 +
41 48  
42 49 dbs = new DatabaseSource(this);
43 50  
... ... @@ -196,4 +203,31 @@ public class Evaluations extends AppCompatActivity {
196 203 .show();
197 204 }
198 205  
  206 + @Override
  207 + public boolean onCreateOptionsMenu (Menu menu) {
  208 + getMenuInflater().inflate(R.menu.main, menu);
  209 + return true;
  210 + }
  211 +
  212 + @Override
  213 + public boolean onOptionsItemSelected(MenuItem item) {
  214 + switch (item.getItemId()) {
  215 + case R.id.action_logout:
  216 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  217 + Toast.makeText(Evaluations.this, "Logger ut",
  218 + Toast.LENGTH_LONG).show();
  219 + return true;
  220 +
  221 + case R.id.action_home:
  222 + Intent intent = new Intent(this, MainMenu.class);
  223 + startActivity(intent);
  224 + return true;
  225 +
  226 + default:
  227 + return super.onOptionsItemSelected(item);
  228 +
  229 + }
  230 + }
  231 +
  232 +
199 233 }
... ...
Risiko/app/src/main/java/activity/Incident.java
... ... @@ -5,13 +5,17 @@ import android.content.Intent;
5 5 import android.support.v7.app.AlertDialog;
6 6 import android.support.v7.app.AppCompatActivity;
7 7 import android.os.Bundle;
  8 +import android.support.v7.widget.Toolbar;
8 9 import android.util.Log;
9 10 import android.view.LayoutInflater;
  11 +import android.view.Menu;
  12 +import android.view.MenuItem;
10 13 import android.view.View;
11 14 import android.widget.Button;
12 15 import android.widget.EditText;
13 16 import android.widget.ListView;
14 17 import android.widget.TextView;
  18 +import android.widget.Toast;
15 19  
16 20 import com.risiko.risiko.R;
17 21  
... ... @@ -37,6 +41,10 @@ public class Incident extends AppCompatActivity {
37 41 super.onCreate(savedInstanceState);
38 42 setContentView(R.layout.activity_incidents);
39 43  
  44 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  45 + setSupportActionBar(myToolbar);
  46 +
  47 +
40 48 dbs = new DatabaseSource(this);
41 49  
42 50 // ArrayList<dataclasses.Incident> incidentList = new ArrayList<>();
... ... @@ -171,4 +179,31 @@ public class Incident extends AppCompatActivity {
171 179 .setNegativeButton(R.string.no, null)
172 180 .show();
173 181 }
  182 +
  183 + @Override
  184 + public boolean onCreateOptionsMenu (Menu menu) {
  185 + getMenuInflater().inflate(R.menu.main, menu);
  186 + return true;
  187 + }
  188 +
  189 + @Override
  190 + public boolean onOptionsItemSelected(MenuItem item) {
  191 + switch (item.getItemId()) {
  192 + case R.id.action_logout:
  193 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  194 + Toast.makeText(Incident.this, "Logger ut",
  195 + Toast.LENGTH_LONG).show();
  196 + return true;
  197 +
  198 + case R.id.action_home:
  199 + Intent intent = new Intent(this, MainMenu.class);
  200 + startActivity(intent);
  201 + return true;
  202 +
  203 + default:
  204 + return super.onOptionsItemSelected(item);
  205 +
  206 + }
  207 + }
  208 +
174 209 }
... ...
Risiko/app/src/main/java/activity/MainMenu.java
... ... @@ -4,8 +4,10 @@ import android.content.Intent;
4 4 import android.support.v7.app.AppCompatActivity;
5 5 import android.os.Bundle;
6 6 import android.support.v7.widget.Toolbar;
  7 +import android.view.Menu;
  8 +import android.view.MenuItem;
7 9 import android.widget.Button;
8   -import android.widget.TextView;
  10 +import android.widget.Toast;
9 11  
10 12 import com.risiko.risiko.R;
11 13  
... ... @@ -15,23 +17,53 @@ public class MainMenu extends AppCompatActivity {
15 17 Button toSequences;
16 18 Button toNewEvent;
17 19  
  20 +
18 21 @Override
19 22 protected void onCreate(Bundle savedInstanceState) {
20 23 super.onCreate(savedInstanceState);
21 24 setContentView(R.layout.activity_main_menu);
22 25  
  26 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  27 + setSupportActionBar(myToolbar);
  28 +
  29 +
23 30 toActivityList = findViewById(R.id.btn_to_activitylist);
24   - toActivityList.setOnClickListener(view -> startActivity(new Intent(this, Activities.class)));
  31 + toActivityList.setOnClickListener(newview -> startActivity(new Intent(this, Activities.class)));
25 32  
26 33 toSequences= findViewById(R.id.btn_to_sequense_of_activities);
27   - toSequences.setOnClickListener(view -> startActivity(new Intent(this, SequenceOfActivities.class)));
  34 + toSequences.setOnClickListener(newview -> startActivity(new Intent(this, SequenceOfActivities.class)));
28 35  
29 36 toEventList = findViewById(R.id.btn_to_events);
30   - toEventList.setOnClickListener(view -> startActivity(new Intent(this, Incident.class)));
  37 + toEventList.setOnClickListener(newview -> startActivity(new Intent(this, Incident.class)));
31 38  
32 39 toNewEvent = findViewById(R.id.btn_to_new_event);
33   - toNewEvent.setOnClickListener(view -> startActivity(new Intent(this, NewIncident.class)));
  40 + toNewEvent.setOnClickListener(newview -> startActivity(new Intent(this, NewIncident.class)));
  41 +
  42 + }
  43 +
  44 + @Override
  45 + public boolean onCreateOptionsMenu (Menu menu) {
  46 + getMenuInflater().inflate(R.menu.main, menu);
  47 + return true;
  48 + }
  49 +
  50 + @Override
  51 + public boolean onOptionsItemSelected(MenuItem item) {
  52 + switch (item.getItemId()) {
  53 + case R.id.action_logout:
  54 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  55 + return true;
  56 +
  57 + case R.id.action_home:
  58 + Toast.makeText(MainMenu.this, "Du er på appens hovedside",
  59 + Toast.LENGTH_LONG).show();
  60 + return true;
  61 +
  62 + default:
  63 +
  64 + return super.onOptionsItemSelected(item);
34 65  
  66 + }
35 67 }
36 68  
37 69 }
... ...
Risiko/app/src/main/java/activity/NewEvaluation.java
... ... @@ -3,10 +3,14 @@ package activity;
3 3 import android.content.Intent;
4 4 import android.support.v7.app.AppCompatActivity;
5 5 import android.os.Bundle;
  6 +import android.support.v7.widget.Toolbar;
  7 +import android.view.Menu;
  8 +import android.view.MenuItem;
6 9 import android.widget.ArrayAdapter;
7 10 import android.widget.Button;
8 11 import android.widget.EditText;
9 12 import android.widget.Spinner;
  13 +import android.widget.Toast;
10 14  
11 15 import com.risiko.risiko.R;
12 16  
... ... @@ -31,6 +35,9 @@ public class NewEvaluation extends AppCompatActivity {
31 35 protected void onCreate(Bundle savedInstanceState) {
32 36 super.onCreate(savedInstanceState);
33 37 setContentView(R.layout.activity_new_evaluation);
  38 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  39 + setSupportActionBar(myToolbar);
  40 +
34 41  
35 42 Intent intent = getIntent();
36 43 String activityId = intent.getStringExtra("ID_OF_CHOSEN_ACTIVITY");
... ... @@ -110,4 +117,31 @@ public class NewEvaluation extends AppCompatActivity {
110 117 if (etNewEvalOutcome.getText().toString().isEmpty()) return false;
111 118 return true;
112 119 }
  120 +
  121 + @Override
  122 + public boolean onCreateOptionsMenu (Menu menu) {
  123 + getMenuInflater().inflate(R.menu.main, menu);
  124 + return true;
  125 + }
  126 +
  127 + @Override
  128 + public boolean onOptionsItemSelected(MenuItem item) {
  129 + switch (item.getItemId()) {
  130 + case R.id.action_logout:
  131 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  132 + Toast.makeText(NewEvaluation.this, "Logger ut",
  133 + Toast.LENGTH_LONG).show();
  134 + return true;
  135 +
  136 + case R.id.action_home:
  137 + Intent intent = new Intent(this, MainMenu.class);
  138 + startActivity(intent);
  139 + return true;
  140 +
  141 + default:
  142 + return super.onOptionsItemSelected(item);
  143 +
  144 + }
  145 + }
  146 +
113 147 }
... ...
Risiko/app/src/main/java/activity/NewIncident.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;
  6 +import android.support.v7.widget.Toolbar;
5 7 import android.util.Log;
  8 +import android.view.Menu;
  9 +import android.view.MenuItem;
6 10 import android.widget.ArrayAdapter;
7 11 import android.widget.Button;
8 12 import android.widget.EditText;
... ... @@ -30,11 +34,15 @@ public class NewIncident extends AppCompatActivity {
30 34 private Spinner spinnerAssociatedRisk;
31 35 private Button btnNewIncident;
32 36 private DatabaseSource dbs;
  37 + private Spinner spinnerReadAccess;
33 38  
34 39 @Override
35 40 protected void onCreate(Bundle savedInstanceState) {
36 41 super.onCreate(savedInstanceState);
37 42 setContentView(R.layout.activity_new_incident);
  43 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  44 + setSupportActionBar(myToolbar);
  45 +
38 46  
39 47 etDate = findViewById(R.id.et_newIncident_date);
40 48 etLocation = findViewById(R.id.et_newIncident_location);
... ... @@ -44,6 +52,19 @@ public class NewIncident extends AppCompatActivity {
44 52 dbs = new DatabaseSource(this);
45 53  
46 54 spinnerAssociatedRisk = findViewById(R.id.spinner_associated_risk);
  55 + spinnerReadAccess = findViewById(R.id.spinner_read_access);
  56 +
  57 + //TODO FJERN DENNE MIDLERTIDIGE DELEN FOR LESEAKSESS
  58 +
  59 + List<String> list = new ArrayList<>();
  60 + list.add("Sykepleiere");
  61 + list.add("Ambulansepersonell");
  62 + list.add("Leger");
  63 + ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(NewIncident.this, android.R.layout.simple_spinner_item, list);
  64 + adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
  65 + spinnerReadAccess.setAdapter(adapter2);
  66 +
  67 +
47 68 // dbs.getAllEvaluation(evaluations);
48 69  
49 70 Api.get().getAllEvaluations()
... ... @@ -127,4 +148,31 @@ public class NewIncident extends AppCompatActivity {
127 148 }
128 149 return evalMap;
129 150 }
  151 +
  152 + @Override
  153 + public boolean onCreateOptionsMenu (Menu menu) {
  154 + getMenuInflater().inflate(R.menu.main, menu);
  155 + return true;
  156 + }
  157 +
  158 + @Override
  159 + public boolean onOptionsItemSelected(MenuItem item) {
  160 + switch (item.getItemId()) {
  161 + case R.id.action_logout:
  162 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  163 + Toast.makeText(NewIncident.this, "Logger ut",
  164 + Toast.LENGTH_LONG).show();
  165 + return true;
  166 +
  167 + case R.id.action_home:
  168 + Intent intent = new Intent(this, MainMenu.class);
  169 + startActivity(intent);
  170 + return true;
  171 +
  172 + default:
  173 + return super.onOptionsItemSelected(item);
  174 +
  175 + }
  176 + }
  177 +
130 178 }
... ...
Risiko/app/src/main/java/activity/SequenceOfActivities.java
... ... @@ -4,11 +4,15 @@ import android.content.Intent;
4 4 import android.support.v7.app.AlertDialog;
5 5 import android.support.v7.app.AppCompatActivity;
6 6 import android.os.Bundle;
  7 +import android.support.v7.widget.Toolbar;
7 8 import android.view.LayoutInflater;
  9 +import android.view.Menu;
  10 +import android.view.MenuItem;
8 11 import android.view.View;
9 12 import android.widget.ArrayAdapter;
10 13 import android.widget.Button;
11 14 import android.widget.Spinner;
  15 +import android.widget.Toast;
12 16  
13 17 import com.risiko.risiko.R;
14 18  
... ... @@ -20,6 +24,10 @@ public class SequenceOfActivities extends AppCompatActivity {
20 24 super.onCreate(savedInstanceState);
21 25 setContentView(R.layout.activity_sequence_of_activities);
22 26  
  27 + Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
  28 + setSupportActionBar(myToolbar);
  29 +
  30 +
23 31 generateReport = findViewById(R.id.btn_generate_report);
24 32 generateReport.setOnClickListener(view -> reportDialog());
25 33  
... ... @@ -55,4 +63,31 @@ public class SequenceOfActivities extends AppCompatActivity {
55 63  
56 64 alert.show();
57 65 }
  66 +
  67 + @Override
  68 + public boolean onCreateOptionsMenu (Menu menu) {
  69 + getMenuInflater().inflate(R.menu.main, menu);
  70 + return true;
  71 + }
  72 +
  73 + @Override
  74 + public boolean onOptionsItemSelected(MenuItem item) {
  75 + switch (item.getItemId()) {
  76 + case R.id.action_logout:
  77 + //TODO: LEGG TIL LOGG-UT-FUNKSJON
  78 + Toast.makeText(SequenceOfActivities.this, "Logger ut",
  79 + Toast.LENGTH_LONG).show();
  80 + return true;
  81 +
  82 + case R.id.action_home:
  83 + Intent intent = new Intent(this, MainMenu.class);
  84 + startActivity(intent);
  85 + return true;
  86 +
  87 + default:
  88 + return super.onOptionsItemSelected(item);
  89 +
  90 + }
  91 + }
  92 +
58 93 }
... ...
Risiko/app/src/main/res/drawable/ic_home_24dp.xml 0 → 100644
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportWidth="24.0"
  5 + android:viewportHeight="24.0">
  6 + <path
  7 + android:fillColor="#ffffff"
  8 + android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/>
  9 +</vector>
... ...
Risiko/app/src/main/res/drawable/ic_logout_24dp.xml 0 → 100644
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportWidth="24.0"
  5 + android:viewportHeight="24.0">
  6 + <path
  7 + android:fillColor="#ffffff"
  8 + android:pathData="M13.5,5.5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM9.8,8.9L7,23h2.1l1.8,-8 2.1,2v6h2v-7.5l-2.1,-2 0.6,-3C14.8,12 16.8,13 19,13v-2c-1.9,0 -3.5,-1 -4.3,-2.4l-1,-1.6c-0.4,-0.6 -1,-1 -1.7,-1 -0.3,0 -0.5,0.1 -0.8,0.1L6,8.3V13h2V9.6l1.8,-0.7"/>
  9 +</vector>
... ...
Risiko/app/src/main/res/layout/activity_activities.xml
1 1 <?xml version="1.0" encoding="utf-8"?>
  2 +
2 3 <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 4 xmlns:app="http://schemas.android.com/apk/res-auto"
4 5 xmlns:tools="http://schemas.android.com/tools"
5 6 android:layout_width="match_parent"
6 7 android:layout_height="match_parent">
7 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
8 11 <TextView
  12 + android:id="@+id/headline"
9 13 android:layout_width="wrap_content"
10 14 android:layout_height="wrap_content"
11 15 android:text="Liste over aktivititeter"
... ... @@ -15,24 +19,28 @@
15 19 app:layout_constraintLeft_toLeftOf="parent"
16 20 app:layout_constraintRight_toRightOf="parent"
17 21 app:layout_constraintTop_toTopOf="parent"
18   - android:layout_marginTop="25dp"/>
  22 + android:layout_marginTop="70dp"
  23 + android:layout_marginBottom="100dp" />
19 24  
20 25  
21 26 <android.support.constraint.ConstraintLayout
  27 + app:layout_constraintTop_toBottomOf="@+id/headline"
22 28 android:layout_width="match_parent"
23 29 android:layout_height="match_parent"
24 30 android:layout_marginVertical="70dp"
25   - android:layout_marginHorizontal="20dp">
  31 + android:layout_marginBottom="20dp">
26 32  
27 33  
28 34 <android.support.v4.widget.SwipeRefreshLayout
29 35 xmlns:android="http://schemas.android.com/apk/res/android"
30 36 android:id="@+id/swiperefresh"
  37 + android:layout_marginTop="50dp"
31 38 android:layout_width="match_parent"
32 39 android:layout_height="match_parent">
33 40  
34 41  
35 42 <LinearLayout
  43 + android:layout_marginTop="200dp"
36 44 android:background="@color/colorWhite"
37 45 android:layout_width="match_parent"
38 46 android:layout_height="match_parent"
... ...
Risiko/app/src/main/res/layout/activity_edit_incident.xml
... ... @@ -6,19 +6,24 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.risiko.risiko.activity.EditIncident">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
9 11 <LinearLayout
10 12 android:layout_width="match_parent"
11 13 android:layout_height="match_parent"
12 14 android:orientation="vertical"
13 15 android:background="@color/colorWhite"
14 16 android:padding="10dp"
15   - android:layout_margin="15dp">
  17 + android:layout_marginTop="70dp"
  18 + android:layout_marginHorizontal="15dp"
  19 + android:layout_marginBottom="15dp">
16 20  
17 21  
18 22 <TextView
19 23 android:layout_width="match_parent"
20 24 android:layout_height="wrap_content"
21 25 android:text="Endre hendelse"
  26 + android:textColor="@color/colorPrimaryDark"
22 27 android:textSize="25dp"
23 28 android:textStyle="bold"
24 29 app:layout_constraintTop_toTopOf="parent"/>
... ...
Risiko/app/src/main/res/layout/activity_evaluations.xml
... ... @@ -6,6 +6,8 @@
6 6 android:layout_width="match_parent"
7 7 android:layout_height="match_parent">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
9 11 <TextView
10 12 android:id="@+id/tv_nameOfActivity"
11 13 android:layout_width="wrap_content"
... ...
Risiko/app/src/main/res/layout/activity_incidents.xml
... ... @@ -5,6 +5,8 @@
5 5 android:layout_width="match_parent"
6 6 android:layout_height="match_parent">
7 7  
  8 + <include layout="@layout/toolbar"/>
  9 +
8 10 <TextView
9 11 android:layout_width="wrap_content"
10 12 android:layout_height="wrap_content"
... ... @@ -15,20 +17,22 @@
15 17 app:layout_constraintLeft_toLeftOf="parent"
16 18 app:layout_constraintRight_toRightOf="parent"
17 19 app:layout_constraintTop_toTopOf="parent"
18   - android:layout_marginTop="25dp"
  20 + android:layout_marginTop="70dp"
19 21 android:layout_marginBottom="10dp"/>
20 22  
21 23  
22 24 <android.support.constraint.ConstraintLayout
23 25 android:layout_width="match_parent"
24 26 android:layout_height="match_parent"
25   - android:layout_marginVertical="70dp"
  27 + android:layout_marginTop="120dp"
  28 + android:layout_marginBottom="20dp"
26 29 android:layout_marginHorizontal="20dp">
27 30  
28 31  
29 32 <android.support.v4.widget.SwipeRefreshLayout
30 33 xmlns:android="http://schemas.android.com/apk/res/android"
31 34 android:id="@+id/swiperefresh"
  35 + android:layout_marginTop="40dp"
32 36 android:layout_width="match_parent"
33 37 android:layout_height="wrap_content">
34 38  
... ...
Risiko/app/src/main/res/layout/activity_main_menu.xml
... ... @@ -6,7 +6,11 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.risiko.risiko.activity.MainMenu">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
  11 +
9 12 <LinearLayout
  13 + android:layout_marginTop="?attr/actionBarSize"
10 14 android:layout_width="match_parent"
11 15 android:layout_height="match_parent"
12 16 android:orientation="vertical"
... ...
Risiko/app/src/main/res/layout/activity_main_page.xml
... ... @@ -8,7 +8,7 @@
8 8  
9 9 <TextView
10 10 android:id="@+id/app_name"
11   - android:layout_marginTop="40dp"
  11 + android:layout_marginTop="50dp"
12 12 android:layout_width="wrap_content"
13 13 android:layout_height="wrap_content"
14 14 android:text="@string/app_name"
... ...
Risiko/app/src/main/res/layout/activity_new_evaluation.xml
... ... @@ -6,19 +6,24 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.risiko.risiko.activity.NewEvaluation">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
9 11 <LinearLayout
10 12 android:layout_width="match_parent"
11 13 android:layout_height="match_parent"
12 14 android:orientation="vertical"
13 15 android:background="@color/colorWhite"
14 16 android:padding="10dp"
15   - android:layout_margin="15dp">
  17 + android:layout_marginTop="70dp"
  18 + android:layout_marginBottom="15dp"
  19 + android:layout_marginHorizontal="15dp">
16 20  
17 21  
18 22 <TextView
19 23 android:layout_width="match_parent"
20 24 android:layout_height="wrap_content"
21 25 android:text="Ny vurdering"
  26 + android:textColor="@color/colorPrimaryDark"
22 27 android:textSize="25dp"
23 28 android:textStyle="bold"/>
24 29  
... ...
Risiko/app/src/main/res/layout/activity_new_incident.xml
... ... @@ -6,13 +6,17 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.risiko.risiko.activity.NewEvent">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
9 11 <LinearLayout
10 12 android:layout_width="match_parent"
11 13 android:layout_height="match_parent"
12 14 android:orientation="vertical"
13 15 android:background="@color/colorWhite"
14 16 android:padding="10dp"
15   - android:layout_margin="15dp">
  17 + android:layout_marginBottom="15dp"
  18 + android:layout_marginHorizontal="15dp"
  19 + android:layout_marginTop="70dp">
16 20  
17 21  
18 22 <TextView
... ... @@ -21,6 +25,7 @@
21 25 android:text="Ny hendelse"
22 26 android:textSize="25dp"
23 27 android:textStyle="bold"
  28 + android:textColor="@color/colorPrimaryDark"
24 29 app:layout_constraintTop_toTopOf="parent"/>
25 30  
26 31 <EditText
... ...
Risiko/app/src/main/res/layout/activity_sequence_of_activities.xml
... ... @@ -6,13 +6,17 @@
6 6 android:layout_height="match_parent"
7 7 tools:context="com.risiko.risiko.activity.SequenceOfActivities">
8 8  
  9 + <include layout="@layout/toolbar"/>
  10 +
9 11 <LinearLayout
10 12 android:layout_width="match_parent"
11 13 android:layout_height="match_parent"
12 14 android:orientation="vertical"
13 15 android:background="@color/colorWhite"
14 16 android:padding="10dp"
15   - android:layout_margin="15dp">
  17 + android:layout_marginBottom="15dp"
  18 + android:layout_marginHorizontal="15dp"
  19 + android:layout_marginTop="70dp">
16 20  
17 21  
18 22 <TextView
... ... @@ -23,6 +27,7 @@
23 27 android:text="@string/sequence_of_activities"
24 28 android:textStyle="bold"
25 29 android:textSize="25dp"
  30 + android:textColor="@color/colorPrimaryDark"
26 31 app:layout_constraintLeft_toLeftOf="parent"
27 32 app:layout_constraintRight_toRightOf="parent"
28 33 app:layout_constraintTop_toTopOf="parent"
... ...
Risiko/app/src/main/res/layout/toolbar.xml 0 → 100644
  1 +<android.support.v7.widget.ActionBarContainer
  2 + 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="wrap_content"
  7 + android:fitsSystemWindows="true"
  8 + tools:context="kna.quizter.Activities.MainActivity"
  9 + android:layout_marginBottom="20dp">
  10 +
  11 + <android.support.v7.widget.Toolbar
  12 + android:id="@+id/my_toolbar"
  13 + android:layout_height="?attr/actionBarSize"
  14 + android:layout_width="match_parent"
  15 + android:background="@color/colorPrimaryDark"
  16 + android:elevation="4dp"
  17 + app:titleTextColor="@color/colorWhite"
  18 + android:textAlignment="center"
  19 + android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
  20 + app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
  21 + />
  22 +
  23 +</android.support.v7.widget.ActionBarContainer>
0 24 \ No newline at end of file
... ...
Risiko/app/src/main/res/menu/main.xml 0 → 100644
  1 +<menu xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:app="http://schemas.android.com/apk/res-auto">
  3 +
  4 + <item
  5 + android:id="@+id/action_home"
  6 + android:icon="@drawable/ic_home_24dp"
  7 + android:title="Hovedmeny"
  8 + app:showAsAction="ifRoom"/>
  9 +
  10 + <item android:id="@+id/action_logout"
  11 + android:icon="@drawable/ic_logout_24dp"
  12 + android:title="Logg ut"
  13 + app:showAsAction="ifRoom"/>
  14 +
  15 +</menu>
0 16 \ No newline at end of file
... ...
Risiko/app/src/main/res/values/styles.xml
1 1 <resources>
2 2  
3 3 <!-- Base application theme. -->
4   - <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5   - <!-- Customize your theme here. -->
6   - <item name="colorPrimary">@color/colorPrimaryDark</item>
7   - <item name="colorPrimaryDark">@color/colorPrimary</item>
8   - <item name="colorAccent">@color/colorAccent</item>
9   - <item name="android:colorBackground">@color/background_material_light</item>
10   - </style>
11 4  
12   - <style name="risikoTheme" parent="AppTheme" >
13   - <item name="colorPrimary">@color/colorPrimaryDark</item>
14   - </style>
  5 + <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
  6 + <!-- Customize your theme here. -->
  7 + <item name="colorPrimary">@color/colorPrimaryDark</item>
  8 + <item name="colorPrimaryDark">@color/colorPrimary</item>
  9 + <item name="colorAccent">@color/colorAccent</item>
  10 + <item name="android:colorBackground">@color/background_material_light</item>
  11 + </style>
  12 +
  13 + <style name="CustomTheme" parent="Theme.AppCompat.Light">
  14 +
  15 + <item name="contentInsetStart">0dp</item>
  16 + <item name="contentInsetEnd">0dp</item>
  17 + </style>
  18 +
15 19  
16 20 </resources>
... ...