购物车 订单 刷新加载

//清单文件

<uses-permission android:name="android.permission.INTERNET" />
//依赖

compile 'com.squareup.okhttp3:okhttp:3.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.jcodecraeer:xrecyclerview:1.5.8'
------------------------------------------------------------------

Model层

public interface IModel {
    //请求数据
    void showData(String url, Map<String,String> map, ModelShowDataListener modelShowDataListener);
    //刷新
    void doRefresh(String url, Map<String,String> params,ModelShowDataListener modelShowDataListener);
    //上拉加载
    void doLoadMore(String url, Map<String,String> params,ModelShowDataListener modelShowDataListener);
    //取消订单
    void deleteGoods(String url, Map<String,String> params,ModelShowDataListener modelShowDataListener);
}
------------------------------------------
public interface ModelShowDataListener {
    void getDataSuccess(String json);
    void getDataError(String error);
}
-------------------------------------------
public class ModelImpl implements IModel {
//请求数据 
 @Override
    public void showData(String url, Map<String, String> map, final ModelShowDataListener modelShowDataListener) {
        OkHttpUtils instance = OkHttpUtils.getInstance();
        instance.okPost(url,map);
        instance.setOkLoadListener(new OkLoadListener() {
            @Override
            public void okLoadSuccess(String json) {
                modelShowDataListener.getDataSuccess(json);
            }

            @Override
            public void okLoadError(String error) {
                modelShowDataListener.getDataError(error);
            }
        });
    }
     //刷新
    @Override
    public void doRefresh(String url, Map<String, String> map, final ModelShowDataListener modelShowDataListener) {
        OkHttpUtils instance = OkHttpUtils.getInstance();
        instance.okPost(url,map);
        instance.setOkLoadListener(new OkLoadListener() {
            @Override
            public void okLoadSuccess(String json) {
                modelShowDataListener.getDataSuccess(json);
            }

            @Override
            public void okLoadError(String error) {
                modelShowDataListener.getDataError(error);
            }
        });
    }
    //上拉加载
    @Override
    public void doLoadMore(String url, Map<String, String> map, final ModelShowDataListener modelShowDataListener) {
        OkHttpUtils instance = OkHttpUtils.getInstance();
        instance.okPost(url,map);
        instance.setOkLoadListener(new OkLoadListener() {
            @Override
            public void okLoadSuccess(String json) {
                modelShowDataListener.getDataSuccess(json);
            }

            @Override
            public void okLoadError(String error) {
                modelShowDataListener.getDataError(error);
            }
        });
    }
    //取消订单
    @Override
    public void deleteGoods(String url, Map<String, String> map, final ModelShowDataListener modelShowDataListener) {
        OkHttpUtils instance = OkHttpUtils.getInstance();
        instance.okPost(url,map);
        instance.setOkLoadListener(new OkLoadListener() {
            @Override
            public void okLoadSuccess(String json) {
                modelShowDataListener.getDataSuccess(json);
            }

            @Override
            public void okLoadError(String error) {
                modelShowDataListener.getDataError(error);
            }
        });
    }
}
-----------------------------------------------------------------------------------------------------
Presenter层
public interface IPresenter {
    //展示数据
    void showData(IModel iModel, IView iView);
    //刷新
    void doRefresh(IModel iModel, IView iView);
    //上拉加载
    void doLoadMore(IModel iModel, IView iView);
    //取消订单
    void deleteGoods(IModel iModel, IView iView,String str);
}

-------------------------------------------------------
public class PresenterImpl implements IPresenter {
    @Override
    public void showData(IModel iModel, final IView iView) {
        Map<String,String> map=new HashMap<String, String>();
        map.put("uid","71");
        iModel.showData(HttpConfig.getOrders_url, map, new ModelShowDataListener() {
            @Override
            public void getDataSuccess(String json) {
                Gson gson = new Gson();
                GoodsBean bean = gson.fromJson(json, GoodsBean.class);
                List<GoodsBean.DataBean> data = bean.getData();
                iView.showData(data);
            }

            private static final String TAG = "PresenterImpl";
            @Override
            public void getDataError(String error) {
                Log.d(TAG, "获取数据失败 ");
            }
        });
    }

