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


Java Province类代码示例

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

示例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);
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:14,代码来源:EditUserInfoDetailActivity.java

示例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);
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:11,代码来源:MainActivity.java

示例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));
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:8,代码来源:TestAddressProvider.java

示例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));
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:8,代码来源:DefaultAddressProvider.java

示例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);
    }
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:11,代码来源:AddressSelector.java

示例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));
        }
    });
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:10,代码来源:AddressSelector.java

示例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;
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:57,代码来源:AddressSelector.java

示例9: getItem

import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
@Override
public Province getItem(int position) {
    return provinces.get(position);
}
 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:5,代码来源:AddressSelector.java

示例10: onAddressSelected

import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
void onAddressSelected(Province province, City city, County county, Street street); 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:2,代码来源:OnAddressSelectedListener.java

示例11: provideProvinces

import chihane.jdaddressselector.model.Province; //导入依赖的package包/类
void provideProvinces(AddressReceiver<Province> addressReceiver); 
开发者ID:chihane,项目名称:JDAddressSelector,代码行数:2,代码来源:AddressProvider.java


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