购物车订单界面

订单适配器

import android.content.Context;

import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.pdf.PdfDocument;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.bwie.mydingdan.R;
import com.bwie.mydingdan.bean.MyDingDanBean;
import com.bwie.mydingdan.holder.MyDingDanHolder;
import com.bwie.mydingdan.present.Presenter;
import com.bwie.mydingdan.url.ApiUtil;
import com.bwie.mydingdan.url.OkHttp3Util;


import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;


/**
 * Created by admin on 2018/1/13.
 */


public class MyDingDanAdapter extends RecyclerView.Adapter<MyDingDanHolder> {
    private final Context context;
    private final List<MyDingDanBean.DataBean> list;
    private Presenter presenter;
    private int page;


    public MyDingDanAdapter(Context context, List<MyDingDanBean.DataBean> list, Presenter presenter, int page) {


        this.context = context;
        this.list = list;
        this.presenter = presenter;
        this.page = page;
    }
    @Override
    public MyDingDanHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_dingdan,parent, false);
        MyDingDanHolder holder = new MyDingDanHolder(view);
        return holder;
    }


    @Override
    public void onBindViewHolder(MyDingDanHolder holder, final int position) {


        holder.text_title.setText(list.get(position).getTitle());
        holder.text_price.setText("价格: "+list.get(position).getPrice());
        holder.text_tame.setText(list.get(position).getCreatetime());
        if (list.get(position).getStatus()==0){
            holder.text_daizhifu.setText("待支付");
            holder.text_daizhifu.setTextColor(Color.RED);
            holder.text_btn.setText("取消订单");
            holder.text_btn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {


                    AlertDialog.Builder builder = new AlertDialog.Builder(context);
                    builder.setTitle("提示");
                    builder.setMessage("确定要取消订单吗?");
                    builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            Map<String, String> params=new HashMap<>();
                            params.put("uid","3690");
                            params.put("orderId", String.valueOf(list.get(position).getOrderid()));
                            params.put("status", String.valueOf(2));
                            OkHttp3Util.doPost(ApiUtil.genxin, params, new Callback() {
                                @Override
                                public void onFailure(Call call, IOException e) {


                                }


                                @Override
                                public void onResponse(Call call, Response response) throws IOException {
                                    if (response.isSuccessful()){
                                        Log.d("+++++++++响哥1", String.valueOf(list.get(position).getStatus()));
                                        presenter.getDingUrl(ApiUtil.dingdan,page);
                                    }
                                }
                            });
                        }
                    });


                    builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {


                        }
                    });
                    builder.show();




                }
            });


        }else if (list.get(position).getStatus()==1){
            holder.text_daizhifu.setText("已支付");
            holder.text_daizhifu.setTextColor(Color.BLACK);
            holder.text_btn.setText("查看订单");
        }else {
            holder.text_daizhifu.setText("已取消");
            holder.text_daizhifu.setTextColor(Color.BLACK);
            holder.text_btn.setText("查看订单");
            holder.text_btn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {


                    AlertDialog.Builder builder = new AlertDialog.Builder(context);
                    builder.setTitle("提示");
                    builder.setMessage("确定循环利用吗?");
                    builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            Map<String, String> params = new HashMap<>();
                            params.put("uid", "3690");
                            params.put("orderId", String.valueOf(list.get(position).getOrderid()));
                            params.put("status", String.valueOf(0));
                            OkHttp3Util.doPost(ApiUtil.genxin, params, new Callback() {
                                @Override
                                public void onFailure(Call call, IOException e) {


                                }


                                @Override
                                public void onResponse(Call call, Response response) throws IOException {
                                    if (response.isSuccessful()) {


                                        Log.d("+++++++++响哥", String.valueOf(list.get(position).getStatus()));
                                        presenter.getDingUrl(ApiUtil.dingdan, page);
                                    }
                                }
                            });
                        }
                    });


                    builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {


                        }
                    });
                    builder.show();
                }
            });


        }


    }


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

