Updated favorites card to show category

This commit is contained in:
Denis 2015-01-14 15:03:42 +02:00
parent 7d22614bc8
commit 034b82dba1
2 changed files with 24 additions and 3 deletions

View file

@ -40,6 +40,18 @@
android:textColor="@color/dashboard_blue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView android:id="@+id/group_image"
android:layout_marginLeft="4dp"
android:src="@drawable/ic_small_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/group_name"
android:layout_marginLeft="4dp"
android:layout_gravity="center_vertical"
android:textSize="@dimen/showAllButtonTextSize"
android:textColor="@color/dashboard_descr_colol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>

View file

@ -36,7 +36,8 @@ import android.widget.LinearLayout;
import android.widget.TextView;
/**
* Created by Denis on 24.11.2014.
* Created by Denis
* on 24.11.2014.
*/
public class DashFavoritesFragment extends DashBaseFragment implements FavouritesDbHelper.FavoritesUpdatedListener {
public static final String TAG = "DASH_FAVORITES_FRAGMENT";
@ -143,8 +144,16 @@ public class DashFavoritesFragment extends DashBaseFragment implements Favourite
View view = inflater.inflate(R.layout.dash_favorites_item, null, false);
TextView name = (TextView) view.findViewById(R.id.name);
TextView label = (TextView) view.findViewById(R.id.distance);
ImageView icon = (ImageView) view.findViewById(R.id.icon);
ImageView direction = (ImageView) view.findViewById(R.id.direction);
if (point.getCategory().length() > 0) {
((TextView) view.findViewById(R.id.group_name)).setText(point.getCategory());
} else {
view.findViewById(R.id.group_image).setVisibility(View.GONE);
}
((ImageView) view.findViewById(R.id.icon)).
setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), point.getColor()));
if(loc != null){
direction.setVisibility(View.VISIBLE);
@ -152,7 +161,7 @@ public class DashFavoritesFragment extends DashBaseFragment implements Favourite
}
arrows.add(direction);
name.setText(point.getName());
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), point.getColor()));
//LatLon lastKnownMapLocation = getMyApplication().getSettings().getLastKnownMapLocation();
int dist = (int) (MapUtils.getDistance(point.getLatitude(), point.getLongitude(),
loc.getLatitude(), loc.getLongitude()));