本文整理汇总了Java中android.widget.SimpleAdapter.ViewBinder方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleAdapter.ViewBinder方法的具体用法?Java SimpleAdapter.ViewBinder怎么用?Java SimpleAdapter.ViewBinder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.SimpleAdapter
的用法示例。
在下文中一共展示了SimpleAdapter.ViewBinder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FillLists
import android.widget.SimpleAdapter; //导入方法依赖的package包/类
void FillLists() {
// We use a - sign to tell that this text should be stiked through
SimpleAdapter.ViewBinder vb = new SimpleAdapter.ViewBinder() {
public boolean setViewValue(View view, Object data, String textRepresentation) {
TextView tv = (TextView) view;
tv.setText(textRepresentation.substring(1));
if(textRepresentation.substring(0, 1).equals("-")) {
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}
return true;
}
};
ArrayList<HashMap<String, String>> feedList;
feedList = createAlertsMap(false);
SimpleAdapter simpleAdapterLow = new SimpleAdapter(this, feedList, R.layout.row_alerts, new String[]{"alertName", "alertThreshold", "alertTime", "alertMp3File", "alertOverrideSilenceMode"}, new int[]{R.id.alertName, R.id.alertThreshold, R.id.alertTime, R.id.alertMp3File, R.id.alertOverrideSilent});
simpleAdapterLow.setViewBinder(vb);
listViewLow.setAdapter(simpleAdapterLow);
feedList = createAlertsMap(true);
SimpleAdapter simpleAdapterHigh = new SimpleAdapter(this, feedList, R.layout.row_alerts, new String[]{"alertName", "alertThreshold", "alertTime", "alertMp3File", "alertOverrideSilenceMode"}, new int[]{R.id.alertName, R.id.alertThreshold, R.id.alertTime, R.id.alertMp3File, R.id.alertOverrideSilent});
simpleAdapterHigh.setViewBinder(vb);
listViewHigh.setAdapter(simpleAdapterHigh);
}
示例2: FillLists
import android.widget.SimpleAdapter; //导入方法依赖的package包/类
void FillLists() {
// We use a - sign to tell that this text should be stiked through
SimpleAdapter.ViewBinder vb = new SimpleAdapter.ViewBinder() {
public boolean setViewValue(View view, Object data, String textRepresentation) {
TextView tv = (TextView) view;
tv.setText(textRepresentation.substring(1));
if (textRepresentation.substring(0, 1).equals("-")) {
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
}
return true;
}
};
ArrayList<HashMap<String, String>> feedList;
feedList = createAlertsMap(false);
SimpleAdapter simpleAdapterLow = new SimpleAdapter(this, feedList, R.layout.row_alerts, new String[]{"alertName", "alertThreshold", "alertTime", "alertMp3File", "alertOverrideSilenceMode"}, new int[]{R.id.alertName, R.id.alertThreshold, R.id.alertTime, R.id.alertMp3File, R.id.alertOverrideSilent});
simpleAdapterLow.setViewBinder(vb);
listViewLow.setAdapter(simpleAdapterLow);
feedList = createAlertsMap(true);
SimpleAdapter simpleAdapterHigh = new SimpleAdapter(this, feedList, R.layout.row_alerts, new String[]{"alertName", "alertThreshold", "alertTime", "alertMp3File", "alertOverrideSilenceMode"}, new int[]{R.id.alertName, R.id.alertThreshold, R.id.alertTime, R.id.alertMp3File, R.id.alertOverrideSilent});
simpleAdapterHigh.setViewBinder(vb);
listViewHigh.setAdapter(simpleAdapterHigh);
}
示例3: hasViewBinder
import android.widget.SimpleAdapter; //导入方法依赖的package包/类
public SimpleAdapterSubject hasViewBinder(SimpleAdapter.ViewBinder binder) {
assertThat(actual().getViewBinder())
.named("view binder")
.isSameAs(binder);
return this;
}