待支付frgment


import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;


import com.bwie.mydingdan.R;
import com.bwie.mydingdan.adapter.MyDingDanAdapter;
import com.bwie.mydingdan.bean.MyDingDanBean;
import com.bwie.mydingdan.present.Presenter;
import com.bwie.mydingdan.url.ApiUtil;
import com.bwie.mydingdan.view.Main;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;


import java.util.ArrayList;
import java.util.List;


/**
 * Created by admin on 2018/1/13.
 */


public class Frag_Daizhi extends Fragment implements Main{


    private List<MyDingDanBean.DataBean> list = new ArrayList<>();
    private View view;
    private RecyclerView recycler_daizhi;
    private int status=0;
    private Presenter presenter;
    private RelativeLayout relative_bar;
    private SmartRefreshLayout smart_refresh;
    private int page=0;
    private int a=0;
    private Handler handler=new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if (msg.what==0){
                page++;
                a=1;
            }
        }
    };
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.frag_daizhi, container, false);
        return view;
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        recycler_daizhi = view.findViewById(R.id.recycler_daizhi);
        relative_bar = view.findViewById(R.id.relative_bar);
        smart_refresh = view.findViewById(R.id.smart_refresh);
        presenter = new Presenter(this);




    }


    @Override
    public void onResume() {
        super.onResume();
        relative_bar.setVisibility(View.VISIBLE);
        if (a==1){
            //page++;
           // presenter.getDingUrl(ApiUtil.dingdan,page);
        }
        presenter.getDingUrl(ApiUtil.dingdan,page);
    }


    @Override
    public void getDingDanBean(final MyDingDanBean myDingDanBean) {
        getActivity().runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (myDingDanBean!=null){
                    list.addAll(myDingDanBean.getData());
                    myAdapter();
                    relative_bar.setVisibility(View.GONE);
                    smart_refresh.setOnRefreshListener(new OnRefreshListener() {
                        @Override
                        public void onRefresh(RefreshLayout refreshlayout) {
                            list.clear();
                            list.addAll(0,myDingDanBean.getData());
                            myAdapter();
                            smart_refresh.finishRefresh();
                        }
                    });
                    smart_refresh.setOnLoadmoreListener(new OnLoadmoreListener() {
                        @Override
                        public void onLoadmore(RefreshLayout refreshlayout) {
                            handler.sendEmptyMessage(0);
                            list.clear();
                            page++;
                            presenter.getDingUrl(ApiUtil.dingdan,page);
                            onResume();
                            list.addAll(myDingDanBean.getData());
                            myAdapter();
                            smart_refresh.finishLoadmore();
                        }
                    });


                }
            }
        });
    }
    public void myAdapter(){
        recycler_daizhi.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
        MyDingDanAdapter adapter = new MyDingDanAdapter(getActivity(), list,presenter,page);
        recycler_daizhi.setAdapter(adapter);
        //adapter.notifyDataSetChanged();
    }
}

YiQufragment

import android.os.Bundle;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.bwie.mydingdan.R;


/**
 * Created by admin on 2018/1/13.
 */


public class Frag_YiQu extends Fragment {


    private View view;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.frag_yiqu, container, false);
        return view;
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);


    }
}

YiZhifragment

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


import com.bwie.mydingdan.R;


/**
 * Created by admin on 2018/1/13.
 */


public class Frag_YiZhi extends Fragment {


    private View view;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.frag_yizhi, container, false);
        return view;
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);


    }
}

dingdanHolder

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;


import com.bwie.mydingdan.R;


/**
 * Created by admin on 2018/1/13.
 */


public class MyDingDanHolder extends RecyclerView.ViewHolder {


    public TextView text_title;
    public TextView text_daizhifu;
    public TextView text_price;
    public TextView text_tame;
    public TextView text_btn;


