中通快递.apk(点击下载) / ActivityZTOProduct.java


package cn.beekee.zhongtong.fragment.main;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ExpandableListView;
import android.widget.TextView;
import cn.beekee.zhongtong.ActivityBase;
import cn.beekee.zhongtong.R;
import cn.beekee.zhongtong.view.adapter.ProductsExpandableAdapter;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ActivityZTOProduct extends ActivityBase implements View.OnClickListener, ExpandableListView.OnChildClickListener {
    private static final String IMG_KEY = "img_key";
    private static final String TEXT_KEY = "text_key";
    private List<ProductGroup> mList;

    /* access modifiers changed from: protected */
    @Override // cn.beekee.zhongtong.ActivityBase
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_product);
        findViewById(R.id.back).setOnClickListener(this);
        ((TextView) findViewById(R.id.title)).setText("产品介绍");
        findViewById(R.id.pc_order).setOnClickListener(this);
        findViewById(R.id.europe).setOnClickListener(this);
        findViewById(R.id.storage).setOnClickListener(this);
        ExpandableListView expandableListView = (ExpandableListView) findViewById(R.id.list_expanded);
        init();
        expandableListView.setAdapter(new ProductsExpandableAdapter(this, this.mList));
        expandableListView.setOnChildClickListener(this);
    }

    private void init() {
        this.mList = new ArrayList();
        List<Product> timeList = new ArrayList<>();
        timeList.add(new Product("8小时同城区域当天件", "http://www.zto.cn/wapZto/effectiveness/today8.html"));
        timeList.add(new Product("12小时次晨达", "http://www.zto.cn/wapZto/effectiveness/today12.html"));
        timeList.add(new Product("12小时次日达", "http://www.zto.cn/wapZto/effectiveness/nextday12.html"));
        timeList.add(new Product("36小时隔日上午达", "http://www.zto.cn/wapZto/effectiveness/nextday36.html"));
        this.mList.add(new ProductGroup("时效件", timeList));
        List<Product> addedValueList = new ArrayList<>();
        addedValueList.add(new Product("电子面单", "http://www.zto.cn/wapZto/addValue/dianzimiandan.html"));
        addedValueList.add(new Product("到付件业务", "http://www.zto.cn/wapZto/addValue/daofujian.html"));
        addedValueList.add(new Product("代收货款", "http://www.zto.cn/wapZto/addValue/daishouhuokuan.html"));
        addedValueList.add(new Product("代取件业务", "http://www.zto.cn/wapZto/addValue/daiqujian.html"));
        addedValueList.add(new Product("签单返还", "http://www.zto.cn/wapZto/addValue/qiandanfanhuan.html"));
        addedValueList.add(new Product("保价快件", "http://www.zto.cn/wapZto/addValue/baojia.html"));
        addedValueList.add(new Product("仓配一体化", "http://www.zto.cn/wapZto/addValue/canpeiyiti.html"));
        this.mList.add(new ProductGroup("增值服务", addedValueList));
        List<Product> gangtaiList = new ArrayList<>();
        gangtaiList.add(new Product("香港件专递", "http://www.zto.cn/wapZto/HongKong/HongKong.html"));
        gangtaiList.add(new Product("台湾件专递", "http://www.zto.cn/wapZto/HongKong/Taiwan.html"));
        this.mList.add(new ProductGroup("港台件", gangtaiList));
        List<Product> internationalList = new ArrayList<>();
        internationalList.add(new Product("俄罗斯专线", "http://www.zto.cn/wapZto/International/Russia.html"));
        internationalList.add(new Product("欧洲专线", "http://www.zto.cn/wapZto/International/Europe.html"));
        this.mList.add(new ProductGroup("国际件", internationalList));
        List<Product> afterSaleList = new ArrayList<>();
        afterSaleList.add(new Product("售后宝", "http://www.zto.cn/wapZto/CustomerService/CustomerService.html"));
        this.mList.add(new ProductGroup("售后服务", afterSaleList));
    }

    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.pc_order:
                showProduct(new Product("电子面单", "http://www.zto.cn/wapZto/addValue/dianzimiandan.html"));
                return;
            case R.id.europe:
                showProduct(new Product("欧洲专线", "http://www.zto.cn/wapZto/International/Europe.html"));
                return;
            case R.id.storage:
                showProduct(new Product("仓配一体", "http://www.zto.cn/wapZto/addValue/canpeiyiti.html"));
                return;
            case R.id.back:
                finish();
                return;
            default:
                return;
        }
    }

    public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
        showProduct(this.mList.get(groupPosition).getProductList().get(childPosition));
        return true;
    }

    private void showProduct(Product product) {
        Intent showProductIntent = new Intent(this, ActivityZTOProductInfo.class);
        showProductIntent.putExtra(ActivityZTOProductInfo.PRODUCT_KEY, product);
        startActivity(showProductIntent);
    }

    public static class ProductGroup {
        private String iProductGroupName;
        private List<Product> iProductList;

        public ProductGroup(String productGroupName, List<Product> productList) {
            this.iProductGroupName = productGroupName;
            this.iProductList = productList;
        }

        public String getProductGroupName() {
            return this.iProductGroupName;
        }

        public List<Product> getProductList() {
            return this.iProductList;
        }
    }

    public static class Product implements Serializable {
        private String iProductName;
        private String iProductUrl;

        public Product(String productName, String productUrl) {
            this.iProductName = productName;
            this.iProductUrl = productUrl;
        }

        public String getProductName() {
            return this.iProductName;
        }

        public String getProductUrl() {
            return this.iProductUrl;
        }
    }
}