| | |
| | | import com.dayu.pipirrapp.MyApplication; |
| | | import com.dayu.pipirrapp.R; |
| | | import com.dayu.pipirrapp.adapter.ImageAdapter; |
| | | import com.dayu.pipirrapp.bean.ImageBean; |
| | | import com.dayu.pipirrapp.bean.net.DealDetailResult; |
| | | import com.dayu.pipirrapp.bean.net.ImageResult; |
| | | import com.dayu.pipirrapp.bean.net.OrderDetailResult; |
| | | import com.dayu.pipirrapp.bean.net.UplodFileState; |
| | | import com.dayu.pipirrapp.databinding.ActivityOrderDetailBinding; |
| | | import com.dayu.pipirrapp.fragment.OrderFragment; |
| | | import com.dayu.pipirrapp.net.ApiManager; |
| | | import com.dayu.pipirrapp.net.BaseResponse; |
| | | import com.dayu.pipirrapp.net.Constants; |
| | | import com.dayu.pipirrapp.net.subscribers.SubscriberListener; |
| | | import com.dayu.pipirrapp.tool.BigimageUtils; |
| | | import com.dayu.pipirrapp.tool.FullyGridLayoutManager; |
| | | import com.dayu.pipirrapp.utils.CommonKeyName; |
| | | import com.dayu.pipirrapp.utils.ToastUtil; |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import cc.shinichi.library.ImagePreview; |
| | | import cc.shinichi.library.bean.ImageInfo; |
| | | import cc.shinichi.library.bean.Type; |
| | | |
| | | /** |
| | | * OrderDetailActivity - |
| | |
| | | String workOrderId; |
| | | String proResultId; |
| | | ImageAdapter mAdapter; |
| | | List<ImageResult> images = new ArrayList<>(); |
| | | List<ImageBean> images = new ArrayList<>(); |
| | | RecyclerView mRecyclerView; |
| | | final List<String> imageInfoList = new ArrayList<>(); |
| | | List<ImageInfo> imageInfoList = new ArrayList<>(); |
| | | int ProResultStateId; |
| | | private ActivityResultLauncher<Intent> activityResultLauncher = |
| | | registerForActivityResult( |
| | |
| | | // 添加间距装饰,确保图片有合适的间隔 |
| | | mRecyclerView.addItemDecoration(new GridSpacingItemDecoration(4, DensityUtil.dip2px(this, 8), false)); |
| | | mAdapter = new ImageAdapter(this, images, (v, position) -> { |
| | | ImagePreview.getInstance().setContext(OrderDetailActivity.this).setImageList(imageInfoList).start(); |
| | | BigimageUtils.showImages(this, position, imageInfoList); |
| | | |
| | | }); |
| | | mRecyclerView.setAdapter(mAdapter); |
| | |
| | | case 0://未上报 |
| | | binding.stateText.setTextColor(OrderDetailActivity.this.getResources().getColor(R.color.black, null)); |
| | | binding.stateText.setBackground(ResourcesCompat.getDrawable(OrderDetailActivity.this.getResources(), R.drawable.order_state_no_bg, null)); |
| | | binding.dealButton.setBackgroundColor(getResources().getColor(R.color.title_color, null)); |
| | | binding.dealButton.setBackground(getResources().getDrawable(R.drawable.bottom_butten_blue_ripple, null)); |
| | | binding.dealButton.setVisibility(View.VISIBLE); |
| | | break; |
| | | case 1://已上报 |
| | | binding.stateText.setTextColor(OrderDetailActivity.this.getResources().getColor(R.color.white, null)); |
| | | binding.stateText.setBackground(ResourcesCompat.getDrawable(OrderDetailActivity.this.getResources(), R.drawable.order_state_wait_bg, null)); |
| | | binding.dealButton.setBackgroundColor(getResources().getColor(R.color.delete_color, null)); |
| | | binding.dealButton.setBackground(getResources().getDrawable(R.drawable.bottom_butten_red_ripple, null)); |
| | | binding.dealButton.setVisibility(View.VISIBLE); |
| | | binding.dealButton.setText("删除处理结果"); |
| | | break; |
| | |
| | | case 3://被驳回 |
| | | binding.stateText.setTextColor(OrderDetailActivity.this.getResources().getColor(R.color.white, null)); |
| | | binding.stateText.setBackground(ResourcesCompat.getDrawable(OrderDetailActivity.this.getResources(), R.drawable.order_state_reject_bg, null)); |
| | | binding.dealButton.setBackgroundColor(getResources().getColor(R.color.title_color)); |
| | | binding.dealButton.setBackground(getResources().getDrawable(R.drawable.bottom_butten_blue_ripple, null)); |
| | | binding.dealButton.setVisibility(View.VISIBLE); |
| | | break; |
| | | |
| | |
| | | if (t.getContent() != null) { |
| | | binding.orderDealLL.setVisibility(View.VISIBLE); |
| | | binding.setDealData(t.getContent()); |
| | | images.addAll(t.getContent().getImages()); |
| | | for (ImageResult imageResult : images) { |
| | | imageInfoList.add(imageResult.getWebPath()); |
| | | |
| | | if (!t.getContent().getImages().isEmpty()) { |
| | | for (ImageResult imageResult : t.getContent().getImages()) { |
| | | ImageBean imageBean = new ImageBean(); |
| | | imageBean.setId(imageResult.getId()); |
| | | imageBean.setWebPath(imageResult.getWebPathZip()); |
| | | imageBean.setType(UplodFileState.IMG_TYPE); |
| | | images.add(imageBean); |
| | | ImageInfo info = new ImageInfo(); |
| | | info.setOriginUrl(imageResult.getWebPath()); |
| | | info.setType(Type.IMAGE); |
| | | if (imageResult.getWebPathZip() != null) { |
| | | info.setThumbnailUrl(imageResult.getWebPathZip()); |
| | | } |
| | | |
| | | imageInfoList.add(info); |
| | | } |
| | | } |
| | | if (!t.getContent().getVideos().isEmpty()) { |
| | | for (ImageResult imageResult : t.getContent().getVideos()) { |
| | | ImageBean imageBean = new ImageBean(); |
| | | imageBean.setId(imageResult.getId()); |
| | | imageBean.setWebPath(imageResult.getWebPathZip()); |
| | | imageBean.setType(UplodFileState.VIDEO_TYPE); |
| | | images.add(imageBean); |
| | | ImageInfo info = new ImageInfo(); |
| | | info.setOriginUrl(imageResult.getWebPath()); |
| | | info.setThumbnailUrl(imageResult.getWebPath()); |
| | | if (imageResult.getWebPathZip() != null) { |
| | | info.setThumbnailUrl(imageResult.getWebPathZip()); |
| | | } |
| | | info.setType(Type.VIDEO); |
| | | imageInfoList.add(info); |
| | | } |
| | | } |
| | | mAdapter.notifyDataSetChanged(); |
| | | } else { |