package fr.free.nrw.commons.nearby;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.ViewHolder;
import fr.free.nrw.commons.utils.ResourceUtils;

public class NearbyViewHolder implements ViewHolder<Place> {
    @BindView(R.id.tvName) TextView tvName;
    @BindView(R.id.tvDesc) TextView tvDesc;
    @BindView(R.id.distance) TextView distance;
    @BindView(R.id.icon) ImageView icon;

    public NearbyViewHolder(View view) {
        ButterKnife.bind(this, view);
    }

    @Override
    public void bindModel(Context context, Place place) {
        // Populate the data into the template view using the data object
        tvName.setText(place.name);
        tvDesc.setText(place.description);
        distance.setText(place.distance);

        icon.setImageResource(ResourceUtils.getDescriptionIcon(place.description));
    }
}

@@ -848,16 +848,212 @@
         
+String description = place.description;%0A        if ( description == null %7C%7C description.isEmpty() %7C%7C description.equals(%22?%22)) %7B%0A            description = %22No Description Found%22;%0A        %7D%0A        
 tvDesc.s
@@ -1059,22 +1059,16 @@
 setText(
-place.
 descript
@@ -1115,17 +1115,16 @@
 tance);%0A
-%0A
         

Set default text when no description found