Sfoglia il codice sorgente

Gave AccountRecoveryActivity a makeover

Víctor Hernández 4 anni fa
parent
commit
59c00c3b37

+ 61
- 73
app/src/main/res/layout/activity_account_recovery.xml Vedi File

@@ -7,125 +7,113 @@
7 7
     android:background="@android:color/white">
8 8
 
9 9
     <TextView
10
-        android:id="@+id/textView5"
10
+        android:id="@+id/accountRecoveryTitle"
11 11
         android:layout_width="wrap_content"
12 12
         android:layout_height="wrap_content"
13
+        android:layout_marginStart="@dimen/horizontalMargin"
14
+        android:layout_marginEnd="@dimen/horizontalMargin"
13 15
         android:fontFamily="@font/cabin"
14
-        android:text="LOG IN TO ACCOUNT"
16
+        android:text="@string/accountRecoveryTitleText"
17
+        android:textAlignment="center"
15 18
         android:textColor="@color/colorPrimary"
16 19
         android:textSize="24sp"
17 20
         android:textStyle="bold"
18
-        app:layout_constraintBottom_toBottomOf="parent"
21
+        app:layout_constraintBottom_toTopOf="@+id/recoverButton"
19 22
         app:layout_constraintEnd_toEndOf="parent"
20
-        app:layout_constraintHorizontal_bias="0.497"
21 23
         app:layout_constraintStart_toStartOf="parent"
22
-        app:layout_constraintTop_toTopOf="parent"
23
-        app:layout_constraintVertical_bias="0.202" />
24
+        app:layout_constraintTop_toTopOf="parent" />
24 25
 
25 26
     <Button
26 27
         android:id="@+id/recoverButton"
27
-        android:layout_width="329dp"
28
-        android:layout_height="49dp"
29
-        android:background="@color/colorPrimary"
30
-        android:fontFamily="@font/acme"
31
-        android:text="LOG IN"
32
-        android:textColor="@color/textColor1"
33
-        android:textSize="18sp"
28
+        android:layout_width="0dp"
29
+        android:layout_height="wrap_content"
30
+        android:layout_marginStart="@dimen/horizontalMargin"
31
+        android:layout_marginEnd="@dimen/horizontalMargin"
32
+        android:layout_marginBottom="@dimen/verticalMargin"
33
+        android:background="@drawable/button_background"
34
+        android:fontFamily="sans-serif-black"
35
+        android:paddingHorizontal="@dimen/buttonHorizontalPadding"
36
+        android:paddingVertical="@dimen/buttonVerticalPadding"
37
+        android:text="@string/recoverAccountButtonText"
38
+        android:textColor="@android:color/white"
39
+        android:textSize="@dimen/buttonTextSize"
34 40
         android:textStyle="bold"
35 41
         app:layout_constraintBottom_toBottomOf="parent"
36 42
         app:layout_constraintEnd_toEndOf="parent"
37
-        app:layout_constraintHorizontal_bias="0.56"
43
+        app:layout_constraintHeight_max="@dimen/buttonMaxHeight"
38 44
         app:layout_constraintStart_toStartOf="parent"
39
-        app:layout_constraintTop_toBottomOf="@+id/textView5"
40
-        app:layout_constraintVertical_bias="0.405" />
41
-
42
-    <ImageView
43
-        android:id="@+id/imageView"
44
-        android:layout_width="339dp"
45
-        android:layout_height="137dp"
46
-        app:layout_constraintBottom_toTopOf="@+id/recoverButton"
47
-        app:layout_constraintEnd_toEndOf="parent"
48
-        app:layout_constraintStart_toStartOf="parent"
49
-        app:layout_constraintTop_toBottomOf="@+id/textView5"
50
-        app:layout_constraintVertical_bias="0.382"
51
-        app:srcCompat="@drawable/login_rectangle" />
45
+        app:layout_constraintTop_toBottomOf="@+id/accountRecoveryTitle" />
52 46
 
53 47
     <TextView
54 48
         android:id="@+id/emailLabelRecover"
55 49
         android:layout_width="wrap_content"
