仿京东收货地址三级联动

声明 我没有用tabLayout(pageSlidingTabStrip) + viewpager  + fragment

如果用上面的方法实现 更加简单

仿京东收货地址三级联动_第1张图片   仿京东收货地址三级联动_第2张图片  仿京东收货地址三级联动_第3张图片  仿京东收货地址三级联动_第4张图片

  我用的是  一个listview  去实现的该界面  代码是从项目中抽取的,没有整理的很细。

 
    
 
    
package com.basedemo.my.xi.basedemo.activity;

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.provider.ContactsContract;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.animation.TranslateAnimation;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.basedemo.my.xi.basedemo.R;
import com.basedemo.my.xi.basedemo.adapter.MyBaseAdapter;
import com.basedemo.my.xi.basedemo.bean.ShengShiQuBean;
import com.basedemo.my.xi.basedemo.net.NetPath;
import com.basedemo.my.xi.basedemo.utils.LogUtils;
import com.google.gson.Gson;
import com.yolanda.nohttp.rest.Response;

import java.util.List;

/**
 * @Author Xi
 * Created by zz.wbkj.xi on 2016/9/22.
 */
public class Me_CreateAddress extends MyBaseActivity {
    private EditText et_name;
    private EditText et_phone;
    private TextView et_diqu;
    private EditText et_address;
    private LinearLayout ll_choose_lianxiren;
    private LinearLayout ll_select;
    private ImageView iv_select;
    private LinearLayout ll_save_address;
    private RelativeLayout rl_choose_diqu;

    private boolean isSelect = false;
    private RelativeLayout rl_parent;
    private PopupWindow popupWindow;
    private ListView listview;
    private ShengShiQuAdapter adapter;
    private String parent_id;
    private TextView tv_sheng;
    private TextView tv_shi;
    private TextView tv_qu;
    private int index_sheng;
    private int index_shi;
    private int index_qu;
    private String sheng_parent_id;
    private String shi_parent_id;
    private String qu_parent_id;
    private TextView line;
    private LinearLayout ll_line;
    private float fromX;
    private float toX;
    private float to1;
    private float to2;
    private float to3;

