From f211b18a6c5c42a70f3994b9fa98e3b7949642b0 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 13 Sep 2017 16:41:31 +0300 Subject: [PATCH] Add shadow --- OsmAnd/res/layout/map_marker_item_new.xml | 207 ++++++++++-------- .../adapters/MapMarkerItemViewHolder.java | 8 + .../adapters/MapMarkersActiveAdapter.java | 4 +- .../adapters/MapMarkersHistoryAdapter.java | 5 + 4 files changed, 130 insertions(+), 94 deletions(-) diff --git a/OsmAnd/res/layout/map_marker_item_new.xml b/OsmAnd/res/layout/map_marker_item_new.xml index 4a4a7f3912..db8346170e 100644 --- a/OsmAnd/res/layout/map_marker_item_new.xml +++ b/OsmAnd/res/layout/map_marker_item_new.xml @@ -4,120 +4,143 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?attr/bg_color" android:descendantFocusability="blocksDescendants" android:orientation="vertical"> - - - - + android:layout_height="wrap_content"> + android:layout_width="match_parent" + android:layout_height="56dp" + android:background="?attr/selectableItemBackground"> - + android:layout_gravity="center_vertical" + android:paddingBottom="16dp" + android:paddingLeft="16dp" + android:paddingStart="16dp" + android:paddingTop="16dp" + android:tint="?attr/secondary_icon_color" + tools:src="@drawable/ic_action_reorder"/> + + - - + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:orientation="vertical"> - - - - + android:textColor="?android:textColorPrimary" + android:textSize="@dimen/default_list_text_size" + tools:text="Van Gogh Museum"/> + + + + + + + + + + + + + + - + - + + + + + + + diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java index 8c94023a17..66b138d20c 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkerItemViewHolder.java @@ -10,6 +10,7 @@ import net.osmand.plus.R; public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { + final View mainLayout; final ImageView iconDirection; final ImageView iconReorder; final ImageView icon; @@ -19,9 +20,11 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { final TextView description; final ImageButton optionsBtn; final View divider; + final View bottomShadow; public MapMarkerItemViewHolder(View view) { super(view); + mainLayout = view.findViewById(R.id.main_layout); iconDirection = (ImageView) view.findViewById(R.id.map_marker_direction_icon); iconReorder = (ImageView) view.findViewById(R.id.map_marker_reorder_icon); icon = (ImageView) view.findViewById(R.id.map_marker_icon); @@ -31,6 +34,7 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { description = (TextView) view.findViewById(R.id.map_marker_description); optionsBtn = (ImageButton) view.findViewById(R.id.map_marker_options_button); divider = view.findViewById(R.id.divider); + bottomShadow = view.findViewById(R.id.bottom_shadow); } public void setOptionsButtonVisibility(int visibility) { @@ -40,4 +44,8 @@ public class MapMarkerItemViewHolder extends RecyclerView.ViewHolder { public void setIconDirectionVisibility(int visibility) { iconDirection.setVisibility(visibility); } + + public void setBottomShadowVisibility(int visibility) { + bottomShadow.setVisibility(visibility); + } } diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java index 65d74932cc..b77f9de136 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersActiveAdapter.java @@ -88,7 +88,7 @@ public class MapMarkersActiveAdapter extends RecyclerView.Adapter