Add icon to bottom sheet details

This commit is contained in:
neslihanturan 2017-12-13 20:20:38 +03:00
parent 53df3dca68
commit 81237e8267
3 changed files with 10 additions and 1 deletions

View file

@ -307,6 +307,8 @@ public class NearbyActivity extends NavigationBaseActivity implements LocationUp
checkGps(); checkGps();
} }
/** /**
* This method should be the single point to load/refresh nearby places * This method should be the single point to load/refresh nearby places
* *

View file

@ -15,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -55,6 +56,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
private TextView description; private TextView description;
private TextView title; private TextView title;
private TextView distance; private TextView distance;
private ImageView icon;
private boolean isFabOpen=false; private boolean isFabOpen=false;
@ -154,6 +156,7 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
description = getActivity().findViewById(R.id.description); description = getActivity().findViewById(R.id.description);
title = getActivity().findViewById(R.id.title); title = getActivity().findViewById(R.id.title);
distance = getActivity().findViewById(R.id.category); distance = getActivity().findViewById(R.id.category);
icon = getActivity().findViewById(R.id.icon);
} }
private void setListeners() { private void setListeners() {
@ -332,7 +335,9 @@ public class NearbyMapFragment extends android.support.v4.app.Fragment {
} }
private void passInfoToSheet(Place place) { private void passInfoToSheet(Place place) {
description.setText(place.getDescription().toString()); //TODO set correct icon here
icon.setImageResource(place.getDescription().getIcon());
description.setText(place.getDescription().getText());
title.setText(place.name.toString()); title.setText(place.name.toString());
distance.setText(place.distance.toString()); distance.setText(place.distance.toString());
} }

View file

@ -52,6 +52,8 @@
app:pressedTranslationZ="12dp" app:pressedTranslationZ="12dp"
android:backgroundTint="@color/cardview_light_background" android:backgroundTint="@color/cardview_light_background"
android:clickable="true" android:clickable="true"
app:srcCompat="@drawable/ic_list_white_24dp"
android:scaleType="center"
/> />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"