    public MyDingDanHolder(View itemView) {
        super(itemView);
        text_title = itemView.findViewById(R.id.text_title);
        text_daizhifu = itemView.findViewById(R.id.text_daizhifu);
        text_price = itemView.findViewById(R.id.text_price);
        text_tame = itemView.findViewById(R.id.text_tame);
        text_btn = itemView.findViewById(R.id.text_btn);


    }
}

Model

import com.bwie.mydingdan.bean.MyDingDanBean;
import com.bwie.mydingdan.present.Presenter;
import com.bwie.mydingdan.url.OkHttp3Util;
import com.google.gson.Gson;


import java.io.IOException;
import java.util.HashMap;
import java.util.Map;


import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;


/**
 * Created by admin on 2018/1/13.
 */


public class Model {
    private Presenter presenter;


    public Model(Presenter presenter) {


        this.presenter = presenter;
    }


    public void getDingUrl(String dingdan, int page) {
        Map<String, String> params=new HashMap<>();
        params.put("uid","3690");
        params.put("page",page+"");
        OkHttp3Util.doPost(dingdan, params, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {


            }


            @Override
            public void onResponse(Call call, Response response) throws IOException {
                if (response.isSuccessful()){
                    String json = response.body().string();
                    MyDingDanBean myDingDanBean = new Gson().fromJson(json, MyDingDanBean.class);
                    presenter.getDingDanBean(myDingDanBean);




                }
            }
        });
    }
}

P层

import com.bwie.mydingdan.bean.MyDingDanBean;
import com.bwie.mydingdan.fragment.Frag_Daizhi;
import com.bwie.mydingdan.model.Model;
import com.bwie.mydingdan.view.Main;


/**
 * Created by admin on 2018/1/13.
 */


public class Presenter implements PresenterPort {




    private Main main;
    private final Model model;


    public Presenter(Main main) {
        model = new Model(this);
        this.main = main;
    }


    @Override
    public void getDingDanBean(MyDingDanBean myDingDanBean) {
        main.getDingDanBean(myDingDanBean);
    }


    public void getDingUrl(String dingdan, int page) {
        model.getDingUrl(dingdan,page);
    }
}

PresenterPort

public interface PresenterPort {
    void getDingDanBean(MyDingDanBean myDingDanBean);
}

Wz


public class ApiUtil {
    //uid 用户id字段 String类型 必传
    //status  订单状态 String类型 非必传(筛选订单列表时,必传)


    public static String dingdan="https://www.zhaoapi.cn/product/getOrders";
    //uid 用户id字段 String类型 必传
    //orderId 订单id参数 String类型 必传
    //status  订单状态 String类型 必传


    public static String genxin="https://www.zhaoapi.cn/product/updateOrder";


}

Mi接口



public interface Main {
    void getDingDanBean(MyDingDanBean myDingDanBean);
}

M层



import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.os.Build;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;


import com.bwie.mydingdan.fragment.Frag_Daizhi;
import com.bwie.mydingdan.fragment.Frag_YiQu;
import com.bwie.mydingdan.fragment.Frag_YiZhi;


