本文整理匯總了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;
}