Skip to content

Commit

Permalink
Fix alignment issues caused by TextInputLayout adding 4dp of padding. F…
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbutcher committed Dec 3, 2015
1 parent ff7d3f0 commit 13a4d7e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_designer_news_login.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015 Google Inc.
Expand Down Expand Up @@ -53,7 +54,7 @@
android:id="@+id/username_float_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_normal"
android:layout_marginStart="@dimen/spacing_micro"
app:hintTextAppearance="@style/TextAppearance.FloatLabelHint">

<AutoCompleteTextView
Expand All @@ -79,7 +80,7 @@
android:id="@+id/password_float_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/spacing_normal"
android:layout_marginStart="@dimen/spacing_micro"
app:hintTextAppearance="@style/TextAppearance.FloatLabelHint">

<EditText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
android:id="@+id/new_story_title_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_normal"
android:layout_marginStart="@dimen/padding_normal_til"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/padding_normal"
app:hintTextAppearance="@style/TextAppearance.FloatLabelHint">
Expand All @@ -94,7 +94,7 @@
android:id="@+id/new_story_url_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_normal"
android:layout_marginStart="@dimen/padding_normal_til"
android:layout_marginEnd="@dimen/padding_normal"
android:stateListAnimator="@animator/disable_text_entry"
app:hintTextAppearance="@style/TextAppearance.FloatLabelHint">
Expand Down Expand Up @@ -122,7 +122,7 @@
android:id="@+id/new_story_comment_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/padding_normal"
android:layout_marginStart="@dimen/padding_normal_til"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_marginEnd="@dimen/padding_normal"
android:stateListAnimator="@animator/disable_text_entry"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/designer_news_enter_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:listPreferredItemHeight"
android:paddingStart="@dimen/padding_normal"
android:paddingStart="@dimen/padding_normal_til"
android:paddingTop="@dimen/spacing_large"
android:paddingEnd="@dimen/padding_normal"
android:orientation="horizontal"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/dribbble_enter_comment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="@dimen/til_margin_fix"
app:hintTextAppearance="@style/TextAppearance.FloatLabelHint">

<EditText
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<dimen name="padding_room_for_fab">88dp</dimen> <!-- padding_normal + fab_size + padding_normal -->
<dimen name="fab_plus_single_padding">72dp</dimen> <!-- fab_size + padding_normal -->
<dimen name="half_fab_plus_single_padding">44dp</dimen> <!-- (fab_size / 2) + padding_normal -->
<!-- text input layout seems to add 4dp of extra padding. The following account for this -->
<dimen name="padding_normal_til">12dp</dimen>
<dimen name="til_margin_fix">-4dp</dimen>


<!-- dialogs -->
Expand Down

0 comments on commit 13a4d7e

Please sign in to comment.