Fix margins in wikivoyage search screen

This commit is contained in:
Alex Sytnyk 2018-04-23 12:39:48 +03:00
parent d54a39b922
commit 88cb8fcea3
5 changed files with 17 additions and 11 deletions

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/wikivoyage_bg_color" android:background="?attr/wikivoyage_bg_color"
@ -16,9 +15,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="@dimen/dashboard_map_toolbar"
android:background="?attr/wikivoyage_card_bg_color" android:background="?attr/wikivoyage_card_bg_color"
android:minHeight="@dimen/dashboard_map_toolbar" android:minHeight="@dimen/dashboard_map_toolbar">
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp">
<include layout="@layout/search_text_layout"/> <include layout="@layout/search_text_layout"/>

View file

@ -17,16 +17,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:minHeight="@dimen/bottom_sheet_selected_item_title_height" android:minHeight="@dimen/bottom_sheet_selected_item_title_height"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/wikivoyage_search_icon_margin_left"
android:paddingRight="@dimen/content_padding"> android:paddingRight="@dimen/wikivoyage_search_icon_margin_left">
<ImageView <ImageView
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="28dp" android:layout_width="28dp"
android:layout_height="28dp" android:layout_height="28dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/content_padding" android:layout_marginEnd="@dimen/wikivoyage_search_icon_margin_right"
android:layout_marginRight="@dimen/content_padding" android:layout_marginRight="@dimen/wikivoyage_search_icon_margin_right"
tools:src="@drawable/ic_action_placeholder_city"/> tools:src="@drawable/ic_action_placeholder_city"/>
<LinearLayout <LinearLayout
@ -80,8 +80,8 @@
android:id="@+id/divider" android:id="@+id/divider"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginLeft="@dimen/bottom_sheet_selected_item_title_height" android:layout_marginLeft="@dimen/wikivoyage_search_divider_margin_start"
android:layout_marginStart="@dimen/bottom_sheet_selected_item_title_height" android:layout_marginStart="@dimen/wikivoyage_search_divider_margin_start"
android:background="?attr/wikivoyage_card_divider_color" android:background="?attr/wikivoyage_card_divider_color"
android:focusable="false"/> android:focusable="false"/>

View file

@ -203,4 +203,7 @@
<dimen name="wikivoyage_welcome_title_bottom_margin">23dp</dimen> <dimen name="wikivoyage_welcome_title_bottom_margin">23dp</dimen>
<dimen name="wikivoyage_welcome_content_margin">48dp</dimen> <dimen name="wikivoyage_welcome_content_margin">48dp</dimen>
<dimen name="wikivoyage_card_button_height">54dp</dimen> <dimen name="wikivoyage_card_button_height">54dp</dimen>
<dimen name="wikivoyage_search_icon_margin_left">21dp</dimen>
<dimen name="wikivoyage_search_icon_margin_right">33dp</dimen>
<dimen name="wikivoyage_search_divider_margin_start">82dp</dimen>
</resources> </resources>

View file

@ -286,6 +286,9 @@
<dimen name="wikivoyage_welcome_title_bottom_margin">15dp</dimen> <dimen name="wikivoyage_welcome_title_bottom_margin">15dp</dimen>
<dimen name="wikivoyage_welcome_content_margin">32dp</dimen> <dimen name="wikivoyage_welcome_content_margin">32dp</dimen>
<dimen name="wikivoyage_card_button_height">36dp</dimen> <dimen name="wikivoyage_card_button_height">36dp</dimen>
<dimen name="wikivoyage_search_icon_margin_left">14dp</dimen>
<dimen name="wikivoyage_search_icon_margin_right">22dp</dimen>
<dimen name="wikivoyage_search_divider_margin_start">64dp</dimen>
<dimen name="text_button_letter_spacing" format="float">0.01</dimen> <dimen name="text_button_letter_spacing" format="float">0.01</dimen>
</resources> </resources>

View file

@ -55,6 +55,9 @@ public class WikivoyageSearchDialogFragment extends WikivoyageBaseDialogFragment
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.toolbar); Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.toolbar);
setupToolbar(toolbar); setupToolbar(toolbar);
toolbar.setContentInsetStartWithNavigation(
getResources().getDimensionPixelOffset(R.dimen.wikivoyage_search_divider_margin_start)
);
searchEt = (EditText) toolbar.findViewById(R.id.searchEditText); searchEt = (EditText) toolbar.findViewById(R.id.searchEditText);
searchEt.setHint(R.string.shared_string_search); searchEt.setHint(R.string.shared_string_search);