From b59290f51f46fb32598906f2e0e0cd5345062f03 Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 8 Apr 2015 18:36:30 +0300 Subject: [PATCH] Updated icon views --- .../search/SearchHistoryFragment.java | 4 +- .../plus/dashboard/DashFavoritesFragment.java | 41 +++++++++---------- .../plus/myplaces/AvailableGPXFragment.java | 10 +++-- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java index d74e3fae56..438e09a449 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java @@ -277,7 +277,9 @@ public class SearchHistoryFragment extends ListFragment implements SearchActivit String typeName = historyEntry.getName().getTypeName(); if (typeName != null && !typeName.isEmpty()) { - row.findViewById(R.id.type_name_icon).setVisibility(View.VISIBLE); + ImageView group = (ImageView)row.findViewById(R.id.type_name_icon); + group.setVisibility(View.VISIBLE); + group.setImageDrawable(ic.getContentIcon(R.drawable.ic_small_group)); ((TextView) row.findViewById(R.id.type_name)).setText(typeName); } else { row.findViewById(R.id.type_name_icon).setVisibility(View.GONE); diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java index a5519be424..f04e5f1351 100644 --- a/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java +++ b/OsmAnd/src/net/osmand/plus/dashboard/DashFavoritesFragment.java @@ -1,35 +1,31 @@ package net.osmand.plus.dashboard; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; - -import net.osmand.data.FavouritePoint; -import net.osmand.data.LatLon; -import net.osmand.data.PointDescription; -import net.osmand.plus.FavouritesDbHelper; -import net.osmand.plus.OsmAndAppCustomization; -import net.osmand.plus.R; -import net.osmand.plus.activities.MapActivity; -import net.osmand.plus.base.FavoriteImageDrawable; -import net.osmand.plus.dialogs.DirectionsDialogs; -import net.osmand.plus.helpers.FontCache; -import net.osmand.plus.myplaces.FavoritesActivity; -import net.osmand.util.MapUtils; -import android.app.Activity; -import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; +import net.osmand.data.FavouritePoint; +import net.osmand.data.LatLon; +import net.osmand.data.PointDescription; +import net.osmand.plus.FavouritesDbHelper; +import net.osmand.plus.R; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.base.FavoriteImageDrawable; +import net.osmand.plus.dialogs.DirectionsDialogs; +import net.osmand.plus.myplaces.FavoritesActivity; +import net.osmand.util.MapUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + /** * Created by Denis * on 24.11.2014. @@ -96,10 +92,12 @@ public class DashFavoritesFragment extends DashLocationFragment { direction.setVisibility(View.VISIBLE); label.setVisibility(View.VISIBLE); view.findViewById(R.id.divider).setVisibility(View.VISIBLE); + ImageView groupImage = (ImageView)view.findViewById(R.id.group_image); if (point.getCategory().length() > 0) { ((TextView) view.findViewById(R.id.group_name)).setText(point.getCategory()); + groupImage.setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_small_group)); } else { - view.findViewById(R.id.group_image).setVisibility(View.GONE); + groupImage.setVisibility(View.GONE); } ((ImageView) view.findViewById(R.id.favourite_icon)).setImageDrawable(FavoriteImageDrawable.getOrCreate( @@ -111,6 +109,7 @@ public class DashFavoritesFragment extends DashLocationFragment { name.setText(point.getName()); name.setTypeface(Typeface.DEFAULT, point.isVisible() ? Typeface.NORMAL : Typeface.ITALIC); view.findViewById(R.id.navigate_to).setVisibility(View.VISIBLE); + ((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_gdirections_dark)); view.findViewById(R.id.navigate_to).setOnClickListener(new View.OnClickListener() { @Override diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 4f8d853e8e..2655ef4772 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -227,10 +227,14 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { ((TextView) v.findViewById(R.id.points_count)).setText(sth.getPoints() + ""); ((TextView) v.findViewById(R.id.distance)) .setText(OsmAndFormatter.getFormattedDistance(sth.getDistance(), app)); - v.findViewById(R.id.points_count).setVisibility(View.VISIBLE); v.findViewById(R.id.points_icon).setVisibility(View.VISIBLE); - v.findViewById(R.id.distance).setVisibility(View.VISIBLE); - v.findViewById(R.id.distance_icon).setVisibility(View.VISIBLE); + ImageView distance = (ImageView) v.findViewById(R.id.distance_icon); + distance.setVisibility(View.VISIBLE); + distance.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_distance)); + ImageView pointsCount = (ImageView) v.findViewById(R.id.points_icon); + pointsCount.setVisibility(View.VISIBLE); + pointsCount.setImageDrawable(app.getIconsCache().getContentIcon(R.drawable.ic_small_point)); + } @Override