private void initializeWindow(View trigger) { if (null == mOfferWindow) { View view = View.inflate(getActivity(), R.layout.layout_order_offer, null); mOfferTitle = (TextView) view.findViewById(R.id.ui_offer_order_title); mTime = (EditText) view.findViewById(R.id.ui_offer_order_time); mMaterial = (EditText) view.findViewById(R.id.ui_offer_order_material); mCancel = (CorneredButton) view.findViewById(R.id.ui_offer_order_cancel); mOfferIt = (CorneredButton) view.findViewById(R.id.ui_offer_order_order); mCancel.setOnClickListener(mOnClickListener); mOfferIt.setOnClickListener(mOnClickListener); mOfferWindow = new CustomPopupWindow(trigger, view); mOfferWindow.setOutsideTouchable(false); // 设置窗体背景透明 mOfferWindow.setWindowBackground( LxbgApp.getInstance().getResources().getColor(R.color.transparent_00)); } }
@Override protected Void doInTask(String... params) { String priceString = params[0]; String myCode = LxbgApp.getInstance().LoginCode; fetchingJson( com.hlk.lxbg.customer.api.Order.OrderApi(), com.hlk.lxbg.customer.api.Order.UpPrice(myCode, orderId, priceString, orderUser)); if (succeed && null != result && result.getS() == 0) { // 更改价格成功 Realm realm = RealmConfig.getInstance().getRealm(); try { Order order = new OrderImpl(realm).selectById(orderId); // 更新我对这个订单的报价状态 realm.beginTransaction(); order.setPrice(priceString); order.setPayState("1"); realm.copyToRealmOrUpdate(order); realm.commitTransaction(); } finally { realm.close(); } } return null; }