    @Override
    public void doRefresh(IModel iModel, final IView iView) {
        Map<String,String> map=new HashMap<String, String>();
        map.put("uid","71");
        map.put("page","1");
        iModel.doRefresh(HttpConfig.getOrders_url, map, new ModelShowDataListener() {
            @Override
            public void getDataSuccess(String json) {
                Gson gson = new Gson();
                GoodsBean bean = gson.fromJson(json, GoodsBean.class);
                List<GoodsBean.DataBean> data = bean.getData();
                iView.showData(data);
            }

            private static final String TAG = "PresenterImpl";
            @Override
            public void getDataError(String error) {
                Log.d(TAG, "获取数据失败 ");
            }
        });
    }

    private static final String TAG = "PresenterImpl";
    int i=1;
    @Override
    public void doLoadMore(IModel iModel, final IView iView) {
        i++;
        Map<String,String> map=new HashMap<String, String>();
        map.put("uid","71");
        map.put("page",""+i);
        Log.d(TAG, i+"");
        iModel.doLoadMore(HttpConfig.getOrders_url, map, new ModelShowDataListener() {
            @Override
            public void getDataSuccess(String json) {
                Gson gson = new Gson();
                GoodsBean bean = gson.fromJson(json, GoodsBean.class);
                List<GoodsBean.DataBean> data = bean.getData();
                iView.showData(data);
            }

            private static final String TAG = "PresenterImpl";
            @Override
            public void getDataError(String error) {
                Log.d(TAG, "获取数据失败 ");
            }
        });
    }

    @Override
    public void deleteGoods(final IModel iModel, final IView iView, String str) {
        Map<String,String> map=new HashMap<String, String>();
        map.put("uid","71");
        map.put("orderId",str);
        map.put("status","2");
        iModel.deleteGoods(HttpConfig.updateOrder_url, map, new ModelShowDataListener(){
            @Override
            public void getDataSuccess(String json) {
                try {
                    JSONObject obj=new JSONObject(json);
                    String code = obj.getString("code");
                    String msg = obj.getString("msg");
                    if (code .equals("0")) {
                        new PresenterImpl().showData(iModel,iView);
                    }else{
                        Log.d(TAG, msg);
                    }
                } catch (JSONException e) {
                    e.printStackTrace();
                }
            }
            @Override
            public void getDataError(String error) {
                Log.d(TAG, error);
            }
        });
    }
}
--------------------------------------------------------------------------------
utils工具类
public class HttpConfig {
    public static String getOrders_url = "https://www.zhaoapi.cn/product/getOrders";
    public static String updateOrder_url = "https://www.zhaoapi.cn/product/updateOrder";
}
---------------------------------------
public class OkHttpUtils {
       private static OkHttpUtils okHttpUtils = null;
          private MyHandler myHandler = new MyHandler();
          private OkLoadListener okLoadListener;

          //单例
          public static OkHttpUtils getInstance() {
             if (okHttpUtils == null) {
                okHttpUtils = new OkHttpUtils();
             }
             return okHttpUtils;
          }