56
-        android:layout_height="wrap_content"
57
-        android:fontFamily="@font/acme"
58
-        android:text="Email:"
59
-        android:textColor="@color/colorPrimary"
60
-        android:textSize="18sp"
61
-        app:layout_constraintBottom_toTopOf="@+id/passwordLabelRecover"
50
+        android:layout_height="@dimen/accountRecoveryTextFieldHeight"
51
+        android:layout_marginStart="@dimen/horizontalMargin"
52
+        android:layout_marginTop="32dp"
53
+        android:layout_marginEnd="16dp"
54
+        android:fontFamily="@font/cabin"
55
+        android:gravity="center"
56
+        android:text="@string/emailInputLabelText"
57
+        android:textSize="@dimen/accountRecoveryLabelTextSize"
62 58
         app:layout_constraintEnd_toStartOf="@+id/emailTextRecover"
63
-        app:layout_constraintHorizontal_bias="0.939"
64 59
         app:layout_constraintStart_toStartOf="parent"
65
-        app:layout_constraintTop_toTopOf="@+id/imageView"
66
-        app:layout_constraintVertical_bias="0.53" />
60
+        app:layout_constraintTop_toBottomOf="@id/accountRecoveryTitle" />
67 61
 
68 62
     <TextView
69 63
         android:id="@+id/passwordLabelRecover"
70 64
         android:layout_width="wrap_content"
71
-        android:layout_height="wrap_content"
72
-        android:fontFamily="@font/acme"
73
-        android:text="Password:"
74
-        android:textColor="@color/colorPrimary"
75
-        android:textSize="18sp"
76
-        app:layout_constraintBottom_toBottomOf="@+id/imageView"
77
-        app:layout_constraintEnd_toStartOf="@+id/passwordTextRecover"
78
-        app:layout_constraintHorizontal_bias="0.915"
79
-        app:layout_constraintStart_toStartOf="parent"
80
-        app:layout_constraintTop_toTopOf="@+id/imageView"
81
-        app:layout_constraintVertical_bias="0.69" />
65
+        android:layout_height="@dimen/accountRecoveryTextFieldHeight"
66
+        android:layout_marginTop="16dp"
67
+        android:fontFamily="@font/cabin"
68
+        android:gravity="center"
69
+        android:text="@string/passwordInputLabelText"
70
+        android:textSize="@dimen/accountRecoveryLabelTextSize"
71
+        app:layout_constraintStart_toStartOf="@id/emailLabelRecover"
72
+        app:layout_constraintTop_toBottomOf="@id/emailTextRecover" />
82 73
 
83 74
     <EditText
84 75
         android:id="@+id/passwordTextRecover"
85
-        android:layout_width="192dp"
86
-        android:layout_height="40dp"
76
+        android:layout_width="@dimen/accountRecoveryTextFieldWidth"
77
+        android:layout_height="@dimen/accountRecoveryTextFieldHeight"
78
+        android:autofillHints="AUTOFILL_HINT_PASSWORD"
87 79
         android:backgroundTint="@color/colorPrimary"
88
-        android:ems="10"
89 80
         android:hint="@string/rss_password"
90 81
         android:inputType="textPassword"
91 82
         android:textColor="@color/textColor2"
92
-        app:layout_constraintBottom_toBottomOf="@+id/imageView"
93
-        app:layout_constraintEnd_toEndOf="@+id/imageView"
94
-        app:layout_constraintHorizontal_bias="0.734"
95
-        app:layout_constraintStart_toStartOf="@+id/imageView"
96
-        app:layout_constraintTop_toTopOf="@+id/imageView"
97
-        app:layout_constraintVertical_bias="0.731" />
83
+        app:layout_constraintStart_toStartOf="@id/emailTextRecover"
84
+        app:layout_constraintTop_toTopOf="@id/passwordLabelRecover" />
98 85
 
99 86
     <EditText
100 87
         android:id="@+id/emailTextRecover"
101
-        android:layout_width="192dp"
102
-        android:layout_height="40dp"
88
+        android:layout_width="@dimen/accountRecoveryTextFieldWidth"
89
+        android:layout_height="@dimen/accountRecoveryTextFieldHeight"
90
+        android:layout_marginEnd="@dimen/horizontalMargin"
91
+        android:autofillHints="AUTOFILL_HINT_EMAIL_ADDRESS"
103 92
         android:backgroundTint="@color/colorPrimary"
104 93
         android:ems="10"
