本文整理汇总了Java中chihane.jdaddressselector.model.Province类的典型用法代码示例。如果您正苦于以下问题:Java Province类的具体用法?Java Province怎么用?Java Province使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Province类属于chihane.jdaddressselector.model包,在下文中一共展示了Province类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Holder holder;
if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_area, parent, false);
holder = new Holder();
holder.textView = (TextView) convertView.findViewById(R.id.textView);
holder.imageViewCheckMark = (ImageView) convertView.findViewById(R.id.imageViewCheckMark);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
}
Province item = getItem(position);
holder.textView.setText(item.name);
boolean checked = provinceIndex != INDEX_INVALID && provinces.get(provinceIndex).id == item.id;
holder.textView.setEnabled(!checked);
holder.imageViewCheckMark.setVisibility(checked ? View.VISIBLE : View.GONE);
return convertView;
}
示例2: onAddressSelected
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public void onAddressSelected(Province province, City city, County county, Street street) {
if (mBottomDialog.isShowing()) {
mBottomDialog.dismiss();
}
StringBuilder stringBuilder=new StringBuilder();
stringBuilder.append(province.name).append("-").append(city.name).append("-").append(county.name);
if (street != null) {
stringBuilder.append("-").append(street.name);
}
currentSelectedAddress=stringBuilder.toString();
address.setText(currentSelectedAddress);
}
示例3: onAddressSelected
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public void onAddressSelected(Province province, City city, County county, Street street) {
String s =
(province == null ? "" : province.name) +
(city == null ? "" : "\n" + city.name) +
(county == null ? "" : "\n" + county.name) +
(street == null ? "" : "\n" + street.name);
T.showShort(this, s);
}
示例4: provideProvinces
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public void provideProvinces(AddressReceiver<Province> addressReceiver) {
Province province = new Province();
province.id = 1;
province.name = "测试用省份";
addressReceiver.send(Collections.singletonList(province));
}
示例5: provideProvinces
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public void provideProvinces(final AddressReceiver<Province> addressReceiver) {
final FlowQueryList<Province> provinceQueryList = SQLite.select()
.from(Province.class)
.flowQueryList();
addressReceiver.send(new ArrayList<>(provinceQueryList));
}
示例6: callbackInternal
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
private void callbackInternal() {
if (listener != null) {
Province province = provinces == null || provinceIndex == INDEX_INVALID ? null : provinces.get(provinceIndex);
City city = cities == null || cityIndex == INDEX_INVALID ? null : cities.get(cityIndex);
County county = counties == null || countyIndex == INDEX_INVALID ? null : counties.get(countyIndex);
Street street = streets == null || streetIndex == INDEX_INVALID ? null : streets.get(streetIndex);
listener.onAddressSelected(province, city, county, street);
}
}
示例7: retrieveProvinces
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
private void retrieveProvinces() {
progressBar.setVisibility(View.VISIBLE);
addressProvider.provideProvinces(new AddressProvider.AddressReceiver<Province>() {
@Override
public void send(List<Province> data) {
handler.sendMessage(Message.obtain(handler, WHAT_PROVINCES_PROVIDED, data));
}
});
}
示例8: handleMessage
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public boolean handleMessage(Message msg) {
switch (msg.what) {
case WHAT_PROVINCES_PROVIDED:
provinces = (List<Province>) msg.obj;
provinceAdapter.notifyDataSetChanged();
listView.setAdapter(provinceAdapter);
break;
case WHAT_CITIES_PROVIDED:
cities = (List<City>) msg.obj;
cityAdapter.notifyDataSetChanged();
if (Lists.notEmpty(cities)) {
// 以次级内容更新列表
listView.setAdapter(cityAdapter);
// 更新索引为次级
tabIndex = INDEX_TAB_CITY;
} else {
// 次级无内容,回调
callbackInternal();
}
break;
case WHAT_COUNTIES_PROVIDED:
counties = (List<County>) msg.obj;
countyAdapter.notifyDataSetChanged();
if (Lists.notEmpty(counties)) {
listView.setAdapter(countyAdapter);
tabIndex = INDEX_TAB_COUNTY;
} else {
callbackInternal();
}
break;
case WHAT_STREETS_PROVIDED:
streets = (List<Street>) msg.obj;
streetAdapter.notifyDataSetChanged();
if (Lists.notEmpty(streets)) {
listView.setAdapter(streetAdapter);
tabIndex = INDEX_TAB_STREET;
} else {
callbackInternal();
}
break;
}
updateTabsVisibility();
updateProgressVisibility();
updateIndicator();
return true;
}
示例9: getItem
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public Province getItem(int position) {
return provinces.get(position);
}
示例10: onAddressSelected
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
void onAddressSelected(Province province, City city, County county, Street street);
示例11: provideProvinces
import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
void provideProvinces(AddressReceiver<Province> addressReceiver);