Commit f6784e90ea62ce721cbfa4b56ea65b9c76e61c41

Authored by kristinlaahneolsen
1 parent f2f0b014

Laget felt for brukernavn og passord på forsiden som en start for hvordan man ka…

…n begynne med en enkel for for autentisering. Ikke implementert sjekk for dette, eller tabell i databasen
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="75dp"
  11 + android:layout_marginTop="40dp"
12 12 android:layout_width="wrap_content"
13 13 android:layout_height="wrap_content"
14 14 android:text="@string/app_name"
... ... @@ -20,7 +20,6 @@
20 20 app:layout_constraintRight_toRightOf="parent" />
21 21  
22 22  
23   -
24 23 <TextView
25 24 android:id="@+id/app_description"
26 25 android:layout_width="wrap_content"
... ... @@ -33,7 +32,7 @@
33 32 app:layout_constraintTop_toBottomOf="@id/app_name" />
34 33  
35 34 <ImageView
36   - android:layout_marginTop="30dp"
  35 + android:layout_marginTop="20dp"
37 36 android:id="@+id/app_icon"
38 37 android:layout_width="70dp"
39 38 android:layout_height="70dp"
... ... @@ -42,17 +41,49 @@
42 41 app:layout_constraintRight_toRightOf="parent"
43 42 app:layout_constraintTop_toBottomOf="@+id/app_description"/>
44 43  
  44 + <EditText
  45 + android:id="@+id/et_username"
  46 + android:layout_marginHorizontal="30dp"
  47 + android:layout_marginTop="30dp"
  48 + android:padding="10dp"
  49 + android:layout_width="match_parent"
  50 + android:layout_height="wrap_content"
  51 + android:background="@color/colorWhite"
  52 + android:hint="@string/username"
  53 + android:textStyle="italic"
  54 + app:layout_constraintLeft_toLeftOf="parent"
  55 + app:layout_constraintRight_toRightOf="parent"
  56 + app:layout_constraintTop_toBottomOf="@id/app_icon"/>
  57 +
  58 +
  59 + <EditText
  60 + android:id="@+id/et_password"
  61 + android:layout_marginHorizontal="30dp"
  62 + android:padding="10dp"
  63 + android:layout_marginTop="20dp"
  64 + android:layout_width="match_parent"
  65 + android:layout_height="wrap_content"
  66 + android:background="@color/colorWhite"
  67 + android:hint="@string/password"
  68 + android:textStyle="italic"
  69 + app:layout_constraintLeft_toLeftOf="parent"
  70 + app:layout_constraintRight_toRightOf="parent"
  71 + app:layout_constraintTop_toBottomOf="@id/et_username"/>
  72 +
  73 +
45 74 <Button
46 75 android:id="@+id/btn_to_main_menu"
47   - android:layout_width="wrap_content"
  76 + android:layout_width="150dp"
48 77 android:layout_height="wrap_content"
49   - android:text="Gå til hovedmeny"
  78 + android:text="@string/btn_login"
  79 + android:textStyle="bold"
50 80 android:textColor="@color/colorPrimaryDark"
51 81 android:background="@color/colorWhite"
52 82 android:padding="10dp"
  83 + app:layout_constraintTop_toBottomOf="@id/et_password"
53 84 app:layout_constraintLeft_toLeftOf="parent"
54 85 app:layout_constraintRight_toRightOf="parent"
55 86 app:layout_constraintBottom_toBottomOf="parent"
56   - android:layout_marginBottom="100dp"/>
  87 + android:layout_marginBottom="40dp"/>
57 88  
58 89 </android.support.constraint.ConstraintLayout>
... ...
Risiko/app/src/main/res/values/strings.xml
... ... @@ -30,5 +30,8 @@
30 30 <string name="comment">Kommentar</string>
31 31 <string name="app_description">App for risikovurdering</string>
32 32 <string name="activity_headline">Overskrift på aktivitet</string>
  33 + <string name="username">Brukernavn</string>
  34 + <string name="password">Passord</string>
  35 + <string name="btn_login">Logg inn</string>
33 36  
34 37 </resources>
... ...