當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。