Skip to content

Commit 529f541

Browse files
committed
Improved the layout of the login screen.
1 parent d37936f commit 529f541

File tree

7 files changed

+500
-89
lines changed

7 files changed

+500
-89
lines changed

app/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ dependencies {
1212
compile 'ch.acra:acra:4.7.0'
1313
compile 'org.mediawiki:api:1.3'
1414
compile 'commons-codec:commons-codec:1.10'
15+
1516
compile "com.android.support:support-v4:${project.supportLibVersion}"
1617
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
1718
compile "com.android.support:design:${project.supportLibVersion}"
19+
compile "com.android.support:cardview-v7:${project.supportLibVersion}"
20+
1821
compile 'com.google.code.gson:gson:2.8.0'
1922
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
2023
compile 'com.github.pedrovgs:renderers:3.3.3'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
7+
<FrameLayout
8+
android:layout_width="320sp"
9+
android:layout_height="wrap_content"
10+
android:layout_gravity="center_horizontal"
11+
android:layout_marginBottom="16dp"
12+
android:layout_marginEnd="16dp"
13+
android:layout_marginLeft="16dp"
14+
android:layout_marginRight="16dp"
15+
android:layout_marginStart="16dp"
16+
android:layout_marginTop="16dp">
17+
18+
<android.support.v7.widget.CardView
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:layout_marginTop="32dp"
22+
app:cardCornerRadius="4dp"
23+
app:cardElevation="4dp">
24+
25+
<RelativeLayout
26+
android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
android:gravity="center"
29+
android:orientation="vertical">
30+
31+
<TextView
32+
android:id="@+id/title"
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:background="@color/action_bar_blue"
36+
android:gravity="center"
37+
android:paddingBottom="32dp"
38+
android:paddingTop="32dp"
39+
android:text="Login to your account"
40+
android:textColor="@android:color/white"
41+
android:textSize="24sp" />
42+
43+
<android.support.design.widget.TextInputLayout
44+
android:id="@+id/username_container"
45+
android:layout_width="match_parent"
46+
android:layout_height="wrap_content"
47+
android:layout_below="@id/title"
48+
android:layout_marginBottom="16dp"
49+
android:layout_marginEnd="16dp"
50+
android:layout_marginLeft="16dp"
51+
android:layout_marginRight="16dp"
52+
android:layout_marginStart="16dp"
53+
android:layout_marginTop="16dp">
54+
55+
<android.support.design.widget.TextInputEditText
56+
android:id="@+id/loginUsername"
57+
android:layout_width="match_parent"
58+
android:layout_height="wrap_content"
59+
android:hint="@string/username"
60+
android:imeOptions="flagNoExtractUi"
61+
android:inputType="textNoSuggestions">
62+
63+
<requestFocus />
64+
65+
</android.support.design.widget.TextInputEditText>
66+
67+
</android.support.design.widget.TextInputLayout>
68+
69+
<android.support.design.widget.TextInputLayout
70+
android:id="@+id/password_container"
71+
android:layout_width="match_parent"
72+
android:layout_height="wrap_content"
73+
android:layout_below="@id/username_container"
74+
android:layout_marginBottom="16dp"
75+
android:layout_marginEnd="16dp"
76+
android:layout_marginLeft="16dp"
77+
android:layout_marginRight="16dp"
78+
android:layout_marginStart="16dp"
79+
app:passwordToggleEnabled="false">
80+
81+
<android.support.design.widget.TextInputEditText
82+
android:id="@+id/loginPassword"
83+
android:layout_width="match_parent"
84+
android:layout_height="wrap_content"
85+
android:hint="@string/password"
86+
android:imeOptions="flagNoExtractUi"
87+
android:inputType="textPassword" />
88+
89+
</android.support.design.widget.TextInputLayout>
90+
91+
<android.support.design.widget.TextInputLayout
92+
android:id="@+id/two_factor_container"
93+
android:layout_width="match_parent"
94+
android:layout_height="wrap_content"
95+
android:layout_below="@id/password_container"
96+
android:layout_marginBottom="16dp"
97+
android:layout_marginEnd="16dp"
98+
android:layout_marginLeft="16dp"
99+
android:layout_marginRight="16dp"
100+
android:layout_marginStart="16dp"
101+
android:visibility="gone"
102+
app:passwordToggleEnabled="false"
103+
tools:visibility="visible">
104+
105+
<android.support.design.widget.TextInputEditText
106+
android:id="@+id/loginTwoFactor"
107+
android:layout_width="match_parent"
108+
android:layout_height="wrap_content"
109+
android:hint="@string/_2fa_code"
110+
android:imeOptions="flagNoExtractUi"
111+
android:inputType="textNoSuggestions"
112+
android:visibility="gone"
113+
tools:visibility="visible" />
114+
115+
</android.support.design.widget.TextInputLayout>
116+
117+
<LinearLayout
118+
android:layout_width="match_parent"
119+
android:layout_height="wrap_content"
120+
android:layout_below="@id/two_factor_container"
121+
android:layout_marginBottom="16dp"
122+
android:layout_marginEnd="16dp"
123+
android:layout_marginLeft="16dp"
124+
android:layout_marginRight="16dp"
125+
android:layout_marginStart="16dp">
126+
127+
<Button
128+
android:id="@+id/signupButton"
129+
android:layout_width="0dp"
130+
android:layout_height="wrap_content"
131+
android:layout_gravity="center_horizontal"
132+
android:layout_marginEnd="8dp"
133+
android:layout_marginRight="8dp"
134+
android:layout_weight="1"
135+
android:text="@string/signup" />
136+
137+
<Button
138+
android:id="@+id/loginButton"
139+
android:layout_width="0dp"
140+
android:layout_height="wrap_content"
141+
android:layout_marginLeft="8dp"
142+
android:layout_marginStart="8dp"
143+
android:layout_weight="1"
144+
android:enabled="false"
145+
android:text="@string/login" />
146+
147+
</LinearLayout>
148+
149+
</RelativeLayout>
150+
</android.support.v7.widget.CardView>
151+
152+
<android.support.v7.widget.CardView
153+
android:layout_width="64dp"
154+
android:layout_height="64dp"
155+
android:layout_gravity="center_horizontal"
156+
app:cardBackgroundColor="@android:color/white"
157+
app:cardCornerRadius="32dp"
158+
app:cardElevation="6dp">
159+
160+
<android.support.v7.widget.AppCompatImageView
161+
android:layout_width="match_parent"
162+
android:layout_height="match_parent"
163+
android:padding="8dp"
164+
app:srcCompat="@drawable/commons_logo_large" />
165+
</android.support.v7.widget.CardView>
166+
167+
</FrameLayout>
168+
169+
</ScrollView>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
7+
<FrameLayout
8+
android:layout_width="320sp"
9+
android:layout_height="wrap_content"
10+
android:layout_gravity="center"
11+
android:layout_marginBottom="16dp"
12+
android:layout_marginEnd="16dp"
13+
android:layout_marginLeft="16dp"
14+
android:layout_marginRight="16dp"
15+
android:layout_marginStart="16dp"
16+
android:layout_marginTop="16dp">
17+
18+
<android.support.v7.widget.CardView
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:layout_marginTop="32dp"
22+
app:cardCornerRadius="4dp"
23+
app:cardElevation="4dp">
24+
25+
<RelativeLayout
26+
android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
android:gravity="center"
29+
android:orientation="vertical">
30+
31+
<TextView
32+
android:id="@+id/title"
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:background="@color/action_bar_blue"
36+
android:gravity="center"
37+
android:paddingBottom="32dp"
38+
android:paddingTop="32dp"
39+
android:text="Login to your account"
40+
android:textColor="@android:color/white"
41+
android:textSize="24sp" />
42+
43+
<android.support.design.widget.TextInputLayout
44+
android:id="@+id/username_container"
45+
android:layout_width="match_parent"
46+
android:layout_height="wrap_content"
47+
android:layout_below="@id/title"
48+
android:layout_marginBottom="16dp"
49+
android:layout_marginEnd="16dp"
50+
android:layout_marginLeft="16dp"
51+
android:layout_marginRight="16dp"
52+
android:layout_marginStart="16dp"
53+
android:layout_marginTop="16dp">
54+
55+
<android.support.design.widget.TextInputEditText
56+
android:id="@+id/loginUsername"
57+
android:layout_width="match_parent"
58+
android:layout_height="wrap_content"
59+
android:hint="@string/username"
60+
android:imeOptions="flagNoExtractUi"
61+
android:inputType="textNoSuggestions">
62+
63+
<requestFocus />
64+
65+
</android.support.design.widget.TextInputEditText>
66+
67+
</android.support.design.widget.TextInputLayout>
68+
69+
<android.support.design.widget.TextInputLayout
70+
android:id="@+id/password_container"
71+
android:layout_width="match_parent"
72+
android:layout_height="wrap_content"
73+
android:layout_below="@id/username_container"
74+
android:layout_marginBottom="16dp"
75+
android:layout_marginEnd="16dp"
76+
android:layout_marginLeft="16dp"
77+
android:layout_marginRight="16dp"
78+
android:layout_marginStart="16dp"
79+
app:passwordToggleEnabled="false">
80+
81+
<android.support.design.widget.TextInputEditText
82+
android:id="@+id/loginPassword"
83+
android:layout_width="match_parent"
84+
android:layout_height="wrap_content"
85+
android:hint="@string/password"
86+
android:imeOptions="flagNoExtractUi"
87+
android:inputType="textPassword" />
88+
89+
</android.support.design.widget.TextInputLayout>
90+
91+
<android.support.design.widget.TextInputLayout
92+
android:id="@+id/two_factor_container"
93+
android:layout_width="match_parent"
94+
android:layout_height="wrap_content"
95+
android:layout_below="@id/password_container"
96+
android:layout_marginBottom="16dp"
97+
android:layout_marginEnd="16dp"
98+
android:layout_marginLeft="16dp"
99+
android:layout_marginRight="16dp"
100+
android:layout_marginStart="16dp"
101+
android:visibility="gone"
102+
app:passwordToggleEnabled="false"
103+
tools:visibility="visible">
104+
105+
<android.support.design.widget.TextInputEditText
106+
android:id="@+id/loginTwoFactor"
107+
android:layout_width="match_parent"
108+
android:layout_height="wrap_content"
109+
android:hint="@string/_2fa_code"
110+
android:imeOptions="flagNoExtractUi"
111+
android:inputType="textNoSuggestions"
112+
android:visibility="gone"
113+
tools:visibility="visible" />
114+
115+
</android.support.design.widget.TextInputLayout>
116+
117+
<LinearLayout
118+
android:layout_width="match_parent"
119+
android:layout_height="wrap_content"
120+
android:layout_below="@id/two_factor_container"
121+
android:layout_marginBottom="16dp"
122+
android:layout_marginEnd="16dp"
123+
android:layout_marginLeft="16dp"
124+
android:layout_marginRight="16dp"
125+
android:layout_marginStart="16dp">
126+
127+
<Button
128+
android:id="@+id/signupButton"
129+
android:layout_width="0dp"
130+
android:layout_height="wrap_content"
131+
android:layout_gravity="center_horizontal"
132+
android:layout_marginEnd="8dp"
133+
android:layout_marginRight="8dp"
134+
android:layout_weight="1"
135+
android:text="@string/signup" />
136+
137+
<Button
138+
android:id="@+id/loginButton"
139+
android:layout_width="0dp"
140+
android:layout_height="wrap_content"
141+
android:layout_marginLeft="8dp"
142+
android:layout_marginStart="8dp"
143+
android:layout_weight="1"
144+
android:enabled="false"
145+
android:text="@string/login" />
146+
147+
</LinearLayout>
148+
149+
</RelativeLayout>
150+
</android.support.v7.widget.CardView>
151+
152+
<android.support.v7.widget.CardView
153+
android:layout_width="64dp"
154+
android:layout_height="64dp"
155+
android:layout_gravity="center_horizontal"
156+
app:cardBackgroundColor="@android:color/white"
157+
app:cardCornerRadius="32dp"
158+
app:cardElevation="6dp">
159+
160+
<android.support.v7.widget.AppCompatImageView
161+
android:layout_width="match_parent"
162+
android:layout_height="match_parent"
163+
android:padding="8dp"
164+
app:srcCompat="@drawable/commons_logo_large" />
165+
</android.support.v7.widget.CardView>
166+
167+
</FrameLayout>
168+
169+
</ScrollView>

0 commit comments

Comments
 (0)