Merge pull request #1119 from Bars107/master

Updated icon views
This commit is contained in:
Denis 2015-04-09 00:34:19 +03:00
commit a09d9f1956
3 changed files with 30 additions and 25 deletions

View file

@ -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);

View file

@ -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

View file

@ -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