105 94
         android:hint="@string/rsb_email"
106 95
         android:inputType="textEmailAddress"
107 96
         android:textColor="@color/textColor2"
108
-        app:layout_constraintBottom_toTopOf="@+id/passwordTextRecover"
109
-        app:layout_constraintEnd_toEndOf="@+id/imageView"
110
-        app:layout_constraintHorizontal_bias="0.734"
111
-        app:layout_constraintStart_toStartOf="@+id/imageView"
112
-        app:layout_constraintTop_toTopOf="@+id/imageView"
113
-        app:layout_constraintVertical_bias="0.638" />
97
+        app:layout_constraintEnd_toEndOf="parent"
98
+        app:layout_constraintStart_toEndOf="@+id/emailLabelRecover"
99
+        app:layout_constraintTop_toTopOf="@id/emailLabelRecover" />
114 100
 
115 101
     <Button
116 102
         android:id="@+id/forgotPasswordButton"
117
-        android:layout_width="329dp"
118
-        android:layout_height="49dp"
119
-        android:background="@color/colorPrimaryDark"
120
-        android:text="@string/rss_forgot_password"
121
-        android:textColor="@color/textColor1"
103
+        android:layout_width="0dp"
104
+        android:layout_height="wrap_content"
105
+        android:layout_marginStart="@dimen/horizontalMargin"
106
+        android:layout_marginTop="16dp"
107
+        android:layout_marginEnd="@dimen/horizontalMargin"
108
+        android:background="@drawable/button_background"
109
+        android:paddingHorizontal="@dimen/buttonHorizontalPadding"
110
+        android:paddingVertical="@dimen/buttonVerticalPadding"
111
+        android:text="@string/forgotPasswordButtonText"
112
+        android:textColor="@android:color/white"
122 113
         android:textSize="18sp"
123 114
         android:textStyle="bold"
124
-        app:layout_constraintBottom_toBottomOf="parent"
125 115
         app:layout_constraintEnd_toEndOf="parent"
126
-        app:layout_constraintHorizontal_bias="0.56"
127 116
         app:layout_constraintStart_toStartOf="parent"
128
-        app:layout_constraintTop_toBottomOf="@+id/recoverButton"
129
-        app:layout_constraintVertical_bias="0.075" />
117
+        app:layout_constraintTop_toBottomOf="@+id/recoverButton" />
130 118
 
131 119
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 3
- 0
app/src/main/res/values/dimens.xml Vedi File

@@ -14,4 +14,7 @@
14 14
     <dimen name="buttonTextSize">24sp</dimen>
15 15
     <dimen name="mainActivityToolbarHeight">54dp</dimen>
16 16
     <dimen name="bubbleSize">18dp</dimen>
17
+    <dimen name="accountRecoveryTextFieldWidth">192dp</dimen>
18
+    <dimen name="accountRecoveryTextFieldHeight">40dp</dimen>
19
+    <dimen name="accountRecoveryLabelTextSize">18sp</dimen>
17 20
 </resources>

+ 4
- 0
app/src/main/res/values/strings.xml Vedi File

@@ -78,4 +78,8 @@
78 78
     <string name="dataUseConsentSectionSummaryText">The data obtained will be used to improve academic offerings and research experiences. The results of this study may be part of a scientific publication on science education strategies and will serve as a basis to improve the teaching curriculum.</string>
79 79
     <string name="dataUseConsentSectionContentText">It may be used to develop proposals for obtaining external funds for research. The officials of the Río Piedras Campus of the University of Puerto Rico and / or federal agencies responsible for ensuring the integrity of the research may require the researcher to prove the data obtained in this study, including this informed consent. The information handled by your device can be intervened or revised by third parties. These people can be people with legitimate or illegitimate access to the device and its content such as a family member, employer, hackers, intruders, etc. In addition, the device that you use may keep track of the information you access or send over the Internet.</string>
80 80
     <string name="generalTitleText">General</string>
81
+    <string name="accountRecoveryTitleText">LOG IN TO ACCOUNT</string>
82
+    <string name="forgotPasswordButtonText">Forgot Password</string>
83
+    <string name="emailInputLabelText">Email:</string>
84
+    <string name="passwordInputLabelText">Password:</string>
81 85
 </resources>