From 40e70a04be5fa5f07757db05a4a227e6a9a7791b Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Tue, 19 Jul 2016 18:39:21 +0300 Subject: [PATCH] [Quick search] UI in progress --- .../src/net/osmand/search/SearchUICore.java | 7 +- OsmAnd/res/layout/search_dialog_fragment.xml | 56 +- .../res/layout/search_dialog_list_layout.xml | 13 + OsmAnd/res/layout/search_list_item.xml | 54 +- OsmAnd/res/layout/search_more_list_item.xml | 4 +- OsmAnd/res/values/attrs.xml | 4 + OsmAnd/res/values/colors.xml | 10 +- OsmAnd/res/values/sizes.xml | 2 +- OsmAnd/res/values/strings.xml | 1 + OsmAnd/res/values/styles.xml | 23 + .../search/QuickSearchDialogFragment.java | 565 +++++++++++++----- ...apter.java => QuickSearchListAdapter.java} | 72 ++- ...ListItem.java => QuickSearchListItem.java} | 57 +- ...Item.java => QuickSearchMoreListItem.java} | 6 +- 14 files changed, 690 insertions(+), 184 deletions(-) create mode 100644 OsmAnd/res/layout/search_dialog_list_layout.xml rename OsmAnd/src/net/osmand/plus/search/{SearchListAdapter.java => QuickSearchListAdapter.java} (58%) rename OsmAnd/src/net/osmand/plus/search/{SearchListItem.java => QuickSearchListItem.java} (84%) rename OsmAnd/src/net/osmand/plus/search/{SearchMoreListItem.java => QuickSearchMoreListItem.java} (66%) diff --git a/OsmAnd-java/src/net/osmand/search/SearchUICore.java b/OsmAnd-java/src/net/osmand/search/SearchUICore.java index dde255c7e9..e544381b2a 100644 --- a/OsmAnd-java/src/net/osmand/search/SearchUICore.java +++ b/OsmAnd-java/src/net/osmand/search/SearchUICore.java @@ -112,8 +112,11 @@ public class SearchUICore { public void setOnResultsComplete(Runnable onResultsComplete) { this.onResultsComplete = onResultsComplete; } - - + + public SearchSettings getSearchSettings() { + return searchSettings; + } + public void updateSettings(SearchSettings settings) { searchSettings = settings; } diff --git a/OsmAnd/res/layout/search_dialog_fragment.xml b/OsmAnd/res/layout/search_dialog_fragment.xml index 44f5f75d25..03761e529c 100644 --- a/OsmAnd/res/layout/search_dialog_fragment.xml +++ b/OsmAnd/res/layout/search_dialog_fragment.xml @@ -13,13 +13,12 @@ android:id="@+id/toolbar" android:layout_width="fill_parent" android:layout_height="@dimen/dashboard_map_toolbar" - android:background="?attr/pstsTabBackground" + android:background="?attr/bg_color" android:minHeight="@dimen/dashboard_map_toolbar" android:theme="?attr/toolbar_theme" app:contentInsetLeft="54dp" app:contentInsetStart="54dp"> - @@ -57,18 +58,51 @@ + + + + + + + - + android:layout_height="match_parent" + android:orientation="vertical"> + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/search_dialog_list_layout.xml b/OsmAnd/res/layout/search_dialog_list_layout.xml new file mode 100644 index 0000000000..b330c962b0 --- /dev/null +++ b/OsmAnd/res/layout/search_dialog_list_layout.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/search_list_item.xml b/OsmAnd/res/layout/search_list_item.xml index e17a434043..7c018c4283 100644 --- a/OsmAnd/res/layout/search_list_item.xml +++ b/OsmAnd/res/layout/search_list_item.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="?attr/listPreferredItemHeight" + android:minHeight="60dp" android:orientation="horizontal" android:paddingBottom="8dp" android:paddingLeft="16dp" @@ -59,22 +59,60 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_marginLeft="2dp" - android:layout_marginRight="4dp" android:textColor="?android:textColorSecondary" - android:textSize="@dimen/default_desc_text_size" + android:textSize="@dimen/default_sub_text_size" tools:text="100500 km"/> - + android:orientation="horizontal"> + + + + + + + + + + diff --git a/OsmAnd/res/layout/search_more_list_item.xml b/OsmAnd/res/layout/search_more_list_item.xml index 793ca91e54..134155fe60 100644 --- a/OsmAnd/res/layout/search_more_list_item.xml +++ b/OsmAnd/res/layout/search_more_list_item.xml @@ -3,7 +3,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:minHeight="?attr/listPreferredItemHeight" + android:minHeight="48dp" android:orientation="horizontal" android:paddingBottom="8dp" android:paddingLeft="16dp" @@ -16,7 +16,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" - android:textColor="?android:textColorSecondary" + android:textColor="?attr/color_dialog_buttons" android:textSize="@dimen/default_list_text_size" tools:text="Amsterdam"/> diff --git a/OsmAnd/res/values/attrs.xml b/OsmAnd/res/values/attrs.xml index 80f3d7df46..a8e72c082c 100644 --- a/OsmAnd/res/values/attrs.xml +++ b/OsmAnd/res/values/attrs.xml @@ -5,6 +5,9 @@ + + + @@ -40,6 +43,7 @@ + diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml index b6f037b90b..aefc43be58 100644 --- a/OsmAnd/res/values/colors.xml +++ b/OsmAnd/res/values/colors.xml @@ -1,6 +1,14 @@ + #fff + #212121 + #7a8c99 + #727272 + + #5b6872 + #727272 + #0f5257 #0c4347 #859899 @@ -77,7 +85,7 @@ #CC080B0D #ff8f00 #b4ff8f00 - + #8cff8f00 #be39464d diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index 4bbd132cb8..ca162e6c44 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -7,7 +7,7 @@ 40dp 240dp 360dp - 58dp + 56dp 78dp 2dp diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a6e09915af..825c16929d 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Categories Postcode from District diff --git a/OsmAnd/res/values/styles.xml b/OsmAnd/res/values/styles.xml index dee2fa8f8b..ad2a19cc36 100644 --- a/OsmAnd/res/values/styles.xml +++ b/OsmAnd/res/values/styles.xml @@ -52,6 +52,9 @@ + + +