    @Override
    public void init() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_me_create_address;
    }

    @Override
    public void initView() {
        initToolBar();
        initPop();
        rl_parent = (RelativeLayout)findViewById(R.id.rl_parent);
        ll_choose_lianxiren = (LinearLayout)findViewById(R.id.ll_choose_lianxiren);
        et_name = (EditText)findViewById(R.id.et_name);
        et_phone = (EditText)findViewById(R.id.et_phone);
        rl_choose_diqu = (RelativeLayout)findViewById(R.id.rl_choose_diqu);
        et_diqu = (TextView)findViewById(R.id.et_diqu);
        et_address = (EditText)findViewById(R.id.et_address);
        ll_select = (LinearLayout)findViewById(R.id.ll_select);
        iv_select = (ImageView)findViewById(R.id.iv_select);
        ll_save_address = (LinearLayout)findViewById(R.id.ll_save_address);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {
        rl_choose_diqu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // popwindow
                if (popupWindow.isShowing()) {
                    popupWindow.dismiss();// 关闭
                } else {
                    popupWindow.showAtLocation(rl_parent, Gravity.BOTTOM,0,0);// 显示
                    tv_sheng.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                        @Override
                        public boolean onPreDraw() {
                            LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tv_sheng.getMeasuredWidth() - 60, 6);
                            lp.leftMargin = 30;
                            lp.rightMargin = 30;
                            line.setLayoutParams(lp);
                            return true;
                        }
                    });
                    backgroundAlpha(0.7f);
                    requestNet_GET(NetPath.ADDRESS_GET_CITYS,1);
                }
                LogUtils.e(mContext,"点击选择地区","");


            }
        });
        ll_choose_lianxiren.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Uri uri = Uri.parse("content://contacts/people");
                Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
                startActivityForResult(intent, 0);
            }
        });
        ll_select.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (isSelect){
                    iv_select.setImageResource(R.drawable.uncheck);
                    isSelect = false;
                }else {
                    iv_select.setImageResource(R.drawable.select);
                    isSelect = true;
                }
            }
        });
    }

    @Override
    public void onSucceedPaser(int what, Gson gson, Response response) {
        super.onSucceedPaser(what, gson, response);
        switch (what){
            case 1:
                ShengShiQuBean bean1 = gson.fromJson(response.get(),ShengShiQuBean.class);
                List shengBeanList = bean1.getData();
                if (adapter == null){
                    adapter = new ShengShiQuAdapter(mContext,shengBeanList);
                    adapter.setTag(1);
                    listview.setAdapter(adapter);
                }else {
                    adapter.setTag(1);
                    adapter.setDatas(shengBeanList);
                    listview.smoothScrollToPosition(0);
                }
                break;
            case 2:
                ShengShiQuBean bean2 = gson.fromJson(response.get(),ShengShiQuBean.class);
                List shiBeanList = bean2.getData();
                adapter.setTag(2);
                adapter.setDatas(shiBeanList);
                listview.smoothScrollToPosition(0);
                break;
            case 3:
                ShengShiQuBean bean3 = gson.fromJson(response.get(),ShengShiQuBean.class);
                List quBeanList = bean3.getData();
                if (quBeanList==null||quBeanList.size()<=0){
                    tv_qu.setText("");
                    String shengshiqu = tv_sheng.getText().toString()+tv_shi.getText().toString()+tv_qu.getText().toString();
                    et_diqu.setText(shengshiqu);
                    popupWindow.dismiss();
                    fromX = 0;
                }else {
                    to3 = tv_sheng.getMeasuredWidth()+tv_shi.getMeasuredWidth();
                    toX = to3;
                    setLineAnimation(fromX,toX);
                    adapter.setTag(3);
                    adapter.setDatas(quBeanList);
                    listview.smoothScrollToPosition(0);
                }
                break;
        }
    }
    class ShengShiQuAdapter extends MyBaseAdapter {

        public int selectionPosition = -1;
        private int tag;
        public ShengShiQuAdapter(Context context, List dataList) {
            super(context, dataList);
        }

        @Override
        public int getCount() {
            return dataList.size();
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            ViewHolder holder = null;
            if (convertView == null){
                convertView = LayoutInflater.from(mContext).inflate(R.layout.pop_item_create_address,null);
                holder = new ViewHolder();
                holder.rl_item = (RelativeLayout)convertView.findViewById(R.id.rl_item);
                holder.tv = (TextView)convertView.findViewById(R.id.tv);
                holder.iv = (ImageView)convertView.findViewById(R.id.iv);
                convertView.setTag(holder);
            }else {
                holder = (ViewHolder) convertView.getTag();
            }
            final int finalPosition = position;
            final ShengShiQuBean.DataBean dataBean = dataList.get(position);
            holder.tv.setText(dataBean.getName());
            holder.rl_item.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    setSelectionPosition(finalPosition);
//                    parent_id = dataBean.getId();
//                    LogUtils.e(mContext,"省市区时listview getView中的tag"+tag,"点击的parent_id:"+parent_id);
                    switch (tag){
                        case 1:
                            tv_sheng.setText(dataBean.getName());
                            tv_shi.setText("请选择");
                            tv_qu.setText("");
                            index_sheng = finalPosition;
                            sheng_parent_id = dataBean.getId();
                            tv_shi.setClickable(true);
                            tv_shi.setVisibility(View.VISIBLE);
                            requestNet_GET(NetPath.ADDRESS_GET_CITYS+"&parent_id="+dataBean.getId(),2);
                            to2 = tv_sheng.getMeasuredWidth();
                            toX = to2;
                            setLineAnimation(fromX,toX);
                            break;
                        case 2:
                            tv_shi.setText(dataBean.getName());
                            tv_qu.setText("请选择");
                            index_shi = finalPosition;
                            shi_parent_id = dataBean.getId();
                            tv_qu.setClickable(true);
                            tv_qu.setVisibility(View.VISIBLE);
                            requestNet_GET(NetPath.ADDRESS_GET_CITYS+"&parent_id="+dataBean.getId(),3);

                            break;
                        case 3:
                            index_qu = finalPosition;
                            tv_qu.setText(dataBean.getName());
                            tv_qu.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                                @Override
                                public boolean onPreDraw() {
                                    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tv_qu.getMeasuredWidth() - 60, 6);
                                    lp.leftMargin = 30;
                                    lp.rightMargin = 30;
                                    line.setLayoutParams(lp);
                                    return true;
                                }
                            });
                            String shengshiqu = tv_sheng.getText().toString()+tv_shi.getText().toString()+tv_qu.getText().toString();
                            et_diqu.setText(shengshiqu);
                            popupWindow.dismiss();
                            fromX =0;
                            break;
                    }
                }
            });
            if (selectionPosition == position){
                holder.tv.setTextColor(getResources().getColor(R.color.pop_city_text_red));
                holder.iv.setImageResource(R.drawable.redduigou);
            }else {
                holder.tv.setTextColor(getResources().getColor(R.color.pop_city_text_black));
                holder.iv.setImageResource(R.color.transparent);
            }
            return convertView;
        }

        public void setTag(int tag){
            this.tag = tag;
        }

        public void setSelectionPosition(int selectionPosition){
            this.selectionPosition = selectionPosition;
            notifyDataSetChanged();
        }

        public void setDatas(List newDatas){
            this.dataList = newDatas;
            selectionPosition = -1;
            notifyDataSetChanged();
        }


        class ViewHolder{

            public RelativeLayout rl_item;
            public TextView tv;
            public ImageView iv;
        }
    }

    private void initPop() {
        // TODO   弹出底部popwindow 进行选择
        popupWindow = new PopupWindow();
        View popView = LayoutInflater.from(mContext).inflate(R.layout.popup_choose_diqu,null);
//                PopupWindow popupWindow = new PopupWindow(popView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        ImageView iv_chahao = (ImageView)popView.findViewById(R.id.iv_chahao);
        tv_sheng = (TextView)popView.findViewById(R.id.sheng);
        tv_shi = (TextView)popView.findViewById(R.id.shi);
        tv_qu = (TextView)popView.findViewById(R.id.qu);
        line = (TextView)popView.findViewById(R.id.line);
        ll_line = (LinearLayout)popView.findViewById(R.id.ll_line);
        listview = (ListView)popView.findViewById(R.id.listview);
        tv_sheng.setText("请选择");
        popupWindow.setContentView(popView);
        tv_shi.setVisibility(View.GONE);
        tv_qu.setVisibility(View.GONE);
        tv_sheng.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv_sheng.setText("请选择");
                tv_sheng.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                    @Override
                    public boolean onPreDraw() {
                        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tv_sheng.getMeasuredWidth() - 60, 6);
                        lp.leftMargin = 30;
                        lp.rightMargin = 30;
                        line.setLayoutParams(lp);
                        return true;
                    }
                });
                tv_shi.setText("");
                tv_qu.setText("");
                tv_shi.setClickable(false);
                tv_qu.setClickable(false);
                LogUtils.e(mContext,"宽:",tv_sheng.getMeasuredWidth()+"");
                to1 = 0;
                toX = to1;
                setLineAnimation(fromX,toX);
                requestNet_GET(NetPath.ADDRESS_GET_CITYS,1);
            }
        });
        tv_shi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv_shi.setText("请选择");
                tv_shi.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                    @Override
                    public boolean onPreDraw() {
                        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tv_shi.getMeasuredWidth() - 60, 6);
                        lp.leftMargin = 30;
                        lp.rightMargin = 30;
                        line.setLayoutParams(lp);
                        return true;
                    }
                });
                tv_qu.setText("");
                tv_qu.setClickable(false);
                to2 = tv_sheng.getMeasuredWidth();
                toX = to2;
                setLineAnimation(fromX,toX);