import static android.view.Gravity.*;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {


    private ImageView image_btn;
    private TextView text_daizhi;
    private TextView text_yizhi;
    private TextView text_yiqu;
    private FrameLayout frame_layout;
    private View item_popup;
    private View view;
    private PopupWindow popupWindow;
    private TextView btn_daizhi;
    private TextView btn_yizhi;
    private TextView btn_yiqu;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        image_btn = findViewById(R.id.image_btn);
        text_daizhi = findViewById(R.id.text_daizhi);
        text_yizhi = findViewById(R.id.text_yizhi);
        text_yiqu = findViewById(R.id.text_yiqu);
        frame_layout = findViewById(R.id.frame_layout);
//https://www.zhaoapi.cn/product/updateOrder?uid=4427&status=1
        //https://www.zhaoapi.cn/product/updateOrder?uid=4427&orderId=
        //https://www.zhaoapi.cn/product/getOrders?uid=4427&status2
        text_daizhi.setOnClickListener(this);
        text_yizhi.setOnClickListener(this);
        text_yiqu.setOnClickListener(this);
        Frag_Daizhi frag_daizhi = new Frag_Daizhi();
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.frame_layout,frag_daizhi).commit();


        item_popup = View.inflate(this, R.layout.item_popup, null);
        view = View.inflate(this, R.layout.activity_main, null);
        popupWindow = new PopupWindow(item_popup
                , ActionBar.LayoutParams.WRAP_CONTENT,ActionBar.LayoutParams.WRAP_CONTENT);
        popupWindow.setTouchable(true);




        btn_daizhi = item_popup.findViewById(R.id.btn_daizhi);
        btn_yizhi = item_popup.findViewById(R.id.btn_yizhi);
        btn_yiqu = item_popup.findViewById(R.id.btn_yiqu);
        btn_daizhi.setOnClickListener(this);
        btn_yizhi.setOnClickListener(this);
        btn_yiqu.setOnClickListener(this);


        image_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //popupWindow.showAtLocation(view, Gravity.BOTTOM,0,0);
                popupWindow.showAsDropDown(image_btn);
            }
        });
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.text_daizhi:
                Frag_Daizhi frag_daizhi = new Frag_Daizhi();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_daizhi).commit();
                break;
            case R.id.text_yizhi:
                Frag_YiZhi frag_yiZhi = new Frag_YiZhi();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_yiZhi).commit();
                break;
            case R.id.text_yiqu:
                Frag_YiQu frag_yiQu = new Frag_YiQu();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_yiQu).commit();
                break;




            case R.id.btn_daizhi:
                Frag_Daizhi frag_daizhi2 = new Frag_Daizhi();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_daizhi2).commit();
                popupWindow.dismiss();
                break;
            case R.id.btn_yizhi:
                Frag_YiZhi frag_yiZhi2 = new Frag_YiZhi();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_yiZhi2).commit();
                popupWindow.dismiss();
                break;
            case R.id.btn_yiqu:
                Frag_YiQu frag_yiQu2 = new Frag_YiQu();
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.frame_layout,frag_yiQu2).commit();
                popupWindow.dismiss();
                break;
        }
    }
}

Bean

import java.util.List;


/**
 * Created by admin on 2018/1/13.
 */


public class MyDingDanBean {


    /**
     * msg : 请求成功
     * code : 0
     * data : [{"createtime":"2017-11-09T09:22:41","orderid":1458,"price":999,"status":1,"title":"订单测试标题","uid":71},{"createtime":"2017-11-09T09:22:41","orderid":1464,"price":156,"status":1,"title":"订单测试标题","uid":71},{"createtime":"2017-12-18T14:55:20","orderid":3459,"price":99.99,"status":1,"title":"订单测试标题71","uid":71},{"createtime":"2017-12-19T20:13:37","orderid":3564,"price":99.99,"status":1,"title":"订单测试标题71","uid":71},{"createtime":"2017-12-20T11:01:10","orderid":3639,"price":1001,"status":1,"title":"订单测试标题71","uid":71},{"createtime":"2017-12-20T11:02:57","orderid":3640,"price":99.99,"status":1,"title":"订单测试标题71","uid":71},{"createtime":"2017-12-20T11:15:37","orderid":3645,"price":99.99,"status":1,"title":"订单测试标题71","uid":71},{"createtime":"2017-12-20T11:58:36","orderid":3723,"price":99.99,"status":1,"title":"订单测试标题71","uid":71}]
     * page : 1
     */


    private String msg;
    private String code;
    private String page;
    private List<DataBean> data;


    public String getMsg() {
        return msg;
    }


    public void setMsg(String msg) {
        this.msg = msg;
    }


    public String getCode() {
        return code;
    }


    public void setCode(String code) {
        this.code = code;
    }


    public String getPage() {
        return page;
    }


    public void setPage(String page) {
        this.page = page;
    }


    public List<DataBean> getData() {
        return data;
    }