          //get
          public void okGet(String url) {
             OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new MyInter()).build();
             Request request = new Request.Builder().url(url).build();
             Call call = client.newCall(request);
             call.enqueue(new Callback() {
                @Override
                public void onFailure(Call call, IOException e) {
                   Message message = myHandler.obtainMessage();
                   message.what = 0;
                   message.obj = e.getMessage();
                   myHandler.sendMessage(message);
                }

                @Override
                public void onResponse(Call call, Response response) throws IOException {
                   Message message = myHandler.obtainMessage();
                   message.what = 1;
                   message.obj = response.body().string();
                   myHandler.sendMessage(message);
                }
             });
          }

          //post
          public void okPost(String url, Map<String, String> map) {
             OkHttpClient client = new OkHttpClient.Builder().addInterceptor(new MyInter()).build();
             //创建FormBody
             FormBody.Builder builder = new FormBody.Builder();
             //遍历map
             Set<String> keys = map.keySet();
             for (String key : keys) {
                String value = map.get(key);
                builder.add(key, value+"");
             }
             //build
             FormBody body = builder.build();
             Request request = new Request.Builder().url(url).post(body).build();
             Call call = client.newCall(request);
             call.enqueue(new Callback() {
                @Override
                public void onFailure(Call call, IOException e) {
                   Message message = myHandler.obtainMessage();
                   message.what = 0;
                   message.obj = e.getMessage();
                   myHandler.sendMessage(message);
                }

                @Override
                public void onResponse(Call call, Response response) throws IOException {
                   Message message = myHandler.obtainMessage();
                   message.what = 1;
                   message.obj = response.body().string();
                   myHandler.sendMessage(message);
                }
             });
          }

          //拦截器
          class MyInter implements Interceptor {
             private static final String TAG = "MyInter";
             @Override
             public Response intercept(Chain chain) throws IOException {
                //获取原来的body
                Request request = chain.request();
                RequestBody body = request.body();
                if (body instanceof FormBody) {
                   //遍历原来的所有参数,加到新的Body里面,最后将公共参数加到新的Body
                   FormBody.Builder newBuilder = new FormBody.Builder();
                   for (int i = 0; i < ((FormBody) body).size(); i++) {
                      String name = ((FormBody) body).name(i);
                      String value = ((FormBody) body).value(i);

                      //放入新的
                      newBuilder.add(name, value);
                   }
                   //在将公共参数添加进去
                   newBuilder.add("source", "android");
                   FormBody newBody = newBuilder.build();
                   //创建新的请求
                   Request newRequest = request.newBuilder().post(newBody).build();
                   Response response = chain.proceed(newRequest);
                   return response;
                }

                return null;
             }
          }

          //handler
          class MyHandler extends Handler {
             @Override
             public void handleMessage(Message msg) {
                switch (msg.what) {
                   case 0:
                      //失败
                      String e = (String) msg.obj;
                      okLoadListener.okLoadError(e);
                      break;
                   case 1:
                      //成功
                      String json = (String) msg.obj;
                      okLoadListener.okLoadSuccess(json);
                      break;
                }
             }
          }

          //提高外部调用的接口
          public void setOkLoadListener(OkLoadListener okLoadListener) {
             this.okLoadListener = okLoadListener;
          }
}
--------------------------------------------------------------
public interface OkLoadListener {
   //网络请求成功
   void okLoadSuccess(String json);
   //网络请求失败
   void okLoadError(String error);
}
----------------------------------------------------------------------------------------------------
view层
public interface IView {
    //显示数据
    void showData(List<GoodsBean.DataBean> list);
    //刷新
    void doRefresh(List<GoodsBean.DataBean> list);
    //上拉加载
    void doLoadMore(List<GoodsBean.DataBean> list);
}
------------------------------------------------
//条目分割线 可有可无
public class MyDecoration extends RecyclerView.ItemDecoration {

    private Context mContext;
    private Drawable mDivider;
    private int mOrientation;
    public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;
    public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL;

    //我们通过获取系统属性中的listDivider来添加,在系统中的AppTheme中设置
    public static final int[] ATRRS = new int[]{
            android.R.attr.listDivider
    };

    public MyDecoration(Context context, int orientation) {
        this.mContext = context;
        final TypedArray ta = context.obtainStyledAttributes(ATRRS);
        this.mDivider = ta.getDrawable(0);
        ta.recycle();
        setOrientation(orientation);
    }

    //设置屏幕的方向
    public void setOrientation(int orientation) {
        if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) {
            throw new IllegalArgumentException("invalid orientation");
        }
        mOrientation = orientation;
    }

    @Override
    public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
        if (mOrientation == HORIZONTAL_LIST) {
            drawVerticalLine(c, parent, state);
        } else {
            drawHorizontalLine(c, parent, state);
        }
    }

    //画横线, 这里的parent其实是显示在屏幕显示的这部分
    public void drawHorizontalLine(Canvas c, RecyclerView parent, RecyclerView.State state) {
        int left = parent.getPaddingLeft();
        int right = parent.getWidth() - parent.getPaddingRight();
        final int childCount = parent.getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);

//获得child的布局信息
            final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
            final int top = child.getBottom() + params.bottomMargin;
            final int bottom = top + mDivider.getIntrinsicHeight();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(c);
            //Log.d("wnw", left + " " + top + " "+right+"   "+bottom+" "+i);
        }
    }

    //画竖线
    public void drawVerticalLine(Canvas c, RecyclerView parent, RecyclerView.State state) {
        int top = parent.getPaddingTop();
        int bottom = parent.getHeight() - parent.getPaddingBottom();
        final int childCount = parent.getChildCount();
        for (int i = 0; i < childCount; i++) {
            final View child = parent.getChildAt(i);

//获得child的布局信息
            final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
            final int left = child.getRight() + params.rightMargin;
            final int right = left + mDivider.getIntrinsicWidth();
            mDivider.setBounds(left, top, right, bottom);
            mDivider.draw(c);
        }
    }

    //由于Divider也有长宽高,每一个Item需要向下或者向右偏移
    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        if (mOrientation == HORIZONTAL_LIST) {
            //画横线,就是往下偏移一个分割线的高度
            outRect.set(0, 0, 0, mDivider.getIntrinsicHeight());
        } else {
            //画竖线,就是往右偏移一个分割线的宽度
            outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0);
        }
    }
}
------------------------------------------------------
public class MainActivity extends AppCompatActivity implements IView,View.OnClickListener{