//                ll_line.setTranslationX(tv_shi.getMeasuredWidth());
                requestNet_GET(NetPath.ADDRESS_GET_CITYS+"&parent_id="+sheng_parent_id,2);
            }
        });
        tv_qu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv_qu.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
                    @Override
                    public boolean onPreDraw() {
                        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(tv_qu.getMeasuredWidth() - 60, 6);
                        lp.leftMargin = 30;
                        lp.rightMargin = 30;
                        line.setLayoutParams(lp);
                        return true;
                    }
                });
                to3 = tv_sheng.getMeasuredWidth()+tv_shi.getMeasuredWidth();
                toX = to3;
                setLineAnimation(fromX,toX);

                requestNet_GET(NetPath.ADDRESS_GET_CITYS+"&parent_id="+shi_parent_id,3);
            }
        });


        popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        popupWindow.setTouchable(true);
        popupWindow.setFocusable(true);
        popupWindow.setOutsideTouchable(true);
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setAnimationStyle(R.style.popwin_anim_style);

        popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                //popupwindow消失的时候恢复成原来的透明度
                backgroundAlpha(1f);
            }
        });


        iv_chahao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                popupWindow.dismiss();
                fromX = 0;
            }
        });
    }

    public void setLineAnimation(float fX,float toX){
        TranslateAnimation translateAnimation = new TranslateAnimation(fX,toX,0,0);
        translateAnimation.setDuration(500);
        translateAnimation.setFillAfter(true);
        ll_line.setAnimation(translateAnimation);
        fromX = toX;
    }


    /**
     * 设置添加屏幕的背景透明度
     * @param bgAlpha
     */
    public void backgroundAlpha(float bgAlpha)
    {
        WindowManager.LayoutParams lp = getWindow().getAttributes();
        lp.alpha = bgAlpha; //0.0-1.0
        getWindow().setAttributes(lp);
    }


    /*
    * 跳转联系人列表的回调函数
    * */
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode){
            case 0:
                if(data==null)
                {
                    return;
                }
                //处理返回的data,获取选择的联系人信息
                Uri uri=data.getData();
                String[] contacts=getPhoneContacts(uri);
                et_name.setText(contacts[0]);
                et_phone.setText(contacts[1]);
                break;
        }
        super.onActivityResult(requestCode, resultCode, data);
    }

    private String[] getPhoneContacts(Uri uri){
        String[] contact=new String[2];
        //得到ContentResolver对象
        ContentResolver cr = getContentResolver();
        //取得电话本中开始一项的光标
        Cursor cursor=cr.query(uri,null,null,null,null);
        if(cursor!=null)
        {
            cursor.moveToFirst();
            //取得联系人姓名
            int nameFieldColumnIndex=cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
            contact[0]=cursor.getString(nameFieldColumnIndex);
            //取得电话号码
            String ContactId = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));
            Cursor phone = cr.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
                    ContactsContract.CommonDataKinds.Phone.CONTACT_ID + "=" + ContactId, null, null);
            if(phone != null){
                phone.moveToFirst();
                contact[1] = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
            }
            phone.close();
            cursor.close();
        }
        else
        {
            return null;
        }
        return contact;
    }

    private void initToolBar() {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        toolbar.setNavigationIcon(R.drawable.jiantou);
        TextView title = (TextView)toolbar.findViewById(R.id.title);
        title.setText("新增收货人");
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                finish();

            }
        });
    }
}


xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rl_parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

<LinearLayout
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/toolbar"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:background="@color/white"
        android:layout_height="125dp">
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:layout_weight="2">

            <LinearLayout
                style="@style/me_create_address_ll_style">
                <TextView
                    style="@style/me_create_address_left_text_style"
                    android:text="姓名"/>
                <EditText
                    android:id="@+id/et_name"
                    style="@style/me_create_address_right_text_style"
                    android:hint="请输入姓名"
                    />
            LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1px"
                android:layout_marginLeft="13dp"
                android:background="@color/line_address"/>

            <LinearLayout
                style="@style/me_create_address_ll_style">
                <TextView
                    style="@style/me_create_address_left_text_style"
                    android:text="电话"/>
                <EditText
                    android:id="@+id/et_phone"
                    android:inputType="number"
                    style="@style/me_create_address_right_text_style"
                    android:hint="请输入手机号"
                    />
            LinearLayout>

        LinearLayout>

        <View
            android:layout_width="1px"
            android:layout_height="match_parent"
            android:background="@color/line_address"/>

        <LinearLayout
            android:id="@+id/ll_choose_lianxiren"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:gravity="center"
            android:orientation="vertical"
            android:layout_height="match_parent">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/chooselianxiren"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="7dp"
                android:textSize="13dp"
                android:textColor="#6a6a6a"
                android:text="选联系人"/>
        LinearLayout>

    LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_marginLeft="13dp"
        android:background="@color/line_address"/>
    <RelativeLayout
        android:id="@+id/rl_choose_diqu"
        style="@style/me_create_address_ll_style">
        <TextView
            android:id="@+id/diqu"
            style="@style/me_create_address_left_text_style"
            android:text="地区"/>
        <TextView
            android:id="@+id/et_diqu"
            android:layout_toRightOf="@+id/diqu"
            style="@style/me_create_address_right_text_style"
            android:hint="请选择地区"
            />
        <ImageView
            android:layout_alignParentRight="true"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="20dp"
            android:src="@drawable/create_address_arrow"/>
    RelativeLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_marginLeft="13dp"
        android:background="@color/line_address"/>
    <LinearLayout
        style="@style/me_create_address_ll_style">
        <TextView
            style="@style/me_create_address_left_text_style"
            android:text="地址"/>
        <EditText
            android:id="@+id/et_address"
            style="@style/me_create_address_right_text_style"
            android:hint="请输入详细地址"
            />
    LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:background="@color/line_address"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:paddingTop="9dp"
        android:paddingLeft="20dp"
        android:layout_weight="1">

        <LinearLayout
            android:id="@+id/ll_select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingLeft="6dp"
            android:paddingTop="5dp"
            android:paddingBottom="5dp">
            <ImageView
                android:id="@+id/iv_select"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginRight="8dp"
                android:src="@drawable/uncheck"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="15dp"
                android:textColor="#a09b9b"

                android:text="设置为默认收货地址"/>
        LinearLayout>

    LinearLayout>



    <LinearLayout
        android:id="@+id/ll_save_address"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_marginLeft="26dp"
        android:layout_marginRight="26dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:background="@drawable/btn_new_address_bg_conner"
        android:layout_marginBottom="11dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="@color/white"
            android:textSize="20dp"
            android:text="保存"/>
    LinearLayout>
