Update wikivoyage search card design

This commit is contained in:
Alex Sytnyk 2018-04-06 18:15:46 +03:00
parent 28e35dc196
commit 8b39c43115
4 changed files with 55 additions and 27 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<nine-patch android:src="@drawable/bg_card_shadow_cr3dp"/>
</item>
<item>
<shape>
<solid android:color="?attr/wikivoyage_card_bg_color"/>
<corners android:radius="3dp"/>
</shape>
</item>
</layer-list>

View file

@ -55,41 +55,53 @@
android:text="@string/shared_string_options" android:text="@string/shared_string_options"
android:textColor="?attr/wikivoyage_active_color" android:textColor="?attr/wikivoyage_active_color"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"/> osmand:typeface="@string/font_roboto_medium"
tools:ignore="UnusedAttribute"/>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
<LinearLayout <FrameLayout
android:id="@+id/search_button"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dashboard_map_toolbar" android:layout_height="wrap_content"
android:background="?attr/bg_color" android:layout_marginLeft="@dimen/text_margin_small"
android:gravity="center_vertical"> android:layout_marginRight="@dimen/text_margin_small"
android:background="@drawable/wikivoyage_search_card_bg">
<TextView <LinearLayout
android:layout_width="0dp" android:id="@+id/search_button"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_marginLeft="16dp" android:layout_height="@dimen/bottom_sheet_list_item_height"
android:layout_marginStart="16dp" android:background="?attr/selectableItemBackground"
android:layout_weight="1" android:gravity="center_vertical">
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/search_poi_category_hint"
android:textColor="?attr/searchbar_text_hint"
android:textSize="@dimen/default_list_text_size_large"/>
<ImageView <TextView
android:id="@+id/search_icon" android:id="@+id/search_hint"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginLeft="@dimen/content_padding"
android:contentDescription="@string/shared_string_search" android:layout_marginStart="@dimen/content_padding"
tools:src="@drawable/ic_action_search_dark"/> android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:text="@string/wikivoyage_search_hint"
android:textSize="@dimen/default_list_text_size"
tools:textColor="?attr/searchbar_text_hint"/>
</LinearLayout> <ImageView
android:id="@+id/search_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_small"
android:contentDescription="@string/shared_string_search"
tools:src="@drawable/ic_action_search_dark"/>
</LinearLayout>
</FrameLayout>
<net.osmand.plus.LockableViewPager <net.osmand.plus.LockableViewPager
android:id="@+id/view_pager" android:id="@+id/view_pager"

View file

@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 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 PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
--> -->
<string name="wikivoyage_search_hint">Search: Country, City, Province</string>
<string name="shared_string_read">Read</string> <string name="shared_string_read">Read</string>
<string name="saved_articles">Saved articles</string> <string name="saved_articles">Saved articles</string>
<string name="shared_string_explore">Explore</string> <string name="shared_string_explore">Explore</string>

View file

@ -15,6 +15,7 @@ import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.plus.LockableViewPager; import net.osmand.plus.LockableViewPager;
@ -40,8 +41,10 @@ public class WikivoyageExploreDialogFragment extends WikivoyageBaseDialogFragmen
setupToolbar((Toolbar) mainView.findViewById(R.id.toolbar)); setupToolbar((Toolbar) mainView.findViewById(R.id.toolbar));
int searchColorId = nightMode ? R.color.icon_color : R.color.ctx_menu_title_color_dark;
((TextView) mainView.findViewById(R.id.search_hint)).setTextColor(getResolvedColor(searchColorId));
((ImageView) mainView.findViewById(R.id.search_icon)) ((ImageView) mainView.findViewById(R.id.search_icon))
.setImageDrawable(getContentIcon(R.drawable.ic_action_search_dark)); .setImageDrawable(getIcon(R.drawable.ic_action_search_dark, searchColorId));
mainView.findViewById(R.id.search_button).setOnClickListener(new View.OnClickListener() { mainView.findViewById(R.id.search_button).setOnClickListener(new View.OnClickListener() {
@Override @Override