    private ImageView image;
    private XRecyclerView xRecyler;
    private String[] item = new String[]{"已支付","待支付","已取消"};
    private PresenterImpl presenter;
    private List<GoodsBean.DataBean> list;
    private PopupWindow popupWindow;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //初始化也没
        initViews();
        //调用
        presenter = new PresenterImpl();
        presenter.showData(new ModelImpl(),this);
    }

    private void initViews() {
        image = (ImageView) findViewById(R.id.image);
        xRecyler = (XRecyclerView) findViewById(R.id.xRecylerView);
        xRecyler = findViewById(R.id.xRecylerView);
        //设置
        xRecyler.setLayoutManager(new LinearLayoutManager(this));
        xRecyler.addItemDecoration(new MyDecoration(this, MyDecoration.VERTICAL_LIST));
        //设置
        xRecyler.setPullRefreshEnabled(true);//下拉刷新
        xRecyler.setLoadingMoreEnabled(true);//上拉加载
        xRecyler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);//样式
        xRecyler.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
        //监听
        xRecyler.setLoadingListener(new XRecyclerView.LoadingListener() {
            @Override
            public void onRefresh() {
                //调用presenter里面的刷新方法
                presenter.doRefresh(new ModelImpl(), MainActivity.this);
                //让进度条缩回去
                xRecyler.refreshComplete();
            }

            @Override
            public void onLoadMore() {
                //调用presenter里面的加载更多方法
                presenter.doLoadMore(new ModelImpl(), MainActivity.this);
                //让进度条缩回去
                xRecyler.refreshComplete();
            }
        });
        //pop
        image = findViewById(R.id.image);
        image.setOnClickListener(this);
    }

    @Override
    public void showData(List<GoodsBean.DataBean> list) {
        //设置适配器
        this.list=list;
        MyAdapter myAdapter = new MyAdapter(MainActivity.this, list, this);
        xRecyler.setAdapter(myAdapter);
    }

    @Override
    public void doRefresh(List<GoodsBean.DataBean> list) {
        //设置适配器
        MyAdapter myAdapter = new MyAdapter(MainActivity.this, list, this);
        xRecyler.setAdapter(myAdapter);
    }

    @Override
    public void doLoadMore(List<GoodsBean.DataBean> list) {
        //设置适配器
        MyAdapter myAdapter = new MyAdapter(MainActivity.this, list, this);
        xRecyler.setAdapter(myAdapter);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.image:
                View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.pop_item,null);
                //设置view里面的数据
                ListView listView = view.findViewById(R.id.listView);
                listView.setAdapter(new BaseAdapter() {
                    @Override
                    public int getCount() {
                        return item.length;
                    }

                    @Override
                    public Object getItem(int position) {
                        return null;
                    }

                    @Override
                    public long getItemId(int position) {
                        return 0;
                    }

                    @Override
                    public View getView(int position, View convertView, ViewGroup parent) {
                        TextView textView = new TextView(MainActivity.this);
                        textView.setText(item[position]);
                        textView.setTextSize(20);
                        return textView;
                    }
                });
                final List<GoodsBean.DataBean> goods=new ArrayList<>();
                listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                        Toast.makeText(MainActivity.this,item[position],Toast.LENGTH_SHORT).show();
                        if (item[position] == "已支付") {
                            goods.clear();
                            for (int i = 0; i < list.size(); i++) {
                                if (list.get(i).getStatus() ==2) {
                                    goods.add(list.get(i));
                                    MyAdapter myAdapter = new MyAdapter(MainActivity.this, goods, MainActivity.this);
                                    xRecyler.setAdapter(myAdapter);
                                }
                            }
                            popupWindow.dismiss();
                        }else if (item[position] == "待支付"){
                            goods.clear();
                            for (int i = 0; i < list.size(); i++) {
                                if (list.get(i).getStatus() ==0) {
                                    goods.add(list.get(i));
                                    MyAdapter myAdapter = new MyAdapter(MainActivity.this, goods, MainActivity.this);
                                    xRecyler.setAdapter(myAdapter);
                                }
                            }
                            popupWindow.dismiss();
                        }else {
                            goods.clear();
                            for (int i = 0; i < list.size(); i++) {
                                if (list.get(i).getStatus() ==1) {
                                    goods.add(list.get(i));
                                    MyAdapter myAdapter = new MyAdapter(MainActivity.this, goods, MainActivity.this);
                                    xRecyler.setAdapter(myAdapter);
                                }
                            }
                            popupWindow.dismiss();
                        }
                    }
                });
                popupWindow = new PopupWindow(view, 200, ViewGroup.LayoutParams.WRAP_CONTENT);
                popupWindow.setBackgroundDrawable(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
                popupWindow.setOutsideTouchable(true);
                popupWindow.showAsDropDown(image,0,10);
                break;
        }
    }
}
---------------------------------------------------------
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.MyViewHoder> {
    private final Context context;
    private final List<GoodsBean.DataBean> list;
    private final IView iView;

    public MyAdapter(Context context, List<GoodsBean.DataBean> list, IView iView) {
        this.context=context;
        this.list=list;
        this.iView=iView;
    }

    @Override
    public MyViewHoder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item, parent,false);
        MyViewHoder myViewHoder = new MyViewHoder(view);
        return myViewHoder;
    }

    @Override
    public void onBindViewHolder(MyViewHoder holder, final int position) {
        //赋值
        holder.title.setText(list.get(position).getTitle() + "");

        holder.price.setText(list.get(position).getPrice() + "");
        holder.time.setText(list.get(position).getCreatetime() + "");
        String bt_text = "";
        String tv_text = "";
        if (list.get(position).getStatus() == 0) {
            bt_text = "取消订单";
            tv_text="待支付";
            //实现状态改变
            holder.bt.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    //弹出AlertDailog
                    AlertDialog.Builder builder = new AlertDialog.Builder(context);
                    builder.setTitle("提示");
                    builder.setMessage("是否取消?");
                    builder.setPositiveButton("是", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            //修改Bean的数据的状态
                            //请求接口,取消订单
                            int orderid = (int) list.get(position).getOrderid();
                             PresenterImpl presenter = new PresenterImpl();
                            presenter.deleteGoods(new ModelImpl(),iView,orderid+"");

                        }
                    });
                    builder.setNegativeButton("否", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {

                        }
                    });
                    builder.show();

                }
            });
        } else if (list.get(position).getStatus() == 1) {
            bt_text = "查看订单";
            tv_text="已取消";
        } else {
            bt_text = "查看订单";
            tv_text="已支付";
        }
        holder.status.setText(tv_text);
        holder.bt.setText(bt_text);
    }

    @Override
    public int getItemCount() {
        return list.size();
    }

    class MyViewHoder extends RecyclerView.ViewHolder{
        public  TextView title;
        public  TextView status;
        public  TextView price;
        public  TextView time;
        public  Button bt;
        public MyViewHoder(View itemView) {
            super(itemView);
            title = itemView.findViewById(R.id.title);
            status = itemView.findViewById(R.id.status);
            price = itemView.findViewById(R.id.price);
            time = itemView.findViewById(R.id.time);
            bt = itemView.findViewById(R.id.bt);
        }
    }
}
-----------------------------------------------------------------
xml文件
<?xml version="1.0" encoding="utf-8"?>//main的xml文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.ljn.myapplication.view.MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center"
            android:text="订单列表"
            android:textSize="25sp"/>

        <ImageView
            android:id="@+id/image"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:src="@mipmap/ic_launcher"/>
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.75dp"
        android:background="#000"/>

    <com.jcodecraeer.xrecyclerview.XRecyclerView
        android:id="@+id/xRecylerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </com.jcodecraeer.xrecyclerview.XRecyclerView>

</LinearLayout>
-----------------------
<?xml version="1.0" encoding="utf-8"?>//item的xml文件
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="8dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="标题"
            android:textSize="20sp"/>

        <TextView
            android:id="@+id/status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="状态"
            android:textSize="20sp"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >

        <TextView
            android:id="@+id/price"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="jiage"
            android:textColor="#F00"
            android:textSize="20sp"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        >

        <TextView
            android:id="@+id/time"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="创建时间"
            android:textSize="20sp"/>

        <Button
            android:id="@+id/bt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="取消订单"/>
    </LinearLayout>
</LinearLayout>
-------------------
<?xml version="1.0" encoding="utf-8"?>//pop的xml文件
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#999999"
    android:orientation="vertical">

    <ListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"></ListView>

</LinearLayout>

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值