forked from commons-app/apps-android-commons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the layout of the login screen.
- Loading branch information
Showing
7 changed files
with
500 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.