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; //w ww. j a v a2 s. com import android.content.res.Resources; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.example.demoaerisproject.R; import com.example.util.FormatUtil; import com.example.view.DayNightView; public class WeekendItemHolder implements AdapterHolder<DayNightPeriod> { DayNightView day; DayNightView night; TextView weekday; TextView date; @Override public View inflateview(LayoutInflater mInflater) { View v = mInflater.inflate(R.layout.listview_weekend, null, false); day = (DayNightView) v.findViewById(R.id.viewToday); night = (DayNightView) v.findViewById(R.id.viewTonight); weekday = (TextView) v.findViewById(R.id.tvWeekendDay); date = (TextView) v.findViewById(R.id.tvWeekendDate); return v; } @Override public void populateView(DayNightPeriod t, int position) { Resources resources = day.getContext().getResources(); date.setText(FormatUtil.getMonthDayFromISO(t.day.dateTimeISO)); weekday.setText(FormatUtil.getDayFromISO(t.day.dateTimeISO, false)); day.setPeriod(t.day, ""); day.setBackgroundColor(resources.getColor(R.color.light_gray)); night.setBackgroundColor(resources.getColor(R.color.dark_blue)); night.setPeriod(t.night, ""); } }