Back to project page AerisAndroidLibrary.
The source code is released under:
Apache License
If you think the Android project AerisAndroidLibrary listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.listview; /* ww w . ja v a 2 s . co m*/ import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.example.demoaerisproject.R; import com.hamweather.aeris.model.Place; import com.hamweather.aeris.response.PlacesResponse; import com.hamweather.aeris.util.WeatherUtil; public class PlacesItemHolder implements AdapterHolder<PlacesResponse> { private TextView placeTextView; private ImageView icon; private TextView countTextView; @Override public View inflateview(LayoutInflater mInflater) { View view = mInflater.inflate(R.layout.drawer_list_item, null, false); placeTextView = (TextView) view.findViewById(R.id.title); icon = (ImageView) view.findViewById(R.id.icon); countTextView = (TextView) view.findViewById(R.id.counter); return view; } @Override public void populateView(PlacesResponse t, int position) { Place place = t.getPlace(); String text = ""; if (place.state != null && place.state.length() > 0) { text = String.format("%s, %s, %s", WeatherUtil.capitalize(place.name), place.state.toUpperCase(), place.country.toUpperCase()); } else { text = String.format("%s, %s", WeatherUtil.capitalize(place.name), place.country.toUpperCase()); } placeTextView.setText(text); icon.setVisibility(View.GONE); countTextView.setVisibility(View.GONE); } }