    public void setData(List<DataBean> data) {
        this.data = data;
    }


    public static class DataBean {
        /**
         * createtime : 2017-11-09T09:22:41
         * orderid : 1458
         * price : 999.0
         * status : 1
         * title : 订单测试标题
         * uid : 71
         */


        private String createtime;
        private int orderid;
        private double price;
        private int status;
        private String title;
        private int uid;


        public String getCreatetime() {
            return createtime;
        }


        public void setCreatetime(String createtime) {
            this.createtime = createtime;
        }


        public int getOrderid() {
            return orderid;
        }


        public void setOrderid(int orderid) {
            this.orderid = orderid;
        }


        public double getPrice() {
            return price;
        }


        public void setPrice(double price) {
            this.price = price;
        }


        public int getStatus() {
            return status;
        }


        public void setStatus(int status) {
            this.status = status;
        }


        public String getTitle() {
            return title;
        }


        public void setTitle(String title) {
            this.title = title;
        }


        public int getUid() {
            return uid;
        }


        public void setUid(int uid) {
            this.uid = uid;
        }
    }
}

//订单布局

<?xml version="1.0" encoding="utf-8"?>
<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:orientation="vertical"
    android:layout_height="match_parent"
    tools:context="com.example.jd_11a.DD.DD">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="#fff"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textSize="20sp"
            android:text="订单列表"
            />
        <ImageView
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:id="@+id/img_btn"
            android:clickable="true"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginLeft="20dp"
            android:background="@drawable/lv_icon"
            />
    </RelativeLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal"
        >
        <TextView
            android:id="@+id/text_daizhi"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:background="@drawable/biankuang"
            android:text="待支付"
            android:textSize="16sp"
            />
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:id="@+id/text_yizhi"
            android:text="已支付"
            android:textSize="16sp"
            android:background="@drawable/biankuang"
            android:gravity="center"


            />
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:id="@+id/text_yiqu"
            android:layout_weight="1"
            android:background="@drawable/biankuang"
            android:text="已取消"
            android:textSize="16sp"
            android:gravity="center"
            />


    </LinearLayout>
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/frame_layout"
        ></FrameLayout>
</LinearLayout>

//订单条目

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:orientation="vertical"
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:orientation="horizontal">
        <TextView
            android:id="@+id/text_title"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:gravity="bottom"
            android:layout_height="match_parent"
            android:text="1111"/>
        <TextView
            android:id="@+id/text_daizhifu"
            android:layout_width="50dp"
            android:gravity="bottom"
            android:layout_height="match_parent"
            android:textColor="#ff0000"
            android:text="待支付"/>
    </LinearLayout>
    <TextView
        android:id="@+id/text_price"
        android:gravity="bottom"
        android:textColor="#ff0000"
        android:layout_marginLeft="20dp"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:text="1111"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:orientation="horizontal">
        <TextView
            android:id="@+id/text_tame"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:gravity="bottom"
            android:layout_height="match_parent"
            android:text="1111"/>
        <TextView
            android:id="@+id/text_btn"
            android:layout_width="70dp"
            android:gravity="center"
            android:layout_gravity="bottom"
            android:layout_height="30dp"
            android:background="@drawable/biankuang"
            android:text="取消订单"/>
    </LinearLayout>
    <TextView
        android:layout_marginTop="15dp"
        android:clickable="true"
        android:focusable="false"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#9999"/>


</LinearLayout>

//待支付fragment布局

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/smart_refresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_daizhi"
                android:layout_width="match_parent"
                android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
        </ScrollView>
    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
    <RelativeLayout
        android:id="@+id/relative_bar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true">
        <ProgressBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </RelativeLayout>


</RelativeLayout>

//取消fragment界面

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    android:background="#ff0000"
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent">


</android.support.constraint.ConstraintLayout>

//已支付界面

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    android:background="#00ff00"
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
    android:layout_height="match_parent">


</android.support.constraint.ConstraintLayout>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值