Skip to content

Commit

Permalink
Fix crash on pre lollipop versions
Browse files Browse the repository at this point in the history
  • Loading branch information
theSoenke committed Jul 27, 2015
1 parent 0faaf71 commit 21f238b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
6 changes: 3 additions & 3 deletions app/src/main/res/drawable-v21/button.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
android:color="?attr/colorControlHighlight">
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp"/>
<solid android:color="@color/primaryColor"/>
<corners android:radius="2dp" />
<solid android:color="@color/primaryColor" />
</shape>
</item>
</ripple>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/button.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/primaryColor"/>
</selector>
4 changes: 4 additions & 0 deletions app/src/main/res/drawable/ripple.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<selector>

</selector>
37 changes: 15 additions & 22 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<LinearLayout 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"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="rocks.paperwork.android.activities.LoginActivity">
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"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="rocks.paperwork.android.activities.LoginActivity">


<android.support.v7.widget.Toolbar
Expand All @@ -18,15 +18,14 @@
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:title="@string/action_sign_in"
app:titleTextAppearance="@style/AppTheme.Toolbar.Title"/>
app:titleTextAppearance="@style/AppTheme.Toolbar.Title" />

<ScrollView
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
>
android:paddingRight="16dp">

<LinearLayout
android:id="@+id/email_login_form"
Expand All @@ -53,7 +52,7 @@
android:hint="@string/auth_host_url"
android:inputType="textUri"
android:maxLines="1"
android:singleLine="true"/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>


Expand All @@ -68,7 +67,7 @@
android:hint="@string/auth_email"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true"/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>


Expand All @@ -81,29 +80,23 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/auth_password"
android:imeOptions="actionDone"
android:imeActionId="@+id/login"
android:imeOptions="actionDone"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true"/>
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>


<Button
android:id="@+id/sign_in_button"
style="@style/Button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@drawable/button"
android:text="@string/action_sign_in"
android:textColor="@color/clouds"/>
android:textColor="@color/clouds" />

<!--<Button
android:id="@+id/register_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/action_sign_up"/>-->
</LinearLayout>
</ScrollView>
</LinearLayout>
7 changes: 5 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@
<item name="color">@android:color/white</item>
</style>

<style name="ToolBarStyle" parent="">
</style>
<style name="ToolBarStyle" parent="" />

<style name="AppTheme.Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<!-- Set proper title size -->
<item name="android:textSize">@dimen/abc_text_size_title_material_toolbar</item>
<!-- Set title color -->
<item name="android:textColor">@android:color/white</item>
</style>

<style name="Button" parent="Base.Widget.AppCompat.Button">
<item name="android:background">@drawable/button</item>
</style>
</resources>

0 comments on commit 21f238b

Please sign in to comment.