当前位置: 首页>>代码示例>>Java>>正文


Java SimpleAdapter.ViewBinder方法代码示例

本文整理汇总了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);
}
 
开发者ID:StephenBlackWasAlreadyTaken,项目名称:xDrip-Experimental,代码行数:26,代码来源:AlertList.java

示例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);
}
 
开发者ID:NightscoutFoundation,项目名称:xDrip,代码行数:26,代码来源:AlertList.java

示例3: hasViewBinder

import android.widget.SimpleAdapter; //导入方法依赖的package包/类
public SimpleAdapterSubject hasViewBinder(SimpleAdapter.ViewBinder binder) {
  assertThat(actual().getViewBinder())
      .named("view binder")
      .isSameAs(binder);
  return this;
}
 
开发者ID:pkware,项目名称:truth-android,代码行数:7,代码来源:SimpleAdapterSubject.java


注:本文中的android.widget.SimpleAdapter.ViewBinder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。