LinearLayout>

RelativeLayout>


<style name="popwin_anim_style">
    <item name="android:windowEnterAnimation">@anim/popshowitem>
    <item name="android:windowExitAnimation">@anim/pophideitem>
style>


xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    
        
        
        
        
    <translate
        android:fromXDelta="0%p"
        android:toXDelta="0%p"
        android:fromYDelta="100%p"
        android:toYDelta="0%p"
        android:duration="300"
        />
set>
xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
        android:fromXDelta="0%p"
        android:toXDelta="0%p"
        android:fromYDelta="0%p"
        android:toYDelta="100%p"
        android:duration="300" />
    
        
        
        
        
set>


xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:background="@color/white"
    android:layout_height="383dp">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="19dp"
        android:paddingBottom="12dp"
        android:paddingRight="14dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textSize="17dp"
            android:textColor="#848689"
            android:text="所在地区"/>
        <ImageView
            android:id="@+id/iv_chahao"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:layout_alignParentRight="true"
            android:src="@drawable/chahao"/>
    RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/sheng"
            style="@style/popwin_choose_address_style"
            android:text="   "/>
        <TextView
            android:id="@+id/shi"
            style="@style/popwin_choose_address_style"
            android:layout_width="79dp"
            android:gravity="center_horizontal"
            android:clickable="false"
            android:text="   "/>
        <TextView
            android:id="@+id/qu"
            style="@style/popwin_choose_address_style"
            android:clickable="false"
            android:minWidth="79dp"
            android:gravity="center_horizontal"
            android:text="   "/>
    LinearLayout>
    <LinearLayout
        android:id="@+id/ll_line"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <TextView
            android:id="@+id/line"
            android:layout_width="60dp"
            android:layout_height="2dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:background="@color/pop_city_text_red"/>
    LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:background="@color/line_address"/>

    <ListView
        android:id="@+id/listview"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:divider="@color/transparent"
        android:dividerHeight="0dp">

    ListView>

LinearLayout>


你可能感兴趣的:(仿京东收货地址三级联动)