Skip to content

Commit

Permalink
Improved the layout of the login screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
psh committed Sep 30, 2017
1 parent d37936f commit 529f541
Show file tree
Hide file tree
Showing 7 changed files with 500 additions and 89 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ dependencies {
compile 'ch.acra:acra:4.7.0'
compile 'org.mediawiki:api:1.3'
compile 'commons-codec:commons-codec:1.10'

compile "com.android.support:support-v4:${project.supportLibVersion}"
compile "com.android.support:appcompat-v7:${project.supportLibVersion}"
compile "com.android.support:design:${project.supportLibVersion}"
compile "com.android.support:cardview-v7:${project.supportLibVersion}"

compile 'com.google.code.gson:gson:2.8.0'
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
compile 'com.github.pedrovgs:renderers:3.3.3'
Expand Down
169 changes: 169 additions & 0 deletions app/src/main/res/layout-land/activity_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:layout_width="320sp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp">

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">

<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/action_bar_blue"
android:gravity="center"
android:paddingBottom="32dp"
android:paddingTop="32dp"
android:text="Login to your account"
android:textColor="@android:color/white"
android:textSize="24sp" />

<android.support.design.widget.TextInputLayout
android:id="@+id/username_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/username"
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions">

<requestFocus />

</android.support.design.widget.TextInputEditText>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/password_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/username_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
app:passwordToggleEnabled="false">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:imeOptions="flagNoExtractUi"
android:inputType="textPassword" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/two_factor_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/password_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:visibility="gone"
app:passwordToggleEnabled="false"
tools:visibility="visible">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginTwoFactor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/_2fa_code"
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions"
android:visibility="gone"
tools:visibility="visible" />

</android.support.design.widget.TextInputLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/two_factor_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp">

<Button
android:id="@+id/signupButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:text="@string/signup" />

<Button
android:id="@+id/loginButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:enabled="false"
android:text="@string/login" />

</LinearLayout>

</RelativeLayout>
</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center_horizontal"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="32dp"
app:cardElevation="6dp">

<android.support.v7.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
app:srcCompat="@drawable/commons_logo_large" />
</android.support.v7.widget.CardView>

</FrameLayout>

</ScrollView>
169 changes: 169 additions & 0 deletions app/src/main/res/layout-xlarge/activity_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:layout_width="320sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp">

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
app:cardCornerRadius="4dp"
app:cardElevation="4dp">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">

<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/action_bar_blue"
android:gravity="center"
android:paddingBottom="32dp"
android:paddingTop="32dp"
android:text="Login to your account"
android:textColor="@android:color/white"
android:textSize="24sp" />

<android.support.design.widget.TextInputLayout
android:id="@+id/username_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/title"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/username"
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions">

<requestFocus />

</android.support.design.widget.TextInputEditText>

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/password_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/username_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
app:passwordToggleEnabled="false">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:imeOptions="flagNoExtractUi"
android:inputType="textPassword" />

</android.support.design.widget.TextInputLayout>

<android.support.design.widget.TextInputLayout
android:id="@+id/two_factor_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/password_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp"
android:visibility="gone"
app:passwordToggleEnabled="false"
tools:visibility="visible">

<android.support.design.widget.TextInputEditText
android:id="@+id/loginTwoFactor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/_2fa_code"
android:imeOptions="flagNoExtractUi"
android:inputType="textNoSuggestions"
android:visibility="gone"
tools:visibility="visible" />

</android.support.design.widget.TextInputLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/two_factor_container"
android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginStart="16dp">

<Button
android:id="@+id/signupButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_weight="1"
android:text="@string/signup" />

<Button
android:id="@+id/loginButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:enabled="false"
android:text="@string/login" />

</LinearLayout>

</RelativeLayout>
</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_gravity="center_horizontal"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="32dp"
app:cardElevation="6dp">

<android.support.v7.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp"
app:srcCompat="@drawable/commons_logo_large" />
</android.support.v7.widget.CardView>

</FrameLayout>

</ScrollView>
Loading

0 comments on commit 529f541

Please sign in to comment.